/* SubHub 仪表盘样式 —— 依赖 Bootstrap 5.3 CSS 变量做主题适配 */

:root {
  --sh-radius: 0.85rem;
  --sh-transition: 0.25s ease;
}

body {
  min-height: 100vh;
  transition: background-color var(--sh-transition), color var(--sh-transition);
  background:
    radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--bs-primary) 8%, transparent), transparent),
    radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, var(--bs-success) 6%, transparent), transparent);
  background-attachment: fixed;
}

/* 导航 */
.app-navbar {
  background: color-mix(in srgb, var(--bs-body-bg) 82%, transparent);
  backdrop-filter: blur(10px);
}

.brand-icon { font-size: 1.2rem; }

#main-tabs .nav-link {
  color: var(--bs-secondary-color);
  border-radius: 0.6rem;
  padding: 0.35rem 0.8rem;
  transition: all var(--sh-transition);
}
#main-tabs .nav-link:hover { color: var(--bs-body-color); background: var(--bs-tertiary-bg); }
#main-tabs .nav-link.active { color: var(--bs-primary); background: color-mix(in srgb, var(--bs-primary) 12%, transparent); font-weight: 500; }

.icon-btn { line-height: 1; }

/* 登录 */
/* 自定义居中而非 d-flex 工具类：工具类的 display !important 在样式表后段，会压过 reboot 的 [hidden] 规则 */
#view-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
#view-login[hidden] { display: none; }

.login-card {
  width: min(420px, 92vw);
  background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent);
  backdrop-filter: blur(14px);
}
.login-logo { font-size: 3rem; filter: drop-shadow(0 6px 16px rgba(13, 110, 253, 0.35)); }

/* 统计卡片 */
.stat-card {
  background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  transition: transform var(--sh-transition), box-shadow var(--sh-transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); }
.stat-icon {
  width: 2.8rem; height: 2.8rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.75rem; font-size: 1.2rem; flex: none;
}
.stat-value { font-size: 1.35rem; font-weight: 650; line-height: 1.1; }
.stat-label { font-size: 0.78rem; color: var(--bs-secondary-color); }

/* 通用卡片 */
.tab-pane .card {
  background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-radius: var(--sh-radius);
}

/* 表格 */
.table > :not(caption) > * > * { padding: 0.55rem 0.75rem; }
.nodes-table { max-height: 62vh; overflow: auto; }
.preview-table { max-height: 40vh; overflow: auto; }
.table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bs-body-bg);
  font-size: 0.78rem; text-transform: none; color: var(--bs-secondary-color);
  font-weight: 600;
}

/* 节点徽标 */
.type-badge {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 0.2rem 0.5rem; border-radius: 0.45rem;
}
.type-ss        { background: #0d6efd22; color: #6ea8fe; }
.type-vmess     { background: #6f42c122; color: #c29cfa; }
.type-vless     { background: #d6338422; color: #ef8fc0; }
.type-trojan    { background: #dc354522; color: #ea868f; }
.type-hysteria2 { background: #fd7e1422; color: #fdb377; }
.type-tuic      { background: #19875422; color: #75c9a3; }

.node-name { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82em; }

.latency-good { color: var(--bs-success); }
.latency-mid  { color: var(--bs-warning); }
.latency-bad  { color: var(--bs-danger); }
.latency-dead { color: var(--bs-danger); text-decoration: line-through; }

/* URL 列表 */
#export-urls .list-group-item {
  background: transparent; border-color: var(--bs-border-color);
  display: flex; align-items: center; gap: 0.5rem;
}
#export-urls code { font-size: 0.75rem; word-break: break-all; }

/* Toast */
.toast { border-radius: 0.7rem; }

/* 小屏 */
@media (max-width: 575.98px) {
  .container-fluid { padding-left: 1rem !important; padding-right: 1rem !important; }
  .node-name { max-width: 150px; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--bs-border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--bs-secondary-color); }
