/* ==================== CSS变量主题系统 ==================== */

:root {
    /* 全局变量 */
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* 协议颜色 */
    --color-vless: #3b82f6;
    --color-vmess: #8b5cf6;
    --color-trojan: #f59e0b;
    --color-ss: #10b981;
    --color-hysteria: #ec4899;
}

/* GitHub Dark 主题（默认，重构为霓虹暗黑风） */
[data-theme="github-dark"] {
    /* 背景色 */
    --bg-body: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-input: rgba(15, 23, 42, 0.6);
    --bg-hover: rgba(51, 65, 85, 0.5);

    /* 文本色 */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* 品牌色 */
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;

    /* 装饰色 */
    --border-color: rgba(148, 163, 184, 0.1);
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);

    /* 背景渐变装饰 */
    --blob-color-1: rgba(99, 102, 241, 0.3);
    --blob-color-2: rgba(168, 85, 247, 0.3);
}

/* Apple Light 主题（清新磨砂风） */
[data-theme="apple-light"] {
    /* 背景色 */
    --bg-body: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-input: rgba(241, 245, 249, 0.8);
    --bg-hover: rgba(241, 245, 249, 1);

    /* 文本色 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* 品牌色 */
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;

    /* 装饰色 */
    --border-color: rgba(226, 232, 240, 0.8);
    --shadow-card: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    --shadow-glow: 0 0 15px rgba(59, 130, 246, 0.1);

    /* 背景渐变装饰 */
    --blob-color-1: rgba(59, 130, 246, 0.15);
    --blob-color-2: rgba(147, 197, 253, 0.15);
}

/* Aurora 主题（极致极光风） */
[data-theme="aurora"] {
    /* 背景色 - 深邃星空 */
    --bg-body: #020617;
    /* 卡片 - 高透光玻璃 */
    --bg-card: rgba(15, 23, 42, 0.4);
    --bg-input: rgba(30, 41, 59, 0.4);
    --bg-hover: rgba(51, 65, 85, 0.4);

    /* 文本色 - 发光白 */
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;

    /* 品牌色 - 极光青 */
    --color-primary: #22d3ee;
    --color-primary-hover: #06b6d4;

    /* 装饰色 */
    --border-color: rgba(34, 211, 238, 0.2);
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(34, 211, 238, 0.3);

    /* 背景渐变装饰 - 极光色斑 */
    --blob-color-1: rgba(6, 182, 212, 0.4);
    /* 青色 */
    --blob-color-2: rgba(168, 85, 247, 0.4);
    /* 紫色 */
}

/* Neon Cyber 霓虹赛博主题 */
[data-theme="neon-cyber"] {
    /* 背景色 - 纯黑深邃 */
    --bg-body: #0a0a0a;
    /* 卡片 - 深灰玻璃 */
    --bg-card: rgba(20, 20, 20, 0.9);
    --bg-input: rgba(30, 30, 30, 0.9);
    --bg-hover: rgba(50, 50, 50, 0.9);

    /* 文本色 - 高对比 */
    --text-primary: #ffffff;
    --text-secondary: #a855f7;
    --text-muted: #6b7280;

    /* 品牌色 - 霓虹粉 */
    --color-primary: #ec4899;
    --color-primary-hover: #db2777;

    /* 状态色 */
    --color-success: #22c55e;
    --color-danger: #ef4444;

    /* 装饰色 - 霓虹边框和发光 */
    --border-color: rgba(236, 72, 153, 0.4);
    --shadow-card: 0 0 30px rgba(236, 72, 153, 0.2), 0 0 60px rgba(168, 85, 247, 0.1);
    --shadow-glow: 0 0 20px rgba(236, 72, 153, 0.5), 0 0 40px rgba(168, 85, 247, 0.3);

    /* 背景渐变装饰 - 霓虹光斑 */
    --blob-color-1: rgba(236, 72, 153, 0.3);
    /* 粉色 */
    --blob-color-2: rgba(168, 85, 247, 0.3);
    /* 紫色 */
}

/* Sakura 樱花浅色主题 */
[data-theme="sakura"] {
    /* 背景色 - 奶白柔和 */
    --bg-body: #fdf2f8;
    /* 卡片 - 纯白微粉 */
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-input: rgba(253, 242, 248, 0.8);
    --bg-hover: rgba(252, 231, 243, 0.8);

    /* 文本色 - 温暖深色 */
    --text-primary: #831843;
    --text-secondary: #9d174d;
    --text-muted: #be185d;

    /* 品牌色 - 樱花粉 */
    --color-primary: #ec4899;
    --color-primary-hover: #db2777;

    /* 状态色 */
    --color-success: #10b981;
    --color-danger: #f43f5e;

    /* 装饰色 - 柔和边框和阴影 */
    --border-color: rgba(236, 72, 153, 0.2);
    --shadow-card: 0 4px 20px rgba(236, 72, 153, 0.1);
    --shadow-glow: 0 0 15px rgba(236, 72, 153, 0.2);

    /* 背景渐变装饰 - 樱花光斑 */
    --blob-color-1: rgba(244, 114, 182, 0.2);
    /* 浅粉 */
    --blob-color-2: rgba(192, 132, 252, 0.15);
    /* 淡紫 */
}

/* ==================== 基础重置 ==================== */

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.3s ease;
}

/* 背景光斑装饰 */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
    animation: floating 10s infinite alternate;
}

body::before {
    top: -100px;
    left: -100px;
    background: var(--blob-color-1);
}

body::after {
    bottom: -100px;
    right: -100px;
    background: var(--blob-color-2);
    animation-delay: -5s;
}

@keyframes floating {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 30px);
    }
}

/* ==================== 组件样式 ==================== */

.container {
    width: 100%;
    max-width: 580px;
    /* 适中宽度，平衡精致与实用 */
    position: relative;
    z-index: 1;
}

/* 玻璃拟态卡片 */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
}

/* 头部区域 */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-size: 56px;
    margin-bottom: 20px;
    display: inline-block;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.3));
    animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

/* 验证输入区 */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    padding-right: 110px;
    /* 为按钮留出空间 */
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 16px;
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--bg-card);
    box-shadow: var(--shadow-glow);
}

#verifyBtn {
    position: absolute;
    right: 6px;
    top: 6px;
    bottom: 6px;
    border-radius: 12px;
    padding: 0 20px;
}

/* 按钮通用样式 */
.btn {
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* 节点列表区域 */
.nodes-section {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
    padding: 0 4px;
}

.section-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.node-count {
    font-size: 13px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* 操作按钮区 (大卡片风格) */
.actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(79, 70, 229, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 18px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: left;
    width: 100%;
}

.action-card:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(79, 70, 229, 0.2) 100%);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
}

.action-card.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    border-color: rgba(16, 185, 129, 0.2);
}

.action-card.success:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
}

.action-card.rocket {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(234, 88, 12, 0.1) 100%);
    border-color: rgba(249, 115, 22, 0.2);
}

.action-card.rocket:hover {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(234, 88, 12, 0.2) 100%);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.4);
}

.action-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.action-content {
    flex: 1;
}

.action-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.action-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 节点卡片列表 */
.nodes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.node-item {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-fast);
    /* 性能优化 */
    contain: layout paint;
    content-visibility: auto;
    contain-intrinsic-size: 0 76px;
}

.node-item:hover {
    background: var(--bg-hover);
    border-color: var(--color-primary);
    transform: translateX(4px);
}

/* 协议图标 */
.node-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.protocol-vless {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.protocol-vmess {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.protocol-trojan {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.protocol-hysteria {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

.protocol-hysteria2,
.protocol-hy2 {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
}

.protocol-ss {
    background: linear-gradient(135deg, #10b981, #059669);
}

.node-info {
    flex: 1;
    overflow: hidden;
}

.node-alias {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-meta {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 复制按钮 */
.node-copy-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.node-copy-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-primary);
}

/* 底部 */
.footer {
    margin-top: 40px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* 主题切换按钮 */
.theme-switcher {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 10;
}

.theme-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    font-size: 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
}

.theme-btn:hover {
    transform: scale(1.1) rotate(15deg);
    background: var(--bg-hover);
}

/* 提示Toast */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-bottom: 2px solid var(--color-success);
}

.toast.error {
    border-bottom: 2px solid var(--color-danger);
}

/* 节点按钮颜色 */
.action-card.nodes {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-color: rgba(139, 92, 246, 0.2);
}

.action-card.nodes:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(124, 58, 237, 0.2) 100%);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
}

/* 全屏模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-fullscreen {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    margin: 20px;
}



.modal-fullscreen .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
}

.modal-fullscreen .modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-input);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-nodes-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 移动端适配 */
@media (max-width: 480px) {
    body {
        padding: 16px;
        align-items: flex-start;
        padding-top: 30px;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .card {
        padding: 28px 20px;
        border-radius: 20px;
    }

    .logo {
        font-size: 44px;
        margin-bottom: 16px;
    }

    .header {
        margin-bottom: 28px;
    }

    h1 {
        font-size: 22px;
        margin-bottom: 6px;
    }

    .subtitle {
        font-size: 14px;
    }

    /* 输入框和按钮优化 */
    .input-group {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .form-input {
        padding: 14px 16px;
        padding-right: 16px;
        font-size: 16px;
        border-radius: 14px;
    }

    #verifyBtn {
        position: relative;
        right: auto;
        top: auto;
        bottom: auto;
        width: 100%;
        padding: 14px 20px;
        border-radius: 14px;
        font-size: 16px;
    }

    /* 主题切换按钮 */
    .theme-switcher {
        top: 16px;
        right: 16px;
    }

    .theme-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 8px;
    }

    /* 操作卡片 */
    .actions {
        gap: 12px;
        margin-bottom: 24px;
    }

    .action-card {
        padding: 16px;
        border-radius: 14px;
    }

    .action-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
        border-radius: 10px;
    }

    .action-title {
        font-size: 15px;
    }

    .action-desc {
        font-size: 11px;
    }

    /* 节点列表 */
    .section-header {
        margin-bottom: 12px;
    }

    .section-header h3 {
        font-size: 16px;
    }

    .node-item {
        padding: 14px;
        border-radius: 14px;
        gap: 12px;
    }

    .node-icon {
        width: 38px;
        height: 38px;
        font-size: 11px;
        border-radius: 10px;
    }

    .node-alias {
        font-size: 14px;
    }

    .node-meta {
        font-size: 10px;
    }

    /* 底部 */
    .footer {
        margin-top: 28px;
        font-size: 11px;
    }

    /* Toast 提示 */
    .toast {
        left: 16px;
        right: 16px;
        transform: translateX(0) translateY(-100px);
        padding: 10px 16px;
        font-size: 13px;
        border-radius: 12px;
    }

    .toast.show {
        transform: translateX(0) translateY(0);
    }
}