/* ============================================================
   XUI Admin - 年轻拟态化风格 (Neumorphism)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* ---- 主色系 ---- */
  --primary:       #6C63FF;
  --primary-light: #8B85FF;
  --primary-dark:  #5A52D5;
  --accent:        #00D9FF;
  --accent-soft:   rgba(0, 217, 255, 0.15);

  /* ---- 状态色 ---- */
  --success:    #2ECC71;
  --success-bg: rgba(46, 204, 113, 0.12);
  --danger:     #FF6B6B;
  --danger-bg:  rgba(255, 107, 107, 0.12);
  --warning:    #FFD93D;
  --warning-bg: rgba(255, 217, 61, 0.12);

  /* ---- 拟态底色 ---- */
  --bg:          #FFFFFF;  /* 纯白 */
  --bg-deep:     #FFFFFF;
  --surface:     #FFFFFF;
  --surface-alt: #FFFFFF;

  /* ---- 投影 ---- */
  --shadow-light: #ffffff;
  --shadow-dark:  rgba(200, 200, 200, 0.7);

  /* ---- 文字 ---- */
  --text:       #4A4458;
  --text-muted: #8E87A8;
  --text-soft:  #B3AECF;

  /* ---- 圆角 & 间距 ---- */
  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-xl:  32px;
  --radius-pill: 999px;

  /* ---- 侧边栏 ---- */
  --sidebar-w: 272px;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---- 滚动条美化 ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--shadow-dark); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============================================================
   整体布局
   ============================================================ */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ---- 侧边栏 ---- */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  box-shadow:
    6px 0 20px var(--shadow-dark),
    inset -1px 0 0 rgba(255,255,255,0.6);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  overflow: hidden;
}

body.user-shell .sidebar {
  display: none;
}

body.user-shell .content {
  margin-left: 0;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 24px 24px;
  border-bottom: 1px solid rgba(163, 152, 200, 0.18);
}

.brand-badge {
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(108, 99, 255, 0.4);
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.brand-text p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav {
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.nav a::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--primary);
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  transition: height 0.2s ease;
}

.nav a:hover {
  background: rgba(108, 99, 255, 0.07);
  color: var(--primary);
}

.nav a.active {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.14), rgba(0, 217, 255, 0.08));
  color: var(--primary);
  font-weight: 600;
  box-shadow:
    4px 4px 10px var(--shadow-dark),
    -2px -2px 8px var(--shadow-light);
}

.nav a.active::before {
  height: 60%;
}

/* ---- 主内容区 ---- */
.content {
  margin-left: var(--sidebar-w);
  flex: 0 0 auto;
  width: calc(100% - var(--sidebar-w));
  min-width: 0;
  padding: 32px 36px;
  min-height: 100vh;
}

/* ---- 顶栏 ---- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.topbar h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.topbar p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-tag {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ============================================================
   卡片 / 面板
   ============================================================ */
.panel,
.stat-card,
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow:
    6px 6px 16px var(--shadow-dark),
    -4px -4px 12px var(--shadow-light);
  border: 1px solid rgba(163, 152, 200, 0.1);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* ---- 统计卡片 ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px 22px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow:
    8px 8px 20px var(--shadow-dark),
    -4px -4px 12px var(--shadow-light);
}

.stat-card span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.stat-card strong {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-card.warn strong { color: var(--danger); }
.stat-card.compact strong { font-size: 26px; }

.dashboard-stats .stat-card {
  text-align: left;
  border-left: 5px solid var(--primary);
}

.dashboard-stats .stat-card span {
  margin-bottom: 10px;
}

.stat-server { border-left-color: #2563eb; }
.stat-server strong { color: #2563eb; }
.stat-node { border-left-color: #7c3aed; }
.stat-node strong { color: #7c3aed; }
.stat-inbound { border-left-color: #0891b2; }
.stat-inbound strong { color: #0891b2; }
.stat-user { border-left-color: #16a34a; }
.stat-user strong { color: #16a34a; }
.stat-online { border-left-color: #059669; }
.stat-online strong { color: #059669; }
.stat-expiring { border-left-color: #dc2626; }
.stat-expiring strong { color: #dc2626; }
.stat-expired { border-left-color: #991b1b; }
.stat-expired strong { color: #991b1b; }

.dashboard-stats .stat-card a {
  display: block;
  color: inherit;
}

.admin-dashboard-stats {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.admin-dashboard-stats .stat-card {
  min-width: 0;
  padding: 16px 14px;
  border-left-width: 4px;
}

.admin-dashboard-stats .stat-card span {
  font-size: 11px;
  margin-bottom: 8px;
  white-space: nowrap;
}

.admin-dashboard-stats .stat-card strong {
  font-size: 28px;
}

.admin-dashboard-stats .stat-expiring-action {
  min-height: 90px;
}

.admin-dashboard-stats .stat-copy-btn {
  right: 10px;
  bottom: 8px;
  min-width: 46px;
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

@media (max-width: 1280px) {
  .admin-dashboard-stats {
    grid-template-columns: repeat(7, minmax(96px, 1fr));
  }
}

.stat-expiring-action {
  position: relative;
  min-height: 98px;
}

.stat-expiring-action a {
  display: block;
  color: inherit;
}

.stat-copy-btn {
  position: absolute;
  right: 12px;
  bottom: 10px;
  min-width: 54px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.stat-copy-btn:hover {
  background: rgba(220, 38, 38, 0.16);
}

.copy-source-textarea {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.stats-grid.user-dashboard-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.user-dashboard-stats .stat-card {
  min-height: 112px;
  padding: 24px 28px;
  border-left: 0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  color: #fff;
  box-shadow: 0 12px 26px rgba(74, 68, 88, 0.14);
}

.user-dashboard-stats .stat-card span {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.user-dashboard-stats .stat-card strong {
  margin-left: 16px;
  color: #fff;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-align: right;
}

.user-dashboard-stats .stat-card a {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: inherit;
}

.user-dashboard-stats .stat-node {
  background: linear-gradient(135deg, #3762e8, #6f8cff);
}

.user-dashboard-stats .stat-online {
  background: linear-gradient(135deg, #0f9f6e, #35c98f);
}

.user-dashboard-stats .stat-expiring {
  background: linear-gradient(135deg, #e06b19, #ffad42);
}

.user-dashboard-stats .stat-expired {
  background: linear-gradient(135deg, #c5305f, #f15b7f);
}

.user-dashboard-stats .stat-expiring-action {
  min-height: 112px;
}

.user-dashboard-stats .stat-expiring-action a {
  padding-bottom: 26px;
}

.user-dashboard-stats .stat-expiring-action .stat-copy-btn {
  position: absolute;
  z-index: 50;
  left: auto;
  right: 18px;
  bottom: 16px;
  height: 30px;
  min-width: 64px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.12));
  color: #fff;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 8px 18px rgba(36, 28, 60, 0.18);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
}

.user-dashboard-stats .stat-expiring-action .stat-copy-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.18));
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .stats-grid.user-dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-dashboard-stats .stat-card {
    min-height: 96px;
    padding: 20px;
  }

  .user-dashboard-stats .stat-card span {
    font-size: 16px;
  }

  .user-dashboard-stats .stat-card strong {
    font-size: 36px;
  }
}

.inline-notice {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
  font-size: 13px;
  font-weight: 700;
}

.inbound-table tr.expiring-row {
  background: rgba(220, 38, 38, 0.045);
}

.server-probe-panel {
  padding: 18px;
}

.probe-panel-header {
  align-items: center;
  gap: 12px;
}

.probe-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  margin-left: auto;
  min-width: 0;
}

.probe-pagination-bar .toolbar-field.small {
  flex: 0 0 92px;
  min-width: 92px;
}

.probe-pagination-bar select {
  height: 30px;
  min-height: 30px;
  padding: 4px 28px 4px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.probe-pagination-bar .toolbar-pagination {
  margin-left: 0;
  flex: 0 0 auto;
}

.qingshe-probe-wrap {
  overflow-x: auto;
}

.qingshe-probe-table {
  min-width: 1240px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.qingshe-probe-table th,
.qingshe-probe-table td {
  padding: 14px 16px;
  white-space: nowrap;
  border-bottom: 1px solid rgba(163, 152, 200, 0.1);
  color: #3f3d49;
}

.qingshe-probe-table th {
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: #4a4458;
}

.qingshe-probe-table th:nth-child(1)::before { content: "🏆 "; }
.qingshe-probe-table th:nth-child(2)::before { content: "📌 "; }
.qingshe-probe-table th:nth-child(3)::before { content: "🛰️ "; }
.qingshe-probe-table th:nth-child(4)::before { content: "💻 "; }
.qingshe-probe-table th:nth-child(5)::before { content: "🌐 "; }
.qingshe-probe-table th:nth-child(6)::before { content: "⏱️ "; }
.qingshe-probe-table th:nth-child(7)::before { content: "⏳ "; }
.qingshe-probe-table th:nth-child(8)::before { content: "🚦 "; }
.qingshe-probe-table th:nth-child(9)::before { content: "▣ "; }
.qingshe-probe-table th:nth-child(10)::before { content: "🎯 "; }
.qingshe-probe-table th:nth-child(11)::before { content: "⚡ "; }
.qingshe-probe-table th:nth-child(12)::before { content: "▣ "; }

.qingshe-probe-table th:nth-child(1),
.qingshe-probe-table td:nth-child(1) { width: 104px; }
.qingshe-probe-table th:nth-child(2),
.qingshe-probe-table td:nth-child(2) { width: 148px; }
.qingshe-probe-table th:nth-child(3),
.qingshe-probe-table td:nth-child(3) { width: 76px; }
.qingshe-probe-table th:nth-child(4),
.qingshe-probe-table td:nth-child(4) {
  width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qingshe-probe-table th:nth-child(5),
.qingshe-probe-table td:nth-child(5) { width: 96px; }
.qingshe-probe-table th:nth-child(6),
.qingshe-probe-table td:nth-child(6) { width: 72px; }
.qingshe-probe-table th:nth-child(7),
.qingshe-probe-table td:nth-child(7) { width: 76px; }
.qingshe-probe-table th:nth-child(8),
.qingshe-probe-table td:nth-child(8) { width: 120px; }
.qingshe-probe-table th:nth-child(9),
.qingshe-probe-table td:nth-child(9) { width: 132px; }
.qingshe-probe-table th:nth-child(10),
.qingshe-probe-table td:nth-child(10),
.qingshe-probe-table th:nth-child(11),
.qingshe-probe-table td:nth-child(11),
.qingshe-probe-table th:nth-child(12),
.qingshe-probe-table td:nth-child(12) {
  width: 94px;
}

.qingshe-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  height: 32px;
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.qingshe-status.online {
  background: #19c85f;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12);
}

.qingshe-status.offline {
  background: #ff6b6b;
}

.qingshe-meter {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 72px;
  height: 30px;
  overflow: hidden;
  border-radius: 7px;
  background: #e6e6e6;
}

.qingshe-meter i {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #16c765, #1fce68);
}

.qingshe-meter b {
  position: relative;
  z-index: 1;
  width: 100%;
  text-align: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.28);
}

/* ---- 面板网格 ---- */
.panel-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}
.panel-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ============================================================
   按钮
   ============================================================ */
button, .btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow:
    4px 4px 10px rgba(108, 99, 255, 0.35),
    -2px -2px 6px var(--shadow-light);
}
.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    6px 6px 14px rgba(108, 99, 255, 0.45),
    -2px -2px 6px var(--shadow-light);
}
.primary-btn:active {
  transform: translateY(0);
  box-shadow:
    2px 2px 6px rgba(108, 99, 255, 0.3),
    -1px -1px 3px var(--shadow-light);
}

.secondary-btn, .action-link.secondary-btn {
  background: var(--surface);
  color: var(--primary);
  box-shadow:
    4px 4px 10px var(--shadow-dark),
    -3px -3px 8px var(--shadow-light);
}
.secondary-btn:hover, .action-link.secondary-btn:hover {
  background: rgba(108, 99, 255, 0.1);
  transform: translateY(-1px);
  box-shadow:
    6px 6px 14px var(--shadow-dark),
    -3px -3px 8px var(--shadow-light);
}

.danger-btn {
  background: var(--surface);
  color: var(--danger);
  box-shadow:
    4px 4px 10px var(--shadow-dark),
    -3px -3px 8px var(--shadow-light);
}
.danger-btn:hover {
  background: var(--danger-bg);
  transform: translateY(-1px);
}

.ghost-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(163, 152, 200, 0.25);
}
.ghost-btn:hover {
  background: rgba(108, 99, 255, 0.07);
  color: var(--primary);
  border-color: rgba(108, 99, 255, 0.3);
}

.action-link {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  box-shadow:
    4px 4px 10px var(--shadow-dark),
    -3px -3px 8px var(--shadow-light);
  transition: all 0.2s ease;
}
.action-link:hover {
  transform: translateY(-1px);
  background: rgba(108, 99, 255, 0.08);
}

/* ============================================================
   表单
   ============================================================ */
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid rgba(163, 152, 200, 0.25);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow:
    3px 3px 8px var(--shadow-dark),
    -2px -2px 6px var(--shadow-light),
    0 0 0 3px rgba(108, 99, 255, 0.1);
}

input::placeholder, textarea::placeholder {
  color: var(--text-soft);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid rgba(163, 152, 200, 0.4);
  background: transparent;
  padding: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
}

input[type="checkbox"]:hover {
  border-color: var(--primary);
  transform: scale(1.08);
}

input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

input[type="checkbox"]:active {
  transform: scale(0.92);
}

textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid rgba(163, 152, 200, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-grid.single { max-width: 600px; }
.action-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}

/* ============================================================
   表格
   ============================================================ */
.table-wrap {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow:
    6px 6px 16px var(--shadow-dark),
    -4px -4px 12px var(--shadow-light);
  overflow: hidden;
  border: 1px solid rgba(163, 152, 200, 0.08);
}

.table-control-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 18px;
}

.table-control-bar .toolbar-field {
  min-width: 180px;
}

.table-control-bar .toolbar-field.grow {
  min-width: 260px;
}

.table-control-bar textarea {
  min-height: 44px;
  resize: vertical;
}

.table-export-btn {
  align-self: flex-end;
  white-space: nowrap;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 12px;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pagination-current {
  min-width: 42px;
  text-align: center;
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
}

.pagination-actions .ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

table { width: 100%; border-collapse: collapse; }

th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(163, 152, 200, 0.1);
  font-size: 13.5px;
  vertical-align: middle;
}

th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: #FFFFFF;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr {
  transition: background 0.15s ease;
}
tbody tr:hover {
  background: rgba(0,0,0,0.02);
}

/* ---- 状态标签 ---- */
.status {
  display: inline-block;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.status.online {
  background: var(--success-bg);
  color: var(--success);
}
.status.offline {
  background: var(--danger-bg);
  color: var(--danger);
}
.status.unknown, .status.warning {
  background: var(--warning-bg);
  color: #C9A000;
}

/* ---- 表格操作按钮 ---- */
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.table-actions form { margin: 0; }
.table-actions .primary-btn,
.table-actions .secondary-btn,
.table-actions .danger-btn,
.table-actions .ghost-btn,
.table-actions .action-link {
  padding: 6px 10px;
  font-size: 11.5px;
  border-radius: var(--radius-sm);
  flex: 1 1 calc(50% - 3px);
  text-align: center;
  justify-content: center;
}
.table-actions .ghost-btn {
  box-shadow: none;
  border: 1px solid rgba(163, 152, 200, 0.2);
}
.table-actions .ghost-btn:hover {
  border-color: var(--primary);
}

/* ============================================================
   工具栏
   ============================================================ */
.node-name-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 0;
  text-align: left;
}
.node-name-btn:hover,
.node-name-btn.is-active {
  color: var(--primary);
}
.node-name-btn:disabled {
  cursor: wait;
  opacity: 0.72;
}

.node-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: flex-start;
  align-items: center;
  background: #f9f9f9;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.node-actions-first {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  flex: 0 0 auto;
}

.node-controls-last {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 260px;
}

.node-inbounds-panel {
  margin-top: 22px;
}
.node-inbounds-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.node-inbounds-head h3 {
  font-size: 16px;
  color: var(--text);
}
.node-inbounds-head p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}
.node-inbounds-table-wrap {
  overflow-x: auto;
}
.nodes-table-wrap {
  overflow-x: auto;
}
.nodes-table {
  table-layout: fixed;
  min-width: 1100px;
}
.nodes-table th:nth-child(1), .nodes-table td:nth-child(1) { width: 42px; }
.nodes-table th:nth-child(2), .nodes-table td:nth-child(2) { width: 52px; }
.nodes-table th:nth-child(3), .nodes-table td:nth-child(3) { width: 150px; }
.nodes-table th:nth-child(4), .nodes-table td:nth-child(4) { width: 110px; }
.nodes-table th:nth-child(5), .nodes-table td:nth-child(5) { width: 190px; }
.nodes-table th:nth-child(6), .nodes-table td:nth-child(6) { width: 116px; }
.nodes-table th:nth-child(7), .nodes-table td:nth-child(7) { width: 82px; }
.nodes-table th:nth-child(8), .nodes-table td:nth-child(8) { width: 76px; }
.nodes-table th:nth-child(9), .nodes-table td:nth-child(9) { width: 136px; }
.nodes-table th:nth-child(10), .nodes-table td:nth-child(10) { width: 82px; }
.nodes-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}
.nodes-table td a,
.nodes-table .node-name-btn {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.node-inbounds-table {
  min-width: 920px;
}
.inbound-table-wrap {
  overflow-x: auto;
}
.inbound-table {
  table-layout: fixed;
  min-width: 1040px;
}
.inbound-table th:nth-child(1), .inbound-table td:nth-child(1) { width: 42px; }
.inbound-table th:nth-child(2), .inbound-table td:nth-child(2) { width: 150px; }
.inbound-table th:nth-child(3), .inbound-table td:nth-child(3) { width: 60px; }
.inbound-table th:nth-child(4), .inbound-table td:nth-child(4) { width: 90px; }
.inbound-table th:nth-child(5), .inbound-table td:nth-child(5) { width: 150px; }
.inbound-table th:nth-child(6), .inbound-table td:nth-child(6) { width: 118px; }
.inbound-table th:nth-child(7), .inbound-table td:nth-child(7) { width: 76px; }
.inbound-table th:nth-child(8), .inbound-table td:nth-child(8) { width: 130px; }
.inbound-table th:nth-child(9), .inbound-table td:nth-child(9) { width: 120px; }
.inbound-table th:nth-child(10), .inbound-table td:nth-child(10) { width: 112px; }
.inbound-table th:nth-child(11), .inbound-table td:nth-child(11) { width: 78px; }
.inbound-table th,
.inbound-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  vertical-align: middle;
}
.inbound-table th:nth-child(2),
.inbound-table td:nth-child(2) {
  text-align: left;
}
.inbound-table .cell-title,
.inbound-table .cell-sub {
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbound-ip-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  text-align: left;
}
.inbound-ip-text {
  min-width: 0;
}

.readonly-inbound-table {
  min-width: 1120px;
  table-layout: fixed;
}

.readonly-inbound-table th:nth-child(1),
.readonly-inbound-table td:nth-child(1) {
  width: 240px;
  text-align: left;
  overflow: visible;
  text-overflow: clip;
}

.readonly-inbound-table th:nth-child(2),
.readonly-inbound-table td:nth-child(2) {
  width: 170px;
  text-align: center;
}

.readonly-inbound-table th:nth-child(3),
.readonly-inbound-table td:nth-child(3) {
  width: 110px;
  text-align: center;
}

.readonly-inbound-table th:nth-child(4),
.readonly-inbound-table td:nth-child(4) {
  width: 170px;
  text-align: center;
}

.readonly-inbound-table th:nth-child(5),
.readonly-inbound-table td:nth-child(5) {
  width: 170px;
  text-align: center;
}

.readonly-inbound-table th:nth-child(6),
.readonly-inbound-table td:nth-child(6) {
  width: 130px;
  text-align: center;
}

.readonly-inbound-table th:nth-child(7),
.readonly-inbound-table td:nth-child(7) {
  width: 90px;
  text-align: center;
}

.readonly-inbound-table .inbound-ip-cell {
  justify-content: flex-start;
  width: 100%;
  min-width: 220px;
}

.readonly-inbound-table .inbound-ip-text {
  display: inline-block;
  min-width: max-content;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.readonly-inbound-table .protocol-badge {
  display: inline-flex;
  min-width: 86px;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.inbound-enable-btn {
  flex: 0 0 auto;
  min-width: 44px;
  height: 28px;
  padding: 0 9px;
  border-radius: 7px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
}
.inbound-enable-btn.enabled {
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.32);
  color: #159947;
}
.inbound-enable-btn.disabled {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: #cc3333;
}
.inbound-enable-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}
.batch-result-table {
  table-layout: fixed;
  min-width: 100%;
  width: 100%;
}
.batch-result-table th,
.batch-result-table td {
  text-align: center;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batch-result-table th:nth-child(1), .batch-result-table td:nth-child(1) { width: 48px; }
.batch-result-table th:nth-child(2), .batch-result-table td:nth-child(2) { width: 210px; }
.batch-result-table th:nth-child(3), .batch-result-table td:nth-child(3) { width: 110px; }
.batch-result-table th:nth-child(4), .batch-result-table td:nth-child(4) { width: 130px; }
.batch-result-table th:nth-child(5), .batch-result-table td:nth-child(5) { width: 130px; }
.batch-result-table th:nth-child(6), .batch-result-table td:nth-child(6) { width: 140px; }
.batch-result-table th:nth-child(7), .batch-result-table td:nth-child(7) { width: 80px; }
.batch-result-table th:nth-child(8), .batch-result-table td:nth-child(8) { width: 160px; }
.batch-result-table th:nth-child(9), .batch-result-table td:nth-child(9) { width: 90px; }
.node-group-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 4px;
  color: #1565c0;
  background: #e3f2fd;
  border: 1px solid #90caf9;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.node-group-form,
.node-group-list {
  display: grid;
  gap: 12px;
}
.node-group-list {
  margin-top: 16px;
}
.node-group-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.5fr) auto auto auto;
  gap: 10px;
  align-items: center;
}
.node-special-check {
  justify-content: flex-start;
  white-space: nowrap;
}
.node-group-badge.is-special {
  background: #fff4d8;
  color: #9a6700;
}
.node-selection-summary {
  color: var(--text);
  background: rgba(108, 99, 255, 0.08);
  border: 1px solid rgba(108, 99, 255, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
}
.nodes-table th,
.nodes-table td,
.node-inbounds-table th,
.node-inbounds-table td {
  white-space: nowrap;
}
.node-inbound-params {
  max-width: 360px;
  white-space: normal;
  word-break: break-all;
  color: var(--text-muted);
  font-size: 12px;
}

.node-detail-row > td {
  padding: 0;
  background: #f2fbff;
  white-space: normal;
}

.node-detail-card {
  padding: 18px 20px 20px;
  border-top: 1px solid rgba(0, 217, 255, 0.16);
}

.node-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.node-detail-head strong {
  display: block;
  font-size: 15px;
  color: var(--text);
}

.node-detail-head span {
  color: var(--text-muted);
  font-size: 12px;
}

.node-detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cache-hint {
  color: var(--text-muted);
  font-size: 11px;
  background: #e8f4ff;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 8px;
}

.refresh-detail-btn {
  font-size: 12px;
  padding: 4px 10px;
}

.loading-hint {
  color: #f0ad4e;
  font-size: 12px;
  margin-left: 6px;
}

.loading-text {
  color: #666;
  font-size: 13px;
}

.node-detail-empty {
  padding: 22px;
  text-align: center;
  color: var(--text-muted);
  background: #fff;
  border-radius: var(--radius-md);
}

.node-detail-empty.error-text {
  color: var(--danger);
  background: var(--danger-bg);
}

.node-xui-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid rgba(163, 152, 200, 0.1);
}

.node-xui-table {
  table-layout: fixed;
  min-width: 1120px;
  width: 100%;
  border-collapse: collapse;
}

.node-xui-table th,
.node-xui-table td {
  padding: 12px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  vertical-align: middle;
}

.node-xui-table th:nth-child(1), .node-xui-table td:nth-child(1) { width: 70px; }
.node-xui-table th:nth-child(2), .node-xui-table td:nth-child(2) { width: 64px; }
.node-xui-table th:nth-child(3), .node-xui-table td:nth-child(3) { width: 60px; }
.node-xui-table th:nth-child(4), .node-xui-table td:nth-child(4) { width: 128px; }
.node-xui-table th:nth-child(5), .node-xui-table td:nth-child(5) { width: 78px; }
.node-xui-table th:nth-child(6), .node-xui-table td:nth-child(6) { width: 82px; }
.node-xui-table th:nth-child(7), .node-xui-table td:nth-child(7) { width: 190px; }
.node-xui-table th:nth-child(8), .node-xui-table td:nth-child(8) { width: 70px; }
.node-xui-table th:nth-child(9), .node-xui-table td:nth-child(9) { width: 170px; }
.node-xui-table th:nth-child(10), .node-xui-table td:nth-child(10) { width: 130px; }

.node-xui-table th:nth-child(4),
.node-xui-table td:nth-child(4),
.node-xui-table th:nth-child(7),
.node-xui-table td:nth-child(7),
.node-xui-table th:nth-child(9),
.node-xui-table td:nth-child(9) {
  text-align: left;
}

.node-xui-table .table-actions {
  justify-content: center;
}

.node-xui-table .table-actions .ghost-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 54px;
  padding: 7px 10px;
}

.node-xui-table .node-toggle-btn,
.node-xui-table .node-view-btn {
  min-width: 54px;
  padding: 7px 10px;
}

.node-xui-table .ghost-btn,
.node-xui-table .node-protocol-badge,
.node-xui-table .node-traffic,
.node-xui-table .node-limit {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-xui-table .node-protocol-badge,
.node-xui-table .node-traffic,
.node-xui-table .node-limit {
  display: inline-block;
  vertical-align: middle;
}

.node-xui-table th {
  background: #fafafa;
  color: #30323a;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.node-xui-table tbody tr:nth-child(n+3) {
  background: #f1fbff;
}

.node-action-link,
.node-view-link {
  color: #1e90ff;
  font-weight: 500;
}

.node-switch {
  display: inline-flex;
  align-items: center;
  width: 36px;
  height: 18px;
  padding: 2px;
  border-radius: 999px;
  background: #d8dce4;
  vertical-align: middle;
}

.node-switch i {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.node-switch.is-on {
  background: #1890ff;
}

.node-switch.is-on i {
  transform: translateX(18px);
}

.node-protocol-badge,
.node-traffic,
.node-limit {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 18px;
}

.node-protocol-badge,
.node-traffic {
  color: #1890ff;
  background: #e6f7ff;
  border: 1px solid #91d5ff;
}

.node-limit {
  color: #52c41a;
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  margin-left: 6px;
}

.node-import-form {
  display: grid;
  gap: 16px;
}

.node-import-form textarea {
  width: 100%;
  resize: vertical;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.server-filter-row,
.inbound-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin-bottom: 12px;
  overflow-x: auto;
}

.filter-actions-left {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
}

.filter-controls-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
  flex: 1 1 360px;
  min-width: 0;
}

.toolbar-field {
  min-width: 180px;
}
.toolbar-field.grow { flex: 1 1 520px; }
.toolbar-field.small { min-width: 120px; }

.clearable-field {
  position: relative;
}

.clearable-field input,
.clearable-field textarea {
  padding-right: 38px;
}

.field-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(163, 152, 200, 0.16);
  color: var(--text-muted);
  font-size: 18px;
  line-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  z-index: 2;
}

.field-clear-btn:hover {
  background: rgba(108, 99, 255, 0.16);
  color: var(--primary);
}

.clearable-field textarea + .field-clear-btn {
  top: 22px;
}

.toolbar-pagination {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  gap: 5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.toolbar-pagination .pagination-summary {
  display: none;
}

.toolbar-pagination .pagination-actions {
  gap: 4px;
}

.toolbar-pagination .ghost-btn {
  height: 30px;
  min-width: 56px;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 10px;
}

.toolbar-pagination .pagination-current {
  min-width: 38px;
  font-size: 12px;
}

.page-bottom-right {
  justify-content: flex-end;
  margin-top: 12px;
  width: 100%;
}

.page-bottom-right .pagination-actions {
  justify-content: flex-end;
}

.server-filter-row .toolbar-field {
  gap: 0;
}

.server-filter-row .toolbar-field.grow {
  min-width: 280px;
}

.server-filter-row .toolbar-field.small {
  flex: 0 0 120px;
}

.server-filter-row input,
.server-filter-row select,
.server-filter-row textarea {
  height: 44px;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    inset 2px 2px 6px rgba(200, 200, 200, 0.35),
    inset -2px -2px 6px #fff;
}

.server-filter-row .server-search-field {
  flex: 1 1 640px;
  min-width: 360px;
}

.server-filter-row textarea#server-keyword-filter {
  min-height: 44px;
  max-height: 82px;
  line-height: 20px;
  padding-top: 10px;
  padding-bottom: 8px;
  resize: vertical;
  overflow-y: auto;
  white-space: pre-wrap;
}

.bulk-tip, .server-toolbar-tip {
  color: var(--text-muted);
  font-size: 12px;
  padding-bottom: 2px;
}

/* ============================================================
   服务器页面专用
   ============================================================ */
.server-shell,
.inbound-shell {
  display: grid;
  gap: 22px;
}

.server-stats-grid,
.inbound-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.server-toolbar,
.inbound-toolbar {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 16px 18px 22px;
  box-shadow:
    6px 6px 16px var(--shadow-dark),
    -4px -4px 12px var(--shadow-light);
  border: 1px solid rgba(163, 152, 200, 0.08);
  display: flex;
  gap: 16px;
}

.server-toolbar {
  flex-direction: column;
}

.inbound-toolbar {
  flex-direction: row;
}

.toolbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-left h3 {
  margin: 0;
}

.inline-form {
  display: inline;
}

.server-action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.server-install-panel {
  display: none;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid rgba(163, 152, 200, 0.15);
}
.server-install-panel.is-open {
  display: grid;
  gap: 16px;
}

.server-install-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.server-bulk-shell {
  display: grid;
  gap: 14px;
}

.bulk-server-config {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.bulk-server-config label {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 0;
}

.bulk-server-config label span {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(163, 152, 200, 0.28);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: rgba(247, 247, 252, 0.95);
  color: var(--text-muted);
  font-weight: 600;
}

.bulk-server-config input {
  height: 38px;
  border-radius: 0 8px 8px 0;
}

.server-editor,
.inbound-editor {
  scroll-margin-top: 24px;
}

.server-panels { align-items: start; }

.inbound-form-grid,
.server-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inbound-form-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(163, 152, 200, 0.15);
}

.proto-hint {
  font-size: 13px;
  color: var(--text-soft);
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  border: 1px solid rgba(163, 152, 200, 0.12);
}

.form-submit-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 8px;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label > span {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
}

/* ============================================================
   服务器表格操作列 - 垂直布局
   ============================================================ */
.server-table-wrap .server-table th,
.server-table-wrap .server-table td {
  white-space: normal;
  word-break: break-word;
  padding: 10px 8px;
  vertical-align: middle;
}

.server-table-wrap .server-table {
  table-layout: fixed;
  width: 100%;
}

.server-table-wrap .server-table th:nth-child(1),
.server-table-wrap .server-table td:nth-child(1) { width: 40px; text-align: center; }
.server-table-wrap .server-table th:nth-child(2),
.server-table-wrap .server-table td:nth-child(2) {
  width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.server-table-wrap .server-table th:nth-child(3),
.server-table-wrap .server-table td:nth-child(3) { width: 130px; text-align: center; }
.server-table-wrap .server-table th:nth-child(4),
.server-table-wrap .server-table td:nth-child(4) { width: 110px; text-align: center; }
.server-table-wrap .server-table th:nth-child(5),
.server-table-wrap .server-table td:nth-child(5) { width: 110px; text-align: center; }
.server-table-wrap .server-table th:nth-child(6),
.server-table-wrap .server-table td:nth-child(6) { width: 110px; text-align: center; }
.server-table-wrap .server-table th:nth-child(7),
.server-table-wrap .server-table td:nth-child(7) { width: 200px; text-align: center; }
.server-table-wrap .server-table th:nth-child(8),
.server-table-wrap .server-table td:nth-child(8) { width: 80px; text-align: center; }

.server-table .server-actions-vertical {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 80px;
}

.server-table .server-actions-vertical > * {
  width: 100%;
  justify-content: center;
  text-align: center;
  padding: 6px 8px;
  font-size: 11.5px;
}

/* ---- 挂载节点标签 ---- */
.mount-cell,
.install-status-cell {
  text-align: center;
}

.mount-cell .node-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #00d9ff;
  background: rgba(0, 217, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-weight: 700;
}

.mount-cell .node-link:hover {
  color: #00b8dd;
  background: rgba(0, 217, 255, 0.2);
}

.mini-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  transition: all 0.2s ease;
  vertical-align: middle;
}
.mini-tag:hover {
  background: rgba(0, 217, 255, 0.25);
  transform: translateY(-1px);
}

/* ---- 探针进度条样式 ---- */
.probe-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 60px;
}

.probe-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.probe-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.probe-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.cpu-fill { background: var(--accent); }
.mem-fill { background: var(--success); }

.probe-simple {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- 行内展开操作面板 ---- */
.expandable-panel {
  display: none;
  background: #FFFFFF;
  border: 1px solid #EBEBEB;
  border-radius: 10px;
  margin: 4px 0 8px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.expandable-panel.is-open { display: table-row; }
.expandable-panel td {
  padding: 0;
  border: none;
}
.expandable-panel .panel-inner {
  padding: 16px 20px;
}
.expandable-panel h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}
.expandable-panel .btn-row {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}
.expandable-panel .btn-row a,
.expandable-panel .btn-row button {
  font-size: 12.5px;
  padding: 7px 14px;
}

/* ---- 行内展开操作面板按钮 ---- */
.expandable-panel .btn-row .ghost-btn,
.expandable-panel .btn-row .secondary-btn,
.expandable-panel .btn-row .action-link {
  background: #FFFFFF;
  color: #444;
  border: 1px solid #E0E0E0;
  box-shadow: none;
}
.expandable-panel .btn-row .ghost-btn:hover,
.expandable-panel .btn-row .secondary-btn:hover,
.expandable-panel .btn-row .action-link:hover {
  background: #F5F5F5;
  border-color: #CCC;
  transform: none;
}
.expandable-panel .btn-row .primary-btn {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 6px rgba(108,99,255,0.3);
}
.expandable-panel .btn-row .primary-btn:hover {
  background: var(--primary-dark);
  transform: none;
}
.expandable-panel .btn-row .danger-btn {
  background: #FEF2F2;
  color: var(--danger);
  border: 1px solid #FECACA;
  box-shadow: none;
}
.expandable-panel .btn-row .danger-btn:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
  transform: none;
}

/* 展开按钮 */
.expand-btn {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  background: #FFFFFF;
  color: #666;
  border: 1px solid #E0E0E0;
}
.expand-btn:hover {
  background: #F5F5F5;
  border-color: #CCC;
}

/* ---- 安装状态单元格 ---- */
.install-status-cell { text-align: center; }

/* ---- 安装进度日志面板 ---- */
.install-progress-panel {
  margin-top: 16px;
}

.install-progress-box {
  width: 100%;
  border-radius: 4px;
  background: #1f1f1f;
  color: #d4d4d4;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}

.install-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px 4px;
  border-bottom: 0;
}

.install-progress-head h3 {
  margin: 0;
  font-size: 14px;
  color: #569cd6;
  font-weight: 500;
}

.install-progress-head span {
  font-size: 12px;
  color: #9ca3af;
}

.install-progress-head button {
  background: rgba(255,255,255,0.08);
  color: #d4d4d4;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: none;
  border-radius: 3px;
  padding: 3px 10px;
}

#install-progress-console {
  margin: 0;
  padding: 8px 14px 16px;
  min-height: 180px;
  max-height: 260px;
  overflow: auto;
  background: #1f1f1f;
  color: #569cd6;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
}

/* ---- 协议徽章 ---- */
.protocol-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(108, 99, 255, 0.1);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stacked-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ============================================================
   提示 & 通知
   ============================================================ */
.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.flash {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
}

.flash.success {
  background: var(--success-bg);
  border-color: rgba(46, 204, 113, 0.25);
  color: #1A9E52;
}
.flash.error {
  background: var(--danger-bg);
  border-color: rgba(255, 107, 107, 0.25);
  color: #CC3333;
}
.flash.warning {
  background: var(--warning-bg);
  border-color: rgba(255, 217, 61, 0.3);
  color: #A08500;
}

/* ============================================================
   新增服务器弹窗
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: min(560px, 90vw);
  box-shadow:
    8px 8px 20px var(--shadow-dark),
    -5px -5px 14px var(--shadow-light);
  border: 1px solid rgba(163, 152, 200, 0.12);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-box-wide {
  width: min(900px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
}

.batch-modal-box {
  width: min(1080px, 96vw);
  max-height: 96vh;
  padding: 14px 18px;
  gap: 9px;
}

.batch-result-box {
  width: min(1280px, 96vw);
  max-height: 94vh;
}

.batch-result-box #batch-result-content {
  overflow: visible;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { margin: 0; }

.modal-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid rgba(163, 152, 200, 0.15);
  padding-bottom: 0;
}

.tab-btn {
  padding: 8px 20px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 14px;
  transition: all 0.2s ease;
}

.tab-btn.active {
  color: var(--primary);
  background: rgba(108, 99, 255, 0.08);
  border-bottom: 2px solid var(--primary);
  margin-bottom: -2px;
}

.tab-btn:hover:not(.active) {
  color: var(--text);
  background: rgba(163, 152, 200, 0.08);
}

.tab-content { display: flex; flex-direction: column; gap: 16px; }

.modal-form { display: flex; flex-direction: column; gap: 16px; }

.form-hint {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ============================================================
   登录页
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.login-card {
  width: min(420px, 100%);
  padding: 40px 36px;
}

.login-card .brand {
  border: none;
  padding: 0 0 24px;
  justify-content: center;
}

.auth-brand { margin-bottom: 24px; }

.hint-box {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.8;
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

/* ============================================================
   其他
   ============================================================ */
.inline-form { display: flex; gap: 12px; }
.editor-hint { color: var(--text-muted); font-size: 12.5px; }
.compact-header { margin-bottom: 0; }
.summary { color: var(--text-muted); line-height: 1.7; }
.days-input { width: 120px; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1100px) {
  .stats-grid,
  .server-stats-grid,
  .inbound-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    width: 72px;
    overflow: visible;
  }

  .brand-text, .nav a span { display: none; }
  .brand { padding: 20px 14px; justify-content: center; }
  .nav { padding: 12px 8px; }
  .nav a { justify-content: center; padding: 12px; }

  .content { margin-left: 72px; width: calc(100% - 72px); padding: 24px 20px; }

  .panel-grid.two,
  .form-grid,
  .form-row-3,
  .batch-modal-box .form-row-2,
  .batch-check-inline,
  .server-probe-row,
  .inbound-form-grid,
  .server-form-grid,
  .server-install-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .stats-grid.admin-dashboard-stats {
    grid-template-columns: repeat(7, minmax(96px, 1fr));
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .stats-grid.user-dashboard-stats {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    overflow-x: auto;
    padding-bottom: 6px;
  }
}

.empty-cell {
  text-align: center;
  color: var(--text-soft);
  padding: 20px;
}

.cell-pass {
  font-family: monospace;
  color: var(--text-soft);
  font-size: 12px;
}

/* ── 批量创建网格布局 ─────────────────────────── */
.batch-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
}

.batch-config {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.batch-modal-box .form-row-2 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.batch-modal-box .form-row-3 {
  gap: 8px;
}

.batch-modal-box .field-label {
  gap: 3px;
}

.batch-modal-box .field-label > span {
  font-size: 11px;
  line-height: 1.15;
}

.batch-modal-box input,
.batch-modal-box select {
  min-height: 32px;
  height: 34px;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.batch-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  margin-top: 1px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(163, 152, 200, 0.15);
}

.batch-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.batch-skip-top {
  padding: 4px 10px;
  border: 1px solid rgba(108, 99, 255, 0.16);
  border-radius: 999px;
  background: rgba(108, 99, 255, 0.06);
  color: var(--text-muted);
  white-space: nowrap;
}

.batch-modal-box .modal-header h3 {
  font-size: 18px;
}

.batch-modal-box .modal-actions {
  margin-top: 2px;
}

.batch-modal-box .modal-actions button {
  min-height: 34px;
  padding: 7px 16px;
  font-size: 12px;
}

.batch-hint-row {
  padding: 4px 0;
}

.batch-check-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  cursor: pointer;
}

.batch-check-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.copy-line-btn {
  margin-right: 8px;
  padding: 4px 10px;
  font-size: 12px;
}

.batch-check-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.batch-copy-output {
  width: 100%;
  min-height: 300px;
  max-height: 42vh;
  resize: vertical;
  margin: 8px 0 14px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.55;
}

/* ---- 展开操作面板详情网格 ---- */
.server-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #f8f9fc;
  border-radius: var(--radius-md);
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.detail-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ---- XUI 状态标签 ---- */
.xui-status.installed {
  background: var(--success-bg);
  color: var(--success);
  display: inline-block;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
}

.xui-status.not-installed {
  background: rgba(142, 135, 168, 0.12);
  color: var(--text-muted);
  display: inline-block;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
}

/* 模态框内按钮行 */
.modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 0;
}

.upgrade-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.upgrade-stats div {
  padding: 14px;
  border-radius: var(--radius-md);
  background: #f8f9fc;
  border: 1px solid rgba(163, 152, 200, 0.12);
}

.upgrade-stats span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.upgrade-stats strong {
  display: block;
  font-size: 24px;
  color: var(--primary);
}

.upgrade-note,
.upgrade-details {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #fff8e8;
  color: var(--text);
  border: 1px solid rgba(220, 168, 70, 0.24);
}

.upgrade-list {
  margin-top: 8px;
  color: var(--text-muted);
  line-height: 1.6;
  word-break: break-all;
}

.upgrade-apply-form {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  cursor: pointer;
}

@media (max-width: 900px) {
  .upgrade-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upgrade-apply-form {
    align-items: stretch;
    flex-direction: column;
  }
}
