/* ===== Animated Background ===== */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.animated-bg {
  background: linear-gradient(-45deg, #0f172a, #1e293b, #312e81, #1e293b);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

/* 固定底栏只保留服务器状态和版权；背景透明，不再显示滚动联系信息。 */
.site-footer-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 28px;
  padding: 4px 16px calc(4px + env(safe-area-inset-bottom));
  background: transparent;
  color: var(--text);
  pointer-events: none;
  letter-spacing: .15px;
  font-size: 11px;
  font-weight: 600;
}
.footer-server-details { flex: 1 1 auto; min-width: 0; text-align: left; }
.footer-copyright { flex: 0 0 auto; text-align: right; font-size: 11px; opacity: .82; }
.bottom-service-marquee {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 20px;
  z-index: 3500;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.bottom-service-marquee .marquee-track {
  display: flex;
  width: max-content;
  animation: serviceMarqueeMove 24s linear infinite;
}

.bottom-service-marquee .marquee-copy {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding-right: 18px;
  white-space: nowrap;
}

.bottom-service-marquee .service-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Inter", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .28px;
  text-shadow: 0 0 14px rgba(var(--primary-rgb), .22);
  opacity: .95;
}

.bottom-service-marquee .service-chip i {
  font-size: 11px;
  color: rgba(var(--primary-rgb), .9);
}

.bottom-service-marquee .service-sep {
  font-size: 11px;
  color: rgba(var(--primary-rgb), .45);
  text-shadow: 0 0 10px rgba(var(--primary-rgb), .18);
}

@keyframes serviceMarqueeMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== Theme 1: Default (Light Warm) ===== */
:root {
  --primary:      #c78328;
  --primary-dark: #a96824;
  --primary-light: #e5b85f;
  --primary-rgb:  199,131,40;

  --bg:       #f6f0e5;
  --bg-2:     #fbf8f0;
  --bg-3:     #fffdf8;
  --card-bg:  #fffdf8;
  --card-bg-2:#f4ead8;

  --sidebar-bg:          #f0eadf;
  --sidebar-hover:       #e4dac8;
  --sidebar-active:      rgba(199,131,40,.23);
  --sidebar-text:        #665844;
  --sidebar-active-text: #3b2d1e;

  --text:       #342b22;
  --text-muted: #887866;
  --text-dim:   #b2a18d;

  --border:     #e7d9bd;
  --border-acc: rgba(199,131,40,.34);

  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #c48a24;

  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow:    0 1px 4px rgba(128,92,35,.10);
  --shadow-md: 0 5px 16px rgba(128,92,35,.13);
  --shadow-lg: 0 14px 36px rgba(128,92,35,.16);
  --glow:      0 0 18px rgba(199,131,40,.10);

  --navbar-h:  60px;
  --sidebar-w: 240px;
  --transition: 0.2s ease;

  --navbar-bg: #fffdf8;
  --navbar-border: #e7d9bd;
  --accent-dim: rgba(199,131,40,.10);
  --accent-border: rgba(199,131,40,.26);
  --on-primary: #ffffff;

  /* legacy component aliases kept in sync with the active theme */
  --bg-color: var(--bg);
  --text-color: var(--text);
  --primary-color: var(--primary);
  --border-color: var(--border);
  --input-bg: var(--card-bg);

  --modal-bg: #e8eef0;
  --modal-section: #dbe5e8;
  --modal-input: #f4f7f7;
  --modal-border: #b9c9ce;
  --modal-text: #27363c;
  --modal-muted: #52646c;
}

/* ===== Theme 2: Gold/Black Luxury ===== */
html.theme-gold {
  --primary:      #c8a84b;
  --primary-dark: #9a7c2e;
  --primary-light: #e8c96a;
  --primary-rgb:  200,168,75;

  --bg:       #0c0c0e;
  --bg-2:     #111115;
  --bg-3:     #18181f;
  --card-bg:  #16161c;
  --card-bg-2:#1e1e28;

  --sidebar-bg:          #0a0a0d;
  --sidebar-hover:       #151519;
  --sidebar-active:      rgba(200,168,75,.12);
  --sidebar-text:        #7a7a8a;
  --sidebar-active-text: #c8a84b;

  --text:       #f0f0f8;
  --text-muted: #8a8aaa;
  --text-dim:   #3a3a4a;

  --border:     #222230;
  --border-acc: rgba(200,168,75,.3);

  --success: #2ecc71;
  --warning: #f0b429;
  --danger:  #e74c3c;
  --info:    #d6a84f;

  --shadow:    0 2px 8px rgba(0,0,0,.5);
  --shadow-md: 0 4px 20px rgba(0,0,0,.6);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.7);
  --glow:      0 0 20px rgba(200,168,75,.15);

  --navbar-bg: #0a0a0d;
  --navbar-border: rgba(200,168,75,.25);
  --accent-dim: rgba(200,168,75,.1);
  --accent-border: rgba(200,168,75,.25);
  --on-primary: #0a0800;
  --modal-bg: #202127;
  --modal-section: #292b32;
  --modal-input: #16181d;
  --modal-border: #444550;
  --modal-text: #f0f0f8;
  --modal-muted: #b5b5c6;
}

/* ===== Theme 3: Colorful Neon Cyberpunk ===== */
html.theme-tech {
  --primary:      #00e5c4;
  --primary-dark: #00b89e;
  --primary-light: #5ffce8;
  --primary-rgb:  0,229,196;

  --bg:       #0d0820;
  --bg-2:     #120c28;
  --bg-3:     #18102e;
  --card-bg:  #1a1030;
  --card-bg-2:#201438;

  --sidebar-bg:          #0b0618;
  --sidebar-hover:       #180e2c;
  --sidebar-active:      rgba(0,229,196,.15);
  --sidebar-text:        #8b7aaa;
  --sidebar-active-text: #00e5c4;

  --text:       #f2eeff;
  --text-muted: #9d8fc0;
  --text-dim:   #5a4a7a;

  --border:     #2e1e4a;
  --border-acc: rgba(0,229,196,.35);

  --success: #00ff88;
  --warning: #ffae00;
  --danger:  #ff3366;
  --info:    #00c8f8;

  --shadow:    0 2px 10px rgba(0,0,0,.5);
  --shadow-md: 0 4px 20px rgba(0,0,0,.6);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.7);
  --glow:      0 0 16px rgba(0,229,196,.2), 0 0 32px rgba(157,0,255,.1);

  --navbar-bg: #0b0618;
  --navbar-border: #2e1e4a;
  --accent-dim: rgba(0,229,196,.1);
  --accent-border: rgba(0,229,196,.3);
  --on-primary: #0d0820;
  --modal-bg: #261b3d;
  --modal-section: #30234a;
  --modal-input: #1a1430;
  --modal-border: #594678;
  --modal-text: #f2eeff;
  --modal-muted: #bdacd8;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; width: 100%; max-width: 100%; }
body {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
ul, li { list-style: none; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Layout ===== */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
}

/* ===== Navbar ===== */
.navbar {
  height: var(--navbar-h);
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--navbar-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 100;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 200px;
}
.navbar-brand .brand-icon {
  width: 40px; height: 40px;
  background: transparent;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1rem;
  box-shadow: none;
  overflow: hidden;
}
.navbar-brand .brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 12px;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 0;
}
.nav-item {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  white-space: nowrap;
}
.nav-item:hover { background: var(--accent-dim); color: var(--primary); }
.nav-item.active { background: var(--accent-dim); color: var(--primary); font-weight: 600; }
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex: 0 0 auto;
}
.conn-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(239,68,68,.08);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,.2);
  cursor: pointer;
  transition: all var(--transition);
}
.conn-badge.connected { background: rgba(16,185,129,.08); color: var(--success); border-color: rgba(16,185,129,.2); }
.conn-badge.warning { background: rgba(245,158,11,.10); color: var(--warning); border-color: rgba(245,158,11,.25); }
.conn-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.conn-badge.connected .dot { animation: pulse 2s infinite; }
.conn-badge span:not(.dot) { white-space: nowrap; }
#navConnMode {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: currentColor;
  font-size: .72rem;
  letter-spacing: 0;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.user-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: transform var(--transition);
}
.user-btn:hover { transform: scale(1.05); }

/* ===== Dropdown ===== */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  overflow: hidden;
  z-index: 999;
  display: none;
  animation: fadeIn .15s ease;
}
.dropdown-menu.open { display: block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
  font-size: 0.9rem;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== Main Body ===== */
.main-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  padding: 12px 0;
}
.sidebar.sidebar-empty {
  display: none;
}
.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-text);
  opacity: .7;
  padding: 12px 18px 6px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: all var(--transition);
  border-radius: 0;
  font-size: 0.88rem;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.sidebar-item:hover { background: var(--sidebar-hover); color: var(--sidebar-active-text); }
.sidebar-item.active { background: var(--sidebar-active); color: var(--sidebar-active-text); border-left-color: var(--primary); }
.sidebar-item i { width: 18px; text-align: center; font-size: 0.95rem; }
.sidebar-divider { height: 1px; background: var(--sidebar-hover); margin: 8px 0; }
.sidebar-submenu { background: rgba(120,92,45,.07); padding: 4px 0; margin: 2px 0; }
.sidebar-subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 36px;
  cursor: pointer;
  color: var(--sidebar-text);
  transition: var(--transition);
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}
.sidebar-subitem:hover { background: var(--sidebar-hover); color: var(--sidebar-active-text); }
.sidebar-subitem.active { background: rgba(var(--primary-rgb),.15); color: var(--sidebar-active-text); border-left-color: var(--primary); }
.sidebar-subitem i { width: 16px; text-align: center; font-size: 0.85rem; opacity: 0.8; }

/* Tabs System */
.tabs-container {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 0;
  margin-top: 20px;
}

.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  padding: 0;
  overflow-x: auto;
}

/* 表格不换行和滚动 */
.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

.table-wrap table {
  min-width: 100%;
  table-layout: auto;
}

.table-wrap th,
.table-wrap td {
  white-space: nowrap;
  padding: 10px 12px;
}

.table-wrap .badge {
  white-space: nowrap;
}

.tab-btn { display: flex; align-items: center; gap: 8px; padding: 14px 20px; background: transparent; border: none; color: var(--text-muted); font-size: 14px; font-weight: 500; cursor: pointer; transition: var(--transition); border-bottom: 3px solid transparent; white-space: nowrap; }
.tab-btn:hover { background: rgba(var(--primary-rgb),.1); color: var(--text); }
.tab-btn.active { background: rgba(var(--primary-rgb),.15); color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; padding: 24px; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

/* Filters Bar */
.filters-bar { 
  display: flex; 
  gap: 12px; 
  margin-bottom: 20px; 
  flex-wrap: wrap; 
  align-items: center;
  padding: 16px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.filters-bar input[type="text"] {
  flex: 1;
  min-width: 250px;
  padding: 10px 16px;
  padding-left: 40px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 14px;
  transition: all 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px;
}

.filters-bar input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filters-bar select {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 140px;
}

.filters-bar select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filters-bar select:hover {
  border-color: var(--primary-color);
}

.filter-select { padding: 8px 12px; background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 14px; min-width: 120px; }

/* ===== Content ===== */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.content-hidden { display: none !important; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-title i { color: var(--primary); }
.page-desc { color: var(--text-muted); font-size: 0.85rem; margin-top: 3px; }

/* ===== Cards ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.95rem;
  gap: 10px;
}
.card-header i { color: var(--primary); }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg-2); }

/* ===== Stat Cards ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.stat-icon.blue   { background: rgba(59,130,246,.1);  color: var(--info); }
.stat-icon.green  { background: rgba(16,185,129,.1);  color: var(--success); }
.stat-icon.yellow { background: rgba(245,158,11,.1);  color: var(--warning); }
.stat-icon.purple { background: rgba(99,102,241,.1);  color: var(--primary); }
.stat-icon.red    { background: rgba(239,68,68,.1);   color: var(--danger); }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--on-primary, #fff); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(var(--primary-rgb),.3); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.9); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.9); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { filter: brightness(.9); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--accent-dim); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; border-radius: 6px; }
.btn-lg { padding: 11px 22px; font-size: 1rem; }
.btn-icon { padding: 7px; min-width: 34px; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: rgba(16,185,129,.1);  color: var(--success); }
.badge-danger  { background: rgba(239,68,68,.1);   color: var(--danger); }
.badge-warning { background: rgba(245,158,11,.1);  color: var(--warning); }
.badge-info    { background: rgba(59,130,246,.1);  color: var(--info); }
.badge-purple  { background: var(--accent-dim);    color: var(--primary); }
.badge-gray    { background: var(--bg-2);          color: var(--text-muted); }

/* ===== Forms ===== */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-size: 0.9rem;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.15);
}
.form-control::placeholder { color: var(--text-dim); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
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 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 14px; text-align: left; font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; background: var(--bg-2); border-bottom: 1px solid var(--border); }
td { padding: 11px 14px; font-size: 0.875rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-2); }
.td-mono { font-family: 'Consolas', monospace; font-size: 0.8rem; color: var(--text-muted); }

/* ===== Log Viewer ===== */
.log-viewer {
  background: #0f172a;
  border-radius: var(--radius);
  padding: 14px;
  height: 440px;
  overflow-y: auto;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
}
.log-entry { display: flex; gap: 10px; padding: 2px 0; }
.log-time { color: #475569; flex-shrink: 0; }
.log-type-badge {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 4px;
}
.log-msg { color: #e2e8f0; word-break: break-all; }
.log-chat .log-type-badge    { background: #1e3a5f; color: #60a5fa; }
.log-kill .log-type-badge    { background: #450a0a; color: #f87171; }
.log-login .log-type-badge   { background: #14532d; color: #4ade80; }
.log-admin .log-type-badge   { background: #1c1917; color: #fbbf24; }
.log-system .log-type-badge  { background: #1e1b4b; color: #a5b4fc; }
.log-sent .log-type-badge    { background: #1c3039; color: #67e8f9; }
.log-economy .log-type-badge { background: #1f2937; color: #a78bfa; }
.log-fame .log-type-badge    { background: #2d1b69; color: #c4b5fd; }
.log-quest .log-type-badge   { background: #1a3a1a; color: #86efac; }
.log-server .log-type-badge  { background: #1e293b; color: #7dd3fc; }
.log-violation .log-type-badge { background: #450a0a; color: #fca5a5; }
.log-loot .log-type-badge    { background: #451a03; color: #fbbf24; }
.log-general .log-type-badge { background: #1e293b; color: #94a3b8; }

/* ===== Log Toolbar ===== */
.log-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.log-filter-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  transition: all var(--transition);
}
.log-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.log-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Quick Commands ===== */
.quick-cmds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.quick-cmd-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.quick-cmd-btn:hover { border-color: var(--primary); background: var(--accent-dim); box-shadow: var(--shadow-md); }
.quick-cmd-btn i { font-size: 1.4rem; color: var(--primary); }
.quick-cmd-btn span { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.quick-cmd-btn:hover span { color: var(--primary); }

/* ===== Item Library ===== */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.item-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.item-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.item-name { font-weight: 700; font-size: 0.85rem; color: var(--text); word-break: break-word; }
.item-cn { font-size: 0.8rem; color: var(--primary); font-weight: 600; }
.item-bp { font-size: 0.72rem; color: var(--text-muted); font-family: monospace; word-break: break-all; }
.item-actions { display: flex; gap: 6px; margin-top: 4px; }

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}
.page-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination button.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 8px;
}

.pagination-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.pagination-stats {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.pagination-stats strong {
  color: var(--text-color);
  font-weight: 600;
}

.pagination-jump {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
}

.pagination-jump input {
  width: 60px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-color);
  color: var(--text-color);
  text-align: center;
  font-size: 13px;
}

.pagination-jump input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.pagination-jump button {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-color);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.pagination-jump button:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* ===== Search Bar ===== */
.search-bar {
  position: relative;
  flex: 1;
}
.search-bar i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-bar input { padding-left: 34px; }

/* ===== Toggle ===== */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle {
  position: relative;
  width: 42px; height: 24px;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 12px;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ===== Modal ===== */
.goods-theme-overlay > div {
  background: var(--modal-bg) !important;
  border-color: var(--modal-border) !important;
  box-shadow: var(--shadow-lg) !important;
  color: var(--modal-text);
}
.goods-theme-overlay > div > div:first-child,
.goods-theme-overlay > div > div:last-child { background: var(--modal-section); border-color: var(--modal-border) !important; }
.goods-theme-overlay > div > div:first-child { border-radius: 15px 15px 0 0; }
.goods-theme-overlay > div > div:last-child { border-radius: 0 0 15px 15px; }
.goods-theme-overlay b,
.goods-theme-overlay label,
.goods-theme-overlay span,
.goods-theme-overlay [style*="color:#e2e8f0"] { color: var(--modal-text) !important; }
.goods-theme-overlay button:not(.btn):not([style*="linear-gradient"]) { color: var(--modal-text) !important; }
.goods-theme-overlay [id*="_panel_"]:not([id$="_panel_url"]):not([id$="_panel_upload"]),
.goods-theme-overlay [style*="background:rgba(15,23,42"] {
  background: var(--modal-section) !important;
  color: var(--modal-text) !important;
  border-color: var(--modal-border) !important;
}
.goods-theme-overlay .form-control { background: var(--modal-input); color: var(--modal-text); border-color: var(--modal-border); }
.goods-theme-overlay [id$="_items_list"] input { background: var(--modal-input) !important; color: var(--modal-text) !important; border-color: var(--modal-border) !important; }
.goods-theme-overlay [id$="_items_list"] > div { background: var(--modal-section) !important; border-color: var(--modal-border) !important; }
.goods-theme-overlay .form-control::placeholder { color: var(--modal-muted); }
.goods-theme-overlay select option { background: var(--modal-input); color: var(--modal-text); }
.gifts-item-picker > div { background: var(--modal-bg) !important; border-color: var(--modal-border) !important; color: var(--modal-text); box-shadow: var(--shadow-lg); }
.gifts-item-picker > div > div { border-color: var(--modal-border) !important; }
.gifts-item-picker b,
.gifts-item-picker span,
.gifts-item-picker [style*="color:#e2e8f0"] { color: var(--modal-text) !important; }
.gifts-item-picker input,
.gifts-item-picker select { background: var(--modal-input) !important; color: var(--modal-text) !important; border-color: var(--modal-border) !important; }
.gifts-item-picker select option { background: var(--modal-input); color: var(--modal-text); }
.items-picker-modal > div { background: var(--modal-bg) !important; border-color: var(--modal-border) !important; color: var(--modal-text); }
.items-picker-modal > div > div:first-child,
.items-picker-modal > div > div:last-child { background: var(--modal-section); border-color: var(--modal-border) !important; }
.items-picker-modal input,
.items-picker-modal select { background: var(--modal-input) !important; color: var(--modal-text) !important; border-color: var(--modal-border) !important; }
.items-picker-modal input::placeholder { color: var(--modal-muted); }
.items-picker-modal [style*="background:var(--card-bg)"] { background: var(--modal-input) !important; }
.items-picker-modal [style*="color:var(--text-muted)"] { color: var(--modal-muted) !important; }
.modal-overlay .modal,
.modal-overlay .modal-content,
.modal-overlay .modal-container,
.bp-admin-modal-box { background: var(--modal-bg) !important; color: var(--modal-text); border-color: var(--modal-border) !important; }
.modal-overlay .modal-header,
.modal-overlay .modal-footer,
.bp-admin-modal-hd,
.bp-admin-modal-ft { background: var(--modal-section); border-color: var(--modal-border); }
.modal-overlay .form-control,
.bp-admin-modal-box input,
.bp-admin-modal-box select,
.bp-admin-modal-box textarea { background: var(--modal-input); color: var(--modal-text); border-color: var(--modal-border); }
.modal-overlay .form-label,
.bp-admin-modal-box label { color: var(--modal-text); }
#customConfirmModal > div:nth-child(2) { background: var(--modal-bg) !important; border-color: var(--modal-border) !important; color: var(--modal-text); }
#customConfirmTitle { color: var(--modal-text) !important; }
#customConfirmMsg { color: var(--modal-muted) !important; }
#customConfirmModal button:first-child { background: var(--modal-section) !important; border-color: var(--modal-border) !important; color: var(--modal-text) !important; }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.75);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .15s ease;
}
#unifiedDialog { z-index: 10100; }
.modal-overlay.open,
.modal.active { display: flex; }
.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 0 1px var(--border);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .2s ease;
  border: 1px solid var(--border);
}
@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 0 1px var(--border);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .2s ease;
  border: 2px solid var(--border);
}
.modal-container {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 0 1px var(--border);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .2s ease;
  border: 1px solid var(--border);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg-2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-title { font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.modal-title i { color: var(--primary); }
.modal-close,
.modal-close-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
  font-size: 1.3rem;
  line-height: 1;
}
.modal-close:hover,
.modal-close-btn:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ===== Log Page Content ===== */
.log-page-content {
  display: none;
}

.log-page-content.active {
  display: block;
}

.log-type-btn {
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  text-align: left;
}

.log-type-btn:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  color: white;
}

.log-type-btn:hover i {
  color: #ffffff !important;
}

.log-type-btn i {
  font-size: 16px;
}

/* ===== Log Category Tabs ===== */
.log-category-tab {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.log-category-tab:hover {
  background: var(--bg-color);
  border-color: var(--primary-color);
  color: var(--text-color);
}

.log-category-tab.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.log-category-content {
  display: none;
}

.log-category-content.active {
  display: block;
}

.log-tab-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.log-sub-tab {
  padding: 10px 20px;
  border: 2px solid var(--border);
  background: var(--card-bg-2);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
}

.log-sub-tab:hover {
  background: linear-gradient(135deg, rgba(var(--primary-rgb),.8), rgba(var(--primary-rgb),.6));
  color: var(--on-primary, #fff);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
  border-color: transparent;
}

.log-sub-tab.active {
  background: linear-gradient(135deg, rgba(var(--primary-rgb),1), rgba(var(--primary-rgb),.75));
  border-color: transparent;
  color: var(--on-primary, #fff);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.4);
}

.log-sub-tab i {
  font-size: 16px;
}

.btn-info {
  background: var(--info);
  color: #fff;
}
.btn-info:hover { filter: brightness(.9); }
.btn-secondary {
  background: var(--card-bg-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-2); }

.log-search-container {
  display: none;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--border);
}
.log-search-container .form-control {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
}
.log-search-container label {
  color: var(--text);
}

/* ===== Toast ===== */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  z-index: 99999;
  pointer-events: none;
  max-width: 360px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  max-width: 360px;
  animation: slideInLeft .2s ease;
}
.toast,
.toast.toast-success,
.toast.toast-error,
.toast.toast-warning,
.toast.toast-info { border-left-color: var(--primary) !important; }
@keyframes slideInLeft { from{opacity:0;transform:translateX(-20px)} to{opacity:1;transform:translateX(0)} }
.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-warning { border-left: 4px solid var(--warning); }
.toast.toast-info { border-left: 4px solid var(--info); }
.toast i { font-size: 1.1rem; }
.toast.toast-success i { color: var(--success); }
.toast.toast-error i { color: var(--danger); }
.toast.toast-warning i { color: var(--warning); }
.toast.toast-info i { color: var(--info); }
.toast i,
.toast.toast-success i,
.toast.toast-error i,
.toast.toast-warning i,
.toast.toast-info i { color: var(--primary) !important; }
.toast-msg { flex: 1; font-size: 0.875rem; font-weight: 500; }
.toast-fade { animation: fadeOutLeft .3s ease forwards; }
@keyframes fadeOutLeft { to{opacity:0;transform:translateX(-20px)} }

/* ===== Forum ===== */
.forum-post {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 14px;
  transition: background var(--transition);
  cursor: pointer;
}
.forum-post:hover { background: var(--bg); }
.forum-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.forum-post-content { flex: 1; }
.forum-post-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.forum-post-meta { font-size: 0.78rem; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }
.forum-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

/* ===== Server List ===== */
.server-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.server-card:hover { background: var(--bg); }
.server-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.server-status-dot.online { background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.server-status-dot.offline { background: var(--danger); }
.server-info { flex: 1; }
.server-name { font-weight: 700; font-size: 0.9rem; }
.server-meta { font-size: 0.78rem; color: var(--text-muted); display: flex; gap: 12px; margin-top: 3px; flex-wrap: wrap; }
.server-players { font-weight: 700; font-size: 0.85rem; color: var(--primary); }

/* ===== Announce Buttons ===== */
.announce-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== Connection Status in Sidebar ===== */
.sidebar-conn-info {
  padding: 12px 18px;
  margin: 8px 10px;
  background: rgba(255,255,255,.04);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--sidebar-text);
}
.sidebar-conn-info .server-addr { color: var(--sidebar-active-text); font-weight: 600; font-size: 0.82rem; word-break: break-all; }

/* ===== Sidebar Account Panel ===== */
.sidebar-account-panel {
  margin: 0 8px 8px;
  padding: 12px;
  background: rgba(255,255,255,.04);
  border-radius: var(--radius-sm);
  border: 1px solid var(--sidebar-hover);
  font-size: 0.8rem;
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.acc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}
.acc-row i { width: 14px; text-align: center; color: var(--sidebar-text); opacity: .7; }
.acc-auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 4px;
}
.acc-auth-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.72rem;
  padding: 8px 8px;
  border-radius: 4px;
  font-weight: 600;
  width: 100%;
}
.auth-on  { background: rgba(16,185,129,.12); color: var(--success); }
.auth-off { background: rgba(239,68,68,.08);  color: var(--text-dim); opacity: .7; }
.auth-on i  { color: var(--success); }
.auth-off i { color: var(--text-dim); }

/* ===== Utility ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.82rem; }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  #app {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
  }
  .navbar {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 8px 10px;
    gap: 8px;
  }
  .navbar-brand {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 1rem;
  }
  .navbar-brand .brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
  #navBrandName {
    min-width: 0;
    max-width: calc(100vw - 132px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .navbar-nav {
    order: 3;
    width: 100%;
    flex: 0 0 100%;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .navbar-nav::-webkit-scrollbar { display: none; }
  .nav-item {
    flex: 0 0 auto;
    padding: 7px 10px;
    font-size: 0.82rem;
  }
  #navScrollMarquee {
    order: 4;
    width: 100%;
    flex: 0 0 100%;
    margin: 0;
  }
  #navServerNameCenter {
    order: 2;
    flex: 1 1 100% !important;
    max-width: 100% !important;
    justify-content: flex-start !important;
    padding: 0 2px !important;
  }
  #navServerNameText {
    max-width: calc(100vw - 160px) !important;
  }
  .navbar-right {
    gap: 6px;
    flex: 0 0 auto;
    margin-left: 0;
  }
  .theme-switcher {
    padding: 6px 9px;
    font-size: 0.78rem;
  }
  .conn-badge {
    padding: 6px 9px;
    font-size: 0.75rem;
  }
  .dropdown-menu,
  .theme-menu {
    right: 0;
    max-width: calc(100vw - 20px);
  }
  .main-body {
    min-height: 0;
  }
  .sidebar { display: none; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .quick-cmds,
  .items-grid,
  .stats-grid { grid-template-columns: 1fr; }
  .content {
    padding: 14px;
    padding-bottom: calc(58px + env(safe-area-inset-bottom));
    overflow-x: hidden;
  }
  .page-header {
    align-items: flex-start;
  }
  .page-title {
    font-size: 1.08rem;
    line-height: 1.35;
  }
  .page-desc {
    font-size: 0.8rem;
    line-height: 1.5;
  }
  .card-header {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .card-body {
    padding: 16px;
  }
  .btn {
    min-height: 36px;
  }
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal,
  .modal-content,
  .modal-container {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }
  .modal-header {
    padding: 16px 16px 14px;
  }
  .modal-body {
    padding: 16px;
  }
  .modal-footer {
    padding: 14px 16px;
    flex-direction: column;
  }
  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
  .site-footer-bar {
    align-items: flex-start;
    gap: 8px;
    padding-left: 10px;
    padding-right: 10px;
  }
  .footer-server-details { white-space: normal; }
  .footer-copyright { white-space: nowrap; }

}

@media (max-width: 560px) {
  .navbar {
    padding: 8px 8px;
  }
  .navbar-brand {
    font-size: 0.94rem;
    gap: 8px;
  }
  #navBrandName {
    max-width: calc(100vw - 120px);
  }
  .navbar-right {
    width: 100%;
    justify-content: flex-end;
    order: 2;
  }
  .theme-switcher {
    gap: 4px;
    padding: 6px 8px;
  }
  .theme-switcher i {
    font-size: 0.8rem;
  }
  .conn-badge span:not(.dot) {
    display: none;
  }
  .nav-item {
    padding: 7px 9px;
    font-size: 0.78rem;
  }
  .content {
    padding: 12px;
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }
  .card-header {
    padding: 12px 14px;
  }
  .card-body {
    padding: 14px;
  }
  .form-control,
  input.form-control,
  select.form-control,
  textarea.form-control {
    font-size: 16px;
  }
  .bottom-service-marquee .marquee-copy {
    gap: 14px;
    padding-right: 14px;
  }
  .bottom-service-marquee .service-sep {
    font-size: 10px;
  }
}

/* ===== Bot Config ===== */
.config-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.config-section-header {
  padding: 14px 18px;
  background: var(--bg-2);
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.config-section-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

/* ===== Trade Station ===== */
.trade-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  transition: all var(--transition);
}
.trade-item:hover { border-color: var(--primary); }
.trade-item-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.trade-item-info { flex: 1; }
.trade-item-name { font-weight: 600; font-size: 0.9rem; }
.trade-item-price { font-size: 0.8rem; color: var(--text-muted); }

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; display: block; opacity: .4; }
.empty-state p { font-size: 0.9rem; }

/* ===== Loading ===== */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(99,102,241,.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Divider ===== */
.gold-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* ===== Theme Switcher ===== */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
}
.theme-switcher:hover { border-color: var(--primary); color: var(--primary); }
.theme-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  overflow: hidden;
  z-index: 999;
  animation: fadeIn .15s ease;
}
.theme-menu.open { display: block; }
.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: background var(--transition);
  color: var(--text);
}
.theme-option:hover { background: var(--bg); }
.theme-option.active { color: var(--primary); font-weight: 600; }
.theme-swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== Tabs Container (Game & General Management) ===== */
.tabs-container {
  margin-top: 12px;
}
.tabs-nav {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.game-tab-btn, .general-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.game-tab-btn:hover, .general-tab-btn:hover {
  background: var(--bg-2);
  color: var(--text);
}
.game-tab-btn.active, .general-tab-btn.active {
  background: var(--primary);
  color: var(--on-primary, #fff);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), .3);
}
.game-tab-btn i, .general-tab-btn i { font-size: 0.95rem; }
.game-tab-content, .general-tab-content { display: none; animation: fadeIn .2s ease; }
.game-tab-content.active, .general-tab-content.active { display: block; }
.game-type-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
}
.game-type-tab-btn:hover { border-color: var(--primary); }
.game-type-tab-btn.active { background: var(--primary-light, rgba(var(--primary-rgb),.1)); border-color: var(--primary); }
.game-type-prob { font-size: 0.72rem; opacity: .7; margin-left: 4px; }
.checkin-sub-content { display: none; }
.checkin-sub-content.active { display: block; }
.checkin-sub-btn.active {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
  font-weight: 600;
}

/* ===== 机器人配置 可折叠区块 ===== */
.rc-section {
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--card-bg);
}
.rc-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: .9rem;
  user-select: none;
  background: var(--bg-1, var(--card-bg));
  transition: background .18s;
}
.rc-section-hd:hover { background: var(--bg-2); }
.rc-chevron { transition: transform .28s; color: var(--text-muted); font-size: .8rem; }
.rc-chevron.open { transform: rotate(180deg); }
.rc-section-bd {
  max-height: 0;
  overflow: hidden;
  transition: max-height .32s ease, padding .32s;
  padding: 0 18px;
  border-top: 0 solid var(--border);
}
.rc-section-bd.open {
  max-height: 2000px;
  padding: 16px 18px;
  border-top: 1px solid var(--border);
}

/* ===== 表格全局居中 ===== */
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}
.table-wrap th,
.table-wrap td {
  text-align: center;
  vertical-align: middle;
  padding: 8px 6px;
}
.table-wrap thead th {
  font-weight: 600;
  white-space: nowrap;
}

/* ===== Floating Online Mini Map ===== */
.mini-online-map-panel {
  position: fixed;
  top: calc(var(--navbar-h, 60px) + 14px);
  right: 16px;
  width: 380px;
  height: 420px;
  min-width: 230px;
  min-height: 170px;
  max-width: min(520px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - var(--navbar-h, 60px) - 28px));
  z-index: 180;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  resize: both;
  border: 1px solid rgba(148, 163, 184, .26);
  border-radius: 10px;
  background: rgba(15, 23, 42, .88);
  box-shadow: 0 14px 40px rgba(15, 23, 42, .28);
  backdrop-filter: blur(12px);
}
.mini-online-map-panel.left {
  left: 16px;
  right: auto;
}
.mini-online-map-panel.right {
  right: 16px;
  left: auto;
}
.mini-online-map-panel.topmost {
  z-index: 3600;
  border-color: rgba(96, 165, 250, .58);
  box-shadow: 0 18px 52px rgba(15, 23, 42, .38), 0 0 0 1px rgba(96, 165, 250, .2);
}
.mini-online-map-panel.collapsed {
  height: 38px;
  min-height: 38px;
  resize: none;
}
.mini-online-map-panel.hidden {
  display: none;
}
.mini-online-map-show-btn {
  position: fixed;
  top: calc(var(--navbar-h, 60px) + 14px);
  right: 16px;
  width: 38px;
  height: 38px;
  z-index: 181;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 10px;
  background: rgba(15, 23, 42, .9);
  color: #bfdbfe;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .28);
  cursor: pointer;
}
.mini-online-map-show-btn.visible {
  display: inline-flex;
}
.mini-online-map-show-btn.left {
  left: 16px;
  right: auto;
}
.mini-online-map-show-btn.right {
  right: 16px;
  left: auto;
}
.mini-online-map-show-btn:hover {
  color: #fff;
  background: rgba(37, 99, 235, .86);
}
.mini-online-map-header {
  height: 38px;
  flex: 0 0 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 0 11px;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
  color: #f8fafc;
}
.mini-online-map-panel.collapsed .mini-online-map-header {
  border-bottom: none;
}
.mini-online-map-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
}
.mini-online-map-title i {
  color: #38bdf8;
  font-size: 12px;
}
.mini-online-map-title span {
  white-space: nowrap;
}
.mini-online-map-title b {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(59, 130, 246, .18);
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 800;
}
.mini-online-map-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}
.mini-online-map-actions button {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 7px;
  background: rgba(255, 255, 255, .07);
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.mini-online-map-actions button:hover {
  border-color: rgba(96, 165, 250, .42);
  background: rgba(59, 130, 246, .18);
  color: #fff;
}
.mini-online-map-panel.topmost #miniOnlineMapPinIcon {
  color: #fbbf24;
}
.mini-online-map-actions button i {
  font-size: 11px;
}
.mini-online-map-body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #05070b;
}
#miniOnlineMap {
  width: 100%;
  height: 100%;
  background: #05070b;
}
#miniOnlineMap .leaflet-control-container {
  display: none;
}
.mini-online-map-status {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .78);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-online-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--mini-dot-color, #22c55e);
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .24), 0 2px 8px rgba(0, 0, 0, .45);
}
.mini-online-dot-label {
  position: absolute;
  left: 50%;
  top: 15px;
  transform: translateX(-50%);
  max-width: 72px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(15, 23, 42, .76);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.mini-online-squad-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
}
.mini-online-squad-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mini-dot-color, #22c55e);
  border: 1px solid rgba(255, 255, 255, .75);
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .mini-online-map-panel {
    top: calc(var(--navbar-h, 60px) + 10px);
    right: 10px;
    width: min(340px, calc(100vw - 20px));
    height: min(380px, calc(100vh - var(--navbar-h, 60px) - 20px));
    min-width: 220px;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - var(--navbar-h, 60px) - 20px);
  }
  .mini-online-map-panel.left {
    left: 10px;
    right: auto;
  }
  .mini-online-map-panel.right {
    right: 10px;
    left: auto;
  }
  .mini-online-map-show-btn,
  .mini-online-map-show-btn.right {
    right: 10px;
  }
  .mini-online-map-show-btn.left {
    left: 10px;
    right: auto;
  }
}




