/* ========== CSS Reset & Variables ========== */

@font-face {
    font-family: 'Outfit';
    src: url('../ttf/Outfit.ttf') format('truetype');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AlimamaShuHeiTi';
    src: url('../ttf/阿里妈妈数黑体.ttf') format('truetype');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

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

:root {
    /* 纯净白色系 */
    --white: #ffffff;
    --off-white: #fafafa;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #868e96;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    /* 活力主色 - 柔和蓝紫 */
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-soft: #ede9fe;
    --primary-hover: #6d28d9;

    /* 辅助色 */
    --success: #10b981;
    --success-soft: #d1fae5;
    --error: #f43f5e;
    --error-soft: #ffe4e6;

    /* 网格线色 */
    --grid-line: rgba(0, 0, 0, 0.03);
    --grid-line-accent: rgba(124, 58, 237, 0.06);

    /* 字体 - Outfit 用于英文，AlimamaShuHeiTi 用于中文 */
    --font-sans: 'Outfit', 'AlimamaShuHeiTi', -apple-system, BlinkMacSystemFont, sans-serif;

    /* 阴影 */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 0 4px var(--primary-soft);

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* 动画 */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    background: var(--white);
    color: var(--gray-800);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ========== 网格背景 ========== */
.grid-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-color: var(--white);
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 48px 48px;
    background-position: center center;
}

/* 渐变叠加 - 增加层次感 */
.grid-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 60% at 10% 10%, rgba(124, 58, 237, 0.04), transparent 50%),
        radial-gradient(ellipse 50% 50% at 90% 90%, rgba(59, 130, 246, 0.03), transparent 50%);
}

/* 装饰圆点 */
.grid-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 24px 24px, var(--grid-line-accent) 2px, transparent 2px);
    background-size: 48px 48px;
}

/* 始终显示滚动条占位，防止宽度跳动 */
html {
    overflow-y: scroll;
}

/* 页面内容 */
.page-content {
    position: relative;
    z-index: 1;
}

/* ========== 选择文本样式 ========== */
::selection {
    background: var(--primary);
    color: white;
}

::-moz-selection {
    background: var(--primary);
    color: white;
}

/* ========== 滚动条样式 ========== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-50);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 5px;
    border: 2px solid var(--gray-50);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Firefox 滚动条 */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) var(--gray-50);
}

/* ========== 浮动装饰元素 ========== */
.floating-shapes {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(59, 130, 246, 0.04));
    top: -100px;
    right: -50px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(124, 58, 237, 0.04));
    bottom: -50px;
    left: -50px;
    animation-delay: -7s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.06), rgba(244, 63, 94, 0.04));
    top: 40%;
    left: 10%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    25% { transform: translate(20px, -20px) scale(1.05) rotate(5deg); }
    50% { transform: translate(0, -30px) scale(1) rotate(0deg); }
    75% { transform: translate(-20px, -10px) scale(0.95) rotate(-5deg); }
}

/* ========== 认证页面 ========== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: cardEnter 0.6s var(--ease-out) forwards;
}

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

/* 卡片顶部装饰线 */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 40px;
    right: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 0 0 4px 4px;
}

/* ========== Logo ========== */
.brand {
    text-align: center;
    margin-bottom: 36px;
}

.brand-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.25);
    animation: iconBounce 0.6s var(--ease-spring) 0.2s both;
}

@keyframes iconBounce {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.brand-icon span {
    font-size: 22px;
    font-weight: 700;
    color: white;
    font-family: 'Courier New', monospace;
    letter-spacing: -1px;
}

.brand h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.brand p {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 500;
}

/* ========== 表单 ========== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

.input-wrapper {
    position: relative;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--gray-800);
    transition: all 0.25s var(--ease-out);
    outline: none;
}

.input-field::placeholder {
    color: var(--gray-400);
}

.input-field:hover {
    background: var(--gray-100);
}

.input-field:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

/* 输入框错误状态 */
.input-field.error {
    border-color: var(--error);
    background: var(--error-soft);
}

.input-field.error:focus {
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.1);
}

/* 错误提示 */
.error-message {
    display: none;
    font-size: 12px;
    color: var(--error);
    margin-top: 6px;
    padding-left: 2px;
    animation: shake 0.4s var(--ease-out);
}

.error-message.show {
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ========== Toast 提示 (Element Plus 风格) ========== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    min-width: 280px;
    pointer-events: auto;
    line-height: 1.5;
    margin-bottom: 12px;
    /* 平滑过渡 */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: toastEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.hiding {
    opacity: 0;
    transform: translateY(-100%);
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    max-height: 0;
    margin-top: -12px;
}

@keyframes toastEnter {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast-error {
    background: #fef0f0;
    border: 1px solid #fde2e2;
    color: #f56c6c;
}

.toast-success {
    background: #f0f9eb;
    border: 1px solid #e1f3d8;
    color: #67c23a;
}

.toast-info {
    background: #f4f4f5;
    border: 1px solid #e9e9eb;
    color: #909399;
}

.toast-warning {
    background: #fdf6ec;
    border: 1px solid #faecd8;
    color: #e6a23c;
}

.toast-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 18px;
    height: 18px;
}

.toast-error .toast-icon {
    color: #f56c6c;
}

.toast-success .toast-icon {
    color: #67c23a;
}

.toast-info .toast-icon {
    color: #909399;
}

.toast-warning .toast-icon {
    color: #e6a23c;
}

.toast-message {
    flex: 1;
}

.toast-close {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

.toast-close svg {
    width: 14px;
    height: 14px;
}

/* ========== 按钮 ========== */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.25s var(--ease-out);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
    margin-top: 8px;
    outline: none;
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

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

/* 按钮涟漪效果 */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-primary:active::after {
    width: 300px;
    height: 300px;
}

/* 加载状态 */
.btn-primary.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-primary.loading::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 底部链接 ========== */
.auth-footer {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.auth-footer p {
    font-size: 14px;
    color: var(--gray-500);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: var(--primary-hover);
}

/* 登录/注册页诗词一言 */
.auth-poetry {
    margin-bottom: 24px;
    text-align: center;
    animation: authPoetryFadeIn 0.6s var(--ease-out) both;
}

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

.auth-poetry-sentence {
    display: block;
    font-size: 15px;
    color: var(--gray-600);
    font-weight: 500;
    line-height: 1.8;
    letter-spacing: 0.5px;
}

.auth-poetry-from {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--gray-400);
    font-style: italic;
}

/* ========== 分步注册 ========== */
.register-card {
    max-width: 460px;
}

/* 步骤指示器 */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    padding: 0 20px;
}

.step-indicator .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-400);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.step-label {
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
    transform: scale(1.1);
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.step.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
    font-size: 0;
}

.step.completed .step-number::after {
    content: '✓';
    font-size: 16px;
    font-weight: 700;
}

.step.completed .step-label {
    color: var(--success);
}

.step-line {
    flex: 1;
    height: 3px;
    background: var(--gray-200);
    margin: 0 8px;
    margin-bottom: 24px;
    max-width: 60px;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.step-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: var(--success);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-line.completed::after {
    width: 100%;
}

/* 表单步骤容器 */
.register-card .auth-form {
    position: relative;
    overflow: hidden;
    min-height: 240px;
}

/* 表单步骤 */
.form-step {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.form-step.active {
    position: relative;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.form-step.prev {
    opacity: 0;
    transform: translateX(-100%);
}

.form-step.next {
    opacity: 0;
    transform: translateX(100%);
}

.step-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
    text-align: center;
}

.step-desc {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 24px;
    text-align: center;
}

.step-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.step-buttons .btn-back,
.step-buttons .btn-primary,
.step-buttons .btn-next {
    flex: 1 !important;
    width: auto !important;
    margin-top: 0 !important;
    padding: 10px 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: auto !important;
    min-height: 40px !important;
    font-size: 14px !important;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 20px;
    background: var(--gray-100);
    color: var(--gray-600);
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    outline: none;
}

.btn-back:focus {
    outline: none;
}

.btn-back:hover {
    background: var(--gray-200);
}

.btn-back svg {
    width: 18px;
    height: 18px;
}

.btn-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 20px;
}

.btn-next svg,
.btn-primary svg {
    width: 18px;
    height: 18px;
}

/* 确认信息 */
.confirm-info {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.confirm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.confirm-item:not(:last-child) {
    border-bottom: 1px solid var(--gray-200);
}

.confirm-label {
    font-size: 14px;
    color: var(--gray-500);
}

.confirm-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

/* ========== 悬浮导航 ========== */
.floating-nav {
    position: fixed;
    top: 20px;
    left: 24px;
    right: 24px;
    z-index: 900;
    animation: navSlideDown 0.5s var(--ease-out);
    box-sizing: border-box;
}

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

.nav-inner {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--gray-200);
    border-radius: 9999px;
    padding: 12px 12px 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
    width: 100%;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.2s var(--ease-out);
}

.nav-link:hover {
    color: var(--gray-900);
    background: var(--gray-100);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-soft);
}

.nav-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.nav-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-greeting {
    font-size: 14px;
    color: var(--gray-500);
}

.user-greeting strong {
    color: var(--gray-800);
    font-weight: 600;
}

.btn-logout {
    padding: 10px 20px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 9999px;
    color: var(--gray-600);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s var(--ease-out);
}

.btn-logout:hover {
    border-color: var(--error);
    color: var(--error);
    background: var(--error-soft);
}

/* 导航栏右侧区域 */
.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ========== 告警通知样式 ========== */
.nav-alert {
    position: relative;
}

.alert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.alert-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

.alert-btn.active {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

.alert-btn svg {
    width: 18px;
    height: 18px;
    color: var(--gray-500);
    transition: all 0.2s;
}

.alert-btn:hover svg {
    color: var(--gray-700);
}

.alert-btn.active svg {
    color: var(--primary);
}

.alert-btn.has-alerts svg {
    color: var(--gray-800);
}

/* 铃铛摇晃动画 */
.alert-btn.ringing {
    animation: bellPulse 0.6s ease;
}

.alert-btn.ringing svg {
    animation: bellSwing 0.6s ease;
    color: var(--error);
}

@keyframes bellSwing {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-15deg); }
    60% { transform: rotate(10deg); }
    80% { transform: rotate(-5deg); }
}

@keyframes bellPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
    50% { box-shadow: 0 0 0 8px rgba(244, 63, 94, 0.15); }
}

/* 告警徽章 */
.alert-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid var(--white);
    line-height: 1;
}

.alert-badge.visible {
    opacity: 1;
    transform: scale(1);
}

/* 告警面板 */
.alert-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: -20px;
    width: 360px;
    max-height: 480px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                0 10px 15px -3px rgba(0, 0, 0, 0.1),
                0 20px 25px -5px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.alert-panel.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.alert-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.alert-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}

.alert-panel-title svg {
    display: none;
}

.alert-panel-actions {
    display: flex;
    gap: 2px;
}

.alert-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.alert-action-btn:hover {
    background: var(--gray-100);
}

.alert-action-btn:active {
    transform: scale(0.95);
}

.alert-action-btn svg {
    width: 16px;
    height: 16px;
    color: var(--gray-400);
}

.alert-action-btn:hover svg {
    color: var(--gray-600);
}

.alert-panel-body {
    max-height: 400px;
    overflow-y: auto;
}

.alert-panel-body::-webkit-scrollbar {
    width: 4px;
}

.alert-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.alert-panel-body::-webkit-scrollbar-thumb {
    background: var(--gray-200);
    border-radius: 2px;
}

/* 空状态 */
.alert-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.alert-empty-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 50%;
    margin-bottom: 12px;
}

.alert-empty-icon svg {
    width: 24px;
    height: 24px;
    color: var(--gray-400);
}

.alert-empty-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin: 0 0 4px 0;
}

.alert-empty-desc {
    font-size: 13px;
    color: var(--gray-400);
    margin: 0;
}

/* 告警列表 */
.alert-list {
    padding: 4px 0;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.alert-item:hover {
    background: var(--gray-50);
}

.alert-item.unread {
    background: #fafbff;
}

.alert-item.unread:hover {
    background: #f5f7ff;
}

/* 未读指示点 */
.alert-item-indicator {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.alert-item.unread .alert-item-indicator {
    opacity: 1;
}

.alert-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 8px;
    color: var(--gray-500);
}

.alert-item[style*="--alert-color: #f59e0b"] .alert-item-icon {
    background: #fef3c7;
    color: #d97706;
}

.alert-item[style*="--alert-color: #8b5cf6"] .alert-item-icon {
    background: #ede9fe;
    color: #7c3aed;
}

.alert-item[style*="--alert-color: #3b82f6"] .alert-item-icon {
    background: #dbeafe;
    color: #2563eb;
}

.alert-item[style*="--alert-color: #ef4444"] .alert-item-icon {
    background: #fee2e2;
    color: #dc2626;
}

.alert-item-icon svg {
    width: 16px;
    height: 16px;
}

.alert-item-body {
    flex: 1;
    min-width: 0;
}

.alert-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.alert-item-server {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}

.alert-item-type {
    font-size: 10px;
    font-weight: 500;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.alert-item[style*="--alert-color: #f59e0b"] .alert-item-type {
    background: #fef3c7;
    color: #b45309;
}

.alert-item[style*="--alert-color: #8b5cf6"] .alert-item-type {
    background: #ede9fe;
    color: #6d28d9;
}

.alert-item[style*="--alert-color: #3b82f6"] .alert-item-type {
    background: #dbeafe;
    color: #1d4ed8;
}

.alert-item[style*="--alert-color: #ef4444"] .alert-item-type {
    background: #fee2e2;
    color: #b91c1c;
}

.alert-item-message {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.4;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.alert-item.unread .alert-item-message {
    color: var(--gray-600);
}

.alert-item-time {
    font-size: 11px;
    color: var(--gray-400);
}

/* 告警 Toast */
.toast-alert {
    background: var(--white) !important;
    border: 1px solid var(--gray-200) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    cursor: pointer;
    min-width: 260px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.toast-alert-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    border-radius: 8px;
    color: #dc2626 !important;
    flex-shrink: 0;
}

.toast-alert-icon svg {
    width: 16px;
    height: 16px;
}

.toast-alert-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.toast-alert-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}

.toast-alert-message {
    font-size: 12px;
    color: var(--gray-500);
}

.toast-alert-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--gray-300);
    transition: color 0.15s;
    align-self: flex-start;
}

.toast-alert-close:hover {
    color: var(--gray-500);
}

.toast-alert-close svg {
    width: 14px;
    height: 14px;
}

/* ========== 告警详情弹窗 ========== */
.alert-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.alert-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.alert-modal {
    background: var(--white);
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
}

.alert-modal-overlay.active .alert-modal {
    transform: scale(1) translateY(0);
}

.alert-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
}

.alert-modal-type {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-modal-type-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-modal-type-icon svg {
    width: 20px;
    height: 20px;
}

.alert-modal-type-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.alert-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.alert-modal-close:hover {
    background: var(--gray-100);
}

.alert-modal-close svg {
    width: 18px;
    height: 18px;
    color: var(--gray-400);
}

.alert-modal-body {
    padding: 0 24px 20px;
}

.alert-modal-server {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.alert-modal-message {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 20px;
}

.alert-modal-meta {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-modal-meta-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-modal-meta-item .meta-label {
    font-size: 13px;
    color: var(--gray-500);
}

.alert-modal-meta-item .meta-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
}

.alert-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--gray-100);
}

.alert-modal-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.alert-modal-btn.secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.alert-modal-btn.secondary:hover {
    background: var(--gray-200);
}

.alert-modal-btn.primary {
    background: var(--gray-900);
    color: var(--white);
}

.alert-modal-btn.primary:hover {
    background: var(--gray-800);
}

/* 告警类型颜色 */
.alert-modal[data-type="cpu"] .alert-modal-type-icon {
    background: #fef3c7;
    color: #d97706;
}

.alert-modal[data-type="memory"] .alert-modal-type-icon {
    background: #ede9fe;
    color: #7c3aed;
}

.alert-modal[data-type="disk"] .alert-modal-type-icon {
    background: #dbeafe;
    color: #2563eb;
}

.alert-modal[data-type="offline"] .alert-modal-type-icon {
    background: #fee2e2;
    color: #dc2626;
}

/* ========== 告警设置样式 ========== */
.alert-settings-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: var(--gray-500);
}

.alert-config-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.alert-config-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.alert-config-row.main-toggle {
    padding: 16px 0;
}

.alert-config-row.notification-permission {
    background: var(--gray-50);
    margin: 0 -20px;
    padding: 12px 20px;
}

.alert-config-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.alert-config-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
}

.alert-config-desc {
    font-size: 12px;
    color: var(--gray-500);
}

.alert-config-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-config-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 8px 0;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch.small {
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch.small .toggle-slider:before {
    height: 14px;
    width: 14px;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch.small input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

/* Threshold Input */
.threshold-input {
    display: flex;
    align-items: center;
    gap: 4px;
}

.threshold-input input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    background: var(--white);
}

.threshold-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.threshold-input span {
    font-size: 13px;
    color: var(--gray-500);
}

.alert-config-controls select {
    padding: 6px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 13px;
    background: var(--white);
    cursor: pointer;
}

.alert-config-controls select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ========== 页脚 ========== */
.site-footer {
    position: relative;
    z-index: 1;
    padding: 24px 32px;
    background: transparent;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.footer-poetry {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 12px;
    transition: background 0.3s var(--ease-out), width 0.4s var(--ease-out);
    white-space: nowrap;
}

.footer-poetry:hover {
    background: rgba(124, 58, 237, 0.05);
}

.footer-poetry .poetry-sentence {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
    line-height: 1.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-poetry .poetry-from {
    font-size: 12px;
    color: var(--gray-400);
    font-style: italic;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-divider {
    width: 1px;
    height: 16px;
    background: var(--gray-300);
    flex-shrink: 0;
}

.footer-copyright {
    font-size: 12px;
    color: var(--gray-400);
    white-space: nowrap;
}

.footer-copyright span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.footer-copyright strong {
    font-weight: 800;
    color: var(--gray-800);
}

/* 诗词切换动画 */
.poetry-fade-out {
    opacity: 0;
    transform: translateY(-5px);
}

.poetry-fade-in {
    animation: poetryFadeIn 0.4s var(--ease-out);
}

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

/* ========== 仪表盘内容 ========== */
.dashboard {
    min-height: 100vh;
    position: relative;
    z-index: 1;
    padding-top: 100px;
}

.main-content {
    padding: 0 32px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 15px;
    color: var(--gray-500);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .floating-nav {
        top: 12px;
        left: 12px;
        right: 12px;
        width: auto;
    }

    .nav-inner {
        padding: 8px 12px;
        border-radius: var(--radius-lg);
        width: 100%;
        min-width: 0;
    }

    .nav-left {
        gap: 0;
        min-width: 0;
        flex-shrink: 1;
    }

    .nav-brand {
        gap: 10px;
        min-width: 0;
    }

    .nav-logo {
        width: 32px;
        height: 32px;
        font-size: 11px;
        flex-shrink: 0;
    }

    .nav-title {
        font-size: 15px;
        white-space: nowrap;
    }

    .nav-right {
        flex-shrink: 0;
    }

    .user-greeting {
        display: none;
    }

    .btn-logout {
        display: none;
    }

    .poetry-widget {
        display: none;
    }

    .dashboard {
        padding-top: 80px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 36px 24px;
        border-radius: var(--radius-lg);
    }

    .auth-card::before {
        left: 24px;
        right: 24px;
    }

    .brand-icon {
        width: 56px;
        height: 56px;
    }

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

    .floating-nav {
        top: 8px;
        left: 8px;
        right: 8px;
        width: auto;
    }

    .nav-inner {
        padding: 6px 10px;
        border-radius: var(--radius-md);
        width: 100%;
        min-width: 0;
    }

    .nav-logo {
        width: 28px;
        height: 28px;
        font-size: 10px;
        border-radius: 6px;
    }

    .nav-title {
        font-size: 14px;
    }

    .mobile-menu-btn {
        width: 32px;
        height: 32px;
        padding: 6px;
    }

    .hamburger-line {
        width: 16px;
    }

    .main-content {
        padding: 0 12px 24px;
    }

    .dashboard {
        padding-top: 65px;
    }

    .toast-container {
        top: 16px;
        left: 12px;
        right: 12px;
        transform: none;
    }

    .toast {
        max-width: none;
        min-width: auto;
        width: 100%;
        margin-bottom: 8px;
    }
}

/* ========== 仪表盘工具栏 ========== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

.btn-add svg {
    width: 18px;
    height: 18px;
}

/* ========== 机器卡片网格 ========== */
.machines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.machine-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.25s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.machine-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.machine-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity 0.25s;
}

.machine-card:hover::before {
    opacity: 1;
}

.machine-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.machine-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-soft);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.machine-icon svg {
    width: 24px;
    height: 24px;
}

.machine-actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-icon.danger:hover {
    background: var(--error-soft);
    color: var(--error);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* 告警开关按钮 */
.btn-icon.alert-toggle-btn {
    color: var(--gray-400);
}

.btn-icon.alert-toggle-btn:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.btn-icon.alert-toggle-btn.enabled {
    color: var(--primary);
}

.btn-icon.alert-toggle-btn.enabled:hover {
    background: rgba(124, 58, 237, 0.1);
    color: var(--primary);
}

.btn-icon.alert-toggle-btn.loading {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed !important;
    transform: scale(0.9);
    filter: grayscale(100%);
}

.machine-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.machine-host {
    font-size: 14px;
    color: var(--gray-500);
    font-family: 'Courier New', monospace;
    margin-bottom: 16px;
}

.machine-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-500);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.meta-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.btn-connect {
    margin-left: auto;
    padding: 8px 16px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-connect:hover {
    background: var(--primary-hover);
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px 80px;
}

.empty-illustration {
    width: 220px;
    height: 180px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-illustration svg {
    width: 100%;
    height: 100%;
    max-width: 200px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--gray-400);
}

.empty-icon svg {
    width: 40px;
    height: 40px;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 24px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* SVG 可点击元素 */
.svg-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.svg-clickable:hover rect {
    fill: #f0f0ff;
    stroke: var(--primary);
    stroke-dasharray: none;
}

.svg-clickable:hover text {
    fill: var(--primary);
}

/* ========== 弹窗 ========== */
/* 防止弹窗打开时页面滚动 */
body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--ease-out);
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s var(--ease-spring);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 0;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 28px;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.modal-form .input-group {
    margin-bottom: 0;
}

.modal-form .input-row {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 16px;
}

.modal-form .auth-key-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 4px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 0 28px 28px;
}

.btn-cancel {
    padding: 12px 20px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    color: var(--gray-600);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-submit {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.btn-submit:hover {
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.35);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========== 确认弹窗 ========== */
.confirm-content {
    text-align: center;
    padding: 20px 0;
}

.confirm-icon {
    width: 64px;
    height: 64px;
    background: var(--error-soft);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--error);
}

.confirm-icon.success {
    background: var(--success-soft, #dcfce7);
    color: var(--success);
}

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

.confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.confirm-desc {
    font-size: 14px;
    color: var(--gray-500);
}

.btn-danger {
    padding: 12px 24px;
    background: var(--error);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ========== 向导弹窗样式 ========== */
.wizard-modal {
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.wizard-modal .modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 28px;
    gap: 0;
    border-bottom: 1px solid var(--gray-100);
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.wizard-step.active {
    opacity: 1;
}

.wizard-step.completed {
    opacity: 1;
}

.wizard-step .step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.wizard-step.active .step-number {
    background: var(--primary);
    color: white;
}

.wizard-step.completed .step-number {
    background: var(--success);
    color: white;
}

.wizard-step .step-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
    white-space: nowrap;
}

.wizard-step.active .step-label {
    color: var(--primary);
}

.wizard-step.completed .step-label {
    color: var(--success);
}

.wizard-step-line {
    width: 40px;
    height: 2px;
    background: var(--gray-200);
    margin: 0 12px;
    margin-bottom: 22px;
    transition: background 0.3s ease;
}

.wizard-step-line.completed {
    background: var(--success);
}

.wizard-body {
    position: relative;
}

.wizard-panel {
    display: none;
    animation: wizardFadeIn 0.3s ease;
}

.wizard-panel.active {
    display: block;
}

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

.wizard-panel-title {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--gray-200);
}

.wizard-summary {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 8px;
}

.wizard-summary .summary-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.wizard-summary .summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
}

.wizard-summary .summary-item:last-child {
    border-bottom: none;
}

.wizard-summary .summary-label {
    font-size: 13px;
    color: var(--gray-500);
}

.wizard-summary .summary-value {
    font-size: 13px;
    color: var(--gray-800);
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wizard-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wizard-footer-spacer {
    flex: 1;
}

/* 输入框带下拉按钮 */
.input-with-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-dropdown .input-field {
    padding-right: 40px;
}

.input-dropdown-btn {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.input-dropdown-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.input-dropdown-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s var(--ease-out);
}

.input-dropdown-menu.show + .input-dropdown-btn svg,
.input-dropdown-btn:focus svg {
    transform: rotate(180deg);
}

.input-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s var(--ease-out);
}

.input-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.input-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.input-dropdown-menu .dropdown-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.input-dropdown-menu .dropdown-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.input-dropdown-menu .dropdown-item:hover {
    background: var(--gray-50);
}

.input-dropdown-menu .dropdown-item img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
}

.input-dropdown-menu .dropdown-item .provider-icon-text {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    flex-shrink: 0;
}

.input-dropdown-menu .dropdown-item span:nth-child(2) {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
}

.input-dropdown-menu .dropdown-url {
    margin-left: auto;
    font-size: 12px;
    color: var(--gray-400);
    font-family: 'Monaco', 'Consolas', monospace;
}

/* 雨云配置指南样式 */
.rainyun-guide {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 16px;
}

.rainyun-guide .guide-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.rainyun-guide .guide-title svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.rainyun-guide .guide-steps {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.8;
}

.rainyun-guide .guide-steps a {
    color: var(--primary);
    text-decoration: none;
}

.rainyun-guide .guide-steps a:hover {
    text-decoration: underline;
}

.link {
    color: var(--primary);
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

/* ========== 输入组行 ========== */
.input-row {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 12px;
}

@media (max-width: 480px) {
    .input-row {
        grid-template-columns: 1fr;
    }

    .machines-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .modal {
        margin: 0 16px;
    }
}

/* ========== 搜索框 ========== */
.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--gray-800);
    transition: all 0.2s var(--ease-out);
    outline: none;
}

.search-input::placeholder {
    color: var(--gray-400);
}

.search-input:hover {
    border-color: var(--gray-300);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

/* ========== 删除弹窗按钮居中 ========== */
.modal-footer.center {
    justify-content: center;
}

/* ========== 首页样式 ========== */
.welcome-section {
    text-align: center;
    padding: 60px 20px;
    animation: fadeInUp 0.6s var(--ease-out);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.welcome-title-wrapper,
.welcome-subtitle-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.welcome-title-wrapper {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(167, 139, 250, 0.08) 100%);
    border: 1px solid rgba(124, 58, 237, 0.15);
}

.welcome-title-wrapper:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(167, 139, 250, 0.12) 100%);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.15);
}

.welcome-title-wrapper:active {
    transform: scale(0.98);
}

.welcome-subtitle-wrapper {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.welcome-subtitle-wrapper:hover {
    background: rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.welcome-subtitle-wrapper:active {
    transform: scale(0.98);
}

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

.welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-xl);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 12px 32px rgba(124, 58, 237, 0.3);
    animation: welcomeBounce 0.6s var(--ease-spring) 0.2s both;
}

@keyframes welcomeBounce {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.welcome-icon span {
    font-size: 28px;
    font-weight: 700;
    color: white;
    font-family: 'Courier New', monospace;
}

.welcome-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.welcome-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin: 0;
    white-space: nowrap;
}

/* ========== 统计卡片网格 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    animation: fadeInUp 0.6s var(--ease-out) 0.1s both;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.25s var(--ease-out);
}

.stat-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.stat-icon.purple {
    background: var(--primary-soft);
    color: var(--primary);
}

.stat-icon.green {
    background: var(--success-soft);
    color: var(--success);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2px;
    letter-spacing: -0.5px;
}

.stat-info p {
    font-size: 14px;
    color: var(--gray-500);
}

/* ========== 快捷访问区域 ========== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    animation: fadeInUp 0.6s var(--ease-out) 0.2s both;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
}

.section-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.section-link:hover {
    color: var(--primary-hover);
}

.section-link svg {
    width: 16px;
    height: 16px;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    animation: fadeInUp 0.6s var(--ease-out) 0.3s both;
}

.quick-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    transition: all 0.25s var(--ease-out);
    cursor: pointer;
}

.quick-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.quick-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-soft);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.quick-icon svg {
    width: 22px;
    height: 22px;
}

.quick-info {
    flex: 1;
    min-width: 0;
}

.quick-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-host {
    font-size: 13px;
    color: var(--gray-500);
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-arrow {
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: all 0.2s;
    flex-shrink: 0;
}

.quick-card:hover .quick-arrow {
    background: var(--primary);
    color: white;
}

.quick-arrow svg {
    width: 16px;
    height: 16px;
}

/* 快捷访问空状态 */
.quick-empty {
    background: var(--gray-50);
    border: 2px dashed var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    grid-column: 1 / -1;
}

.quick-empty p {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 16px;
}

.quick-empty .btn-add {
    display: inline-flex;
}

/* ========== 响应式 - 首页 ========== */
@media (max-width: 768px) {
    .welcome-section {
        padding: 40px 16px;
    }

    .welcome-title {
        font-size: 26px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }
}

@media (max-width: 480px) {
    .search-box {
        width: 100%;
    }

    .quick-access-grid {
        grid-template-columns: 1fr;
    }

    .welcome-icon {
        width: 64px;
        height: 64px;
    }

    .welcome-icon span {
        font-size: 22px;
    }

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

    .stat-card {
        padding: 20px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
    }

    .stat-icon svg {
        width: 24px;
        height: 24px;
    }

    .stat-info h3 {
        font-size: 24px;
    }
}

/* ========== 设置页面 ========== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.settings-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: fadeInUp 0.5s var(--ease-out);
}

.settings-card.danger {
    border-color: rgba(244, 63, 94, 0.2);
}

.settings-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
    border-bottom: 1px solid var(--gray-100);
}

.settings-card-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-soft);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.settings-card-icon svg {
    width: 24px;
    height: 24px;
}

.settings-card-icon.warning {
    background: rgba(251, 191, 36, 0.1);
    color: #f59e0b;
}

.settings-card-icon.danger {
    background: var(--error-soft);
    color: var(--error);
}

.settings-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.settings-card-desc {
    font-size: 14px;
    color: var(--gray-500);
}

.settings-card-body {
    padding: 24px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.btn-settings-submit {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
    margin-top: 8px;
}

.btn-settings-submit:hover {
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.35);
    transform: translateY(-1px);
}

.btn-settings-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 信息行 */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 14px;
    color: var(--gray-500);
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

/* 危险操作 */
.danger-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.danger-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.danger-info p {
    font-size: 13px;
    color: var(--gray-500);
}

.btn-danger-outline {
    padding: 10px 18px;
    background: transparent;
    border: 1px solid var(--error);
    border-radius: var(--radius-md);
    color: var(--error);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-danger-outline:hover {
    background: var(--error);
    color: white;
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .danger-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-danger-outline {
        width: 100%;
        text-align: center;
    }
}

/* ========== 工具栏改进 ========== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    color: var(--gray-700);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.btn-secondary svg {
    width: 18px;
    height: 18px;
}

/* ========== 标签筛选器 ========== */
.tag-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-filter-btn {
    padding: 6px 14px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 9999px;
    color: var(--gray-600);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tag-filter-btn:hover {
    border-color: var(--gray-400);
    color: var(--gray-800);
}

.tag-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* 标签颜色变体 */
.tag-filter-btn.tag-purple.active { background: #7c3aed; border-color: #7c3aed; }
.tag-filter-btn.tag-blue.active { background: #3b82f6; border-color: #3b82f6; }
.tag-filter-btn.tag-green.active { background: #10b981; border-color: #10b981; }
.tag-filter-btn.tag-orange.active { background: #f59e0b; border-color: #f59e0b; }
.tag-filter-btn.tag-red.active { background: #ef4444; border-color: #ef4444; }
.tag-filter-btn.tag-pink.active { background: #ec4899; border-color: #ec4899; }

/* ========== 分组筛选 ========== */
.group-filter-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.group-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.group-filter-btn {
    padding: 6px 14px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 9999px;
    color: var(--gray-600);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.group-filter-btn:hover {
    border-color: var(--gray-400);
    color: var(--gray-800);
}

.group-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.group-filter-btn.group-purple.active { background: #7c3aed; border-color: #7c3aed; }
.group-filter-btn.group-blue.active { background: #3b82f6; border-color: #3b82f6; }
.group-filter-btn.group-green.active { background: #10b981; border-color: #10b981; }
.group-filter-btn.group-orange.active { background: #f59e0b; border-color: #f59e0b; }
.group-filter-btn.group-red.active { background: #ef4444; border-color: #ef4444; }
.group-filter-btn.group-pink.active { background: #ec4899; border-color: #ec4899; }

/* 分组管理弹窗 */
.group-add-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

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

.group-add-form .color-select {
    width: 100px;
    flex: none;
}

.group-list {
    max-height: 300px;
    overflow-y: auto;
}

.group-item {
    display: flex;
    align-items: center;
}

.group-indent {
    color: var(--gray-300);
}

/* ========== SFTP 文件管理器 ========== */
.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-back svg {
    width: 20px;
    height: 20px;
}

.path-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
}

.path-nav svg {
    width: 18px;
    height: 18px;
    color: var(--gray-400);
}

.path-separator {
    color: var(--gray-300);
}

.path-item {
    color: var(--gray-600);
    cursor: pointer;
    transition: color 0.2s ease;
}

.path-item:hover {
    color: var(--primary);
}

.path-item.active {
    color: var(--primary);
    font-weight: 500;
}

.file-list-container {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
    min-height: 500px;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.file-item {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-item:hover {
    background: var(--gray-100);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.file-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-bottom: 12px;
}

.file-icon.icon-folder {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.file-icon.icon-folder svg {
    width: 28px;
    height: 28px;
    color: #3b82f6;
}

.file-icon.icon-file {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.file-icon.icon-file svg {
    width: 24px;
    height: 24px;
    color: var(--gray-600);
}

.file-info {
    flex: 1;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: 12px;
    color: var(--gray-500);
}

.file-actions {
    display: flex;
    gap: 4px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    border: 2px dashed var(--gray-300);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.upload-area svg {
    width: 48px;
    height: 48px;
    color: var(--gray-400);
    margin-bottom: 16px;
}

.upload-area p {
    color: var(--gray-600);
    font-size: 14px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-state p {
    margin-top: 16px;
    color: var(--gray-600);
}

/* ========== 机器卡片标签 ========== */
.machine-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

.machine-tag.tag-purple { background: #ede9fe; color: #7c3aed; }
.machine-tag.tag-blue { background: #dbeafe; color: #3b82f6; }
.machine-tag.tag-green { background: #d1fae5; color: #10b981; }
.machine-tag.tag-orange { background: #fef3c7; color: #f59e0b; }
.machine-tag.tag-red { background: #fee2e2; color: #ef4444; }
.machine-tag.tag-pink { background: #fce7f3; color: #ec4899; }

/* 机器卡片徽章容器 */
.machine-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

/* 认证方式徽章 */
.auth-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.auth-badge svg {
    flex-shrink: 0;
}

.auth-badge.auth-password {
    background: #f0f9ff;
    color: #0284c7;
}

.auth-badge.auth-key {
    background: #f0fdf4;
    color: #16a34a;
}

/* ========== 标签管理 ========== */
.tag-add-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.tag-add-form .input-field {
    flex: 1;
}

.color-select {
    width: 100px;
    flex: none !important;
}

.btn-add-tag {
    padding: 12px 20px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-add-tag:hover {
    background: var(--primary-hover);
}

.tag-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tag-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.tag-badge {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
}

.tag-badge.tag-purple { background: #ede9fe; color: #7c3aed; }
.tag-badge.tag-blue { background: #dbeafe; color: #3b82f6; }
.tag-badge.tag-green { background: #d1fae5; color: #10b981; }
.tag-badge.tag-orange { background: #fef3c7; color: #f59e0b; }
.tag-badge.tag-red { background: #fee2e2; color: #ef4444; }
.tag-badge.tag-pink { background: #fce7f3; color: #ec4899; }

.tag-count {
    flex: 1;
    font-size: 13px;
    color: var(--gray-500);
}

.tag-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
    font-size: 14px;
}

/* ========== 服务标签样式 ========== */
.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    min-height: 0;
}

.service-tags:empty {
    display: none;
}

.service-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: color-mix(in srgb, var(--service-color, #666) 10%, white);
    border: 1px solid color-mix(in srgb, var(--service-color, #666) 25%, transparent);
    border-radius: 6px;
    font-size: 11px;
    color: var(--service-color, #666);
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: default;
}

.service-tag:hover {
    background: color-mix(in srgb, var(--service-color, #666) 15%, white);
    transform: translateY(-1px);
}

.service-tag img {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.service-tag .service-name {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-tag .service-running {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
    animation: service-pulse 2s infinite;
}

@keyframes service-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0); }
}

.service-tag.service-more {
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-500);
    font-size: 10px;
    padding: 3px 6px;
}

/* ========== 服务筛选样式 ========== */
.service-filter-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid var(--gray-200);
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.service-filter {
    display: flex;
    gap: 6px;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.service-filter::-webkit-scrollbar {
    display: none;
}

/* 左右滚动按钮 */
.service-filter-wrap .scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    pointer-events: none;
}

.service-filter-wrap:hover .scroll-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.service-filter-wrap .scroll-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.service-filter-wrap .scroll-btn svg {
    width: 16px;
    height: 16px;
    color: var(--gray-600);
}

.service-filter-wrap .scroll-btn.scroll-left {
    left: 0;
}

.service-filter-wrap .scroll-btn.scroll-right {
    right: 0;
}

.service-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.service-filter-btn:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.service-filter-btn.active {
    background: var(--service-color, var(--primary));
    border-color: var(--service-color, var(--primary));
    color: white;
}

.service-filter-btn img {
    width: 14px;
    height: 14px;
}

.service-filter-btn.active img {
    filter: brightness(0) invert(1);
}

.service-filter-btn .filter-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
}

@media (max-width: 1024px) {
    .service-filter-wrap {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        margin-top: 10px;
        width: 100%;
    }

    .toolbar-row.filters {
        flex-wrap: wrap;
    }
}

/* 加载动画 */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== 服务器详情页 - 服务卡片样式 ========== */
.services-card .info-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.services-card .btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.services-container {
    min-height: 100px;
}

.services-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px;
    color: var(--gray-500);
}

.services-loading svg {
    width: 20px;
    height: 20px;
    animation: rotate 1s linear infinite;
}

.services-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--gray-500);
    gap: 12px;
}

.services-empty svg {
    width: 48px;
    height: 48px;
    stroke: var(--gray-300);
}

.services-empty p {
    margin: 0;
    font-size: 14px;
}

/* 系统信息栏 */
.system-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.sys-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: transparent;
    border: none;
    font-size: 13px;
    color: var(--gray-600);
}

.sys-badge svg {
    width: 16px;
    height: 16px;
    stroke: var(--gray-400);
}

.sys-badge::after {
    content: '·';
    margin-left: 8px;
    color: var(--gray-300);
}

.sys-badge:last-child::after {
    display: none;
}

.sys-badge strong {
    font-weight: 600;
    color: var(--gray-800);
}

.sys-badge.os svg { stroke: #3b82f6; }
.sys-badge.arch svg { stroke: #8b5cf6; }
.sys-badge.cpu svg { stroke: #f59e0b; }
.sys-badge.mem svg { stroke: #10b981; }
.sys-badge.time {
    font-size: 12px;
    color: var(--gray-400);
}
.sys-badge.time svg { stroke: var(--gray-400); }

/* 服务网格 */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    border-left: 3px solid var(--service-color, var(--gray-300));
}

.service-item:hover {
    border-color: var(--service-color, var(--gray-300));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.service-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--service-color, #666) 10%, white);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.service-icon img {
    width: 24px;
    height: 24px;
}

.service-info {
    flex: 1;
    min-width: 0;
}

.service-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.service-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800);
}

.service-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.service-status.running {
    background: #dcfce7;
    color: #16a34a;
}

.service-status.stopped {
    background: var(--gray-100);
    color: var(--gray-500);
}

.service-details {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--gray-500);
}

.service-version {
    font-family: 'Monaco', 'Menlo', monospace;
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
}

.service-path {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }

    .system-info-bar {
        gap: 8px;
    }

    .sys-badge {
        font-size: 12px;
        padding: 4px 10px;
    }
}

@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-right {
        justify-content: stretch;
    }

    .toolbar-right > * {
        flex: 1;
    }

    .tag-filter {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .tag-add-form {
        flex-wrap: wrap;
    }

    .tag-add-form .input-field {
        min-width: 0;
    }
}

/* ========== 添加服务器页面 ========== */
.page-header-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-500);
    text-decoration: none;
    transition: color 0.2s;
    margin-bottom: 8px;
}

.back-link:hover {
    color: var(--primary);
}

.back-link svg {
    width: 18px;
    height: 18px;
}

.add-server-container {
    max-width: 700px;
}

.add-server-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: fadeInUp 0.5s var(--ease-out);
}

.form-section-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.form-section-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-soft);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.form-section-icon svg {
    width: 22px;
    height: 22px;
}

.form-section-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.form-section-icon.orange {
    background: rgba(251, 191, 36, 0.1);
    color: #f59e0b;
}

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.form-section-desc {
    font-size: 13px;
    color: var(--gray-500);
}

.form-section-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.flex-grow {
    flex: 1;
}

.input-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 8px;
}

.input-hint a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.input-hint a:hover {
    text-decoration: underline;
}

/* 密钥提示样式 - 弹窗中使用 */
.input-hint.key-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border: 1px solid #fcd34d;
    border-radius: var(--radius-sm);
    color: #92400e;
}

.input-hint.key-hint svg {
    width: 14px;
    height: 14px;
    color: #f59e0b;
    flex-shrink: 0;
}

.input-hint.key-hint a {
    color: var(--primary);
    font-weight: 600;
    margin-left: 2px;
}

.required {
    color: var(--error);
}

.optional {
    color: var(--gray-500);
    font-weight: 400;
    font-size: 12px;
}

/* 认证方式切换字段 */
.auth-key-fields,
.auth-password-field {
    animation: fadeIn 0.2s ease;
}

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

/* 密码框 */
.password-wrapper {
    position: relative;
}

.password-wrapper .input-field {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.2s;
}

.password-toggle:hover {
    color: var(--gray-600);
    background: var(--gray-100);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

/* 操作按钮 */
.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
}

.btn-cancel-large {
    padding: 14px 24px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    color: var(--gray-600);
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel-large:hover {
    border-color: var(--gray-400);
    color: var(--gray-800);
}

.btn-test {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: var(--white);
    border: 1px solid var(--success);
    border-radius: var(--radius-md);
    color: var(--success);
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-test:hover {
    background: var(--success);
    color: white;
}

.btn-test svg {
    width: 18px;
    height: 18px;
}

.btn-submit-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
    margin-left: auto;
}

.btn-submit-large:hover {
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
    transform: translateY(-1px);
}

.btn-submit-large:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-submit-large svg {
    width: 18px;
    height: 18px;
}

.btn-submit-large svg.spin {
    animation: spin 1s linear infinite;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }

    .form-row .input-group {
        width: 100% !important;
    }

    .form-actions {
        flex-wrap: wrap;
    }

    .btn-submit-large {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        order: -1;
    }

    .btn-test, .btn-cancel-large {
        flex: 1;
    }
}

/* ========== 按钮组 ========== */
.btn-group {
    display: flex;
    align-items: stretch;
}

.btn-group .btn-add {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-add-alt {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    background: var(--primary-hover);
    border: none;
    border-left: 1px solid rgba(255,255,255,0.2);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-add-alt:hover {
    background: #5b21b6;
}

.btn-add-alt svg {
    width: 18px;
    height: 18px;
}

/* ========== 空状态改进 ========== */
.empty-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.empty-actions .btn-secondary {
    background: var(--white);
}

/* ========== 快捷操作卡片 ========== */
.quick-actions-section {
    margin-bottom: 32px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    text-decoration: none;
    color: var(--gray-800);
    font-weight: 500;
}

.quick-action-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action-icon svg {
    width: 24px;
    height: 24px;
}

.quick-action-icon.green {
    background: var(--success-soft);
    color: var(--success);
}

.quick-action-icon.blue {
    background: #dbeafe;
    color: #3b82f6;
}

.quick-action-icon.purple {
    background: var(--primary-soft);
    color: var(--primary);
}

.quick-action-icon.orange {
    background: #ffedd5;
    color: #f97316;
}

/* ========== 最近连接列表 ========== */
.recent-connections-list {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--gray-100);
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-item:hover {
    background: var(--gray-50);
}

.recent-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
}

.recent-icon svg {
    width: 20px;
    height: 20px;
}

.recent-info {
    flex: 1;
    min-width: 0;
}

.recent-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.recent-host {
    font-size: 13px;
    color: var(--gray-500);
}

.recent-time {
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
}

.recent-arrow {
    color: var(--gray-400);
}

.recent-arrow svg {
    width: 16px;
    height: 16px;
}

.recent-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 20px;
    color: var(--gray-500);
}

.recent-empty svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

/* ========== 批量操作 ========== */
.batch-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.batch-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    padding: 6px 12px;
    background: var(--primary-soft);
    border-radius: var(--radius-sm);
}

.btn-secondary.danger {
    color: var(--error);
    border-color: var(--error-soft);
}

.btn-secondary.danger:hover {
    background: var(--error-soft);
    border-color: var(--error);
}

/* ========== 选择模式 ========== */
.machine-card.select-mode {
    cursor: pointer;
    position: relative;
}

.machine-card.select-mode:hover {
    border-color: var(--primary-light);
}

.machine-card.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.select-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.select-checkbox svg {
    width: 14px;
    height: 14px;
    color: white;
    opacity: 0;
    transition: opacity 0.15s;
}

.select-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.select-checkbox.checked svg {
    opacity: 1;
}

/* ========== 收藏按钮 ========== */
.btn-icon.favorite {
    color: var(--gray-400);
}

.btn-icon.favorite:hover {
    color: #f59e0b;
    background: #fef3c7;
}

.btn-icon.favorite.active {
    color: #f59e0b;
}

/* ========== 导入弹窗 ========== */
.import-modal {
    max-width: 600px;
}

.import-tips {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.import-tip-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: #0ea5e9;
}

.import-tip-icon svg {
    width: 24px;
    height: 24px;
}

.import-tip-content {
    flex: 1;
}

.import-tip-content p {
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.import-tip-content pre {
    background: white;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: 'Monaco', 'Consolas', monospace;
    overflow-x: auto;
    color: var(--gray-700);
    border: 1px solid #e0f2fe;
}

.import-textarea {
    min-height: 200px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    resize: vertical;
}

/* ========== 统计卡片 - 四列 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-icon.orange {
    background: #ffedd5;
    color: #f97316;
}

/* ========== 添加服务器页面 - 两列布局 ========== */
.add-server-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

.add-server-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.add-server-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 100px;
}

/* 表单卡片样式 */
.form-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-card:hover {
    border-color: var(--gray-300);
}

.form-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    background: linear-gradient(to bottom, var(--gray-50), var(--white));
    border-bottom: 1px solid var(--gray-100);
}

.form-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.form-card-icon svg {
    width: 22px;
    height: 22px;
}

.form-card-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.form-card-icon.orange {
    background: rgba(251, 191, 36, 0.1);
    color: #f59e0b;
}

.form-card-icon.purple {
    background: var(--primary-soft);
    color: var(--primary);
}

.form-card-icon.green {
    background: var(--success-soft);
    color: var(--success);
}

.form-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.form-card-desc {
    font-size: 13px;
    color: var(--gray-500);
}

.form-card-body {
    padding: 28px;
}

.form-card-body .input-group {
    margin-bottom: 0;
}

.form-card-body .input-group + .input-group {
    margin-top: 20px;
}

/* 表单网格 - 两列 */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-grid-2 .input-group {
    margin-top: 0 !important;
}

/* 侧边栏卡片 */
.sidebar-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.sidebar-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
    margin: 0;
}

.sidebar-card-title svg {
    width: 18px;
    height: 18px;
    color: var(--gray-500);
}

.sidebar-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-card.help {
    background: linear-gradient(to bottom, #fefce8, var(--white));
    border-color: #fef08a;
}

.sidebar-card.help .sidebar-card-title {
    background: transparent;
    color: #a16207;
    border-bottom-color: #fef08a;
}

.sidebar-card.help .sidebar-card-title svg {
    color: #eab308;
}

/* 帮助列表 */
.help-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.help-list li {
    position: relative;
    padding-left: 20px;
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.5;
}

.help-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #eab308;
}

/* 操作按钮栏 */
.form-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
}

.form-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 输入框带操作按钮 */
.input-with-action {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-with-action .input-field {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    background: var(--gray-100);
    border: 2px solid transparent;
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
}

.input-action-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.input-action-btn svg {
    width: 20px;
    height: 20px;
}

.input-with-action .input-field:focus + .input-action-btn {
    border-color: var(--primary);
    border-left: none;
}

/* ========== 服务器页面 - 新工具栏 ========== */
.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* 工具栏卡片 */
.toolbar-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.toolbar-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-row.filters {
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

/* 大搜索框 */
.search-box-large {
    position: relative;
    flex: 1;
    max-width: 480px;
}

.search-box-large svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-box-large .search-input {
    padding: 14px 16px 14px 48px;
    font-size: 15px;
    border-radius: var(--radius-md);
}

/* 工具栏操作区 */
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

/* 标签筛选区 */
.tag-filter-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.filter-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-500);
    flex-shrink: 0;
}

/* 收藏筛选按钮 */
.favorite-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 9999px;
    color: var(--gray-600);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.favorite-btn svg {
    width: 14px;
    height: 14px;
}

.favorite-btn:hover {
    border-color: #f59e0b;
    color: #f59e0b;
}

.favorite-btn.active {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #b45309;
}

/* 文本按钮 */
.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--gray-600);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-text svg {
    width: 18px;
    height: 18px;
}

.btn-text:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

/* ========== 响应式调整 ========== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .add-server-layout {
        grid-template-columns: 1fr;
    }

    .add-server-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .batch-actions {
        flex-wrap: wrap;
    }

    .toolbar-right {
        flex-wrap: wrap;
    }

    .normal-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .form-actions-bar {
        flex-direction: column;
        gap: 12px;
    }

    .form-actions-right {
        width: 100%;
        flex-direction: column;
    }

    .form-actions-right .btn-secondary,
    .form-actions-right .btn-add {
        width: 100%;
        justify-content: center;
    }

    .btn-cancel {
        width: 100%;
        text-align: center;
    }

    .page-header-row {
        flex-direction: column;
        gap: 16px;
    }

    .page-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .page-header-actions > * {
        flex: 1;
        min-width: 0;
    }

    .toolbar-card {
        padding: 16px;
    }

    .toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box-large {
        max-width: none;
    }

    .toolbar-actions {
        margin-left: 0;
        flex-wrap: wrap;
    }

    .toolbar-actions > * {
        flex: 1;
    }

    .tag-filter-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .tag-filter {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
}

@media (max-width: 480px) {
    .add-server-layout {
        gap: 16px;
    }

    .form-card-header {
        padding: 16px;
    }

    .form-card-body {
        padding: 16px;
    }

    .sidebar-card-body {
        padding: 16px;
    }

    .form-actions-bar {
        padding: 16px;
    }
}

/* ========== 高级动画系统 ========== */

/* 页面入场动画 */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(124, 58, 237, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(124, 58, 237, 0.4), 0 0 30px rgba(124, 58, 237, 0.2);
    }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
}

/* 页面标题动画 */
.page-header {
    animation: slideUp 0.6s var(--ease-out) forwards;
}

.page-title {
    animation: slideInLeft 0.5s var(--ease-out) 0.1s both;
}

.page-subtitle {
    animation: slideInLeft 0.5s var(--ease-out) 0.2s both;
}

.page-header-actions {
    animation: slideInRight 0.5s var(--ease-out) 0.2s both;
}

/* 工具栏动画 */
.toolbar-card {
    animation: slideUp 0.5s var(--ease-out) 0.15s both;
}

/* 机器卡片网格动画 */
.machines-grid {
    animation: fadeIn 0.4s var(--ease-out);
}

.machine-card {
    animation: scaleIn 0.4s var(--ease-out) both;
    transition: all 0.3s var(--ease-out);
}

/* 卡片交错入场 */
.machine-card:nth-child(1) { animation-delay: 0.05s; }
.machine-card:nth-child(2) { animation-delay: 0.1s; }
.machine-card:nth-child(3) { animation-delay: 0.15s; }
.machine-card:nth-child(4) { animation-delay: 0.2s; }
.machine-card:nth-child(5) { animation-delay: 0.25s; }
.machine-card:nth-child(6) { animation-delay: 0.3s; }
.machine-card:nth-child(7) { animation-delay: 0.35s; }
.machine-card:nth-child(8) { animation-delay: 0.4s; }
.machine-card:nth-child(9) { animation-delay: 0.45s; }
.machine-card:nth-child(10) { animation-delay: 0.5s; }
.machine-card:nth-child(11) { animation-delay: 0.55s; }
.machine-card:nth-child(12) { animation-delay: 0.6s; }

/* 卡片高级悬停效果 */
.machine-card {
    position: relative;
    overflow: hidden;
}

.machine-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(124, 58, 237, 0.03),
        transparent
    );
    transition: left 0.5s ease;
    pointer-events: none;
}

.machine-card:hover::after {
    left: 100%;
}

.machine-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow:
        0 20px 40px rgba(124, 58, 237, 0.12),
        0 8px 16px rgba(0, 0, 0, 0.06);
}

.machine-card:active {
    transform: translateY(-2px) scale(0.99);
}

/* 机器图标动画 */
.machine-icon {
    transition: all 0.3s var(--ease-spring);
}

.machine-card:hover .machine-icon {
    transform: scale(1.1) rotate(-5deg);
    background: var(--primary);
    color: white;
}

/* 连接按钮动画 */
.btn-connect {
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
}

.btn-connect::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-connect:hover::before {
    width: 200px;
    height: 200px;
}

.btn-connect:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-connect:active {
    transform: scale(0.95);
}

/* 操作按钮动画 */
.btn-icon {
    transition: all 0.25s var(--ease-spring);
}

.btn-icon:hover {
    transform: scale(1.15);
}

.btn-icon:active {
    transform: scale(0.9);
}

/* 收藏按钮特殊动画 */
.btn-icon.favorite:hover svg {
    animation: heartbeat 0.6s ease;
}

.btn-icon.favorite.active svg {
    animation: bounceIn 0.5s var(--ease-spring);
}

/* 主按钮动画 */
.btn-add, .btn-primary, .btn-submit {
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
}

.btn-add:hover, .btn-primary:hover, .btn-submit:hover {
    transform: translateY(-3px);
    box-shadow:
        0 10px 30px rgba(124, 58, 237, 0.35),
        0 0 0 2px rgba(124, 58, 237, 0.1);
}

.btn-add:active, .btn-primary:active, .btn-submit:active {
    transform: translateY(-1px);
}

/* 次要按钮动画 */
.btn-secondary, .btn-text {
    transition: all 0.25s var(--ease-out);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

/* 标签筛选按钮动画 */
.tag-filter-btn {
    transition: all 0.25s var(--ease-spring);
}

.tag-filter-btn:hover {
    transform: translateY(-2px) scale(1.02);
}

.tag-filter-btn:active {
    transform: translateY(0) scale(0.98);
}

.tag-filter-btn.active {
    animation: pulse 0.3s var(--ease-spring);
}

/* 搜索框聚焦动画 */
.search-input {
    transition: all 0.3s var(--ease-out);
}

.search-input:focus {
    transform: scale(1.01);
}

.search-box-large svg {
    transition: all 0.3s var(--ease-out);
}

.search-box-large:focus-within svg {
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

/* 添加服务器页面动画 */
.add-server-layout {
    animation: pageEnter 0.6s var(--ease-out);
}

.add-server-main {
    animation: slideInLeft 0.5s var(--ease-out) 0.1s both;
}

.add-server-sidebar {
    animation: slideInRight 0.5s var(--ease-out) 0.2s both;
}

/* 表单卡片入场动画 */
.form-card {
    animation: slideUp 0.5s var(--ease-out) both;
    transition: all 0.3s var(--ease-out);
}

.form-card:nth-child(1) { animation-delay: 0.1s; }
.form-card:nth-child(2) { animation-delay: 0.2s; }
.form-card:nth-child(3) { animation-delay: 0.3s; }

.form-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* 侧边栏卡片动画 */
.sidebar-card {
    animation: slideUp 0.5s var(--ease-out) both;
    transition: all 0.3s var(--ease-out);
}

.sidebar-card:nth-child(1) { animation-delay: 0.25s; }
.sidebar-card:nth-child(2) { animation-delay: 0.35s; }

.sidebar-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* 表单图标动画 */
.form-card-icon {
    transition: all 0.3s var(--ease-spring);
}

.form-card:hover .form-card-icon {
    transform: scale(1.1) rotate(-5deg);
}

/* 输入框动画 */
.input-field {
    transition: all 0.3s var(--ease-out);
}

.input-field:focus {
    transform: translateY(-1px);
}

.input-group {
    transition: all 0.2s var(--ease-out);
}

.input-group:focus-within label {
    color: var(--primary);
}

/* 帮助列表项动画 */
.help-list li {
    transition: all 0.2s var(--ease-out);
}

.help-list li:hover {
    transform: translateX(4px);
    color: var(--gray-800);
}

.help-list li::before {
    transition: all 0.2s var(--ease-out);
}

.help-list li:hover::before {
    transform: scale(1.3);
}

/* 统计卡片动画 */
.stat-card {
    animation: scaleIn 0.5s var(--ease-out) both;
    transition: all 0.3s var(--ease-out);
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
}

.stat-icon {
    transition: all 0.3s var(--ease-spring);
}

.stat-card:hover .stat-icon {
    transform: scale(1.15) rotate(-8deg);
}

.stat-info h3 {
    transition: all 0.3s var(--ease-out);
}

.stat-card:hover .stat-info h3 {
    color: var(--primary);
}

/* 快捷操作卡片动画 */
.quick-action-card {
    animation: slideUp 0.4s var(--ease-out) both;
    transition: all 0.3s var(--ease-out);
}

.quick-action-card:nth-child(1) { animation-delay: 0.1s; }
.quick-action-card:nth-child(2) { animation-delay: 0.15s; }
.quick-action-card:nth-child(3) { animation-delay: 0.2s; }
.quick-action-card:nth-child(4) { animation-delay: 0.25s; }

.quick-action-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.quick-action-icon {
    transition: all 0.3s var(--ease-spring);
}

.quick-action-card:hover .quick-action-icon {
    transform: scale(1.2) rotate(-10deg);
}

/* 快捷访问卡片动画 */
.quick-card {
    animation: slideUp 0.4s var(--ease-out) both;
    transition: all 0.3s var(--ease-out);
}

.quick-card:nth-child(1) { animation-delay: 0.15s; }
.quick-card:nth-child(2) { animation-delay: 0.2s; }
.quick-card:nth-child(3) { animation-delay: 0.25s; }

.quick-card:hover {
    transform: translateX(8px);
}

.quick-icon {
    transition: all 0.3s var(--ease-spring);
}

.quick-card:hover .quick-icon {
    transform: scale(1.15);
    background: var(--primary);
    color: white;
}

.quick-arrow {
    transition: all 0.3s var(--ease-out);
}

.quick-card:hover .quick-arrow {
    transform: translateX(4px);
}

/* 最近连接列表动画 */
.recent-item {
    transition: all 0.25s var(--ease-out);
}

.recent-item:hover {
    transform: translateX(8px);
    background: var(--primary-soft);
}

.recent-icon {
    transition: all 0.3s var(--ease-spring);
}

.recent-item:hover .recent-icon {
    transform: scale(1.1);
    background: var(--primary);
    color: white;
}

/* 弹窗动画增强 */
.modal-overlay {
    transition: all 0.35s var(--ease-out);
}

.modal-overlay.active {
    backdrop-filter: blur(8px);
}

.modal {
    transition: all 0.4s var(--ease-spring);
}

.modal-overlay.active .modal {
    animation: bounceIn 0.5s var(--ease-spring);
}

/* 弹窗关闭按钮动画 */
.modal-close {
    transition: all 0.25s var(--ease-spring);
}

.modal-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: var(--error-soft);
    color: var(--error);
}

/* 确认弹窗图标动画 */
.confirm-icon {
    animation: bounceIn 0.6s var(--ease-spring) 0.1s both;
}

.confirm-icon svg {
    animation: wiggle 0.5s ease 0.5s;
}

/* 标签徽章动画 */
.machine-tag {
    animation: scaleIn 0.3s var(--ease-spring);
    transition: all 0.2s var(--ease-out);
}

.machine-tag:hover {
    transform: scale(1.05);
}

/* 标签管理列表动画 */
.tag-item {
    animation: slideUp 0.3s var(--ease-out) both;
    transition: all 0.2s var(--ease-out);
}

.tag-item:hover {
    transform: translateX(4px);
    background: var(--gray-100);
}

/* 空状态动画 */
.empty-state {
    animation: fadeIn 0.6s var(--ease-out);
}

.empty-illustration {
    animation: floatIn 0.8s var(--ease-spring) 0.1s both;
}

@keyframes floatIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.empty-icon {
    animation: bounceIn 0.7s var(--ease-spring) 0.2s both;
}

.empty-title {
    animation: slideUp 0.5s var(--ease-out) 0.3s both;
}

.empty-desc {
    animation: slideUp 0.5s var(--ease-out) 0.4s both;
}

.empty-actions {
    animation: slideUp 0.5s var(--ease-out) 0.5s both;
}

/* 批量选择动画 */
.select-checkbox {
    transition: all 0.25s var(--ease-spring);
}

.select-checkbox.checked {
    animation: bounceIn 0.4s var(--ease-spring);
}

.machine-card.selected {
    animation: pulse 0.4s var(--ease-out);
}

/* 批量操作栏动画 */
.batch-actions {
    animation: slideUp 0.3s var(--ease-spring);
}

.batch-count {
    animation: scaleIn 0.3s var(--ease-spring);
}

/* 导航栏动画增强 */
.floating-nav {
    animation: navSlideDown 0.6s var(--ease-spring);
}

.nav-logo {
    transition: all 0.3s var(--ease-spring);
}

.nav-logo:hover {
    transform: rotate(-10deg) scale(1.1);
}

.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s var(--ease-out);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

/* 登出按钮动画 */
.btn-logout {
    transition: all 0.25s var(--ease-out);
}

.btn-logout:hover {
    transform: translateY(-2px);
}

/* 返回链接动画 */
.back-link {
    transition: all 0.25s var(--ease-out);
}

.back-link:hover {
    transform: translateX(-4px);
}

.back-link svg {
    transition: transform 0.25s var(--ease-out);
}

.back-link:hover svg {
    transform: translateX(-4px);
}

/* 设置卡片动画 */
.settings-card {
    animation: slideUp 0.5s var(--ease-out) both;
    transition: all 0.3s var(--ease-out);
}

.settings-card:nth-child(1) { animation-delay: 0.1s; }
.settings-card:nth-child(2) { animation-delay: 0.2s; }
.settings-card:nth-child(3) { animation-delay: 0.3s; }

.settings-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.settings-card-icon {
    transition: all 0.3s var(--ease-spring);
}

.settings-card:hover .settings-card-icon {
    transform: scale(1.1) rotate(-5deg);
}

/* 加载旋转动画 */
.spin {
    animation: rotate 1s linear infinite;
}

/* 脉冲加载动画 */
.loading-pulse {
    animation: pulse 1.5s ease infinite;
}

/* 骨架屏动画 */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-100) 25%,
        var(--gray-200) 50%,
        var(--gray-100) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* 成功状态动画 */
@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-animation {
    animation: successPop 0.5s var(--ease-spring);
}

/* 错误抖动动画 */
@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.error-shake {
    animation: errorShake 0.5s ease;
}

/* 禁用动画 - 尊重用户偏好 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 魔方财务同步页面 ========== */

/* 同步源配置网格 */
.configs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* 配置卡片 */
.config-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: slideUp 0.4s var(--ease-out) both;
    transition: all 0.3s var(--ease-out);
}

.config-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.config-card.inactive {
    opacity: 0.7;
}

.config-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid var(--gray-100);
}

.config-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--gray-100);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s var(--ease-spring);
}

.config-icon svg {
    width: 24px;
    height: 24px;
}

.config-icon.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.config-card:hover .config-icon {
    transform: scale(1.1) rotate(-5deg);
}

.config-info {
    flex: 1;
    min-width: 0;
}

.config-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.config-url {
    font-size: 13px;
    color: var(--gray-500);
    font-family: 'Monaco', 'Consolas', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.config-actions {
    display: flex;
    gap: 4px;
}

.config-card-body {
    padding: 20px;
}

.config-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.config-stat {
    display: flex;
    flex-direction: column;
}

.config-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.config-stat-label {
    font-size: 12px;
    color: var(--gray-500);
}

.config-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.config-status {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 9999px;
}

.config-status.active {
    background: var(--success-soft);
    color: var(--success);
}

.config-status.inactive {
    background: var(--gray-100);
    color: var(--gray-500);
}

.btn-sync {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sync:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-sync:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-sync svg,
.btn-sync .sync-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

/* 同步中旋转动画 */
.btn-sync.syncing .sync-icon {
    animation: syncSpin 1s linear infinite;
}

@keyframes syncSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 服务商图标包装 */
.config-icon-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.config-favicon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: contain;
    background: var(--gray-50);
    padding: 8px;
    border: 1px solid var(--gray-100);
    transition: all 0.3s var(--ease-spring);
}

/* 雨云 logo 特殊样式 */
.config-favicon.rainyun-logo {
    object-fit: contain;
    padding: 6px;
    background: transparent;
    border: none;
}

.config-card:hover .config-favicon {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: var(--shadow-sm);
}

/* 服务商类型标签 */
.config-type-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 4px;
}

/* 雨云类型标签 */
.config-type-badge.rainyun {
    color: #7c3aed;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

/* 输入提示增强 */
.input-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.5;
}

.input-hint code {
    padding: 2px 6px;
    background: var(--gray-100);
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 11px;
    color: var(--primary);
}

/* 机器列表中的服务商图标 */
.mofang-config-favicon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    object-fit: contain;
    margin-right: 6px;
    vertical-align: middle;
}

/* 同步机器列表 */
.sync-machines-section {
    animation: fadeIn 0.5s var(--ease-out) 0.2s both;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-actions .btn-secondary {
    white-space: nowrap;
    flex-shrink: 0;
}

.config-filter {
    min-width: 160px;
}

/* 魔方机器网格 */
.mofang-machines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* 魔方机器卡片 */
.mofang-machine-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    animation: scaleIn 0.4s var(--ease-out) both;
    transition: all 0.3s var(--ease-out);
}

.mofang-machine-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.mofang-machine-card.imported {
    border-color: var(--success);
    background: linear-gradient(to bottom, #f0fdf4, var(--white));
}

.mofang-machine-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.mofang-machine-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mofang-machine-status.active {
    background: var(--success-soft);
    color: var(--success);
}

.mofang-machine-status.pending {
    background: #fef3c7;
    color: #b45309;
}

.mofang-machine-status.suspended {
    background: #fee2e2;
    color: #dc2626;
}

.mofang-machine-status.terminated,
.mofang-machine-status.cancelled {
    background: var(--gray-100);
    color: var(--gray-500);
}

.mofang-machine-status.unknown {
    background: var(--gray-100);
    color: var(--gray-600);
}

.imported-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--success);
    color: white;
    margin-left: auto;
}

.mofang-machine-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mofang-machine-ip {
    font-size: 14px;
    font-family: 'Monaco', 'Consolas', monospace;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.mofang-machine-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.mofang-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--gray-500);
}

.mofang-meta-item svg {
    width: 14px;
    height: 14px;
}

.mofang-machine-dates {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 12px;
}

.mofang-date {
    display: flex;
    flex-direction: column;
}

.mofang-date-label {
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 2px;
}

.mofang-date-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.mofang-date-value.expiring {
    color: var(--error);
}

.mofang-machine-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mofang-config-name {
    font-size: 12px;
    color: var(--gray-500);
}

.btn-small {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-600);
}

.btn-small:hover {
    border-color: var(--gray-400);
    color: var(--gray-800);
}

.btn-small.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-small.primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* 魔方空状态 */
.mofang-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

/* 导入信息 */
.import-info {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.import-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--gray-200);
}

.import-info-row:last-child {
    border-bottom: none;
}

.import-info-label {
    font-size: 13px;
    color: var(--gray-500);
}

.import-info-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}

/* 批量导入提示 */
.batch-import-tips {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    color: #1e40af;
}

.batch-import-tips svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.batch-import-tips p {
    font-size: 14px;
}

/* 批量选择列表 */
.batch-select-list {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
}

.batch-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.15s;
}

.batch-select-item:last-child {
    border-bottom: none;
}

.batch-select-item:hover {
    background: var(--gray-50);
}

.batch-select-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.batch-select-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
}

.batch-select-ip {
    font-size: 13px;
    font-family: 'Monaco', 'Consolas', monospace;
    color: var(--gray-500);
}

.batch-select-cred {
    font-size: 11px;
    padding: 2px 8px;
    background: #d1fae5;
    color: #059669;
    border-radius: 9999px;
    font-weight: 500;
}

.batch-select-nocred {
    font-size: 11px;
    padding: 2px 8px;
    background: #fef3c7;
    color: #d97706;
    border-radius: 9999px;
    font-weight: 500;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    gap: 20px;
}

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

.radio-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.radio-label {
    font-size: 14px;
    color: var(--gray-700);
}

/* 复选框标签 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.checkbox-label span {
    font-size: 14px;
    color: var(--gray-700);
}

/* flex-grow 辅助类 */
.flex-grow {
    flex: 1;
}

/* ========== SSH密钥管理页面 ========== */

.keys-section {
    animation: fadeIn 0.5s var(--ease-out);
}

.keys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
}

/* 密钥卡片 */
.key-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: slideUp 0.4s var(--ease-out) both;
    transition: all 0.3s var(--ease-out);
}

.key-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.key-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid var(--gray-100);
}

.key-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s var(--ease-spring);
}

.key-icon svg {
    width: 24px;
    height: 24px;
}

.key-icon.rsa {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.key-icon.ed25519 {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.key-icon.ecdsa {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.key-card:hover .key-icon {
    transform: scale(1.1) rotate(-5deg);
}

.key-info {
    flex: 1;
    min-width: 0;
}

.key-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.key-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.key-type-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 4px;
}

.key-protected-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--success);
    background: var(--success-soft);
    border-radius: 4px;
}

.key-actions {
    display: flex;
    gap: 4px;
}

.key-card-body {
    padding: 16px 20px;
}

.key-fingerprint-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.key-fingerprint-label {
    font-size: 12px;
    color: var(--gray-500);
}

.key-fingerprint-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 11px;
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 4px 8px;
    border-radius: 4px;
}

.key-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.key-date {
    font-size: 12px;
    color: var(--gray-500);
}

.key-usage {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
}

/* 大文本框 */
.textarea-large {
    resize: vertical;
    min-height: 100px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
}

/* 密钥详情 */
.key-detail-section {
    margin-bottom: 24px;
}

.key-detail-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.key-content-wrapper {
    position: relative;
    background: var(--gray-900);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.key-content {
    padding: 16px;
    margin: 0;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #a5f3fc;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

.key-content.key-private {
    color: #fca5a5;
}

.btn-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-copy svg {
    width: 14px;
    height: 14px;
}

.key-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.key-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    background: var(--gray-50);
    padding: 16px;
    border-radius: var(--radius-md);
}

.key-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.key-info-label {
    font-size: 12px;
    color: var(--gray-500);
}

.key-info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
}

.key-info-value.key-fingerprint {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 11px;
}

/* 成功提示 */
.success-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.success-notice svg {
    width: 24px;
    height: 24px;
    color: #f59e0b;
    flex-shrink: 0;
}

.success-notice p {
    font-size: 14px;
    color: #92400e;
    font-weight: 500;
}

/* 响应式 */
@media (max-width: 768px) {
    .configs-grid {
        grid-template-columns: 1fr;
    }

    .mofang-machines-grid {
        grid-template-columns: 1fr;
    }

    .keys-grid {
        grid-template-columns: 1fr;
    }

    .section-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .config-filter {
        min-width: auto;
    }

    .key-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 认证方式选择器 ========== */
.auth-type-selector {
    display: flex;
    gap: 16px;
}

.auth-type-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.auth-type-option:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.auth-type-option.active {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.auth-type-option input[type="radio"] {
    display: none;
}

.auth-type-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    transition: all 0.2s var(--ease-out);
}

.auth-type-option.active .auth-type-icon {
    background: var(--primary);
}

.auth-type-icon svg {
    width: 22px;
    height: 22px;
    color: var(--gray-600);
    transition: color 0.2s;
}

.auth-type-option.active .auth-type-icon svg {
    color: var(--white);
}

.auth-type-option span {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-700);
}

.auth-type-option.active span {
    color: var(--primary);
    font-weight: 600;
}

/* 密钥空提示 */
.key-empty-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border: 1px solid #fcd34d;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #92400e;
}

.key-empty-hint svg {
    width: 18px;
    height: 18px;
    color: #f59e0b;
    flex-shrink: 0;
}

.key-create-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
    margin-left: 2px;
}

.key-create-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* 可选标签 */
.optional {
    color: var(--gray-500);
    font-weight: 400;
    font-size: 12px;
}

/* 认证区域动画 */
.auth-password-section,
.auth-key-section {
    animation: fadeIn 0.3s var(--ease-out);
    margin-top: 20px;
}

.auth-key-section .input-group + .input-group {
    margin-top: 20px;
}

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

/* 响应式 */
@media (max-width: 640px) {
    .auth-type-selector {
        flex-direction: column;
    }
}

/* ========== 服务器状态指示器 ========== */
.server-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--gray-50);
    border-radius: 20px;
    margin-left: auto;
    margin-right: 8px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-400);
    transition: all 0.3s;
}

.status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

.status-indicator.offline {
    background: var(--gray-400);
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.status-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-500);
}

.status-text.online {
    color: var(--success);
}

.status-text.offline {
    color: var(--gray-500);
}

/* ========== 服务器资源使用条 ========== */
.server-metrics {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.metric-item {
    flex: 1;
}

.metric-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--gray-500);
}

.metric-label span:last-child {
    font-weight: 600;
    font-family: 'Monaco', 'Consolas', monospace;
}

.metric-bar {
    height: 6px;
    background: var(--gray-100);
    border-radius: 3px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease-out, background-color 0.3s;
}

.metric-fill.normal {
    background: linear-gradient(90deg, var(--success), #34d399);
}

.metric-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.metric-fill.critical {
    background: linear-gradient(90deg, var(--error), #f87171);
    animation: criticalPulse 1s ease-in-out infinite;
}

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

/* 机器卡片悬停时显示更多信息 */
.machine-card {
    cursor: pointer;
}

.machine-card:hover .server-metrics {
    background: var(--gray-50);
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ========== 圆形进度图表 - 服务器列表卡片 ========== */
.server-metrics-circle {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding: 14px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.circle-metric {
    position: relative;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.circle-chart {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    stroke: var(--gray-200);
}

.circle-progress {
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.3s ease;
}

.circle-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.circle-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
    font-family: 'Monaco', 'Consolas', monospace;
}

.circle-label {
    font-size: 10px;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 3px;
}

/* 悬停效果 */
.machine-card:hover .circle-metric {
    transform: scale(1.05);
    transition: transform 0.3s var(--ease-out);
}

/* ========== 服务器详情页 - 大圆形图表 ========== */
.circle-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card-circle {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    border: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.stat-card-circle:hover {
    transform: translateY(-2px);
    border-color: var(--gray-200);
}

.stat-circle-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.stat-circle-chart {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.stat-circle-bg {
    stroke: var(--gray-100);
}

.stat-circle-progress {
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.3s ease;
}

.stat-circle-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-circle-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
    font-family: 'Monaco', 'Consolas', monospace;
}

.stat-circle-label {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 4px;
}

.stat-circle-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0;
}

.stat-circle-detail {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 6px;
    font-family: 'Monaco', 'Consolas', monospace;
}

/* 运行时间卡片 */
.stat-card-circle.uptime-card {
    justify-content: space-between;
    padding: 20px;
    gap: 16px;
}

.uptime-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.uptime-time-blocks {
    display: flex;
    align-items: center;
    gap: 4px;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    min-width: 48px;
}

.time-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
    font-family: 'Monaco', 'Consolas', monospace;
    line-height: 1;
}

.time-unit {
    font-size: 10px;
    color: var(--gray-500);
    margin-top: 4px;
}

.time-separator {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-400);
    margin: 0 2px;
}

.uptime-title {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

.load-display {
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.load-title {
    display: block;
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 10px;
    text-align: center;
}

.load-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.load-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.load-label {
    font-size: 10px;
    color: var(--gray-500);
    width: 24px;
    text-align: right;
    font-family: 'Monaco', 'Consolas', monospace;
}

.load-bar-wrap {
    flex: 1;
    height: 6px;
    background: var(--gray-100);
    border-radius: 3px;
    overflow: hidden;
}

.load-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease-out, background 0.3s ease;
    background: #10b981;
}

.load-value {
    font-size: 11px;
    color: var(--gray-700);
    width: 32px;
    text-align: left;
    font-family: 'Monaco', 'Consolas', monospace;
    font-weight: 500;
}

/* 响应式 */
@media (max-width: 1024px) {
    .circle-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .circle-stats {
        grid-template-columns: 1fr;
    }

    .server-metrics-circle {
        flex-direction: column;
        gap: 12px;
    }

    .circle-metric {
        width: 80px;
        height: 80px;
    }
}

/* ========== 服务器详情页 ========== */
.server-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-top: 8px;
}

.server-detail-info {
    flex: 1;
}

.server-detail-actions {
    display: flex;
    gap: 12px;
}

.server-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-left: 12px;
    vertical-align: middle;
}

.server-status-badge .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-400);
}

.server-status-badge.online {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.server-status-badge.online .status-dot {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

.server-status-badge.offline {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* 服务器统计卡片 */
.server-stats .stat-card {
    position: relative;
    padding-bottom: 20px;
}

.stat-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gray-100);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    transition: width 0.5s ease-out, background-color 0.3s;
}

.stat-bar-fill.normal {
    background: linear-gradient(90deg, var(--success), #34d399);
}

.stat-bar-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.stat-bar-fill.critical {
    background: linear-gradient(90deg, var(--error), #f87171);
}

.stat-detail {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
}

/* 图表区域 */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.chart-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
}

.chart-title svg {
    width: 18px;
    height: 18px;
    color: var(--gray-500);
}

.chart-time {
    font-size: 12px;
    color: var(--gray-500);
}

.chart-body {
    padding: 20px 24px;
    height: 250px;
}

/* 信息卡片 */
.info-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.info-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    background: linear-gradient(to bottom, var(--gray-50), var(--white));
}

.info-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
}

.info-card-title svg {
    width: 18px;
    height: 18px;
    color: var(--gray-500);
}

.info-card-body {
    padding: 24px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 12px;
    color: var(--gray-500);
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
}

/* 响应式 */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .server-detail-header {
        flex-direction: column;
    }

    .server-detail-actions {
        width: 100%;
    }

    .server-detail-actions .btn-secondary,
    .server-detail-actions .btn-add {
        flex: 1;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 骨架屏加载动画 ========== */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 骨架屏容器 */
.skeleton-container {
    animation: skeletonFadeIn 0.3s ease-out;
}

/* 服务器管理页骨架屏网格 */
.machines-grid .skeleton-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* 密钥管理页骨架屏网格 */
.keys-grid .skeleton-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
}

/* 首页收藏服务器骨架屏网格 */
.quick-access-grid .skeleton-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

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

/* 统计卡片骨架 */
.skeleton-stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.skeleton-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
}

.skeleton-stat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-stat-number {
    width: 60px;
    height: 28px;
}

.skeleton-stat-label {
    width: 80px;
    height: 14px;
}

/* 快捷操作骨架 */
.skeleton-quick-action {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.skeleton-quick-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
}

.skeleton-quick-text {
    width: 64px;
    height: 14px;
}

/* 服务器卡片骨架 */
.skeleton-server-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.skeleton-server-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
}

.skeleton-server-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-server-name {
    width: 120px;
    height: 18px;
}

.skeleton-server-host {
    width: 160px;
    height: 14px;
}

.skeleton-server-arrow {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* 最近连接骨架 */
.skeleton-recent-item {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.skeleton-recent-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
}

.skeleton-recent-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skeleton-recent-name {
    width: 100px;
    height: 16px;
}

.skeleton-recent-host {
    width: 140px;
    height: 12px;
}

.skeleton-recent-time {
    width: 60px;
    height: 12px;
}

/* 密钥卡片骨架 */
.skeleton-key-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-key-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.skeleton-key-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
}

.skeleton-key-title {
    width: 140px;
    height: 18px;
}

.skeleton-key-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-key-type {
    width: 100px;
    height: 14px;
}

.skeleton-key-date {
    width: 120px;
    height: 12px;
}

.skeleton-key-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.skeleton-key-btn {
    width: 80px;
    height: 36px;
    border-radius: var(--radius-sm);
}

/* 机器卡片骨架（服务器管理页） */
.skeleton-machine-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-machine-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.skeleton-machine-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-machine-name {
    width: 140px;
    height: 20px;
}

.skeleton-machine-host {
    width: 180px;
    height: 14px;
}

.skeleton-machine-status {
    width: 60px;
    height: 24px;
    border-radius: 12px;
}

.skeleton-machine-tags {
    display: flex;
    gap: 8px;
}

.skeleton-machine-tag {
    width: 60px;
    height: 24px;
    border-radius: 12px;
}

.skeleton-machine-actions {
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.skeleton-machine-btn {
    flex: 1;
    height: 40px;
    border-radius: var(--radius-sm);
}

/* 骨架屏淡出动画 */
.skeleton-fade-out {
    animation: skeletonFadeOut 0.3s ease-out forwards;
}

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

/* ========== 服务商页面骨架屏 ========== */

/* 服务商配置卡片骨架屏 */
.skeleton-config-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-config-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.skeleton-config-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.skeleton-config-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-config-name {
    height: 20px;
    width: 60%;
    border-radius: var(--radius-sm);
}

.skeleton-config-url {
    height: 14px;
    width: 80%;
    border-radius: var(--radius-sm);
}

.skeleton-config-stats {
    display: flex;
    gap: 24px;
    padding: 12px 0;
    border-top: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
}

.skeleton-config-stat {
    height: 36px;
    width: 80px;
    border-radius: var(--radius-sm);
}

.skeleton-config-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skeleton-config-status {
    height: 24px;
    width: 60px;
    border-radius: 12px;
}

.skeleton-config-btn {
    height: 32px;
    width: 90px;
    border-radius: var(--radius-sm);
}

/* 同步机器卡片骨架屏 */
.skeleton-mofang-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-mofang-header {
    display: flex;
    justify-content: flex-start;
}

.skeleton-mofang-status {
    height: 22px;
    width: 50px;
    border-radius: 11px;
}

.skeleton-mofang-name {
    height: 20px;
    width: 70%;
    border-radius: var(--radius-sm);
}

.skeleton-mofang-ip {
    height: 16px;
    width: 50%;
    border-radius: var(--radius-sm);
}

.skeleton-mofang-meta {
    display: flex;
    gap: 16px;
}

.skeleton-mofang-meta-item {
    height: 16px;
    width: 80px;
    border-radius: var(--radius-sm);
}

.skeleton-mofang-dates {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid var(--gray-100);
}

.skeleton-mofang-date {
    height: 32px;
    width: 80px;
    border-radius: var(--radius-sm);
}

.skeleton-mofang-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
}

.skeleton-mofang-source {
    height: 20px;
    width: 70px;
    border-radius: var(--radius-sm);
}

.skeleton-mofang-btn {
    height: 28px;
    width: 50px;
    border-radius: var(--radius-sm);
}

/* ========== 卡片入场动画 ========== */
@keyframes cardFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.config-card.animate-in,
.mofang-machine-card.animate-in {
    animation: cardFadeInUp 0.4s var(--ease-out) forwards;
}

/* 交错动画延迟 */
.config-card.animate-in:nth-child(1),
.mofang-machine-card.animate-in:nth-child(1) { animation-delay: 0ms; }
.config-card.animate-in:nth-child(2),
.mofang-machine-card.animate-in:nth-child(2) { animation-delay: 50ms; }
.config-card.animate-in:nth-child(3),
.mofang-machine-card.animate-in:nth-child(3) { animation-delay: 100ms; }
.config-card.animate-in:nth-child(4),
.mofang-machine-card.animate-in:nth-child(4) { animation-delay: 150ms; }
.config-card.animate-in:nth-child(5),
.mofang-machine-card.animate-in:nth-child(5) { animation-delay: 200ms; }
.config-card.animate-in:nth-child(6),
.mofang-machine-card.animate-in:nth-child(6) { animation-delay: 250ms; }
.config-card.animate-in:nth-child(7),
.mofang-machine-card.animate-in:nth-child(7) { animation-delay: 300ms; }
.config-card.animate-in:nth-child(8),
.mofang-machine-card.animate-in:nth-child(8) { animation-delay: 350ms; }

/* ========== 移动端导航 ========== */

/* 汉堡菜单按钮 - 默认隐藏 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    gap: 5px;
    transition: background 0.2s ease;
}

.mobile-menu-btn:hover {
    background: var(--gray-100);
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all 0.3s var(--ease-out);
}

/* 汉堡菜单激活状态 - X 形 */
.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* 移动端导航遮罩 */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

/* 移动端侧边栏 */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--white);
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s var(--ease-out);
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.1);
}

.mobile-nav.active {
    transform: translateX(0);
}

/* 移动端导航头部 */
.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.mobile-nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-nav-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.2s ease;
}

.mobile-nav-close:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.mobile-nav-close svg {
    width: 18px;
    height: 18px;
}

/* 移动端用户信息 */
.mobile-nav-user {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.mobile-user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.mobile-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mobile-user-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.mobile-user-label {
    font-size: 13px;
    color: var(--gray-500);
}

/* 移动端导航链接 */
.mobile-nav-links {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.mobile-nav-link svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--gray-500);
    transition: color 0.2s ease;
}

.mobile-nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.mobile-nav-link:hover svg {
    color: var(--gray-700);
}

.mobile-nav-link.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.mobile-nav-link.active svg {
    color: var(--primary);
}

/* 移动端导航底部 */
.mobile-nav-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-100);
}

.mobile-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-700);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-logout-btn svg {
    width: 18px;
    height: 18px;
}

.mobile-logout-btn:hover {
    background: var(--error-soft);
    color: var(--error);
}

/* 移动端响应式 - 显示汉堡菜单 */
@media (max-width: 768px) {
    /* 隐藏桌面端导航链接和用户信息 */
    .nav-links {
        display: none;
    }

    .nav-user {
        display: none;
    }

    /* 显示汉堡菜单按钮 */
    .mobile-menu-btn {
        display: flex;
    }

    /* 显示移动端侧边栏（但默认隐藏在右侧） */
    .mobile-nav {
        display: flex;
    }

    /* 导航栏简化 */
    .nav-inner {
        padding: 10px 12px 10px 16px;
    }

    .nav-left {
        gap: 0;
    }
}

@media (max-width: 480px) {
    .mobile-nav {
        width: 100%;
        max-width: none;
    }

    .mobile-nav-header {
        padding: 14px 16px;
    }

    .mobile-nav-user {
        padding: 16px;
    }

    .mobile-nav-links {
        padding: 8px;
    }

    .mobile-nav-link {
        padding: 12px 14px;
    }
}

/* 防止滚动穿透 */
body.mobile-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ========== 移动端页面布局优化 ========== */
@media (max-width: 768px) {
    /* 页面头部 */
    .page-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .page-header-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .page-header-actions .btn-add,
    .page-header-actions .btn-secondary {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }

    .btn-group {
        flex: 1;
        min-width: 120px;
    }

    .btn-group .btn-add {
        flex: 1;
    }

    /* 工具栏 */
    .toolbar-row {
        flex-direction: column;
        gap: 12px;
    }

    .toolbar-row.filters {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tag-filter {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .tag-filter-btn {
        flex-shrink: 0;
    }

    .search-box-large {
        width: 100%;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* 卡片网格 */
    .machines-grid,
    .keys-grid,
    .configs-grid,
    .mofang-machines-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 统计卡片 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-icon svg {
        width: 20px;
        height: 20px;
    }

    .stat-info h3 {
        font-size: 22px;
    }

    .stat-info p {
        font-size: 12px;
    }

    /* 设置页面 */
    .settings-grid {
        grid-template-columns: 1fr;
    }

    /* 服务商页面 */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .section-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .section-actions .btn-secondary {
        flex: 1;
        justify-content: center;
    }

    .config-filter {
        flex: 1;
        min-width: 120px;
    }

    /* 机器卡片内部布局 */
    .machine-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .machine-actions {
        margin-left: auto;
    }

    .server-metrics-circle {
        gap: 16px;
    }

    .circle-chart {
        width: 50px;
        height: 50px;
    }

    /* 弹窗 */
    .modal {
        margin: 16px;
        max-height: calc(100vh - 32px);
    }

    .modal-body {
        max-height: calc(100vh - 200px);
    }

    .input-row {
        flex-direction: column;
        gap: 0;
    }

    .input-row .input-group {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* 更小屏幕的优化 */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

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

    .page-subtitle {
        font-size: 13px;
    }

    /* 按钮全宽 */
    .page-header-actions .btn-add,
    .page-header-actions .btn-secondary,
    .btn-group {
        width: 100%;
        min-width: auto;
    }

    /* 机器卡片 */
    .machine-card {
        padding: 16px;
    }

    .machine-name {
        font-size: 15px;
    }

    .machine-host {
        font-size: 12px;
    }

    .btn-connect {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* 密钥卡片 */
    .key-card {
        padding: 16px;
    }

    .key-card-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .key-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* 服务商卡片 */
    .config-card {
        padding: 16px;
    }

    .config-card-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .config-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .config-stats {
        flex-direction: column;
        gap: 8px;
    }

    /* 同步机器卡片 */
    .mofang-machine-card {
        padding: 14px;
    }

    .mofang-machine-meta {
        flex-direction: column;
        gap: 6px;
    }

    /* 欢迎区域 */
    .welcome-title-wrapper,
    .welcome-subtitle-wrapper {
        max-width: 100%;
    }

    .welcome-title {
        font-size: 20px;
    }

    .welcome-subtitle {
        font-size: 13px;
    }

    /* 最近连接 */
    .recent-item {
        padding: 12px;
    }

    .recent-name {
        font-size: 14px;
    }

    .recent-host {
        font-size: 12px;
    }

    .recent-time {
        font-size: 11px;
    }

    /* 页脚 */
    .footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .footer-divider {
        display: none;
    }

    .footer-poetry {
        font-size: 12px;
    }
}


/* ========== 2FA 两步验证页面 ========== */

.verify-2fa-card {
    max-width: 400px;
    padding: 32px;
    border-radius: var(--radius-lg);
}

/* 头部 */
.verify-2fa-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.verify-2fa-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 6px;
}

.verify-2fa-header p {
    font-size: 14px;
    color: var(--gray-500);
}

/* 用户信息 */
.verify-2fa-card .verify-2fa-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.verify-2fa-card .verify-2fa-user .user-label {
    font-size: 13px;
    color: var(--gray-500);
}

.verify-2fa-card .verify-2fa-user .user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

/* 验证码输入框 - 6个独立格子 */
.verify-2fa-code-boxes {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.verify-2fa-code-boxes .code-box {
    width: 48px;
    height: 56px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-800);
    font-size: 24px;
    font-weight: 600;
    font-family: 'Outfit', monospace;
    text-align: center;
    transition: all 0.15s ease;
}

.verify-2fa-code-boxes .code-box:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--primary-soft);
}

.verify-2fa-code-boxes .code-box:not(:placeholder-shown) {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.verify-2fa-code-boxes .code-separator {
    color: var(--gray-400);
    font-size: 20px;
    font-weight: 500;
    margin: 0 4px;
    user-select: none;
}

/* 提示信息 */
.verify-2fa-card .verify-2fa-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 24px;
}

.verify-2fa-card .verify-2fa-hint i {
    font-size: 14px;
    color: var(--gray-400);
}

.verify-2fa-card .verify-2fa-hint span {
    font-size: 12px;
    color: var(--gray-500);
}

/* 验证按钮 */
.verify-2fa-card .btn-verify {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.verify-2fa-card .btn-verify:hover {
    background: var(--primary-hover);
}

.verify-2fa-card .btn-verify .btn-text {
    color: white;
}

.verify-2fa-card .btn-verify i {
    font-size: 18px;
    color: white;
}

.verify-2fa-card .btn-verify.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* 返回链接 */
.verify-2fa-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--gray-500);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.15s ease;
}

.verify-2fa-back i {
    font-size: 16px;
}

.verify-2fa-back:hover {
    color: var(--primary);
}

/* 响应式 */
@media (max-width: 480px) {
    .verify-2fa-card {
        padding: 24px 20px;
    }

    .verify-2fa-header h1 {
        font-size: 20px;
    }

    .verify-2fa-code-boxes {
        gap: 8px;
    }

    .verify-2fa-code-boxes .code-box {
        width: 44px;
        height: 52px;
        font-size: 22px;
    }

    .verify-2fa-card .btn-verify {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* 2FA 弹窗尺寸 */
.modal-2fa-setup {
    max-width: 440px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-2fa-disable {
    max-width: 400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-2fa-ask {
    max-width: 360px;
    padding: 0;
    overflow: hidden;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow:
        0 25px 60px -15px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.05);
}

.modal-2fa-setup .modal-body,
.modal-2fa-disable .modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    padding: 20px;
}

/* 验证码输入组 */
.setup-2fa-code-input {
    margin-top: 16px;
    max-width: 100%;
}

/* 2FA 弹窗底部按钮 - 强制一行 */
.modal-2fa-setup .modal-footer,
.modal-2fa-disable .modal-footer,
.modal-2fa-ask .modal-footer {
    flex-wrap: nowrap;
    gap: 10px;
}

.modal-2fa-setup .modal-footer .btn-cancel,
.modal-2fa-disable .modal-footer .btn-cancel,
.modal-2fa-ask .modal-footer .btn-cancel {
    flex-shrink: 0;
    white-space: nowrap;
}

.modal-2fa-setup .modal-footer .btn-primary,
.modal-2fa-disable .modal-footer .btn-primary,
.modal-2fa-disable .modal-footer .btn-danger,
.modal-2fa-ask .modal-footer .btn-primary {
    flex-shrink: 1;
    white-space: nowrap;
    min-width: 0;
}

/* 验证页面用户信息 */
.verify-user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-soft) 0%, var(--gray-50) 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
    border: 1px solid rgba(124, 58, 237, 0.1);
}

.verify-user-label {
    font-size: 13px;
    color: var(--gray-500);
}

.verify-user-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
}

/* 验证码输入框 */
.code-input {
    text-align: center;
    font-size: 28px !important;
    font-weight: 600;
    letter-spacing: 12px;
    font-family: 'Outfit', monospace;
    padding-left: 12px;
    height: 56px;
}

.code-input::placeholder {
    font-size: 14px;
    letter-spacing: normal;
    font-weight: 400;
}

/* 设置页面 2FA 状态 */
.two-fa-status {
    min-height: 100px;
    display: flex;
    align-items: center;
}

.two-fa-status-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px;
    color: var(--gray-500);
    font-size: 14px;
    width: 100%;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.two-fa-enabled,
.two-fa-disabled {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
}

.two-fa-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
}

.two-fa-badge svg {
    width: 16px;
    height: 16px;
}

.two-fa-badge.enabled {
    background: var(--success-soft);
    color: var(--success);
}

.two-fa-badge.disabled {
    background: var(--gray-100);
    color: var(--gray-500);
}

.two-fa-desc {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.5;
}

.two-fa-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    color: var(--gray-500);
    width: 100%;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-text:hover {
    background: var(--primary-soft);
}

.btn-primary-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
}

.btn-primary-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.btn-danger-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: 2px solid var(--error);
    color: var(--error);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
}

.btn-danger-outline:hover {
    background: var(--error);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25);
}

/* 设置卡片图标状态 */
.settings-card-icon.success {
    background: var(--success-soft);
    color: var(--success);
}

/* 2FA 设置弹窗 */
.setup-2fa-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-soft) 0%, transparent 100%);
    border-radius: var(--radius-lg);
    max-width: 100%;
    box-sizing: border-box;
}

.setup-2fa-intro-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: var(--primary);
    border-radius: 50%;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.15);
}

.setup-2fa-intro-icon svg {
    width: 32px;
    height: 32px;
}

.setup-2fa-intro p {
    font-size: 14px;
    color: var(--gray-600);
    max-width: 280px;
    line-height: 1.5;
}

.setup-2fa-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
    max-width: 100%;
}

.setup-2fa-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    max-width: 100%;
    box-sizing: border-box;
}

.setup-2fa-step:hover {
    background: var(--gray-100);
}

.step-num {
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    padding-top: 3px;
    min-width: 0;
    overflow: hidden;
}

.step-content p {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.step-hint {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.4;
    word-wrap: break-word;
}

/* 二维码容器 */
.qr-code-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: white;
    border: 2px dashed var(--gray-200);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    min-height: 180px;
    max-width: 100%;
    box-sizing: border-box;
}

.qr-code-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--gray-500);
    font-size: 13px;
}

.qr-code-img {
    max-width: 180px;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.qr-code-error {
    color: var(--error);
    font-size: 13px;
    text-align: center;
}

/* 密钥显示 - 强制一行 */
.secret-key-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    border: 1px solid var(--gray-200);
    flex-wrap: nowrap;
    white-space: nowrap;
    max-width: 100%;
    box-sizing: border-box;
}

.secret-key-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
    flex-shrink: 0;
}

.secret-key {
    font-family: 'Outfit', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: 1px;
    user-select: all;
    background: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-copy-secret {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--gray-500);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-copy-secret:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-copy-secret svg {
    width: 14px;
    height: 14px;
}

/* 禁用 2FA 警告 */
.disable-2fa-warning {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--error-soft) 0%, rgba(255, 228, 230, 0.5) 100%);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.disable-2fa-warning svg {
    width: 28px;
    height: 28px;
    color: var(--error);
    flex-shrink: 0;
}

.disable-2fa-warning p {
    font-size: 14px;
    font-weight: 500;
    color: var(--error);
}

/* 询问 2FA 弹窗 - 新设计 */
.ask-2fa-success-badge {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 32px auto 0;
}

.ask-2fa-success-badge .success-check {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.ask-2fa-success-badge .success-check i {
    font-size: 40px;
    color: white;
    line-height: 1;
    animation: checkPop 0.4s var(--ease-spring) 0.2s both;
}

@keyframes checkPop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.ask-2fa-success-badge .success-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--success);
    opacity: 0;
    animation: ringExpand 0.6s ease-out 0.3s both;
}

@keyframes ringExpand {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.2); opacity: 0; }
}

.ask-2fa-body {
    padding: 24px 28px 20px;
    text-align: center;
}

.ask-2fa-body h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.ask-2fa-body .ask-2fa-question {
    font-size: 15px;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.ask-2fa-benefits {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ask-2fa-benefits .benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.ask-2fa-benefits .benefit-item:hover {
    background: var(--primary-soft);
}

.ask-2fa-benefits .benefit-item i {
    font-size: 18px;
    color: var(--primary);
    line-height: 1;
}

.ask-2fa-benefits .benefit-item span {
    font-size: 13px;
    color: var(--gray-700);
    font-weight: 500;
}

.ask-2fa-actions {
    display: flex;
    gap: 10px;
    padding: 16px 24px 24px;
}

.ask-2fa-actions .btn-ask-skip {
    flex: 1;
    padding: 12px 16px;
    background: var(--gray-100);
    border: none;
    border-radius: 10px;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

.ask-2fa-actions .btn-ask-skip:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.ask-2fa-actions .btn-ask-setup {
    flex: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
    font-family: var(--font-sans);
}

.ask-2fa-actions .btn-ask-setup i {
    font-size: 18px;
    line-height: 1;
}

.ask-2fa-actions .btn-ask-setup:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

/* 2FA 弹窗响应式 */
@media (max-width: 768px) {
    .modal-2fa-setup,
    .modal-2fa-disable,
    .modal-2fa-ask {
        max-width: calc(100vw - 32px);
        margin: 16px;
    }

    .modal-2fa-setup .modal-body,
    .modal-2fa-disable .modal-body {
        padding: 16px;
    }

    .setup-2fa-intro {
        padding: 14px 10px;
    }

    .setup-2fa-intro-icon {
        width: 52px;
        height: 52px;
    }

    .setup-2fa-intro-icon svg {
        width: 26px;
        height: 26px;
    }

    .setup-2fa-intro p {
        font-size: 13px;
    }

    .setup-2fa-step {
        padding: 10px;
        gap: 10px;
    }

    .step-num {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .step-content p {
        font-size: 13px;
    }

    .step-hint {
        font-size: 11px;
    }

    .qr-code-container {
        padding: 16px;
        min-height: 160px;
    }

    .qr-code-img {
        max-width: 140px;
    }

    .secret-key-container {
        padding: 8px 10px;
        gap: 6px;
    }

    .secret-key {
        font-size: 11px;
        letter-spacing: 1px;
        padding: 3px 6px;
    }

    .code-input {
        font-size: 22px !important;
        letter-spacing: 8px;
        height: 50px;
    }

    .setup-2fa-code-input {
        margin-top: 12px;
    }
}

@media (max-width: 480px) {
    .modal-2fa-setup,
    .modal-2fa-disable,
    .modal-2fa-ask {
        max-width: calc(100vw - 24px);
        margin: 12px;
    }

    .modal-2fa-setup .modal-header,
    .modal-2fa-disable .modal-header {
        padding: 16px 16px 0;
    }

    .modal-2fa-setup .modal-header h2,
    .modal-2fa-disable .modal-header h2 {
        font-size: 17px;
    }

    .modal-2fa-setup .modal-body,
    .modal-2fa-disable .modal-body {
        padding: 14px;
    }

    .modal-2fa-setup .modal-footer,
    .modal-2fa-disable .modal-footer,
    .modal-2fa-ask .modal-footer {
        padding: 14px 16px 16px;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .modal-2fa-setup .modal-footer .btn-cancel,
    .modal-2fa-disable .modal-footer .btn-cancel,
    .modal-2fa-ask .modal-footer .btn-cancel {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 10px 16px;
    }

    .modal-2fa-setup .modal-footer .btn-primary,
    .modal-2fa-disable .modal-footer .btn-primary,
    .modal-2fa-disable .modal-footer .btn-danger,
    .modal-2fa-ask .modal-footer .btn-primary {
        flex: 1;
        white-space: nowrap;
        padding: 10px 14px;
        font-size: 13px;
    }

    .verify-user-info {
        padding: 10px 14px;
        gap: 6px;
    }

    .verify-user-label {
        font-size: 12px;
    }

    .verify-user-name {
        font-size: 13px;
    }

    .setup-2fa-intro {
        padding: 12px 8px;
        margin-bottom: 14px;
    }

    .setup-2fa-intro-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 10px;
    }

    .setup-2fa-intro-icon svg {
        width: 24px;
        height: 24px;
    }

    .setup-2fa-intro p {
        font-size: 12px;
        max-width: 240px;
    }

    .setup-2fa-steps {
        gap: 10px;
        margin-bottom: 14px;
    }

    .setup-2fa-step {
        padding: 8px;
        gap: 8px;
    }

    .step-num {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    .step-content {
        padding-top: 1px;
    }

    .step-content p {
        font-size: 12px;
        margin-bottom: 2px;
    }

    .step-hint {
        font-size: 10px;
    }

    .qr-code-container {
        padding: 14px;
        min-height: 140px;
        margin-bottom: 12px;
    }

    .qr-code-img {
        max-width: 120px;
    }

    .secret-key-container {
        padding: 6px 8px;
        gap: 4px;
        margin-bottom: 10px;
    }

    .secret-key-label {
        font-size: 10px;
    }

    .secret-key {
        font-size: 10px;
        letter-spacing: 0.5px;
        padding: 2px 5px;
    }

    .btn-copy-secret {
        width: 26px;
        height: 26px;
        min-width: 26px;
    }

    .btn-copy-secret svg {
        width: 12px;
        height: 12px;
    }

    .code-input {
        font-size: 20px !important;
        letter-spacing: 6px;
        height: 46px;
        padding-left: 6px;
    }

    .setup-2fa-code-input {
        margin-top: 10px;
    }

    /* 询问 2FA 弹窗响应式 */
    .ask-2fa-success-badge {
        width: 64px;
        height: 64px;
        margin-top: 24px;
    }

    .ask-2fa-success-badge .success-check i {
        font-size: 32px;
    }

    .ask-2fa-body {
        padding: 20px 20px 16px;
    }

    .ask-2fa-body h3 {
        font-size: 18px;
    }

    .ask-2fa-body .ask-2fa-question {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .ask-2fa-benefits .benefit-item {
        padding: 8px 12px;
    }

    .ask-2fa-benefits .benefit-item i {
        font-size: 16px;
    }

    .ask-2fa-benefits .benefit-item span {
        font-size: 12px;
    }

    .ask-2fa-actions {
        padding: 12px 20px 20px;
        gap: 8px;
    }

    .ask-2fa-actions .btn-ask-skip,
    .ask-2fa-actions .btn-ask-setup {
        padding: 10px 14px;
        font-size: 13px;
    }

    .ask-2fa-actions .btn-ask-setup i {
        font-size: 16px;
    }

    .disable-2fa-warning {
        padding: 12px;
        gap: 10px;
        margin-bottom: 16px;
    }

    .disable-2fa-warning svg {
        width: 22px;
        height: 22px;
    }

    .disable-2fa-warning p {
        font-size: 12px;
    }

    .two-fa-enabled,
    .two-fa-disabled {
        gap: 10px;
    }

    .two-fa-badge {
        padding: 6px 10px;
        font-size: 12px;
    }

    .two-fa-desc {
        font-size: 12px;
    }

    .btn-primary-outline,
    .btn-danger-outline {
        padding: 10px 16px;
        font-size: 13px;
    }
}


/* ========== 错误页面 ========== */
/* ========== 全屏错误页面样式 ========== */
.error-fullscreen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    position: relative;
    z-index: 1;
}

.error-container {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* 顶部图标区域 */
.error-hero {
    margin-bottom: 32px;
}

.error-icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 12px 32px rgba(239, 68, 68, 0.3);
    animation: iconEnter 0.6s var(--ease-spring) forwards;
}

@keyframes iconEnter {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.error-icon-wrapper i {
    font-size: 36px;
    color: white;
}

.error-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.error-subtitle {
    font-size: 15px;
    color: var(--gray-500);
    font-weight: 500;
}

/* 错误码徽章 */
.error-code-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    margin-bottom: 20px;
}

.error-code-badge .code-label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.error-code-badge .code-value {
    font-size: 24px;
    font-weight: 700;
    color: #ef4444;
    font-family: 'Outfit', var(--font-sans);
    letter-spacing: -1px;
}

/* 错误信息 */
.error-message-text {
    font-size: 15px;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 400px;
}

/* 请求元信息 */
.error-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 32px;
}

.error-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--gray-600);
}

.error-meta-item i {
    font-size: 15px;
    color: var(--gray-400);
}

.error-meta-item .meta-path {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 返回按钮 */
.error-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--gray-900);
    color: white;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 40px;
}

.error-back-btn:hover {
    background: var(--gray-800);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.error-back-btn i {
    font-size: 18px;
}

/* 法律条文折叠区 */
.error-legal-box {
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    text-align: left;
}

.error-legal-box .error-legal-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--gray-50);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.error-legal-box .error-legal-toggle:hover {
    background: var(--gray-100);
}

.error-legal-box .error-legal-toggle.active {
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
}

.error-legal-box .toggle-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-legal-box .toggle-left i {
    font-size: 20px;
    color: #f59e0b;
}

.error-legal-box .toggle-left span {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.error-legal-box .toggle-arrow {
    font-size: 20px;
    color: var(--gray-400);
    transition: transform 0.3s ease;
}

.error-legal-box .error-legal-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: white;
}

.error-legal-box .error-legal-content.expanded {
    max-height: 500px;
    overflow-y: auto;
}

.error-legal-box .legal-intro {
    padding: 16px 20px 12px;
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.6;
    border-bottom: 1px solid var(--gray-100);
    margin: 0;
}

.error-legal-box .legal-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.error-legal-box .legal-item:last-child {
    border-bottom: none;
}

.error-legal-box .legal-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.error-legal-box .legal-text {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.7;
}

/* 底部提示 */
.error-footer-text {
    font-size: 13px;
    color: var(--gray-400);
}

/* 响应式 */
@media (max-width: 640px) {
    .error-fullscreen {
        padding: 24px 16px;
    }

    .error-icon-wrapper {
        width: 64px;
        height: 64px;
    }

    .error-icon-wrapper i {
        font-size: 28px;
    }

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

    .error-code-badge .code-value {
        font-size: 20px;
    }

    .error-meta {
        flex-direction: column;
        align-items: center;
    }

    .error-meta-item .meta-path {
        max-width: 200px;
    }

    .error-back-btn {
        width: 100%;
        max-width: 280px;
    }

    .error-legal-box {
        max-width: 100%;
    }
}

/* ========== SFTP 动画效果 ========== */

/* 文件项淡入上升动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 文件项淡出动画 */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* 路径项从左滑入 */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 上传区域拖拽悬停效果 */
.upload-area {
    transition: all 0.3s var(--ease-out);
}

.upload-area:hover {
    transform: translateY(-2px);
}

/* 文件项悬停效果增强 */
.file-item {
    transition: all 0.3s var(--ease-out);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.file-item:hover {
    transform: translateY(-4px);
}

/* 按钮点击反馈 */
.btn-icon:active {
    transform: scale(0.95);
}

.btn-secondary:active,
.btn-add:active {
    transform: scale(0.98);
}

/* 模态框动画增强 */
.modal-overlay {
    transition: opacity 0.3s var(--ease-out);
}

.modal-overlay .modal {
    transition: all 0.3s var(--ease-spring);
}

.modal-overlay:not(.active) .modal {
    transform: scale(0.95) translateY(20px);
}

/* 进度条动画 */
.progress-fill {
    transition: width 0.3s var(--ease-out);
}

/* 加载状态旋转动画 */
.spinner {
    animation: spin 1s linear infinite;
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 加载状态容器 */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    animation: fadeIn 0.3s ease-out;
}

.loading-state p {
    color: var(--gray-500);
    font-size: 14px;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* 路径导航项悬停效果 */
.path-item {
    transition: all 0.2s var(--ease-out);
}

.path-item:hover {
    color: var(--primary);
    transform: translateY(-1px);
}

/* 空状态动画 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    animation: fadeIn 0.5s ease-out;
}

.empty-state p {
    color: var(--gray-400);
    font-size: 15px;
}

/* 文件图标动画 */
.file-icon {
    transition: all 0.3s var(--ease-out);
}

.file-item:hover .file-icon {
    transform: scale(1.1);
}

.file-icon.icon-folder:hover {
    color: var(--primary);
}

/* 按钮悬停效果 */
.btn-back {
    transition: all 0.2s var(--ease-out);
}

.btn-back:hover {
    background-color: var(--gray-100);
    transform: translateX(-2px);
}

.btn-back:active {
    transform: translateX(-2px) scale(0.95);
}

/* ========== 文件编辑器样式 ========== */

/* 编辑器容器 */
.editor-container {
    position: fixed;
    inset: 0;
    background: var(--white);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

/* 编辑器头部 */
.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(to bottom, var(--white), var(--gray-50));
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    min-height: 70px;
}

.editor-title-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.editor-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}

.editor-path {
    font-size: 12px;
    color: var(--gray-500);
    font-family: 'Courier New', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 11px;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.encoding-select {
    padding: 8px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    min-width: 100px;
}

.encoding-select:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.encoding-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* 编辑器主体 */
.editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: var(--gray-50);
}

/* 左侧文件树 */
.editor-sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    transition: all 0.3s var(--ease-out);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
}

/* 文件树 */
.file-tree {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s var(--ease-out);
    user-select: none;
    position: relative;
}

.tree-item-nested {
    padding-left: 28px;
}

.tree-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s var(--ease-out);
}

.tree-expand:hover {
    opacity: 1;
    transform: scale(1.2);
}

.tree-children {
    padding-left: 16px;
}

.tree-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
    transition: height 0.2s var(--ease-out);
}

.tree-item:hover {
    background: var(--gray-100);
}

.tree-item:hover::before {
    height: 60%;
}

.tree-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 500;
}

.tree-item.active::before {
    height: 100%;
}

.tree-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.tree-item.active svg {
    opacity: 1;
}

.tree-item span {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* 右侧编辑器 */
.editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--white);
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.editor-toolbar .btn-icon {
    padding: 6px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    color: var(--gray-600);
}

.editor-toolbar .btn-icon:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.editor-info {
    font-size: 12px;
    color: var(--gray-600);
    font-family: 'Courier New', monospace;
    display: flex;
    align-items: center;
    gap: 12px;
}

.editor-info::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* 代码编辑器 */
.code-editor-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.code-editor-container .CodeMirror {
    height: 100%;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.code-editor-container .CodeMirror-scroll {
    height: 100%;
}

/* 搜索/替换面板 */
.search-panel {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.search-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    transition: all 0.2s var(--ease-out);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.search-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    user-select: none;
}

.search-option input[type="checkbox"] {
    cursor: pointer;
}

.search-status {
    font-size: 12px;
    color: var(--gray-600);
    padding: 4px 0;
}

.btn-icon-small {
    padding: 6px;
    background: transparent;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-small:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-800);
}

.btn-icon-small svg {
    width: 14px;
    height: 14px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    color: var(--gray-700);
    font-weight: 500;
}

.btn-small:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

/* 滚动条样式 */
.sidebar-content::-webkit-scrollbar,
.code-editor::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.sidebar-content::-webkit-scrollbar-track,
.code-editor::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb,
.code-editor::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.sidebar-content::-webkit-scrollbar-thumb:hover,
.code-editor::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* 编辑器按钮样式优化 */
.editor-actions .btn-secondary {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: var(--white);
    border: none;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.2);
}

.editor-actions .btn-secondary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    transform: translateY(-1px);
}

.editor-actions .btn-secondary svg {
    width: 16px;
    height: 16px;
}

.editor-actions .btn-cancel {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.editor-actions .btn-cancel:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.editor-actions .btn-cancel svg {
    width: 16px;
    height: 16px;
}

/* 侧边栏按钮 */
.sidebar-header .btn-icon {
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    color: var(--gray-600);
}

.sidebar-header .btn-icon:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.sidebar-header .btn-icon svg {
    width: 16px;
    height: 16px;
}

/* 编辑器模态框动画 */
#editorModal.active .editor-container {
    animation: slideInUp 0.3s var(--ease-out);
}

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

/* 响应式 */
@media (max-width: 768px) {
    .editor-sidebar {
        width: 220px;
    }

    .editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        min-height: auto;
    }

    .editor-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .code-editor {
        font-size: 13px;
        padding: 16px;
    }
}




/* 发送验证码按钮 */
.btn-send-code {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 120px;
}

.btn-send-code:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-send-code:disabled {
    background: var(--gray-300);
    color: var(--gray-600);
    cursor: not-allowed;
}
