/* ==========================================================================
   GOGO 智能授权控制台 - 现代人机美学视觉系统 (Enterprise Human Aesthetic)
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* 主题色系 - 科技深蓝与电光紫 */
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: #EEF2FF;
  --primary-glow: rgba(79, 70, 229, 0.25);

  /* 状态颜色 */
  --emerald: #10B981;
  --emerald-bg: #ECFDF5;
  --emerald-border: #A7F3D0;
  --emerald-text: #065F46;

  --amber: #F59E0B;
  --amber-bg: #FFFBEB;
  --amber-border: #FDE68A;
  --amber-text: #92400E;

  --rose: #EF4444;
  --rose-bg: #FEF2F2;
  --rose-border: #FECACA;
  --rose-text: #991B1B;

  /* 中性背景色与边界 */
  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;
  --slate-950: #0B1120;

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

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.35);

  --sidebar-width: 256px;
  --header-height: 68px;
}

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

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--slate-700);
  background-color: var(--slate-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ==========================================================================
   登录界面 (Modern Split Screen + Ambient Backdrop)
   ========================================================================== */

.login-wrapper {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: var(--slate-950);
  padding: 24px;
  overflow-y: auto;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.25) 0%, transparent 40%),
                    radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.2) 0%, transparent 45%),
                    url('/admin/assets/login-bg.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.65;
  filter: contrast(1.1) brightness(0.9);
  pointer-events: none;
}

.login-container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  max-width: 980px;
  width: 100%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(79, 70, 229, 0.2);
}

.login-brand-panel {
  padding: 48px 40px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-brand-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 36px;
}

.brand-avatar-glow {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.brand-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #FFFFFF;
}

.brand-text h2 span {
  color: #818CF8;
  font-weight: 300;
}

.brand-text p {
  font-size: 13px;
  color: var(--slate-400);
  margin-top: 3px;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 20px 0;
}

.feature-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(79, 70, 229, 0.18);
  color: #A5B4FC;
  border: 1px solid rgba(129, 140, 248, 0.3);
  flex-shrink: 0;
}

.feature-item strong {
  display: block;
  font-size: 14px;
  color: #F1F5F9;
  font-weight: 600;
}

.feature-item p {
  font-size: 12px;
  color: var(--slate-400);
  margin-top: 3px;
}

.login-footer-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--slate-400);
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.login-form-panel {
  padding: 48px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
}

.login-card {
  width: 100%;
  max-width: 360px;
}

.login-header {
  margin-bottom: 32px;
}

.login-header h3 {
  font-size: 22px;
  font-weight: 700;
  color: #FFFFFF;
}

.login-header p {
  font-size: 13px;
  color: var(--slate-400);
  margin-top: 6px;
}

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

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-300);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--slate-400);
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  height: 48px;
  padding: 0 44px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: #FFFFFF;
  font-size: 14px;
  transition: all 0.2s ease;
}

.input-with-icon input:focus {
  outline: none;
  border-color: #818CF8;
  background: rgba(30, 41, 59, 0.95);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.input-with-icon input::placeholder {
  color: var(--slate-500);
}

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--slate-400);
  cursor: pointer;
  padding: 6px;
  display: grid;
  place-items: center;
  border-radius: 4px;
}

.toggle-password:hover {
  color: #FFFFFF;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 600;
  color: #FFFFFF;
  background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338CA 0%, #4F46E5 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

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

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

.btn-block {
  width: 100%;
}

.btn-glow {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.login-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  font-size: 11px;
  color: var(--slate-400);
}

.login-notice svg {
  flex-shrink: 0;
  color: var(--slate-400);
}

/* ==========================================================================
   控制台后台布局 (Sidebar + Main Wrapper)
   ========================================================================== */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* 左侧侧边栏 */
.sidebar {
  width: var(--sidebar-width);
  background: #0B1120;
  border-right: 1px solid #1E293B;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  padding: 20px 16px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-avatar {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.brand-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.3px;
}

.brand-subtitle {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: #818CF8;
  margin-top: 2px;
}

/* 隐藏底层原生 select 保证 DOM API 与原生测试 100% 正常运行 */
.hidden-native-select {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  clip: rect(0 0 0 0) !important;
}

/* 现代化通用 SVG 动画下拉菜单系统 */
.svg-dropdown {
  position: relative;
  width: 100%;
}

/* 侧边栏应用下拉容器 */
.sidebar-app-selector {
  margin: 18px 0;
  position: relative;
}

.selector-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--slate-400);
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* 侧边栏应用下拉触发按钮 */
.svg-dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  text-align: left;
}

.svg-dropdown-trigger:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.svg-dropdown.open .svg-dropdown-trigger {
  background: rgba(15, 23, 42, 0.98);
  border-color: #818CF8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.trigger-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.app-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  display: grid;
  place-items: center;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.svg-dropdown-trigger:hover .app-icon-badge {
  transform: translateY(-1px) rotate(-4deg) scale(1.05);
}

.trigger-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.selected-title {
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-subtitle {
  font-size: 10px;
  font-family: var(--font-mono);
  color: #818CF8;
  margin-top: 1px;
}

/* 核心 SVG 动画箭头 (Animated Chevron) */
.chevron-box {
  display: grid;
  place-items: center;
  padding: 4px;
  color: var(--slate-400);
  flex-shrink: 0;
}

.svg-animated-chevron {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.2s ease;
}

.svg-dropdown-trigger:hover .svg-animated-chevron {
  color: #FFFFFF;
}

.svg-dropdown.open .svg-animated-chevron {
  transform: rotate(180deg) scale(1.15);
  stroke: #818CF8;
}

/* 下拉菜单面板主体 (Animated Dropdown Menu) */
.svg-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 150;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(79, 70, 229, 0.25);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.22s;
}

.svg-dropdown.open .svg-dropdown-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--slate-400);
}

.menu-count-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #A5B4FC;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgba(129, 140, 248, 0.3);
}

.menu-items-scroll {
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
}

/* 下拉菜单项 (Interactive Option Item) */
.app-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #E2E8F0;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.app-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.app-menu-item.active {
  background: rgba(79, 70, 229, 0.25);
  color: #FFFFFF;
  border: 1px solid rgba(129, 140, 248, 0.4);
}

.item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.item-badge-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  color: #CBD5E1;
  font-size: 11px;
  font-weight: 700;
}

.app-menu-item.active .item-badge-icon {
  background: var(--primary);
  color: #FFFFFF;
}

.item-text {
  display: flex;
  flex-direction: column;
}

.item-name {
  font-size: 13px;
  font-weight: 600;
}

.item-id {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--slate-400);
}

.app-menu-item.active .item-id {
  color: #A5B4FC;
}

/* 核心 SVG 对勾绘制动画 (Animated Checkmark Drawing) */
.svg-animated-check {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.svg-check-path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  transition: stroke-dashoffset 0.35s cubic-bezier(0.65, 0, 0.45, 1);
}

.app-menu-item.active .svg-animated-check,
.status-option-item.active .svg-animated-check,
.tier-option-item.active .svg-animated-check {
  opacity: 1;
  transform: scale(1);
}

.app-menu-item.active .svg-check-path,
.status-option-item.active .svg-check-path,
.tier-option-item.active .svg-check-path {
  stroke-dashoffset: 0;
}

/* ==========================================================================
   设备状态自定义 SVG 动画下拉菜单 (Device Status Dropdown)
   ========================================================================== */

.status-dropdown {
  width: auto;
  min-width: 170px;
}

.status-trigger {
  height: 38px;
  padding: 0 12px;
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.status-trigger:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
}

.status-dropdown.open .status-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: #FFFFFF;
}

.status-dropdown.open .svg-animated-chevron {
  transform: rotate(180deg) scale(1.15);
  stroke: var(--primary);
}

.trigger-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
}

.status-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  width: 270px;
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 100;
}

.status-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.status-option-item:hover {
  background: var(--slate-50);
}

.status-option-item.active {
  background: #EEF2FF;
}

.status-option-item strong {
  display: block;
  font-size: 13px;
  color: var(--slate-800);
}

.status-option-item small {
  display: block;
  font-size: 11px;
  color: var(--slate-400);
  margin-top: 2px;
}

.opt-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 多彩呼吸指示灯 */
.pulse-dot.green {
  background-color: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}
.pulse-dot.green::after {
  background-color: rgba(16, 185, 129, 0.4);
}

.pulse-dot.red {
  background-color: var(--rose);
  box-shadow: 0 0 8px var(--rose);
}
.pulse-dot.red::after {
  background-color: rgba(239, 68, 68, 0.4);
}

.pulse-dot.grey {
  background-color: var(--slate-400);
  box-shadow: 0 0 6px var(--slate-400);
}
.pulse-dot.grey::after {
  display: none;
}

.pulse-dot.blue {
  background-color: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}
.pulse-dot.blue::after {
  background-color: rgba(79, 70, 229, 0.4);
}

/* ==========================================================================
   发卡套餐模版推荐下拉菜单 (Tier Preset Dropdown)
   ========================================================================== */
.tier-preset-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--slate-50);
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.tier-preset-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  flex-shrink: 0;
}

.tier-preset-label svg {
  color: var(--primary);
}

.tier-dropdown {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.tier-trigger {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.tier-trigger:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
}

.tier-dropdown.open .tier-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: #FFFFFF;
}

.tier-dropdown.open .svg-animated-chevron {
  transform: rotate(180deg) scale(1.15);
  stroke: var(--primary);
}

.tier-trigger-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.tier-icon-badge {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 14px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  flex-shrink: 0;
}

.tier-icon-badge.blue { background: rgba(59, 130, 246, 0.1); }
.tier-icon-badge.emerald { background: rgba(16, 185, 129, 0.1); }
.tier-icon-badge.indigo { background: rgba(99, 102, 241, 0.1); }
.tier-icon-badge.amber { background: rgba(245, 158, 11, 0.1); }
.tier-icon-badge.purple { background: rgba(168, 85, 247, 0.1); }

.tier-trigger-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
}

.tier-trigger-text strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tier-trigger-text small {
  font-size: 11px;
  color: var(--slate-400);
}

.tier-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 120;
}

.tier-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.tier-option-item:hover {
  background: var(--slate-50);
}

.tier-option-item.active {
  background: #EEF2FF;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.tier-opt-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tier-opt-left strong {
  display: block;
  font-size: 13px;
  color: var(--slate-800);
}

.tier-opt-left small {
  display: block;
  font-size: 11px;
  color: var(--slate-400);
  margin-top: 1px;
}

/* ==========================================================================
   卡密列表数据导出与快捷操作下拉菜单 (Card Actions Dropdown)
   ========================================================================== */
.card-actions-dropdown {
  width: auto;
  position: relative;
}

.card-actions-trigger {
  height: 38px;
  padding: 0 12px;
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-700);
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.card-actions-trigger:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
  color: var(--primary);
}

.card-actions-dropdown.open .card-actions-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  color: var(--primary);
}

.card-actions-dropdown.open .svg-animated-chevron {
  transform: rotate(180deg) scale(1.15);
  stroke: var(--primary);
}

.card-actions-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  width: 260px;
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 100;
}

.card-action-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  color: var(--slate-700);
}

.card-action-item:hover {
  background: #EEF2FF;
  color: var(--primary);
}

.card-action-item svg {
  color: var(--slate-400);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.card-action-item:hover svg {
  color: var(--primary);
}

.card-action-item strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: inherit;
}

.card-action-item small {
  display: block;
  font-size: 11px;
  color: var(--slate-400);
  margin-top: 1px;
}

/* ==========================================================================
   Header 管理员操作员专属下拉菜单 (User Profile Dropdown)
   ========================================================================== */

.user-profile-dropdown {
  width: auto;
  position: relative;
}

.user-profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px 0 6px;
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid var(--slate-200);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-profile-trigger:hover {
  background: #EEF2FF;
  border-color: rgba(99, 102, 241, 0.3);
}

.user-profile-dropdown.open .user-profile-trigger {
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.user-profile-dropdown.open .svg-animated-chevron {
  transform: rotate(180deg) scale(1.15);
  stroke: var(--primary);
}

.user-avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.4);
}

.user-avatar-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-name-text strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-800);
  line-height: 1.1;
}

.user-name-text small {
  font-size: 9px;
  font-weight: 600;
  color: var(--emerald-text);
  letter-spacing: 0.5px;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: 240px;
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 100;
}

.user-menu-header {
  padding: 10px 12px;
  background: var(--slate-50);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.user-menu-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-800);
}

.user-menu-desc {
  font-size: 11px;
  color: var(--slate-400);
  margin-top: 3px;
}

.user-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-700);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-menu-item:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

.user-menu-item.text-danger {
  color: var(--rose-text);
}

.user-menu-item.text-danger:hover {
  background: var(--rose-bg);
}

.user-menu-divider {
  height: 1px;
  background: var(--slate-100);
  margin: 4px 0;
}

/* 旋转动画 SVG 图标 */
.svg-spin-icon {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-icon:hover .svg-spin-icon {
  transform: rotate(45deg);
}

.btn-icon.spinning .svg-spin-icon {
  animation: spinSmooth 0.75s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes spinSmooth {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 导航分组与菜单项 */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--slate-500);
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--slate-400);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-item svg {
  color: var(--slate-400);
  transition: color 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
}

.nav-item:hover svg {
  color: #818CF8;
}

.nav-item.active {
  background: rgba(79, 70, 229, 0.2);
  color: #FFFFFF;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 0 12px rgba(79, 70, 229, 0.15);
}

.nav-item.active svg {
  color: #818CF8;
}

/* 侧边栏底部状态卡片 */
.sidebar-status-card {
  margin-top: auto;
  padding: 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #A7F3D0;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.4);
  animation: pulseAnimation 2s infinite ease-out;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.status-sub {
  font-size: 11px;
  color: var(--slate-400);
  margin-top: 6px;
  line-height: 1.4;
}

/* ==========================================================================
   主工作区内容包装 (Main Wrapper)
   ========================================================================== */

.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* 顶部轻盈 Header */
.top-header {
  height: var(--header-height);
  background: #FFFFFF;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.crumb-root {
  color: var(--slate-400);
  font-weight: 500;
}

.crumb-separator {
  color: var(--slate-300);
}

.crumb-current {
  font-weight: 600;
  color: var(--slate-800);
  font-size: 16px;
}

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

.engine-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--emerald-text);
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  padding: 4px 10px;
  border-radius: 20px;
}

.ping-circle {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  color: var(--slate-600);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
  color: var(--slate-800);
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--slate-200);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--slate-500);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  background: var(--rose-bg);
  border-color: var(--rose-border);
  color: var(--rose-text);
}

/* 浮动通知消息 (Floating Toast Notification) */
.toast-message {
  position: fixed;
  top: 80px;
  right: 32px;
  z-index: 10001;
  max-width: 420px;
  padding: 14px 18px;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  font-size: 13px;
  line-height: 1.5;
  color: var(--slate-800);
  border-left: 4px solid var(--primary);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: none;
}

.toast-message:not(:empty) {
  display: block;
  animation: slideIn 0.3s ease-out;
}

.toast-message.error {
  border-left-color: var(--rose);
  background: #FFF5F5;
  color: #9B1C1C;
}

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

/* 内容主体 */
.content-body {
  padding: 28px 32px;
  max-width: 1440px;
  width: 100%;
}

/* ==========================================================================
   通用卡片与面板体系 (Panels & Cards)
   ========================================================================== */

.panel-card {
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.panel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--slate-100);
}

.panel-card-header h2, .panel-card-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--slate-900);
}

.panel-desc {
  font-size: 13px;
  color: var(--slate-400);
  margin-top: 4px;
}

/* 现代徽章系统 (Badges) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-indigo {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.badge-emerald, .badge-online, .badge-valid {
  background: var(--emerald-bg);
  color: var(--emerald-text);
  border: 1px solid var(--emerald-border);
}

.badge-amber, .badge-pending {
  background: var(--amber-bg);
  color: var(--amber-text);
  border: 1px solid var(--amber-border);
}

.badge-rose, .badge-danger, .badge-blocked, .badge-disabled {
  background: var(--rose-bg);
  color: var(--rose-text);
  border: 1px solid var(--rose-border);
}

.badge-offline, .badge-expired {
  background: var(--slate-100);
  color: var(--slate-500);
  border: 1px solid var(--slate-200);
}

/* ==========================================================================
   概览看板 (Dashboard Overview)
   ========================================================================== */

.overview-welcome-banner {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  border: 1px solid #334155;
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.overview-welcome-banner::after {
  content: '';
  position: absolute;
  right: -50px;
  top: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.welcome-text h2 {
  font-size: 22px;
  font-weight: 700;
  color: #FFFFFF;
}

.welcome-text p {
  font-size: 14px;
  color: var(--slate-400);
  margin-top: 6px;
}

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

.kpi-card {
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 18px;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.kpi-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.kpi-icon-wrap.indigo { background: #EEF2FF; color: #4F46E5; }
.kpi-icon-wrap.emerald { background: #ECFDF5; color: #059669; }
.kpi-icon-wrap.violet { background: #F5F3FF; color: #7C3AED; }
.kpi-icon-wrap.amber { background: #FFFBEB; color: #D97706; }

.kpi-title {
  font-size: 13px;
  color: var(--slate-500);
  font-weight: 500;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--slate-900);
  margin: 4px 0 2px;
}

.kpi-sub {
  font-size: 11px;
  color: var(--slate-400);
}

.text-emerald { color: #059669 !important; }

/* 快捷分栏网格 */
.quick-split-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.spec-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--slate-50);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.spec-label {
  color: var(--slate-500);
  font-weight: 500;
}

.spec-value {
  color: var(--slate-900);
  font-weight: 600;
  text-align: right;
}

.quick-buttons-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-tile {
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-tile:hover {
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateX(3px);
}

.action-tile strong {
  font-size: 14px;
  color: var(--slate-800);
}

.action-tile small {
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 2px;
}

/* ==========================================================================
   发卡工作台 (Card Generator Studio)
   ========================================================================== */

.generator-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.form-card-field {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 20px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 12px;
}

.field-control {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.large-input {
  width: 100%;
  height: 52px;
  font-size: 20px;
  font-weight: 700;
  padding: 0 48px 0 16px;
  border: 1.5px solid var(--slate-300);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  color: var(--slate-900);
  transition: border-color 0.2s ease;
}

.large-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.field-unit {
  position: absolute;
  right: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-400);
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 14px;
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-600);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  font-weight: 600;
}

.generator-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #EEF2FF;
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.summary-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #3730A3;
  font-weight: 500;
}

.btn-lg {
  height: 50px;
  padding: 0 28px;
  font-size: 15px;
}

/* 发行结果密匙库 (Issued Vault) */
.issued-vault {
  margin-top: 28px;
  background: #0B1120;
  border: 1px solid #1E293B;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.vault-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #0F172A;
  border-bottom: 1px solid #1E293B;
}

.vault-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #F1F5F9;
  font-size: 14px;
}

.vault-alert {
  font-size: 12px;
  color: #FBBF24;
  margin-left: 8px;
}

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

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1E293B;
  color: #F1F5F9;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: #334155;
  color: #FFFFFF;
}

.btn-danger {
  background: var(--rose-bg);
  color: var(--rose-text);
  border: 1px solid var(--rose-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
}

.btn-danger:hover {
  background: #FEE2E2;
}

.code-textarea {
  width: 100%;
  min-height: 160px;
  background: #0B1120;
  color: #34D399;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 16px 20px;
  border: none;
  resize: vertical;
}

.code-textarea:focus {
  outline: none;
}

/* ==========================================================================
   现代化数据表格系统 (Table Component)
   ========================================================================== */

.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

thead th {
  background: var(--slate-50);
  color: var(--slate-600);
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1.5px solid var(--slate-200);
  white-space: nowrap;
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-700);
  vertical-align: middle;
}

tbody tr {
  transition: background-color 0.1s ease;
}

tbody tr:hover {
  background-color: #F8FAFC;
}

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

.monospace {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--slate-800);
  background: var(--slate-100);
  padding: 2px 6px;
  border-radius: 4px;
}

/* 表格内微操作按钮组 */
tbody td button {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-right: 6px;
  transition: all 0.15s ease;
  border: 1px solid var(--slate-200);
  background: #FFFFFF;
  color: var(--slate-700);
}

tbody td button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.device-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.device-action-dialog .device-actions button {
  width: 100%;
  min-height: 38px;
  height: auto;
  margin: 0;
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.device-action-dialog .device-actions button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 批量操作工具栏与复选框 */
.batch-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 14px;
  background: #F8FAFC;
  border: 1px solid var(--slate-200);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

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

.batch-count-badge {
  font-size: 13px;
  color: var(--slate-700);
  font-weight: 500;
}

.batch-count-badge strong {
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}

.btn-batch-tool {
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--slate-600);
  transition: all 0.15s ease;
}

.btn-batch-tool:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.batch-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-batch-action {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.device-checkbox, #deviceSelectAllHeader {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
  vertical-align: middle;
}

/* 分页控件条 (Pagination Bar) */
.bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.table-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pagination {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  color: var(--slate-700);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-pagination:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-pagination:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-500);
  padding: 0 4px;
}

.filter-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-500);
  white-space: nowrap;
  flex-shrink: 0;
}

.modern-select {
  height: 36px;
  padding: 0 12px;
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--slate-700);
  cursor: pointer;
}

.modern-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* ==========================================================================
   应用设置面板 (Settings Two-Col Layout)
   ========================================================================== */

.settings-two-col {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 24px;
}

.identity-card-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.id-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--slate-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
}

.id-label {
  font-size: 12px;
  color: var(--slate-500);
  font-weight: 500;
}

.id-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-800);
}

.hidden-raw-id {
  display: none !important;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
}

.modern-input {
  height: 44px;
  padding: 0 14px;
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--slate-800);
  transition: border-color 0.2s ease;
}

.modern-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.modern-textarea {
  padding: 12px 14px;
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
  color: var(--slate-800);
  resize: vertical;
  transition: border-color 0.2s ease;
}

.modern-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-save {
  align-self: flex-start;
  margin-top: 8px;
}

/* ==========================================================================
   页脚 (Footer)
   ========================================================================== */

.app-footer {
  margin-top: auto;
  padding: 20px 32px;
  border-top: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--slate-400);
  background: #FFFFFF;
}

.app-footer a {
  color: var(--slate-400);
  text-decoration: none;
  transition: color 0.15s ease;
}

.app-footer a:hover {
  color: var(--slate-600);
}

/* ==========================================================================
   响应式断点适配 (Responsive)
   ========================================================================== */

@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-split-grid, .form-row-grid, .settings-two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .login-container {
    grid-template-columns: 1fr;
  }
  .login-brand-panel {
    display: none;
  }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #1E293B;
  }
  .main-wrapper {
    margin-left: 0;
  }
  .app-layout {
    flex-direction: column;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .top-header {
    padding: 0 16px;
  }
  .content-body {
    padding: 16px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   解封弹窗、客服联系与设备备注系统样式
   ══════════════════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}
.modal-backdrop[hidden] {
  display: none !important;
}
.modal-card {
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  animation: scaleUp 0.2s ease-out;
}
.modal-unban-card {
  max-width: 580px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #F1F5F9;
  background: #F8FAFC;
}
.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-title-wrap h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0F172A;
}
.modal-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748B;
}
.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
}
.modal-icon.blue { background: #EFF6FF; }
.modal-icon.emerald { background: #ECFDF5; }
.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #94A3B8;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s;
}
.modal-close:hover {
  color: #0F172A;
  background: #E2E8F0;
}
.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #F1F5F9;
  background: #F8FAFC;
}

/* 前台登录页申请解封按钮 */
.login-unban-action-bar {
  margin-top: 14px;
  text-align: center;
}
.btn-unban-portal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #475569;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-unban-portal:hover {
  background: #F1F5F9;
  border-color: #10B981;
  color: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

/* 解封申诉卡片样式 */
.unban-banner {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: #ECFDF5;
  border-left: 4px solid #10B981;
  border-radius: 8px;
  margin-bottom: 20px;
}
.unban-banner strong {
  display: block;
  font-size: 14px;
  color: #065F46;
  margin-bottom: 2px;
}
.unban-banner p {
  margin: 0;
  font-size: 12.5px;
  color: #047857;
  line-height: 1.5;
}
.contact-card-item {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}
.channel-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 8px;
}
.channel-content-pre {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.7;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 12px 0;
}
.unban-steps {
  background: #F8FAFC;
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid #E2E8F0;
}
.unban-steps h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 700;
  color: #1E293B;
}
.unban-steps ol {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: #64748B;
  line-height: 1.6;
}

/* 顶部快速解封按钮 */
.btn-unblock-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #ECFDF5 !important;
  border: 1px solid #A7F3D0 !important;
  color: #059669 !important;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-unblock-header:hover {
  background: #D1FAE5 !important;
  border-color: #6EE7B7 !important;
  color: #047857 !important;
}

/* 绿色解封高亮按钮 */
.btn-emerald-action {
  background: #10B981 !important;
  color: #FFFFFF !important;
  border-color: #10B981 !important;
}
.btn-emerald-action:hover {
  background: #059669 !important;
}

/* 设备备注单元格 */
.device-note-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  max-width: 180px;
}
.device-note-text {
  font-size: 13px;
  color: #1E293B;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #F1F5F9;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  transition: all 0.15s;
}
.device-note-cell:hover .device-note-text {
  background: #E2E8F0;
  border-color: #CBD5E1;
}
.device-note-edit-icon {
  background: transparent;
  border: none;
  font-size: 12px;
  opacity: 0.6;
  cursor: pointer;
  padding: 0;
}
.device-note-cell:hover .device-note-edit-icon {
  opacity: 1;
}
.btn-add-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: transparent;
  border: 1px dashed #CBD5E1;
  color: #64748B;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-add-note:hover {
  background: #F1F5F9;
  border-color: #4F46E5;
  color: #4F46E5;
}

/* 标签选择栏 */
.preset-tag-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.preset-label {
  font-size: 12px;
  color: #64748B;
}
.tag-chip {
  padding: 4px 10px;
  border-radius: 100px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  color: #334155;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.tag-chip:hover {
  background: #E2E8F0;
  color: #0F172A;
}
.tag-chip.text-danger {
  color: #DC2626;
  border-color: #FECACA;
  background: #FEF2F2;
}

/* Device management: keep the toolbar and rows compact without hiding actions. */
#cards .panel-card-header {
  flex-wrap: wrap;
  gap: 12px;
}

#cards .panel-card-header .bar {
  flex-wrap: wrap;
}

.card-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 16px;
}

#cardSearchInput {
  flex: 1 1 320px;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.card-search-row button {
  flex: 0 0 auto;
  min-height: 38px;
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

#cardBatchBar[hidden] {
  display: none;
}

.card-id-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.card-id-cell input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

#cardTable table {
  min-width: 900px;
}

#cardTable tbody td:first-child {
  white-space: nowrap;
}

#devices .panel-card {
  padding: 20px;
}

#devices .device-panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 16px;
}

#devices .device-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
}

#devices .device-search {
  display: flex;
  flex: 1 1 300px;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#deviceSearchInput {
  flex: 1 1 auto;
  width: 100%;
  min-width: 120px;
  height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

#devices .table-pagination {
  margin-left: auto;
  white-space: nowrap;
}

#deviceTable table {
  table-layout: fixed;
  min-width: 760px;
}

#deviceTable th:nth-child(1) { width: 42px; }
#deviceTable th:nth-child(2) { width: 22%; }
#deviceTable th:nth-child(3) { width: 21%; }
#deviceTable th:nth-child(4) { width: 23%; }
#deviceTable th:nth-child(5) { width: 20%; }
#deviceTable th:nth-child(6) { width: 86px; }

#deviceTable thead th,
#deviceTable tbody td {
  padding: 10px 12px;
}

#deviceTable .device-id-code,
#deviceTable .device-license-cell .monospace {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.device-license-cell,
.device-activity-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}

.device-secondary-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--slate-500);
  font-size: 11px;
}

#deviceTable .device-manage-button {
  min-height: 32px;
  margin: 0;
  padding: 4px 12px;
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: var(--primary);
}

#deviceTable .device-manage-button:hover {
  border-color: var(--primary);
}

.device-action-dialog {
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  background: #FFFFFF;
  box-shadow: var(--shadow-lg);
  color: var(--slate-900);
}

.device-action-dialog::backdrop {
  background: rgba(15, 23, 42, 0.46);
}

.device-action-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.device-action-dialog-header h3 {
  font-size: 16px;
}

.device-action-dialog-header .btn-secondary {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.device-action-identifier {
  margin-top: 5px;
  color: var(--slate-500);
  font-size: 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .card-search-row { flex-wrap: wrap; }
  #cardSearchInput { flex-basis: 100%; }
  #devices .panel-card { padding: 16px; }
  #devices .device-toolbar { align-items: stretch; }
  #devices .device-search { flex-basis: 100%; }
  #devices .table-pagination { margin-left: 0; }
}
