/**
 * Copyright (c) 2014 The xterm.js authors. All rights reserved.
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * https://github.com/chjj/term.js
 * @license MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 *   The original design remains. The terminal itself
 *   has been extended to include xterm CSI codes, among
 *   other features.
 */

/**
 *  Default styles for xterm.js
 */

.xterm {
    cursor: text;
    position: relative;
    user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
}

.xterm.focus,
.xterm:focus {
    outline: none;
}

.xterm .xterm-helpers {
    position: absolute;
    top: 0;
    /**
     * The z-index of the helpers must be higher than the canvases in order for
     * IMEs to appear on top.
     */
    z-index: 5;
}

.xterm .xterm-helper-textarea {
    padding: 0;
    border: 0;
    margin: 0;
    /* Move textarea out of the screen to the far left, so that the cursor is not visible */
    position: absolute;
    opacity: 0;
    left: -9999em;
    top: 0;
    width: 0;
    height: 0;
    z-index: -5;
    /** Prevent wrapping so the IME appears against the textarea at the correct position */
    white-space: nowrap;
    overflow: hidden;
    resize: none;
}

.xterm .composition-view {
    /* TODO: Composition position got messed up somewhere */
    background: #000;
    color: #FFF;
    display: none;
    position: absolute;
    white-space: nowrap;
    z-index: 1;
}

.xterm .composition-view.active {
    display: block;
}

.xterm .xterm-viewport {
    /* On OS X this is required in order for the scroll bar to appear fully opaque */
    background-color: #000;
    overflow-y: scroll;
    cursor: default;
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
}

.xterm .xterm-screen {
    position: relative;
}

.xterm .xterm-screen canvas {
    position: absolute;
    left: 0;
    top: 0;
}

.xterm .xterm-scroll-area {
    visibility: hidden;
}

.xterm-char-measure-element {
    display: inline-block;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: -9999em;
    line-height: normal;
}

.xterm.enable-mouse-events {
    /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
    cursor: default;
}

.xterm.xterm-cursor-pointer,
.xterm .xterm-cursor-pointer {
    cursor: pointer;
}

.xterm.column-select.focus {
    /* Column selection mode */
    cursor: crosshair;
}

.xterm .xterm-accessibility,
.xterm .xterm-message {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10;
    color: transparent;
    pointer-events: none;
}

.xterm .live-region {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.xterm-dim {
    /* Dim should not apply to background, so the opacity of the foreground color is applied
     * explicitly in the generated class and reset to 1 here */
    opacity: 1 !important;
}

.xterm-underline-1 { text-decoration: underline; }
.xterm-underline-2 { text-decoration: double underline; }
.xterm-underline-3 { text-decoration: wavy underline; }
.xterm-underline-4 { text-decoration: dotted underline; }
.xterm-underline-5 { text-decoration: dashed underline; }

.xterm-overline {
    text-decoration: overline;
}

.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }

.xterm-strikethrough {
    text-decoration: line-through;
}

.xterm-screen .xterm-decoration-container .xterm-decoration {
	z-index: 6;
	position: absolute;
}

.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
	z-index: 7;
}

.xterm-decoration-overview-ruler {
    z-index: 8;
    position: absolute;
    top: 0;
    right: 0;
    pointer-events: none;
}

.xterm-decoration-top {
    z-index: 2;
    position: relative;
}
/* ============================================
   灵墟阙 KVM Management Dashboard - Global Styles
   黛青玄黑 + 暗金描边 国风高冷科技感
   ============================================ */

/* ============================================
   Theme Variables - DARK (灵墟阙主题)
   ============================================ */
:root,
[data-theme="dark"] {
  /* Background - 黛青玄黑 */
  --bg-primary: #0a0c10;
  --bg-secondary: #0f1218;
  --bg-card: #14171f;
  --bg-card-hover: #1a1f28;
  --bg-input: #0d0f14;
  --bg-modal: #0f1218;
  --bg-overlay: rgba(0, 0, 0, 0.75);

  /* Border - 暗金描边 */
  --border-color: rgba(16, 185, 129, 0.08);
  --border-hover: rgba(16, 185, 129, 0.15);
  --border-active: rgba(16, 185, 129, 0.4);

  /* Text */
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;

  /* Accent - 黛青为主，暗金为辅 */
  --accent-blue: #06b6d4;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-amber: #d4a574;
  --accent-orange: #f97316;
  --accent-pink: #ec4899;

  /* Glow */
  --glow-blue: 0 0 15px rgba(6, 182, 212, 0.15);
  --glow-green: 0 0 15px rgba(16, 185, 129, 0.15);
  --glow-red: 0 0 12px rgba(239, 68, 68, 0.12);
  --glow-purple: 0 0 15px rgba(139, 92, 246, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);

  /* Misc */
  --star-color: rgba(16, 185, 129, 0.4);
  --shooting-star-from: rgba(16, 185, 129, 0.4);
  --scrollbar-thumb: rgba(16, 185, 129, 0.15);
  --scrollbar-thumb-hover: rgba(16, 185, 129, 0.25);
  --skeleton-base: rgba(16, 185, 129, 0.03);
  --skeleton-shine: rgba(16, 185, 129, 0.06);
  --table-stripe: rgba(16, 185, 129, 0.02);
  --code-bg: var(--bg-input);
  --code-color: var(--accent-cyan);
  --meta-bg: rgba(16, 185, 129, 0.08);
  --meta-border: rgba(16, 185, 129, 0.06);

  /* Login */
  --login-card-bg: linear-gradient(135deg, rgba(20, 23, 31, 0.98), rgba(15, 18, 24, 0.98));
  --login-gradient: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));

  /* Progress bars */
  --progress-track: rgba(16, 185, 129, 0.08);

  /* Checkbox / accent */
  --checkbox-accent: var(--accent-blue);
}

/* ============================================
   Theme Variables - LIGHT (warm, paper-like)
   ============================================ */
[data-theme="light"] {
  --bg-primary: #f8f9fc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f1f5f9;
  --bg-modal: #ffffff;
  --bg-overlay: rgba(15, 23, 42, 0.3);

  --border-color: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(15, 23, 42, 0.16);
  --border-active: rgba(59, 130, 246, 0.5);

  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --accent-orange: #f97316;
  --accent-pink: #ec4899;

  --glow-blue: 0 0 12px rgba(59, 130, 246, 0.06);
  --glow-green: 0 0 12px rgba(34, 197, 94, 0.06);
  --glow-red: 0 0 12px rgba(239, 68, 68, 0.06);
  --glow-purple: 0 0 12px rgba(139, 92, 246, 0.06);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.1);

  --star-color: rgba(100, 116, 139, 0.3);
  --shooting-star-from: rgba(59, 130, 246, 0.2);
  --scrollbar-thumb: rgba(15, 23, 42, 0.12);
  --scrollbar-thumb-hover: rgba(15, 23, 42, 0.22);
  --skeleton-base: rgba(15, 23, 42, 0.04);
  --skeleton-shine: rgba(15, 23, 42, 0.08);
  --table-stripe: rgba(15, 23, 42, 0.015);
  --code-bg: #f1f5f9;
  --code-color: #0369a1;
  --meta-bg: #f8fafc;
  --meta-border: rgba(15, 23, 42, 0.05);

  --login-card-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(248, 249, 252, 0.98));
  --login-gradient: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));

  --progress-track: rgba(15, 23, 42, 0.08);

  --checkbox-accent: var(--accent-blue);
}

/* ============================================
   Shared Variables (theme-independent)
   ============================================ */
:root {
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-theme: 0.35s ease;

  --sidebar-width: 280px;
  --header-height: 64px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Theme transition on body */
body,
.sidebar,
.top-header,
.stat-card,
.vm-card,
.modal-box,
.confirm-box,
.toast,
.data-table thead th,
.vm-table-wrap,
.host-info-bar,
.search-box input,
.login-card {
  transition: background-color var(--transition-theme),
              color var(--transition-theme),
              border-color var(--transition-theme),
              box-shadow var(--transition-theme);
}

/* ============================================
   Reset
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
  cursor: pointer;
}

button {
  text-transform: none;
  letter-spacing: 0;
}

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

img {
  max-width: 100%;
  display: block;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* ============================================
   Star Background (dark only)
   ============================================ */
.stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity var(--transition-theme);
}

[data-theme="light"] .stars-container {
  opacity: 0;
}

.star {
  position: absolute;
  background: var(--star-color);
  border-radius: 50%;
  animation: starTwinkle var(--duration) infinite ease-in-out;
  animation-delay: var(--delay);
  opacity: 0;
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.1; transform: scale(0.8); }
  50% { opacity: var(--max-opacity); transform: scale(1.2); }
}

.shooting-star {
  position: absolute;
  width: 120px;
  height: 2px;
  background: linear-gradient(to right, var(--shooting-star-from), transparent);
  border-radius: 50%;
  animation: shootingStar 4s infinite ease-in;
  opacity: 0;
}

@keyframes shootingStar {
  0% { transform: translateX(-100px) translateY(0) rotate(-35deg); opacity: 0; }
  5% { opacity: 1; }
  15% { opacity: 1; }
  20% { transform: translateX(600px) translateY(200px) rotate(-35deg); opacity: 0; }
  100% { opacity: 0; }
}

/* ============================================
   Theme Toggle Button
   ============================================ */
.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.theme-toggle-btn:hover {
  background: rgba(99, 179, 237, 0.08);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: none;
  box-shadow: none;
}

[data-theme="light"] .theme-toggle-btn:hover {
  background: rgba(59, 130, 246, 0.06);
}

.theme-toggle-btn .icon-sun,
.theme-toggle-btn .icon-moon {
  position: absolute;
  transition: all 0.3s ease;
}

.theme-toggle-btn .icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}
.theme-toggle-btn .icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

[data-theme="light"] .theme-toggle-btn .icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}
[data-theme="light"] .theme-toggle-btn .icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 20px;
}

.login-card {
  background: var(--login-card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
  animation: loginCardIn 0.6s ease-out;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--login-gradient);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo .icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(99, 179, 237, 0.1);
  border: 1px solid rgba(99, 179, 237, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 28px;
}

[data-theme="light"] .login-logo .icon-wrap {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.12);
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  background: var(--login-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 6px;
}

.login-form .form-group {
  margin-bottom: 20px;
  position: relative;
}

.login-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.login-form .input-wrapper {
  position: relative;
}

.login-form .input-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
  transition: color var(--transition-fast);
  z-index: 1;
}

.login-form input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-sans);
  transition: all var(--transition-normal);
  outline: none;
}

.login-form input::placeholder {
  color: var(--text-muted);
}

.login-form input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.08);
}

[data-theme="light"] .login-form input:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.login-form input:focus + i,
.login-form .input-wrapper:focus-within i {
  color: var(--accent-blue);
}

.login-form .form-error {
  font-size: 12px;
  color: var(--accent-red);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 13px;
}

.login-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}

.login-options label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--checkbox-accent);
  cursor: pointer;
}

.login-options a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.login-options a:hover {
  color: var(--accent-cyan);
}

.btn-login-submit {
  width: 100%;
  padding: 13px 24px;
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-normal);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.btn-login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99, 179, 237, 0.25);
}

.btn-login-submit:active {
  transform: translateY(0);
}

.btn-login-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-login-submit .spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
}

/* ============================================
   Layout - Sidebar + Header + Main
   ============================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: width 0.25s ease,
              transform var(--transition-slow),
              background-color var(--transition-theme),
              border-color var(--transition-theme);
}

.sidebar-brand {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  min-height: var(--header-height);
  background: linear-gradient(180deg, rgba(212, 165, 116, 0.03) 0%, transparent 100%);
}

.sidebar-brand .brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  transition: opacity var(--transition-fast);
}
.sidebar-brand .brand-logo:hover {
  opacity: 0.85;
}

.sidebar-brand .brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.2), rgba(212, 165, 116, 0.05));
  border: 1px solid rgba(212, 165, 116, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  color: #d4a574;
  box-shadow: 0 2px 12px rgba(212, 165, 116, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: all var(--transition-fast);
  position: relative;
}
.sidebar-brand .brand-icon::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.08), transparent);
  z-index: -1;
}

[data-theme="light"] .sidebar-brand .brand-icon {
  background: rgba(212, 165, 116, 0.1);
  border-color: rgba(212, 165, 116, 0.2);
  color: #b8864a;
  box-shadow: 0 1px 4px rgba(212, 165, 116, 0.08);
}

.sidebar-brand .brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.sidebar-brand .brand-text strong {
  font-size: 20px;
  font-weight: 800;
  color: #d4a574;
  letter-spacing: 4px;
  font-family: "Noto Serif SC", "Source Han Serif SC", serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 0 20px rgba(212, 165, 116, 0.15);
  white-space: nowrap;
  line-height: 1.2;
}

.sidebar-brand .brand-text span {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  line-height: 1;
  opacity: 0.7;
}

/* 侧边栏折叠/展开按钮 */
.sidebar-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
  background: rgba(212, 165, 116, 0.1);
  color: #d4a574;
  border-color: rgba(212, 165, 116, 0.15);
}

/* 侧边栏折叠状态 */
.sidebar.collapsed {
  width: 68px;
}
.sidebar.collapsed .sidebar-brand {
  padding: 16px 10px;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, rgba(212, 165, 116, 0.03) 0%, transparent 100%);
}
.sidebar.collapsed .brand-logo {
  justify-content: center;
}
.sidebar.collapsed .brand-icon {
  width: 38px;
  height: 38px;
  font-size: 18px;
  border-radius: 10px;
}
.sidebar.collapsed .sidebar-collapse-btn {
  width: 36px;
  height: 24px;
  border-radius: 12px;
  background: rgba(212, 165, 116, 0.08);
  border: 1px solid rgba(212, 165, 116, 0.15);
  font-size: 13px;
  color: #d4a574;
}
.sidebar.collapsed .sidebar-collapse-btn:hover {
  background: rgba(212, 165, 116, 0.15);
}
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}
.sidebar.collapsed .nav-item i {
  margin: 0;
  font-size: 18px;
}
.sidebar.collapsed .sidebar-user {
  justify-content: center;
  padding: 8px;
}
.sidebar.collapsed .sidebar-footer {
  padding: 12px 8px;
}

/* 主内容区适配侧边栏折叠 */
.sidebar.collapsed ~ .main-content {
  margin-left: 68px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #d4a574;
  letter-spacing: 3px;
  padding: 14px 12px 8px;
  font-family: "Noto Serif SC", serif;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}
.nav-section-title:hover {
  color: #e8c49a;
}
.sidebar.collapsed .nav-section-title {
  justify-content: center;
  padding: 14px 0 8px;
  cursor: default;
}
.sidebar.collapsed .nav-section-title:hover {
  color: #d4a574;
}
.sidebar.collapsed .nav-section-title i {
  font-size: 15px;
  opacity: 0.7;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
  border: 1px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
}

.nav-item i {
  font-size: 18px;
  width: 22px;
  text-align: center;
}

.nav-item:hover {
  background: rgba(99, 179, 237, 0.05);
  color: var(--text-primary);
}

[data-theme="light"] .nav-item:hover {
  background: rgba(59, 130, 246, 0.04);
}

.nav-item.active {
  background: rgba(99, 179, 237, 0.08);
  color: var(--accent-blue);
  border-color: rgba(99, 179, 237, 0.12);
}

[data-theme="light"] .nav-item.active {
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.12);
}

.nav-item.active i {
  color: var(--accent-blue);
}

.nav-item .badge {
  margin-left: auto;
  background: var(--accent-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-user:hover {
  background: rgba(148, 163, 184, 0.04);
}

[data-theme="light"] .sidebar-user:hover {
  background: rgba(15, 23, 42, 0.03);
}

.sidebar-user .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user .user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user .user-info .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .user-info .role {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-user .logout-btn {
  color: var(--text-muted);
  font-size: 18px;
  padding: 4px;
  transition: color var(--transition-fast);
  background: none;
  border: none;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}

.sidebar-user .logout-btn:hover {
  color: var(--accent-red);
  transform: none;
  box-shadow: none;
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Header */
.top-header {
  height: var(--header-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

[data-theme="dark"] .top-header {
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(12px);
}

[data-theme="light"] .top-header {
  background: rgba(248, 249, 252, 0.85);
  backdrop-filter: blur(12px);
}

.top-header .header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-header .header-left .menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}

.top-header .header-left .menu-toggle:hover {
  color: var(--text-primary);
  transform: none;
  box-shadow: none;
}

.top-header .header-left h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.top-header .header-left .breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
}

.top-header .header-left .breadcrumb span {
  color: var(--text-secondary);
}

.top-header .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.header-doc-btn {
  width: auto;
  min-width: 88px;
  padding: 0 14px;
  gap: 8px;
  justify-content: center;
  background: linear-gradient(135deg, rgba(96,165,250,0.16), rgba(14,165,233,0.07));
  border-color: rgba(96,165,250,0.28);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header-doc-btn i {
  font-size: 16px;
  color: var(--accent-blue);
}

.header-doc-btn span {
  display: inline-block;
  transform: translateY(0.5px);
}

.header-btn:hover {
  background: rgba(99, 179, 237, 0.06);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: none;
  box-shadow: none;
}

.header-doc-btn:hover {
  background: linear-gradient(135deg, rgba(96,165,250,0.22), rgba(14,165,233,0.11));
  border-color: rgba(96,165,250,0.36);
}

.header-btn .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-red);
  border: 2px solid var(--bg-secondary);
}

.header-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 宿主机选择器 */
.host-selector {
  position: relative;
  margin-right: 4px;
}
.host-selector-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 6px 10px 6px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  white-space: nowrap;
  min-width: 164px;
  justify-content: space-between;
}
.host-selector-trigger:hover {
  border-color: var(--accent-blue);
  background: var(--bg-card-hover);
}
.host-selector-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.host-selector-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-items: flex-start;
  gap: 1px;
}
.host-selector-label {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.host-selector-name {
  max-width: 136px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  line-height: 1.15;
}
.host-selector-arrow {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.host-selector-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  z-index: 1000;
  overflow: hidden;
  padding: 4px;
  animation: host-dropdown-in 0.12s ease-out;
}
.host-selector-dropdown-head {
  padding: 8px 10px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
@keyframes host-dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.host-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
}
.host-dropdown-item:hover {
  background: var(--bg-card-hover);
}
.host-dropdown-active {
  background: rgba(96,165,250,0.08);
  color: var(--accent-blue);
  font-weight: 600;
}
.host-dropdown-active:hover {
  background: rgba(96,165,250,0.12);
}
.host-dropdown-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-create-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 320px;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(96,165,250,0.18);
  background:
    radial-gradient(circle at top right, rgba(96,165,250,0.12), transparent 34%),
    radial-gradient(circle at bottom left, rgba(16,185,129,0.08), transparent 30%),
    var(--bg-card);
}

.user-create-main {
  min-width: 0;
}

.user-create-section + .user-create-section {
  margin-top: 16px;
}

.user-create-title,
.user-create-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 12px;
}

.user-create-title {
  font-size: 15px;
}

.user-create-subtitle {
  font-size: 13px;
  letter-spacing: 0.02em;
}

.user-create-title i,
.user-create-subtitle::before {
  color: var(--accent-blue);
}

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

.user-scope-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-scope-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(148,163,184,0.08);
  font-size: 13px;
  color: var(--text-secondary);
}

.user-scope-chip:hover {
  border-color: rgba(96,165,250,0.28);
  background: rgba(96,165,250,0.08);
}

.user-helper-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.user-cap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.user-cap-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(148,163,184,0.07);
  font-size: 13px;
  color: var(--text-primary);
}

.user-cap-card:hover {
  border-color: rgba(96,165,250,0.28);
  background: rgba(96,165,250,0.08);
}

.user-create-side {
  display: flex;
}

.user-create-side-card {
  width: 100%;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(96,165,250,0.18);
  background: linear-gradient(180deg, rgba(15,23,42,0.86), rgba(30,41,59,0.72));
  color: #d9e7f7;
}

.user-create-side-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226,232,240,0.7);
  margin-bottom: 12px;
}

.user-role-note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.user-role-note strong {
  font-size: 15px;
  color: #fff;
}

.user-role-note span {
  font-size: 13px;
  line-height: 1.65;
  color: rgba(226,232,240,0.78);
}

.user-create-checklist {
  margin: 14px 0 0;
  padding-left: 18px;
  color: rgba(226,232,240,0.8);
  line-height: 1.8;
  font-size: 13px;
}

/* ============================================
   Host Row - 宿主机行样式
   ============================================ */
.host-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.host-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.host-row:hover {
  border-color: rgba(96,165,250,0.3);
}
.host-row-active {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue), 0 2px 12px rgba(96,165,250,0.1);
}
.host-row-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-blue);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.host-row-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  position: relative;
}
.host-row-icon-local {
  background: rgba(52,211,153,0.1);
  color: var(--accent-green);
}
.host-row-icon-remote {
  background: rgba(96,165,250,0.1);
  color: var(--accent-blue);
}
.host-row-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--accent-green);
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
}
.host-row-body {
  flex: 1;
  min-width: 0;
}
.host-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.host-row-name {
  font-size: 14px;
  color: var(--text-primary);
}
.host-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
}
.host-tag-green {
  color: var(--accent-green);
  background: rgba(52,211,153,0.1);
}
.host-tag-blue {
  color: var(--accent-blue);
  background: rgba(96,165,250,0.1);
}
.host-tag-amber {
  color: var(--accent-amber);
  background: rgba(245,158,11,0.1);
}
.host-row-addr {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.host-row-sep {
  color: var(--border-color);
}
.host-row-test {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}
.host-row-test-ok {
  color: var(--accent-green);
}
.host-row-test-fail {
  color: var(--accent-red);
}
.host-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
}

.btn-refresh i.spinning {
  animation: spin 1s linear infinite;
}

/* Page Content */
.page-content {
  flex: 1;
  padding: 28px;
}

/* ============================================
   Stats Cards
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--stat-accent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card .stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-card .stat-trend {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
}

.stat-card .stat-trend.up {
  color: var(--accent-green);
}

.stat-card .stat-trend.down {
  color: var(--accent-red);
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 4px;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   VM Cards Grid
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header h3 i {
  color: var(--accent-blue);
}

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

.search-box {
  position: relative;
}

.search-box input {
  padding: 8px 14px 8px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  width: 240px;
  transition: all var(--transition-normal);
  outline: none;
}

.search-box input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.08);
  width: 280px;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-normal);
  letter-spacing: 0;
  text-transform: none;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 179, 237, 0.2);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* VM Cards */
.vm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.vm-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.4s ease-out backwards;
}

.vm-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.vm-card .vm-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.vm-card .vm-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.vm-card .vm-icon-wrap.running {
  background: rgba(104, 211, 145, 0.1);
  color: var(--accent-green);
}

.vm-card .vm-icon-wrap.shut {
  background: rgba(252, 129, 129, 0.1);
  color: var(--accent-red);
}

.vm-card .vm-icon-wrap.other {
  background: rgba(246, 201, 92, 0.1);
  color: var(--accent-amber);
}

.vm-card .vm-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.vm-card .vm-status-badge.running {
  background: rgba(104, 211, 145, 0.08);
  color: var(--accent-green);
  border: 1px solid rgba(104, 211, 145, 0.15);
}

.vm-card .vm-status-badge.shut {
  background: rgba(252, 129, 129, 0.08);
  color: var(--accent-red);
  border: 1px solid rgba(252, 129, 129, 0.15);
}

.vm-card .vm-status-badge.other {
  background: rgba(246, 201, 92, 0.08);
  color: var(--accent-amber);
  border: 1px solid rgba(246, 201, 92, 0.15);
}

.vm-card .vm-status-badge .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.vm-card .vm-status-badge.running .status-dot {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.vm-card .vm-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.vm-card .vm-id {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.vm-card .vm-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
  padding: 14px;
  background: var(--meta-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--meta-border);
}

.vm-card .vm-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.vm-card .vm-meta-item i {
  color: var(--text-muted);
  font-size: 14px;
}

.vm-card .vm-meta-item .meta-label {
  color: var(--text-muted);
}

.vm-card .vm-meta-item .meta-value {
  color: var(--text-secondary);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 12px;
}

.vm-card .vm-actions {
  display: flex;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.vm-card .vm-actions button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
}

.vm-card .vm-actions button:hover {
  transform: translateY(-1px);
}

.vm-card .vm-actions button:active {
  transform: translateY(0);
}

.vm-card .vm-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.vm-card .vm-actions .btn-action-start {
  background: rgba(104, 211, 145, 0.1);
  color: var(--accent-green);
  border-color: rgba(104, 211, 145, 0.15);
}
.vm-card .vm-actions .btn-action-start:hover:not(:disabled) {
  background: rgba(104, 211, 145, 0.18);
  box-shadow: var(--glow-green);
}

.vm-card .vm-actions .btn-action-stop {
  background: rgba(252, 129, 129, 0.1);
  color: var(--accent-red);
  border-color: rgba(252, 129, 129, 0.15);
}
.vm-card .vm-actions .btn-action-stop:hover:not(:disabled) {
  background: rgba(252, 129, 129, 0.18);
  box-shadow: var(--glow-red);
}

.vm-card .vm-actions .btn-action-restart {
  background: rgba(246, 201, 92, 0.1);
  color: var(--accent-amber);
  border-color: rgba(246, 201, 92, 0.15);
}
.vm-card .vm-actions .btn-action-restart:hover:not(:disabled) {
  background: rgba(246, 201, 92, 0.18);
}

.vm-card .vm-actions .btn-action-clone {
  background: rgba(183, 148, 244, 0.1);
  color: var(--accent-purple);
  border-color: rgba(183, 148, 244, 0.15);
}
.vm-card .vm-actions .btn-action-clone:hover:not(:disabled) {
  background: rgba(183, 148, 244, 0.18);
  box-shadow: var(--glow-purple);
}

.vm-card .vm-actions .btn-action-delete {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-muted);
  border-color: rgba(100, 116, 139, 0.15);
}
.vm-card .vm-actions .btn-action-delete:hover:not(:disabled) {
  background: rgba(252, 129, 129, 0.1);
  color: var(--accent-red);
  border-color: rgba(252, 129, 129, 0.15);
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: overlayIn 0.2s ease;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-box .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-box .modal-head h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-box .modal-head h3 i {
  color: var(--accent-blue);
  font-size: 20px;
}

.modal-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: rgba(252, 129, 129, 0.12);
  color: var(--accent-red);
  transform: rotate(90deg);
}

.modal-box .modal-body {
  padding: 24px;
}

.modal-box .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-box .form-group {
  margin-bottom: 18px;
}

.modal-box .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.modal-box .form-group label .required {
  color: var(--accent-red);
  margin-left: 2px;
}

.modal-box .form-group input,
.modal-box .form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  transition: all var(--transition-normal);
  outline: none;
}

.modal-box .form-group input::placeholder {
  color: var(--text-muted);
}

.modal-box .form-group input:focus,
.modal-box .form-group select:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.08);
}

.modal-box .form-group input:read-only {
  color: var(--text-muted);
  cursor: not-allowed;
}

.modal-box .form-group .form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.modal-box .form-group .form-error {
  font-size: 12px;
  color: var(--accent-red);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.modal-box .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 24px;
  border-top: 1px solid var(--border-color);
}

.btn-secondary {
  padding: 9px 20px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0;
  text-transform: none;
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.04);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: none;
  box-shadow: none;
}

.btn-submit {
  padding: 9px 24px;
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-normal);
  letter-spacing: 0;
  text-transform: none;
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 179, 237, 0.2);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-submit .spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* ============================================
   Confirm Dialog
   ============================================ */
.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  animation: overlayIn 0.15s ease;
}

.confirm-box {
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s ease-out;
}

.confirm-box .confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 16px;
}

.confirm-box .confirm-icon.danger {
  background: rgba(252, 129, 129, 0.1);
  color: var(--accent-red);
}

.confirm-box .confirm-icon.warning {
  background: rgba(246, 201, 92, 0.1);
  color: var(--accent-amber);
}

.confirm-box h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.confirm-box p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.confirm-box .confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-box .btn-danger {
  padding: 9px 24px;
  background: var(--accent-red);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-normal);
  letter-spacing: 0;
  text-transform: none;
}

.confirm-box .btn-danger:hover {
  background: #ef4444;
  box-shadow: var(--glow-red);
}

.confirm-box .btn-warning {
  padding: 9px 24px;
  background: var(--accent-amber);
  border: none;
  border-radius: var(--radius-sm);
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-normal);
  letter-spacing: 0;
  text-transform: none;
}

.confirm-box .btn-warning:hover {
  box-shadow: 0 4px 16px rgba(246, 201, 92, 0.2);
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  min-width: 320px;
  max-width: 420px;
  pointer-events: auto;
  animation: toastIn 0.3s ease-out;
}

.toast.removing {
  animation: toastOut 0.25s ease-in forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(40px) scale(0.95); }
}

.toast .toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast.success .toast-icon {
  background: rgba(104, 211, 145, 0.1);
  color: var(--accent-green);
}

.toast.error .toast-icon {
  background: rgba(252, 129, 129, 0.1);
  color: var(--accent-red);
}

.toast.warning .toast-icon {
  background: rgba(246, 201, 92, 0.1);
  color: var(--accent-amber);
}

.toast .toast-content {
  flex: 1;
}

.toast .toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast .toast-message {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.toast .toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.toast .toast-close:hover {
  color: var(--text-primary);
  transform: none;
  box-shadow: none;
}

.toast .toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  animation: toastProgress 3s linear forwards;
}

.toast.success .toast-progress { background: var(--accent-green); }
.toast.error .toast-progress { background: var(--accent-red); }
.toast.warning .toast-progress { background: var(--accent-amber); }

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0; }
}

/* ============================================
   Loading States
   ============================================ */
.loading-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.skeleton-line {
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
  max-width: 300px;
  margin: 0 auto;
}

/* ============================================
   Platform Customize
   ============================================ */

/* 输入框带图标样式 */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.input-with-icon input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  transition: all var(--transition-normal);
  outline: none;
}

.input-with-icon input::placeholder {
  color: var(--text-muted);
}

.input-with-icon input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(99, 179, 237, 0.12);
  background: var(--bg-primary);
}

.input-with-icon input:focus + i,
.input-with-icon:has(input:focus) i {
  color: var(--accent-blue);
}

/* 平台定制卡片 */
.platform-customize-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.platform-customize-card:hover {
  border-color: rgba(99, 179, 237, 0.2);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* 预览区 */
.platform-preview {
  background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(99, 102, 241, 0.03) 100%);
  padding: 28px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 20px;
}

.platform-preview-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: var(--accent-purple);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.platform-preview-text h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.platform-preview-text p {
  font-size: 14px;
  color: var(--text-muted);
}

/* 预览文字高亮效果 */
.platform-preview-text h3.placeholder,
.platform-preview-text p.placeholder {
  opacity: 0.4;
}

/* 表单区 */
.platform-form {
  padding: 28px;
}

.platform-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

@media (max-width: 640px) {
  .platform-form-row {
    grid-template-columns: 1fr;
  }
}

.platform-form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.platform-form-group label i {
  color: var(--accent-blue);
  font-size: 15px;
}

/* 图标选择器 - 横向滚动 */
.icon-selector-wrapper {
  margin-top: 8px;
}

.icon-selector-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.icon-selector-label i {
  color: var(--accent-purple);
  font-size: 15px;
}

.icon-selector {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 12px 2px;
  margin: 0 -2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.icon-selector::-webkit-scrollbar {
  height: 6px;
}

.icon-selector::-webkit-scrollbar-track {
  background: transparent;
}

.icon-selector::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.icon-option {
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--text-secondary);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.icon-option::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.icon-option:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.icon-option:hover::before {
  opacity: 1;
}

.icon-option:hover i {
  color: var(--accent-purple);
}

.icon-option.selected {
  border-color: var(--accent-blue);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.icon-option.selected i {
  color: var(--accent-blue);
}

.icon-option i {
  position: relative;
  z-index: 1;
  transition: all var(--transition-fast);
}

/* 操作按钮区 */
.platform-actions {
  display: flex;
  gap: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  margin-top: 28px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   VM Card Grid & Actions
   ============================================ */
.vm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.vm-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-normal);
  animation: fadeInUp 0.4s ease-out both;
}

.vm-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.vm-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.vm-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.vm-icon-wrap.running {
  background: linear-gradient(135deg, rgba(104, 211, 145, 0.15), rgba(104, 211, 145, 0.05));
  color: var(--accent-green);
}

.vm-icon-wrap.shut {
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.15), rgba(100, 116, 139, 0.05));
  color: var(--text-muted);
}

.vm-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.vm-status-badge.running {
  background: rgba(104, 211, 145, 0.1);
  color: var(--accent-green);
}

.vm-status-badge.shut {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
}

.vm-status-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.vm-status-badge.running .status-dot {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.vm-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.vm-id {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
  margin-bottom: 4px;
}

.vm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.vm-extra-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-text:hover {
  background: var(--bg-input);
  color: var(--accent-blue);
}

.btn-action-start,
.btn-action-stop,
.btn-action-restart,
.btn-action-clone,
.btn-action-delete {
  flex: 1;
  min-width: 70px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.btn-action-start:hover {
  background: rgba(104, 211, 145, 0.1);
  border-color: rgba(104, 211, 145, 0.3);
  color: var(--accent-green);
}

.btn-action-stop:hover {
  background: rgba(252, 129, 129, 0.1);
  border-color: rgba(252, 129, 129, 0.3);
  color: var(--accent-red);
}

.btn-action-restart:hover {
  background: rgba(99, 179, 237, 0.1);
  border-color: rgba(99, 179, 237, 0.3);
  color: var(--accent-blue);
}

.btn-action-clone:hover {
  background: rgba(246, 201, 92, 0.1);
  border-color: rgba(246, 201, 92, 0.3);
  color: var(--accent-amber);
}

.btn-action-delete:hover {
  background: rgba(252, 129, 129, 0.1);
  border-color: rgba(252, 129, 129, 0.3);
  color: var(--accent-red);
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.search-box i {
  color: var(--text-muted);
  font-size: 16px;
}

.search-box input {
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  width: 180px;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

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

  .header-doc-btn {
    min-width: 0;
    padding: 0 12px;
  }

  .header-doc-btn span {
    display: none;
  }

  .host-selector-trigger {
    min-width: 0;
    padding: 6px 10px;
  }

  .host-selector-label {
    display: none;
  }

  .host-selector-name {
    max-width: 92px;
  }

  .user-create-shell {
    grid-template-columns: 1fr;
  }

  .user-create-grid,
  .user-cap-grid {
    grid-template-columns: 1fr;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading Skeleton */
.loading-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

/* Page Container */
.page-container {
  padding: 0;
}

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

.page-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.page-header h1 i {
  color: var(--accent-blue);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0 0;
}

/* ============================================
   Settings Page Input Styling
   ============================================ */
.settings-page input[type="text"],
.settings-page input[type="password"],
.settings-page input[type="number"],
.settings-page select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  transition: all var(--transition-normal);
  outline: none;
}

.settings-page input[type="text"]:focus,
.settings-page input[type="password"]:focus,
.settings-page input[type="number"]:focus,
.settings-page select:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.12);
}

.settings-page input[type="text"]::placeholder,
.settings-page input[type="password"]::placeholder,
.settings-page input[type="number"]::placeholder {
  color: var(--text-muted);
}

/* 输入框带图标的包装样式 */
.input-with-icon {
  position: relative;
}

.input-with-icon i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
  z-index: 1;
}

.input-with-icon input {
  padding-left: 44px !important;
}

/* ============================================
   Stat Card Styling - Settings Page
   ============================================ */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition-normal);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  flex-shrink: 0;
}

.stat-icon i {
  color: white;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .main-content {
    margin-left: 0;
  }

  .top-header .header-left .menu-toggle {
    display: flex;
  }

  .top-header {
    padding: 0 16px;
  }

  .page-content {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card .stat-value {
    font-size: 26px;
  }

  .vm-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section-actions {
    width: 100%;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    width: 100%;
  }

  .search-box input:focus {
    width: 100%;
  }

  .modal-box {
    max-width: 100%;
    margin: 10px;
  }

  .modal-box .form-row {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 32px 24px;
  }

  .toast {
    min-width: 280px;
    max-width: calc(100vw - 40px);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .vm-card .vm-actions {
    flex-wrap: wrap;
  }
}

/* ============================================
   Sidebar Overlay (mobile)
   ============================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* ============================================
   Login - Server Error & Hint
   ============================================ */
.login-server-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(252, 129, 129, 0.06);
  border: 1px solid rgba(252, 129, 129, 0.15);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--accent-red);
  animation: shakeX 0.4s ease;
}

.login-server-error i {
  font-size: 18px;
  flex-shrink: 0;
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.login-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px;
  background: rgba(99, 179, 237, 0.04);
  border: 1px dashed rgba(99, 179, 237, 0.12);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
}

.login-hint i {
  color: var(--accent-blue);
  font-size: 14px;
}

.login-hint code {
  background: rgba(99, 179, 237, 0.08);
  color: var(--accent-blue);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Input error state */
.input-error {
  border-color: var(--accent-red) !important;
  box-shadow: 0 0 0 3px rgba(252, 129, 129, 0.08) !important;
}

/* Left/right icon positioning for login inputs */
.input-icon-left {
  position: absolute;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  right: auto !important;
}

.input-icon-right {
  position: absolute !important;
  right: 14px !important;
  left: auto !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

/* Checkbox label styling */
.checkbox-label {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: var(--text-secondary) !important;
  cursor: pointer !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  margin: 0 !important;
}

.checkbox-label input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  padding: 0 !important;
  accent-color: var(--checkbox-accent) !important;
  cursor: pointer;
}

/* ============================================
   VNC Console (future placeholder)
   ============================================ */
.console-area {
  background: #000;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ============================================
   Host Info Bar (Dashboard)
   ============================================ */
.host-info-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.host-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.host-info-item i {
  color: var(--accent-blue);
  font-size: 16px;
}
.host-info-item span {
  color: var(--text-muted);
}
.host-info-item strong {
  color: var(--text-primary);
}
.host-info-item em {
  font-style: normal;
  color: var(--text-muted);
  font-size: 12px;
}
.host-info-divider {
  width: 1px;
  height: 24px;
  background: var(--border-color);
}

/* ============================================
   Data Table (Storage / Network / Dashboard VM list)
   ============================================ */
.vm-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}
.data-table tbody tr:nth-child(even) {
  background: var(--table-stripe);
}
.data-table tbody tr:nth-child(even):hover {
  background: var(--bg-card-hover);
}
.data-table code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--code-color);
}

/* ============================================
   Table Action Buttons
   ============================================ */
.table-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.btn-xs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  font-family: var(--font-sans);
}
.btn-xs i { font-size: 13px; }
.btn-start { background: rgba(104,211,145,0.1); color: var(--accent-green); }
.btn-start:hover { background: rgba(104,211,145,0.22); }
.btn-stop { background: rgba(246,201,92,0.1); color: var(--accent-amber); }
.btn-stop:hover { background: rgba(246,201,92,0.22); }
.btn-restart { background: rgba(99,179,237,0.1); color: var(--accent-blue); }
.btn-restart:hover { background: rgba(99,179,237,0.22); }
.btn-destroy { background: rgba(252,129,129,0.1); color: var(--accent-red); }
.btn-destroy:hover { background: rgba(252,129,129,0.22); }
.btn-amber { background: rgba(212,165,116,0.1); color: var(--accent-amber); }
.btn-amber:hover { background: rgba(212,165,116,0.22); }

/* Status tags for tables */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.status-tag .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-tag.running {
  background: rgba(104,211,145,0.08);
  color: var(--accent-green);
}
.status-tag.shut {
  background: rgba(100,116,139,0.08);
  color: var(--text-secondary);
}
.status-tag.paused {
  background: rgba(212,165,116,0.08);
  color: var(--accent-amber);
}
.status-tag.other {
  background: rgba(246,201,92,0.08);
  color: var(--accent-amber);
}

/* ============================================
   VM Extra Actions (detail / snapshot / vnc)
   ============================================ */
.vm-extra-actions {
  display: flex;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
}
.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-sans);
}
.btn-text:hover {
  color: var(--accent-blue);
  background: rgba(99,179,237,0.06);
}

/* ============================================
   Detail Modal Grid
   ============================================ */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.detail-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.detail-item span:last-child,
.detail-item strong:last-child {
  font-size: 14px;
  color: var(--text-primary);
}

/* Detail Section */
.detail-section {
  margin-bottom: 20px;
}
.detail-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.detail-section h4 i {
  color: var(--accent-blue);
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ============================================
   Button Small
   ============================================ */
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

/* ============================================
   Stat Icon Color Variants (replaces inline rgba)
   ============================================ */
.stat-icon-blue { background: rgba(99, 179, 237, 0.1); color: var(--accent-blue); }
.stat-icon-green { background: rgba(104, 211, 145, 0.1); color: var(--accent-green); }
.stat-icon-red { background: rgba(252, 129, 129, 0.1); color: var(--accent-red); }
.stat-icon-amber { background: rgba(246, 201, 92, 0.1); color: var(--accent-amber); }
.stat-icon-purple { background: rgba(183, 148, 244, 0.1); color: var(--accent-purple); }

[data-theme="light"] .stat-icon-blue { background: rgba(59, 130, 246, 0.08); }
[data-theme="light"] .stat-icon-green { background: rgba(34, 197, 94, 0.08); }
[data-theme="light"] .stat-icon-red { background: rgba(239, 68, 68, 0.08); }
[data-theme="light"] .stat-icon-amber { background: rgba(245, 158, 11, 0.08); }
[data-theme="light"] .stat-icon-purple { background: rgba(139, 92, 246, 0.08); }

/* ============================================
   Progress Bars (Monitor Page)
   ============================================ */
.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--progress-track);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* ============================================
   Light theme specific overrides
   ============================================ */
[data-theme="light"] .console-area {
  background: #1e293b;
  color: #e2e8f0;
}

[data-theme="light"] .vm-card .vm-meta {
  background: var(--meta-bg);
  border-color: var(--meta-border);
}

[data-theme="light"] .sidebar {
  box-shadow: 1px 0 8px rgba(0, 0, 0, 0.04);
}

/* ============================================
   Dark theme specific overrides
   ============================================ */
[data-theme="dark"] .sidebar {
  box-shadow: 1px 0 12px rgba(0, 0, 0, 0.2);
}

/* ============================================
   VM Card Grid - 卡片视图
   ============================================ */
.vm-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.vm-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.25s ease;
  cursor: default;
}
.vm-card-hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.vm-card-accent {
  height: 3px;
  width: 100%;
  transition: height 0.2s;
}

.vm-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 8px;
  cursor: pointer;
}
.vm-card-header:hover .vm-card-name {
  color: var(--accent-blue);
}

.vm-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--meta-bg);
  flex-shrink: 0;
}

.vm-card-title-wrap {
  flex: 1;
  min-width: 0;
}
.vm-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s;
}

.vm-card-body {
  padding: 8px 16px 16px;
}

.vm-card-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
}
.vm-card-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}
.vm-card-meta-item i {
  color: var(--text-muted);
  font-size: 14px;
}

.vm-card-ip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.vm-ip-tag {
  font-family: monospace;
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(16, 185, 129, 0.08);
  color: var(--accent-green);
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.1);
}
.vm-ip-empty {
  font-size: 11px;
  color: var(--text-muted);
}
.vm-ip-inline {
  font-family: monospace;
  font-size: 12px;
  color: var(--accent-green);
  margin-right: 8px;
}

.vm-card-actions {
  display: flex;
  gap: 4px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-input);
  animation: fadeInUp 0.15s ease-out;
}

/* 卡片运行/停止态细调 */
.vm-card-running .vm-card-accent { background: var(--accent-green); }
.vm-card-stopped .vm-card-accent { background: var(--text-muted); }
.vm-card-paused .vm-card-accent { background: var(--accent-amber); }
.vm-card-running .vm-card-icon { background: rgba(16, 185, 129, 0.1); }
.vm-card-paused .vm-card-icon { background: rgba(212, 165, 116, 0.1); }

/* ============================================
   View Toggle - 视图切换按钮
   ============================================ */
.view-toggle {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}
.view-toggle-btn {
  padding: 6px 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
}
.view-toggle-btn:hover {
  color: var(--text-secondary);
  background: var(--bg-card-hover);
}
.view-toggle-btn.active {
  color: var(--accent-blue);
  background: var(--meta-bg);
}

/* ============================================
   Input Base - 统一输入框样式
   ============================================ */
.input-base {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.input-base:focus {
  border-color: var(--accent-blue);
}
.input-base::placeholder {
  color: var(--text-muted);
}

/* ============================================
   Form Styles - 表单样式
   ============================================ */
.form-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}
.form-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================
   Browse Panel - 文件浏览器弹出面板
   ============================================ */
.btn-browse {
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: border-color 0.2s;
}
.btn-browse:hover { border-color: var(--accent-blue); color: var(--accent-blue); }

.browse-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  margin-top: 4px;
  overflow: hidden;
}

.browse-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-input);
}
.browse-scope-switch {
  display: flex;
  gap: 2px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}
.browse-scope-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.browse-scope-btn.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}
.browse-scope-btn:hover:not(.active) {
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.browse-nav-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 14px;
}
.browse-nav-btn:hover { color: var(--accent-blue); }
.browse-path {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.browse-quick {
  display: flex;
  gap: 4px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}
.browse-quick-btn {
  padding: 2px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s;
}
.browse-quick-btn:hover { border-color: var(--accent-blue); color: var(--accent-blue); }

.browse-list {
  height: 260px;
  overflow-y: auto;
  padding: 4px;
}
.browse-loading, .browse-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 13px;
}
.browse-loading i { animation: spin 1s linear infinite; margin-right: 8px; }

.browse-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: background 0.1s;
}
.browse-item:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}
.browse-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.browse-item-size {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================
   Detail Modal Extensions
   ============================================ */
.detail-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
}
.detail-loading i { animation: spin 1s linear infinite; margin-right: 8px; font-size: 20px; }
.detail-empty { text-align: center; padding: 40px; color: var(--text-muted); }

.metrics-badge {
  margin-left: 8px;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--meta-bg);
  color: var(--accent-cyan);
  font-weight: normal;
}

.pct-bar {
  width: 80px;
  height: 6px;
  background: var(--progress-track);
  border-radius: 3px;
  margin-left: 8px;
  display: inline-block;
  vertical-align: middle;
}
.pct-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}
.detail-sub {
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Network tags */
.net-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.net-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-input);
  border-radius: 6px;
  font-size: 13px;
  font-family: monospace;
}
.ip-tag span { color: var(--accent-green); }
.mac-tag span { color: var(--accent-amber); }
.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  transition: color 0.15s;
}
.copy-btn:hover { color: var(--accent-blue); }
.net-empty {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Detail list (NICs, Disks, Snapshots) */
.detail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: 6px;
  border: 1px solid var(--border-color);
  transition: border-color 0.15s;
}
.detail-list-item:hover {
  border-color: var(--accent-cyan);
}
.detail-list-item > i:first-child {
  font-size: 15px;
  flex-shrink: 0;
}
.detail-list-info {
  flex: 1;
  min-width: 0;
}
.detail-list-title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-list-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: monospace;
}

/* Detail inline form (add NIC/Disk) */
.detail-inline-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.detail-inline-form .input-base {
  flex: 1;
  min-width: 100px;
}

/* ri-spin utility (Remix Icon) */
.ri-spin {
  animation: spin 1s linear infinite;
  margin-right: 6px;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   VM Config Modal
   ============================================ */
.config-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}
.config-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.config-tab:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}
.config-tab.active {
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.08);
}
.config-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.12);
  border-radius: var(--radius-sm);
}
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.config-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.config-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.config-field-hint {
  font-size: 10px;
  color: var(--text-muted);
}
.config-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}
.config-toggle.active {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--accent-green);
}
.config-toggle-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background var(--transition-fast);
}
.config-toggle.active .config-toggle-dot {
  background: var(--accent-green);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.3);
}
.config-inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.config-table-wrap {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* XML Editor */
.xml-editor-wrap {
  position: relative;
  height: 450px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #0d0f14;
}
.xml-highlight {
  position: absolute;
  inset: 0;
  padding: 12px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: auto;
  pointer-events: none;
  z-index: 1;
}
.xml-editor-input {
  position: absolute;
  inset: 0;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: transparent;
  caret-color: #d4a574;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: auto;
  z-index: 2;
  -webkit-text-fill-color: transparent;
}
.xml-editor-input::selection {
  background: rgba(59, 130, 246, 0.2);
  -webkit-text-fill-color: var(--text-primary);
}
.xml-tag { color: #56b6c2; }
.xml-attr { color: #d4a574; }
.xml-attr-val { color: #98c379; }
.xml-comment { color: #5c6370; font-style: italic; }

/* ---- ISO 下载面板 ---- */
.iso-download-panel {
  margin-top: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
}
.iso-mirror-item {
  display: flex;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}
.iso-mirror-item:last-child { border-bottom: none; }
.iso-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}
.iso-dl-btn:hover:not(:disabled) {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}
.iso-dl-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.iso-dl-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
}
.iso-dl-link:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}
.iso-dl-progress {
  padding: 8px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
