:root {
    --bg-primary: #05050a;
    --bg-card: rgba(255, 255, 255, 0.02);
    --bg-card-header: rgba(255, 255, 255, 0.03);
    --bg-input: rgba(255, 255, 255, 0.05);
    --primary-color: #00d4ff;
    --primary-dim: rgba(0, 212, 255, 0.15);
    --secondary-color: #7c3aed;
    --accent-red: #ef4444;
    --accent-green: #10b981;
    --text-color: #ffffff;
    --text-dim: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(0, 212, 255, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-primary);
    padding: 20px;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Data Flow Background (Tech Style) */
.bg-tech {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background: 
        radial-gradient(circle at 15% 30%, rgba(0, 212, 255, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 70%, rgba(124, 58, 237, 0.12) 0%, transparent 40%);
}

.bg-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 80%);
    animation: moveLines 20s linear infinite;
}

@keyframes moveLines {
    0% { background-position: 0 0; }
    100% { background-position: 30px 30px; }
}

/* Glassmorphism Classes */
.liquid-glass {
    background: rgba(255, 255, 255, 0.02);
    background-blend-mode: luminosity;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
    border-radius: 12px;
}

.liquid-glass::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.4px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%, rgba(0,212,255,0.2) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding-bottom: 70px;
    position: relative;
    z-index: 10;
}

h1 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--primary-color);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fff, var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* ========== 卡片 ========== */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    border: none;
    overflow: hidden;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 8px 32px rgba(0, 0, 0, 0.3);
}

.card-header {
    padding: 16px 20px;
    background: linear-gradient(to right, rgba(0,212,255,0.05), transparent);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 15px;
    margin: 0;
    color: var(--text-color);
    font-weight: 500;
}

.card-body {
    padding: 20px;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dim);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    background: var(--bg-input);
    color: var(--text-color);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

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

.input-group .form-control {
    border-radius: 6px 0 0 6px;
}

.input-group-append {
    padding: 10px 15px;
    background: var(--bg-card-header);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 6px 6px 0;
    color: var(--text-dim);
    font-size: 15px;
}

/* ========== 按钮 ========== */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #00b894);
    color: #0a0e17;
    font-weight: 600;
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card-header);
    color: var(--text-dim);
    border: 1px solid var(--border-color);
}

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

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

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* ========== 切换按钮 ========== */
.toggle-container {
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.toggle-btn {
    flex: 1;
    padding: 8px 20px;
    border: none;
    background: var(--bg-input);
    color: var(--text-dim);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--primary-color);
    color: #0a0e17;
    font-weight: 600;
}

.toggle-btn:hover:not(.active) {
    background: var(--bg-card-header);
}

/* ========== 状态 ========== */
.status-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.status-label {
    color: var(--text-muted);
    font-size: 13px;
}

.status-value {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

.refresh-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auto-refresh-label {
    font-size: 13px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ========== 日志 ========== */
.logs-container {
    max-height: 400px;
    overflow-y: auto;
}

.logs-list {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.8;
}

.log-entry {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dim);
}

.log-entry:hover {
    background: var(--bg-card-header);
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px;
    color: var(--text-dim);
    font-size: 13px;
}

.logs-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logs-controls select {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-color);
    font-size: 13px;
}

/* ========== 底部导航 ========== */
.nav-footer {
    display: flex;
    justify-content: space-around;
    background: var(--bg-card);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-top: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    transition: all 0.2s;
}

.nav-item a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    display: block;
    letter-spacing: 0.5px;
}

.nav-item.active {
    background: transparent;
    border-top: 2px solid var(--primary-color);
}

.nav-item.active a {
    color: var(--primary-color);
}

.nav-item:hover:not(.active) a {
    color: var(--text-color);
}

/* ========== 最大最小值 ========== */
.min-max-container {
    display: flex;
    gap: 15px;
}

.min-max-item {
    flex: 1;
}

/* ========== 通知设置 ========== */
.notification-section {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-input);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.notification-section h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.notification-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.notification-toggle label {
    font-size: 14px;
    color: var(--text-dim);
}

/* ========== 输入+按钮组合 ========== */
.input-with-btn {
    display: flex;
    gap: 10px;
}

.input-with-btn .form-control {
    flex: 1;
}

/* ========== 服务器列表 ========== */
.server-list {
    width: 100%;
}

.server-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    margin-bottom: 8px;
    border-radius: 6px;
}

.server-info {
    flex: 1;
}

.server-name {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-color);
}

.server-url {
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
    font-family: 'SF Mono', monospace;
}

.empty-text, .error-text {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 15px;
}

.error-text {
    color: var(--accent-red);
}

.loading-text {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

.mt-4 {
    margin-top: 20px;
}

/* ========== 登录页 ========== */
.login-container {
    max-width: 380px;
    margin: 80px auto;
}

.login-container h1 {
    margin-bottom: 30px;
}

/* ========== 退出按钮 ========== */
.logout-container {
    text-align: right;
    margin-top: 20px;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    body { padding: 0; }
    .container { max-width: 100%; padding-left: 0; padding-right: 0; }
    .card, .chart-wrapper { border-radius: 0; margin-left: 0; margin-right: 0; border-left: none; border-right: none; }
    h1 { font-size: 16px; margin: 14px 0; }
    .status-container { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; }
    .stat-card { padding: 8px; }
    .stat-value { font-size: 16px; }
    .stat-label { font-size: 11px; }
}
