/* ==================== 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);
}

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

* {
    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: 480px;
    /* 收窄宽度，更加精致 */
    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-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;
}

.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);
}

.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: 100;
    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);
}

/* 移动端适配 */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

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

    .logo {
        font-size: 48px;
    }

    .header {
        margin-bottom: 30px;
    }

    h1 {
        font-size: 24px;
    }
}