/* ========================================
   DNS 系统 - 运营级样式表 v3.0
   左侧导航栏 + 现代化后台布局
   ======================================== */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Open Sans', 'Helvetica Neue', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

html, body {
  scroll-behavior: smooth;
}

article, aside, details, figcaption, figure,
footer, header, hgroup, main, menu, nav, section,
summary {
  display: block;
}

a {
  background-color: transparent;
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover, a:focus {
  color: var(--accent-purple);
  text-decoration: none;
}

a:active, a:hover {
  outline: 0;
}

a:focus {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

b, strong {
  font-weight: 700;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 0.5em;
  line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.875rem; }
h6 { font-size: 0.75rem; }

img {
  border: 0;
  max-width: 100%;
  height: auto;
  display: block;
}

svg:not(:root) {
  overflow: hidden;
}

hr {
  box-sizing: content-box;
  height: 0;
  border: 0;
  border-top: 1px solid var(--border-glass);
  margin: 1em 0;
}

pre {
  overflow: auto;
  font-family: monospace, monospace;
  font-size: 1em;
  background: var(--bg-tertiary);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 1em;
}

button, input, optgroup, select, textarea {
  color: inherit;
  font: inherit;
  margin: 0;
}

button {
  overflow: visible;
  cursor: pointer;
}

button, select {
  text-transform: none;
}

button::-moz-focus-inner,
input::-moz-focus-inner {
  border: 0;
  padding: 0;
}

input {
  line-height: normal;
}

input[type="checkbox"], input[type="radio"] {
  box-sizing: border-box;
  padding: 0;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ========================================
   CSS Variables & Design Tokens
   ======================================== */

:root {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.98);
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-glass-hover: rgba(255, 255, 255, 0.9);
  --bg-overlay: rgba(0, 0, 0, 0.5);

  --sidebar-bg: #ffffff;
  --sidebar-bg-hover: rgba(99, 102, 241, 0.08);
  --sidebar-bg-active: rgba(99, 102, 241, 0.12);
  --sidebar-border: rgba(0, 0, 0, 0.08);
  --sidebar-text: rgba(0, 0, 0, 0.65);
  --sidebar-text-hover: rgba(0, 0, 0, 0.95);
  --sidebar-text-active: #4f46e5;
  --sidebar-section-title: rgba(0, 0, 0, 0.4);
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --sidebar-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --topbar-height: 56px;
  --topbar-bg: rgba(255, 255, 255, 0.92);
  --topbar-border: rgba(0, 0, 0, 0.06);

  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-yellow: #fbbf24;
  --accent-indigo: #6366f1;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-tertiary: #64748b;
  --text-muted: #94a3b8;
  --text-disabled: #cbd5e1;

  --border-glass: rgba(0, 0, 0, 0.06);
  --border-glow: rgba(59, 130, 246, 0.3);
  --border-focus: rgba(59, 130, 246, 0.4);
  --shadow-glass: 0 4px 24px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);

  --gradient-primary: linear-gradient(135deg, #6366f1, #818cf8);
  --gradient-secondary: linear-gradient(135deg, #2563eb, #3b82f6);
  --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
  --gradient-warning: linear-gradient(135deg, #f59e0b, #f97316);
  --gradient-danger: linear-gradient(135deg, #ef4444, #dc2626);
  --gradient-purple: linear-gradient(135deg, #8b5cf6, #7c3aed);
  --gradient-cyan: linear-gradient(135deg, #06b6d4, #22d3ee);
  --gradient-pink: linear-gradient(135deg, #ec4899, #d946ef);

  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 20px;
  --spacing-2xl: 24px;
  --spacing-3xl: 32px;
  --spacing-4xl: 48px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --text-xs: 10px;
  --text-sm: 12px;
  --text-base: 12px;
  --text-lg: 14px;
  --text-xl: 16px;
  --text-2xl: 18px;
  --text-3xl: 20px;
  --text-4xl: 24px;

  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-sidebar: 1040;
  --z-topbar: 1050;
  --z-overlay: 1060;
  --z-popover: 1070;
  --z-tooltip: 1080;
  --z-max: 9999;
}

[data-theme="dark"] {
  --bg-primary: #0a0f1a;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-card: rgba(17, 24, 39, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --bg-glass-hover: rgba(255, 255, 255, 0.1);
  --bg-overlay: rgba(0, 0, 0, 0.7);

  --sidebar-bg: #111827;
  --sidebar-bg-hover: rgba(255, 255, 255, 0.06);
  --sidebar-bg-active: rgba(99, 102, 241, 0.25);
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-text: rgba(255, 255, 255, 0.7);
  --sidebar-text-hover: rgba(255, 255, 255, 0.95);
  --sidebar-text-active: #818cf8;

  --topbar-bg: rgba(15, 23, 42, 0.92);
  --topbar-border: rgba(255, 255, 255, 0.06);

  --text-primary: #f9fafb;
  --text-secondary: #e5e7eb;
  --text-tertiary: #9ca3af;
  --text-muted: #6b7280;
  --text-disabled: #4b5563;

  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(59, 130, 246, 0.4);
  --shadow-glass: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.4);
}

/* ========================================
   Base Styles
   ======================================== */

body {
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Sidebar Navigation
   ======================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  transition: width var(--sidebar-transition), transform var(--sidebar-transition);
  overflow: hidden;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.03) 0%, transparent 40%);
  pointer-events: none;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  flex: 1;
  min-width: 0;
  transition: var(--transition-fast);
}

.sidebar-logo:hover {
  opacity: 0.9;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo-icon svg {
  width: 100%;
  height: 100%;
}

.sidebar-logo-text {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar.collapsed .sidebar-logo-text {
  opacity: 0;
  width: 0;
}

.sidebar-collapse-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
  border-radius: var(--radius-md);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3);
}

.sidebar-collapse-btn:hover {
  background: linear-gradient(135deg, #9333ea 0%, #2563eb 100%);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}

.sidebar.collapsed .sidebar-collapse-btn {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-collapse-btn svg {
  width: 16px;
  height: 16px;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  position: relative;
  z-index: 1;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-nav-section {
  margin-bottom: 8px;
}

.sidebar-nav-section-title {
  padding: 8px 20px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-section-title);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-nav-section-title {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
}

.sidebar-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav-item {
  margin: 1px 8px;
  list-style: none;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-nav-link:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-hover);
}

.sidebar-nav-link.active {
  background: var(--sidebar-bg-active);
  color: var(--sidebar-text-active);
}

.sidebar-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--sidebar-text-active);
  border-radius: 0 3px 3px 0;
}

.sidebar-nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-nav-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-nav-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .sidebar-nav-text {
  opacity: 0;
  width: 0;
}

.sidebar.collapsed .sidebar-nav-link {
  justify-content: center;
  padding: 10px;
  gap: 0;
}

/* Sidebar Submenu */
.sidebar-submenu-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.sidebar-submenu-arrow svg {
  width: 14px;
  height: 14px;
}

.sidebar-submenu.active .sidebar-submenu-arrow {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-submenu-arrow {
  opacity: 0;
  width: 0;
}

.sidebar-submenu-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0;
}

.sidebar-submenu.active .sidebar-submenu-items {
  max-height: 500px;
}

.sidebar-submenu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 44px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 400;
  transition: var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-submenu-link:hover {
  color: var(--sidebar-text-hover);
  background: var(--sidebar-bg-hover);
}

.sidebar-submenu-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.sidebar-submenu-link:hover .sidebar-submenu-dot {
  background: var(--sidebar-text-active);
}

.sidebar.collapsed .sidebar-submenu-items {
  display: none;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

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

.sidebar-user:hover {
  background: var(--sidebar-bg-hover);
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-user-avatar svg {
  width: 100%;
  height: 100%;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

.sidebar.collapsed .sidebar-user-info {
  opacity: 0;
  width: 0;
}

.sidebar.collapsed .sidebar-user {
  justify-content: center;
  padding: 8px 0;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-sidebar) - 1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

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

/* ========================================
   Main Wrapper & Topbar
   ======================================== */

.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--sidebar-transition);
}

.sidebar.collapsed ~ .main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
}

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: var(--z-topbar);
  flex-shrink: 0;
}

[data-theme="dark"] .topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
}

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

.topbar-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  position: relative;
  z-index: 1;
}

.topbar-menu-btn:hover {
  background: var(--bg-glass);
}

.topbar-menu-btn svg {
  pointer-events: none;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

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

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-md);
  position: relative;
  transition: var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--bg-glass);
}

.theme-icon-sun,
.theme-icon-moon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

.theme-icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

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

[data-theme="light"] .theme-icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

/* Topbar Action Buttons */
.topbar-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.topbar-action-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--accent-blue);
  text-decoration: none;
}

.topbar-action-primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
}

.topbar-action-primary:hover {
  opacity: 0.9;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.topbar-action-danger {
  color: var(--accent-red);
}

.topbar-action-danger:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* ========================================
   Main Content Area
   ======================================== */

main {
  flex: 1;
  padding: 24px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

/* ========================================
   Page Header - Compact Gradient Style
   ======================================== */

.page-header-card {
    position: relative;
    background: linear-gradient(90deg, #f3e8ff 0%, #e0f2fe 50%, #f0fdf4 100%);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.page-header-card-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.page-header-card-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 0% 50%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 100% 50%, rgba(34, 197, 94, 0.08) 0%, transparent 50%);
}

.page-header-card-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    z-index: 1;
}

.page-header-card-icon {
    flex-shrink: 0;
}

.page-header-icon-bg {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.25);
}

.page-header-icon-bg svg {
    width: 20px;
    height: 20px;
}

.page-header-card-text {
    flex: 1;
}

.page-header-card-text h1 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0;
    letter-spacing: -0.2px;
}

.page-header-card-text p {
    display: none;
}

.page-header-card-actions {
    flex-shrink: 0;
}

.btn-glow {
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%) !important;
    color: white !important;
    font-weight: 500;
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.25);
    transition: all 0.2s ease;
    font-size: 12px;
}

.btn-glow:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
}

/* Legacy Page Header (for backward compatibility) */
.page-header {
  margin-bottom: 24px;
}

.page-header-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-header-left {
  flex: 1;
  min-width: 0;
}

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

.page-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-indigo);
  flex-shrink: 0;
}

.page-header-left p {
  font-size: 14px;
  color: var(--text-tertiary);
  margin: 0;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

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

.page-header p {
  font-size: 14px;
  color: var(--text-tertiary);
  margin: 0;
}

/* ========================================
   Cards
   ======================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-glass);
}

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

/* ========================================
   Stats Grid
   ======================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

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

.stat-card h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-card-info .value { color: var(--accent-blue); }
.stat-card-success .value { color: var(--accent-green); }
.stat-card-warning .value { color: var(--accent-orange); }
.stat-card-danger .value { color: var(--accent-red); }

.stat-card.warning { border-left: 3px solid var(--accent-orange); }
.stat-card.success { border-left: 3px solid var(--accent-green); }
.stat-card.danger { border-left: 3px solid var(--accent-red); }

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  color: white;
  text-decoration: none;
}

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

.btn-secondary:hover {
  background: var(--bg-glass-hover);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.04);
}

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

.btn-danger:hover {
  background: var(--accent-red);
  color: white;
}

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

.btn-xs {
  padding: 4px 10px;
  font-size: 11px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

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

/* ========================================
   Forms
   ======================================== */

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

.input-with-icon {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.form-control,
.domain-filter,
.form-select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  outline: none;
}

.form-control:focus,
.domain-filter:focus,
.form-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-with-icon .form-control,
.input-with-icon .domain-filter {
  padding-left: 34px;
}

.form-group {
  margin-bottom: 16px;
}

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

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

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

.form-group-small {
  margin-bottom: 0;
}

/* ========================================
   Tables
   ======================================== */

.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

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

.domain-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-glass);
  white-space: nowrap;
  background: var(--bg-glass);
}

.domain-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-glass);
  font-size: 13px;
  color: var(--text-secondary);
}

.domain-table tbody tr {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.domain-table tbody tr:hover {
  background: linear-gradient(135deg, #faf5ff 0%, #ffffff 50%, #f5f3ff 100%);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.08);
}

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

.text-center {
  text-align: center;
}

.domain-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.domain-icon {
  width: 28px;
  height: 28px;
  background: rgba(59, 130, 246, 0.08);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
  flex-shrink: 0;
}

/* ========================================
   通用列表悬停效果
   ======================================== */
.list-item-hover,
.domain-table tbody tr,
.notification-item,
.purchase-item,
.domain-item {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.list-item-hover::before,
.domain-table tbody tr::before,
.notification-item::before,
.purchase-item::before,
.domain-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #7c3aed 0%, #a78bfa 100%);
  transform: scaleY(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.list-item-hover:hover,
.domain-table tbody tr:hover,
.notification-item:hover,
.purchase-item:hover,
.domain-item:hover {
  background: linear-gradient(135deg, #faf5ff 0%, #ffffff 50%, #f5f3ff 100%);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.08);
}

.list-item-hover:hover::before,
.domain-table tbody tr:hover::before,
.notification-item:hover::before,
.purchase-item:hover::before,
.domain-item:hover::before {
  transform: scaleY(1);
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-icon {
  color: var(--text-muted);
  margin-bottom: 12px;
  opacity: 0.4;
}

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

.empty-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.text-link {
  color: var(--accent-blue);
}

/* ========================================
   Badges & Tags
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-green { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }
.badge-blue { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--accent-orange); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.badge-critical { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); }
.badge-orange { background: rgba(245, 158, 11, 0.1); color: var(--accent-orange); }

[data-theme="dark"] .badge-green { background: rgba(16, 185, 129, 0.2); }
[data-theme="dark"] .badge-blue { background: rgba(59, 130, 246, 0.2); }
[data-theme="dark"] .badge-warning { background: rgba(245, 158, 11, 0.2); }
[data-theme="dark"] .badge-success { background: rgba(16, 185, 129, 0.2); }
[data-theme="dark"] .badge-danger { background: rgba(239, 68, 68, 0.2); }
[data-theme="dark"] .badge-info { background: rgba(59, 130, 246, 0.2); }
[data-theme="dark"] .badge-critical { background: rgba(239, 68, 68, 0.2); }
[data-theme="dark"] .badge-orange { background: rgba(245, 158, 11, 0.2); }

[data-theme="dark"] .page-header-card {
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.15) 0%, rgba(59, 130, 246, 0.12) 50%, rgba(16, 185, 129, 0.1) 100%);
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .page-header-card-text h1 {
    color: #f3f4f6;
}
[data-theme="dark"] .page-header-card-pattern {
    background-image:
        radial-gradient(circle at 0% 50%, rgba(168, 85, 247, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 100% 50%, rgba(34, 197, 94, 0.12) 0%, transparent 50%);
}
[data-theme="dark"] .page-header-icon-bg {
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
}

[data-theme="dark"] .card,
[data-theme="dark"] .record-card,
[data-theme="dark"] .domain-item,
[data-theme="dark"] .notification-item,
[data-theme="dark"] .purchase-domain-card {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .record-card:hover,
[data-theme="dark"] .domain-item:hover,
[data-theme="dark"] .notification-item:hover,
[data-theme="dark"] .purchase-domain-card:hover {
    border-left-color: var(--accent-purple);
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.08) 0%, var(--bg-card) 30%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .recharge-balance-badge {
    background: rgba(99, 102, 241, 0.15);
    color: #c4b5fd;
}

[data-theme="dark"] .record-subdomain,
[data-theme="dark"] .domain-name-highlight {
    color: #a78bfa !important;
}

[data-theme="dark"] .record-domain,
[data-theme="dark"] .domain-suffix {
    color: #7c3aed !important;
}

[data-theme="dark"] .record-meta-item {
    color: #9ca3af;
}

[data-theme="dark"] .empty-state {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .empty-state h3 {
    color: #e5e7eb;
}

[data-theme="dark"] .empty-state p {
    color: #9ca3af;
}

/* ========================================
   Pagination
   ======================================== */

.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 0 4px;
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-stats {
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

.pagination-stats strong {
  color: var(--accent-blue);
}

.pagination-page-info {
  color: var(--text-muted);
  margin-left: 8px;
}

.pagination {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.pagination-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  text-decoration: none;
  transition: var(--transition-fast);
}

.pagination-item:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  text-decoration: none;
}

.pagination-item.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
}

/* ========================================
   Footer
   ======================================== */

.footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 0 20px 16px;
}

.footer-inner {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.04) 0%, rgba(139, 92, 246, 0.06) 50%, rgba(168, 85, 247, 0.03) 100%);
  border: 1px solid var(--border-glass);
  padding: 14px 24px;
}

[data-theme="dark"] .footer-inner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.1) 50%, rgba(168, 85, 247, 0.06) 100%);
  border-color: rgba(255, 255, 255, 0.06);
}

.footer-bg {
  display: none;
}

.footer-bg-circle {
  display: none;
}

.footer-bg-circle-1 {
  display: none;
}

.footer-bg-circle-2 {
  display: none;
}

.footer-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.footer-left p,
.footer-content p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  font-weight: 500;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-link {
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-link:hover {
  color: var(--accent-purple);
}

@media (max-width: 480px) {
  .footer {
    padding: 0 12px 12px;
  }
  .footer-inner {
    padding: 12px 16px;
    border-radius: 12px;
  }
  .footer-content {
    justify-content: center;
    text-align: center;
  }
}

/* ========================================
   Toast Messages
   ======================================== */

.toast-message {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  z-index: var(--z-max);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.toast-message.show {
  transform: translateX(0);
}

.toast-info {
  background: var(--bg-card);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.toast-success {
  background: var(--bg-card);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.toast-warning {
  background: var(--bg-card);
  color: var(--accent-orange);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.toast-error {
  background: var(--bg-card);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ========================================
   Utility Classes
   ======================================== */

.inline-icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
  flex-shrink: 0;
}

.link {
  color: var(--accent-blue);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

/* ========================================
   Animations
   ======================================== */

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

/* ========================================
   Responsive Design
   ======================================== */

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

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    z-index: calc(var(--z-topbar) + 10);
  }

  .sidebar.collapsed {
    width: var(--sidebar-width) !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .topbar-menu-btn {
    display: flex;
  }

  .sidebar-overlay.active {
    display: block;
    z-index: calc(var(--z-topbar) + 5);
  }
}

@media (max-width: 768px) {
  main {
    padding: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: auto;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

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

  .page-header h1 {
    font-size: 18px;
  }

  .page-header-content {
    flex-direction: column;
    gap: 12px;
  }

  .page-header-actions {
    width: 100%;
  }

  .page-header-icon {
    width: 30px;
    height: 30px;
  }

  /* Page Header Card Mobile - Same as desktop */
  .page-header-card {
    border-radius: 12px;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .page-header-card-content {
    flex-direction: row;
    text-align: left;
    padding: 12px 16px;
    gap: 12px;
  }

  .page-header-card-icon {
    flex-shrink: 0;
  }

  .page-header-icon-bg {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .page-header-icon-bg svg {
    width: 20px;
    height: 20px;
  }

  .page-header-card-text {
    flex: 1;
    min-width: 0;
  }

  .page-header-card-text h1 {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-header-card-actions {
    width: auto;
  }

  .page-header-card-actions .btn-glow {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    background: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.25);
    border: none;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .page-header-card-actions .btn-glow svg {
    width: 14px;
    height: 14px;
  }

  .page-header-card-actions .btn-glow:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
  }

  /* Profile Page Mobile Fixes */
  .profile-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .profile-avatar-card {
    margin-top: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .profile-avatar-cover {
    height: 60px;
    width: 100%;
  }

  .profile-avatar-body {
    margin-top: -30px;
    padding: 0 12px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .profile-avatar-ring {
    width: 60px;
    height: 60px;
    margin-bottom: 8px;
  }

  .profile-avatar-email {
    font-size: 13px;
    word-break: break-all;
    overflow-wrap: break-word;
  }

  .profile-quick-stats {
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .profile-quick-stat {
    padding: 10px 12px;
    min-width: 0;
  }

  .profile-nav {
    padding: 6px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .profile-nav-item {
    padding: 10px 12px;
    font-size: 13px;
  }

  .search-filter {
    flex-direction: column;
  }

  .input-with-icon {
    width: 100%;
  }

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

  .topbar {
    padding: 0 12px;
  }

  .topbar-action-btn span {
    display: none;
  }

  .topbar-action-btn {
    padding: 7px 10px;
  }
}

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

  .stat-card {
    padding: 12px;
  }

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

  main {
    padding: 12px;
  }

  .card {
    padding: 14px;
  }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  .sidebar,
  .topbar,
  .sidebar-overlay {
    display: none !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
  }

  main {
    padding: 0;
  }
}
