/* ============================================
   亦穿透 - 科技风深色主题 CSS
   ============================================ */

/* === CSS变量 === */
:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #111631;
    --bg-card: rgba(26, 31, 58, 0.85);
    --bg-card-hover: rgba(35, 42, 78, 0.9);
    --bg-input: rgba(15, 20, 45, 0.8);
    --border-color: rgba(99, 102, 241, 0.2);
    --border-hover: rgba(99, 102, 241, 0.5);
    --text-primary: #e8eaf6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-orange: #f97316;
    --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-cyan: linear-gradient(135deg, #06b6d4, #3b82f6);
    --gradient-green: linear-gradient(135deg, #10b981, #06b6d4);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === 基础重置 === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--accent-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-secondary); }

/* === 背景动效 === */
.bg-particles {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none; z-index: 0;
}

/* === 容器 === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
.container-fluid { width: 100%; padding: 0 20px; position: relative; z-index: 1; }

/* === 导航栏 === */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(10, 14, 39, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 30px; height: 64px;
    display: flex; align-items: center; justify-content: space-between;
}
.navbar-brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 20px; font-weight: 700; color: var(--text-primary);
}
.navbar-brand .logo-icon {
    width: 32px; height: 32px;
    background: var(--gradient-primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.navbar-nav { display: flex; align-items: center; gap: 8px; list-style: none; }
.navbar-nav a {
    padding: 8px 16px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 14px; transition: var(--transition);
}
.navbar-nav a:hover, .navbar-nav a.active {
    color: var(--text-primary); background: rgba(99, 102, 241, 0.15);
}
.navbar-actions { display: flex; align-items: center; gap: 12px; }

/* === 侧边栏 === */
.layout-wrapper { display: flex; min-height: 100vh; padding-top: 64px; }
.sidebar {
    width: 240px; min-height: calc(100vh - 64px);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px 0; position: fixed; top: 64px; left: 0;
    overflow-y: auto;
}
.sidebar-menu { list-style: none; }
.sidebar-menu li a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 24px; color: var(--text-secondary);
    font-size: 14px; transition: var(--transition);
    border-left: 3px solid transparent;
}
.sidebar-menu li a:hover {
    color: var(--text-primary); background: rgba(99, 102, 241, 0.1);
}
.sidebar-menu li a.active {
    color: var(--accent-primary); background: rgba(99, 102, 241, 0.15);
    border-left-color: var(--accent-primary);
}
.sidebar-menu li a .icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar-section { padding: 16px 24px 8px; font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 1px; }
.main-content { flex: 1; margin-left: 240px; padding: 30px; }

/* === 按钮 === */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 24px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; cursor: pointer;
    border: 1px solid transparent; transition: var(--transition);
    text-decoration: none; line-height: 1.5;
}
.btn-primary {
    background: var(--gradient-primary); color: white; border: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(99, 102, 241, 0.45); color: white; }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-color); }
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.btn-danger { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); border-color: rgba(239, 68, 68, 0.3); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.3); }
.btn-success { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); border-color: rgba(16, 185, 129, 0.3); }
.btn-success:hover { background: rgba(16, 185, 129, 0.3); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 8px; }

/* === 卡片 === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-glow); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }

/* === 统计卡片 === */
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 24px;
    display: flex; align-items: center; gap: 16px;
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); border-color: var(--border-hover); }
.stat-icon {
    width: 56px; height: 56px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; flex-shrink: 0;
}
.stat-icon.purple { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.stat-icon.orange { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); }
.stat-info .stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat-info .stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* === 表单 === */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.form-control {
    width: 100%; padding: 10px 16px; font-size: 14px;
    background: var(--bg-input); color: var(--text-primary);
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    transition: var(--transition); outline: none;
}
.form-control:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* === 表格 === */
.table-wrapper { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border-color); }
.table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid rgba(99, 102, 241, 0.08); }
.table tr:hover td { background: rgba(99, 102, 241, 0.05); }

/* === 标签/徽章 === */
.badge {
    display: inline-flex; align-items: center; padding: 4px 10px;
    border-radius: 20px; font-size: 12px; font-weight: 500;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.badge-info { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.badge-primary { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }

/* === 状态指示器 === */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.online { background: var(--accent-green); box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.status-dot.offline { background: var(--text-muted); }

/* === 分页 === */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 24px; }
.pagination a, .pagination span {
    display: flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 10px;
    border-radius: var(--radius-sm); font-size: 14px;
    border: 1px solid var(--border-color); color: var(--text-secondary);
    transition: var(--transition);
}
.pagination a:hover { border-color: var(--border-hover); color: var(--text-primary); }
.pagination .active { background: var(--gradient-primary); color: white; border-color: transparent; }

/* === 提示框 === */
.alert { padding: 14px 20px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: var(--accent-green); }
.alert-error { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--accent-red); }
.alert-info { background: rgba(99, 102, 241, 0.15); border: 1px solid rgba(99, 102, 241, 0.3); color: var(--accent-primary); }

/* === Toast通知 === */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
    padding: 14px 24px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border-color);
    backdrop-filter: blur(20px); color: var(--text-primary);
    font-size: 14px; min-width: 280px; max-width: 400px;
    animation: slideIn 0.3s ease; box-shadow: var(--shadow-card);
}
.toast.success { border-color: rgba(16, 185, 129, 0.5); }
.toast.error { border-color: rgba(239, 68, 68, 0.5); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* === 网格布局 === */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* === 模态框 === */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
    z-index: 2000; display: none; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 32px;
    max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto;
    animation: modalIn 0.3s ease;
}
@keyframes modalIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; }

/* === 页面标题 === */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.page-title { font-size: 24px; font-weight: 700; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* === 空状态 === */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state .title { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }

/* === 协议标签颜色 === */
.protocol-tcp { color: var(--accent-primary); }
.protocol-udp { color: var(--accent-cyan); }
.protocol-http { color: var(--accent-green); }
.protocol-https { color: var(--accent-yellow); }
.protocol-stcp { color: var(--accent-orange); }
.protocol-xtcp { color: var(--accent-red); }

/* === 套餐卡片 === */
.pricing-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 32px; text-align: center;
    transition: var(--transition); position: relative; overflow: hidden;
}
.pricing-card:hover { transform: translateY(-8px); border-color: var(--border-hover); box-shadow: var(--shadow-glow); }
.pricing-card.featured { border-color: var(--accent-primary); }
.pricing-card.featured::before {
    content: '推荐'; position: absolute; top: 16px; right: -28px;
    background: var(--gradient-primary); color: white; font-size: 12px;
    padding: 4px 32px; transform: rotate(45deg);
}
.pricing-name { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.pricing-price { font-size: 42px; font-weight: 800; margin: 16px 0; }
.pricing-price .currency { font-size: 20px; vertical-align: top; }
.pricing-price .period { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.pricing-features { list-style: none; text-align: left; margin: 24px 0; }
.pricing-features li { padding: 8px 0; font-size: 14px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.pricing-features li::before { content: '✓'; color: var(--accent-green); font-weight: 700; }

/* === 首页Hero === */
.hero {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    text-align: center; padding: 120px 20px 80px; position: relative;
}
.hero-title {
    font-size: 56px; font-weight: 800; line-height: 1.2; margin-bottom: 20px;
    background: linear-gradient(135deg, #e8eaf6 0%, #6366f1 50%, #06b6d4 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-subtitle { font-size: 20px; color: var(--text-secondary); max-width: 600px; margin: 0 auto 40px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; }
.hero-stats { display: flex; gap: 60px; justify-content: center; margin-top: 80px; }
.hero-stat-value { font-size: 36px; font-weight: 700; color: var(--accent-primary); }
.hero-stat-label { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* === 特性区域 === */
.features { padding: 100px 0; }
.section-title { font-size: 36px; font-weight: 700; text-align: center; margin-bottom: 16px; }
.section-subtitle { font-size: 16px; color: var(--text-secondary); text-align: center; margin-bottom: 60px; }
.feature-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 32px; text-align: center;
    transition: var(--transition);
}
.feature-card:hover { transform: translateY(-6px); border-color: var(--border-hover); box-shadow: var(--shadow-glow); }
.feature-icon { font-size: 40px; margin-bottom: 16px; }
.feature-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.feature-desc { font-size: 14px; color: var(--text-secondary); }

/* === 页脚 === */
.footer {
    background: var(--bg-secondary); border-top: 1px solid var(--border-color);
    padding: 40px 0; text-align: center; color: var(--text-muted); font-size: 14px;
}

/* === 响应式 === */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: 40px; }
}
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .hero-title { font-size: 32px; }
    .hero-stats { flex-direction: column; gap: 20px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .navbar { padding: 0 16px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .pricing-card { padding: 24px; }
}

/* === 加载动画 === */
.loading-spinner {
    width: 40px; height: 40px; border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary); border-radius: 50%;
    animation: spin 0.8s linear infinite; margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === 工具类 === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-green); }
.text-danger { color: var(--accent-red); }
.text-warning { color: var(--accent-yellow); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none; }
