/* 现代化设计系统 */
:root {
  /* 主色调 */
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  
  /* 次要色彩 */
  --secondary: #64748b;
  --accent: #10b981;
  --accent-light: #34d399;
  
  /* 状态色彩 */
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --error: #ef4444;
  --error-bg: #fee2e2;
  --info: #06b6d4;
  --info-bg: #cffafe;
  
  /* 中性色彩 */
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* 语义化色彩 */
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
  --bg-primary: #ffffff;
  --bg-secondary: var(--gray-50);
  --bg-tertiary: var(--gray-100);
  --border-light: var(--gray-200);
  --border-default: var(--gray-300);
  
  /* 阴影系统 */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-base: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* 圆角系统 */
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  /* 间距系统 */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* 字体系统 */
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  
  /* 动画时长 */
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
  --duration-slower: 500ms;
  
  /* 缓动函数 */
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置和全局样式 */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--white) 100%);
  line-height: 1.6;
  font-weight: 400;
  min-height: 100vh;
  position: relative;
}

.no-select, .no-select * { user-select: none; -webkit-user-select: none; }

/* 背景装饰 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}
/* 布局组件 */
.manage-panel [hidden] {
  display: none !important;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-8);
  display: grid;
  gap: var(--space-6);
}

.title {
  margin: 0;
  text-align: center;
  font-weight: 800;
  letter-spacing: -0.025em;
  font-size: 2.5rem;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-2);
}

.page-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.toolbar {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* 按钮系统 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.25rem;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  box-shadow: var(--shadow-xs);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-300);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn:focus {
  outline: none;
  box-shadow: var(--shadow-sm), 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 按钮变体 */
.btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-600) 100%);
  border-color: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  box-shadow: var(--shadow-lg);
}

.btn.danger {
  background: linear-gradient(135deg, var(--error) 0%, #dc2626 100%);
  border-color: var(--error);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn.danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: var(--shadow-lg);
}

.btn.secondary {
  background: var(--bg-secondary);
  border-color: var(--border-default);
  color: var(--text-secondary);
}

.btn.secondary:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn.small {
  padding: var(--space-2) var(--space-3);
  font-size: 0.75rem;
  border-radius: var(--radius-base);
}

/* 统一顶部操作按钮尺寸（历史记录/生成/清空等） */
.page-actions .toolbar .btn.small {
  min-width: 76px;
  height: 36px;
}

.btn.large {
  padding: var(--space-4) var(--space-6);
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: var(--shadow-xs) !important;
}

/* 按钮加载态：右侧旋转指示器 */
.btn.loading {
  padding-right: calc(var(--space-4) + 16px);
}
.btn.loading::after {
  content: '';
  position: absolute;
  right: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

/* 按钮光效动画 */
.btn.primary::before,
.btn.danger::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--duration-slower);
}

.btn.primary:hover::before,
.btn.danger:hover::before {
  left: 100%;
}
/* 卡片网格系统 */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-6);
}

/* 表格样式用于模拟结果和历史 */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}
.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.table thead {
  background: var(--bg-secondary);
}
.table th, .table td {
  text-align: left;
  padding: 5px 10px; /* 略微增加单行高度与左右留白 */
  border-bottom: 1px solid var(--border-light);
  line-height: 1.15;
  font-size: 0.85rem;
  vertical-align: middle;
  white-space: nowrap;
}

.table .mono { font-family: var(--font-mono); letter-spacing: .03em; }
.table .nowrap { white-space: nowrap; }

/* 表格内复制按钮去除额外内边距，保证与表头文字对齐 */
.table td .copy {
  padding: 0;
  display: block;
  width: 100%;
  text-align: inherit;
}

/* 表格内操作按钮：更小的高度，避免行高被撑大 */
.table td .btn {
  padding: 3px 10px;
  font-size: 0.75rem;
  line-height: 1;
  height: 26px;
  min-height: 26px;
  border-radius: 8px;
}

/* 列对齐：保证表头与数据一致 */
.table th:nth-child(1),
.table td:nth-child(1) { text-align: center; width: 64px; }
.table th:nth-child(2),
.table td:nth-child(2) { text-align: left; }
.table th:nth-child(3),
.table td:nth-child(3) { text-align: left; }
.table th:nth-child(4),
.table td:nth-child(4) { text-align: center; }
.table th:nth-child(5),
.table td:nth-child(5) { text-align: center; }
.table th:nth-child(6),
.table td:nth-child(6) { text-align: left; } /* 创建时间较长，左对齐更易读 */
/* 历史记录表的第7列（操作） */
.table th:nth-child(7),
.table td:nth-child(7) { text-align: center; }

/* 现代化卡片设计 */
.card {
  position: relative;
  display: grid;
  gap: var(--space-2);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  background: linear-gradient(135deg, var(--white) 0%, var(--gray-50) 100%);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  transition: all var(--duration-base) var(--ease-out);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-200);
}

/* 卡片装饰元素 */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.card-chip {
  width: 50px;
  height: 36px;
  border-radius: var(--radius-base);
  background: linear-gradient(135deg, 
    var(--gray-100) 0%, 
    var(--gray-200) 50%, 
    var(--gray-300) 100%);
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.1),
    var(--shadow-xs);
  position: relative;
}

.card-chip::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 2px;
  background: var(--gray-400);
  border-radius: 1px;
  box-shadow: 0 4px 0 var(--gray-400);
}

.card-brand {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-size: 0.875rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 模拟卡片：加入历史按钮（悬停显示，右上角） */
.add-history {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}

.card:hover .add-history {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.card-number {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.4;
  padding: var(--space-1) 0;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-base);
  transition: all var(--duration-fast) var(--ease-out);
  text-align: center !important;
  width: 100%;
  display: block;
}

.card-number:hover {
  background: var(--primary-50);
  color: var(--primary-700);
  transform: translateY(-1px);
}

/* 键值对组件 */
.kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.kv:last-of-type {
  border-bottom: none;
}

/* 使用次数行布局 */
.kv.usage-row {
  justify-content: space-between;
  align-items: center;
}

/* 访客状态文字显示 */
.guest-status-text {
  margin-left: auto;
  flex-shrink: 0;
}

.guest-status {
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  transition: all var(--duration-base) var(--ease-out);
}

.guest-status.allowed {
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid var(--success);
}

.guest-status.denied {
  color: var(--error);
  background: var(--error-bg);
  border: 1px solid var(--error);
}

.k {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 80px;
}

.v {
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  flex: 1;
}

/* 可复制元素 */
.copy {
  border: none;
  background: transparent;
  padding: var(--space-2) var(--space-3);
  color: inherit;
  cursor: pointer;
  border-radius: var(--radius-base);
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
  font-weight: inherit;
  font-size: inherit;
  text-align: inherit;
}

.copy:hover {
  background: var(--primary-50);
  color: var(--primary-700);
  transform: translateY(-1px);
}

.copy:active {
  transform: translateY(0);
}

.copy.copied {
  background: var(--success-bg);
  color: var(--success);
  box-shadow: 0 0 0 2px var(--success);
}

.copy.copied::after {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  background: var(--success);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  animation: bounceIn var(--duration-base) var(--ease-out);
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* 卡片操作按钮区域 */
.card-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}
/* 模态框系统 */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1000;
  animation: fadeIn var(--duration-base) var(--ease-out);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  animation: fadeIn var(--duration-base) var(--ease-out);
}

.modal-content {
  position: relative;
  z-index: 10;
  width: min(480px, 95vw);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--white);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
  animation: slideInScale var(--duration-base) var(--ease-out);
}

.modal-title {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.modal-title::before {
  content: '❓';
  font-size: 1.5rem;
}

.modal-desc {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* 子页面（表单面板）系统 */
.manage-panel[hidden] {
  display: none;
}

.subpage {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  animation: fadeIn var(--duration-base) var(--ease-out);
}

.subpage[hidden] {
  display: none;
}

.subpage-inner {
  width: min(800px, 95vw);
  max-height: 90vh;
  overflow: auto;
  border-radius: var(--radius-xl);
  background: var(--white);
  border: 1px solid var(--border-light);
  padding: var(--space-8);
  box-shadow: var(--shadow-xl);
  animation: slideInScale var(--duration-base) var(--ease-out);
}

.subpage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.subpage-title {
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 内联选择器组件 */
.inline-select {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  transition: all var(--duration-base) var(--ease-out);
}

.inline-select:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-sm);
}

.select-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  white-space: nowrap;
  min-width: fit-content;
}

.inline-select .select {
  min-width: 280px;
  background: var(--white);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-base);
  padding: var(--space-2) var(--space-3);
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--duration-base) var(--ease-out);
  box-shadow: var(--shadow-xs);
}

.inline-select .select:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.inline-select .select:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: var(--shadow-sm), 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
  outline: none;
}
/* 表单系统 */
.form {
  display: grid;
  gap: var(--space-3);
  width: 100%;
  max-width: 600px;
  margin-inline: auto;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

/* 三列表单栅格（仅用于模拟页顶部配置） */
.grid.grid-3 {
  grid-template-columns: auto auto 1fr; /* 前两项按内容，最后一项占剩余 */
  align-items: center;
  column-gap: var(--space-4); /* 更紧凑 */
}

/* 表单字段改为单行展示：标签与控件同一行 */
.field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 0;
  white-space: nowrap;
}

/* 统一字段标签宽度与样式，使三项更对齐 */
.field .field-label {
  min-width: 96px; /* 防止中文标签过短被挤压 */
  flex: 0 0 auto;  /* 不允许收缩，确保完整显示 */
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

/* 三列内边距与间距微调，让整体更平衡 */
.grid.grid-3 .field {
  padding: 2px 6px;
}

/* 让数量输入框宽度适中，避免过长或过短 */
.form .field #count {
  flex: 0 0 180px;
  width: 180px;
}

/* 前缀输入在大屏保持合适宽度 */
.form .field #prefix {
  flex: 1 1 280px;
}

/* 品牌选择器设定合理宽度，避免占满导致割裂 */
.form .field #brand {
  flex: 0 0 280px;
  width: 280px;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-bottom: var(--space-1);
}

/* 选择器样式 */
select.select {
  width: 100%;
  padding: var(--space-2) var(--space-3); /* 统一与 input 高度 */
  border-radius: var(--radius-md);
  border: 2px solid var(--border-default);
  background: var(--white);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  box-shadow: var(--shadow-xs);
  
  /* 自定义下拉箭头 */
  background-image: 
    linear-gradient(45deg, transparent 50%, var(--gray-400) 50%),
    linear-gradient(135deg, var(--gray-400) 50%, transparent 50%);
  background-position: 
    calc(100% - 20px) calc(50% - 2px),
    calc(100% - 15px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* 在单行字段内，输入控件占据剩余空间且不溢出 */
.form .field select.select,
.form .field input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto; /* 覆盖默认100%以适配flex */
  height: 36px; /* 统一控件高度 */
  line-height: 1.2;
}

select.select:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

select.select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm), 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

/* 输入框样式 */
input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 2px solid var(--border-default);
  background: var(--white);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  outline: none;
  transition: all var(--duration-base) var(--ease-out);
  box-shadow: var(--shadow-xs);
}

input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

input:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-sm);
}

input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm), 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

input:invalid {
  border-color: var(--error);
}

input:invalid:focus {
  box-shadow: var(--shadow-sm), 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* 表单操作区域 */
.form-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

/* 页脚 */
.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: var(--space-8);
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

/* 访客权限状态样式 */
.guest-status {
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  transition: all var(--duration-base) var(--ease-out);
}

.guest-status.allowed {
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid var(--success);
}

.guest-status.denied {
  color: var(--error);
  background: var(--error-bg);
  border: 1px solid var(--error);
}

/* 访客权限设置字段样式 */
/* 访客权限字段样式已简化，现在使用标准field样式 */

/* 访客权限字段悬停效果已简化 */

/* 一行显示的权限设置 */
/* 访客权限内联样式已简化，现在使用标准field样式 */

.guest-permission-inline:hover {
  background: var(--primary-50);
}

/* 权限文本样式已简化，现在使用标准field label样式 */

.permission-radio {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
  z-index: -1;
}

.permission-options {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.permission-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
  padding: var(--space-2);
  border-radius: var(--radius-base);
  transition: all var(--duration-base) var(--ease-out);
  border: 2px solid transparent;
}

.permission-option:hover {
  background: var(--primary-50);
  border-color: var(--primary-100);
}

.radio-custom {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
  background: var(--white);
  border: 2px solid var(--border-default);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  box-shadow: var(--shadow-xs);
}

.radio-custom.allow {
  border-color: var(--success);
}

.radio-custom.deny {
  border-color: var(--error);
}

.permission-option:hover .radio-custom {
  transform: scale(1.1);
  box-shadow: var(--shadow-sm);
}

.permission-radio:focus + .radio-custom {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.permission-radio:checked + .radio-custom {
  border-width: 6px;
  box-shadow: var(--shadow-md);
}

.permission-radio:checked + .radio-custom.allow {
  border-color: var(--success);
  background: var(--success);
}

.permission-radio:checked + .radio-custom.deny {
  border-color: var(--error);
  background: var(--error);
}

.option-text {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  transition: color var(--duration-base) var(--ease-out);
}

.permission-radio:checked + .radio-custom + .option-text {
  color: var(--text-primary);
  font-weight: 700;
}

/* 权限状态样式已简化，不再需要 */

/* 状态文字样式 */
.status-text {
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: all var(--duration-base) var(--ease-out);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-text.allow {
  color: var(--success);
  background: var(--success-bg);
  opacity: 0.5;
}

.status-text.deny {
  color: var(--error);
  background: var(--error-bg);
  opacity: 1;
}

/* 勾选状态下的样式 */
.permission-checkbox:checked + .permission-status .allow {
  opacity: 1;
  transform: scale(1.05);
}

.permission-checkbox:checked + .permission-status .deny {
  opacity: 0.5;
  transform: scale(0.95);
}

/* 悬停效果 */
/* 访客权限内联悬停效果已简化 */

/* 字段提示样式 */
.field-hint {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-top: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--info-bg);
  border-radius: var(--radius-base);
  border-left: 3px solid var(--info);
  line-height: 1.3;
}

/* 动画关键帧 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutLeft {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-100%); opacity: 0; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

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

/* 响应式设计 */
@media (max-width: 1024px) {
  .grid-cards {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }
  
  .container {
    padding: var(--space-6);
  }
  
  .title {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: var(--space-4);
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  .grid.grid-3 {
    grid-template-columns: 1fr;
  }
  
  .grid-cards {
    grid-template-columns: 1fr;
  }
  
  .card-number {
    font-size: 1.25rem;
  }
  
  .title {
    font-size: 1.75rem;
  }
  
  .page-actions {
    justify-content: center;
  }
  
  .subpage-inner {
    padding: var(--space-6);
  }
  
  .subpage-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .inline-select {
    flex-direction: column;
    align-items: stretch;
  }
  
  .inline-select .select {
    min-width: auto;
  }
  
  .form-actions {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: var(--space-3);
  }
  
  .card {
    padding: var(--space-4);
  }
  
  .title {
    font-size: 1.5rem;
  }
  
  .btn {
    padding: var(--space-2) var(--space-3);
    font-size: 0.75rem;
  }
}

