/* ==============================================================================
   MoyaKey 极简现代纯白科技风格设计系统 (Apple & Linear Design Language)
   遵循 ui-ux-pro-max 规范：SVG 图标、无 Emoji 干扰、4.5:1 高对比度、全设备响应式
   ============================================================================== */

:root {
  /* 基础主色板 (Clean White + Deep Slate + Royal Blue) */
  --bg-primary: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-hover: #F8FAFC;
  
  --border-color: #E2E8F0;
  --border-subtle: #EDF2F7;
  --border-focus: #2563EB;

  --text-main: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;

  /* 语义化状态色 */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;

  --success: #059669;
  --success-light: #ECFDF5;
  --success-border: #A7F3D0;

  --warning: #D97706;
  --warning-light: #FFFBEB;
  --warning-border: #FDE68A;

  --danger: #DC2626;
  --danger-hover: #B91C1C;
  --danger-light: #FEF2F2;
  --danger-border: #FECACA;

  --purple: #7C3AED;
  --purple-light: #F5F3FF;

  /* 圆角与阴影体系 */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-modal: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* 基础重置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.code-font {
  font-family: var(--font-mono) !important;
}

/* 通用卡片容器 */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* 顶部导航 */
.navbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  background: var(--primary);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.brand-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-title {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.4px;
  color: var(--text-main);
}

.brand-tag {
  font-size: 10px;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.5px;
}

.system-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--success);
  background: var(--success-light);
  border: 1px solid var(--success-border);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-left: 12px;
}

.pulse-indicator {
  width: 7px;
  height: 7px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(5, 150, 105, 0.5);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

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

/* 次级选项卡切换条 */
.sub-nav {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 64px;
  z-index: 30;
}

.sub-nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sub-nav-inner::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.nav-tab.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

.nav-tab .icon {
  width: 17px;
  height: 17px;
}

/* 主容器 */
.admin-container {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 80px;
  flex: 1;
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

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

/* 通用按钮系统 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #FFFFFF;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: #CBD5E1;
}

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
}
.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-danger-outline {
  background: #FFFFFF;
  border-color: var(--danger-border);
  color: var(--danger);
}
.btn-danger-outline:hover {
  background: var(--danger-light);
  border-color: var(--danger);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}
.btn-lg {
  padding: 12px 20px;
  font-size: 14px;
}

.btn .icon {
  width: 15px;
  height: 15px;
}

.btn-link {
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
}
.btn-link:hover {
  text-decoration: underline;
}

/* 图标基础尺寸 */
.icon {
  display: inline-block;
  vertical-align: middle;
}

/* 核心 KPI 统计网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

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

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

.stat-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon-wrapper.bg-blue { background: var(--primary-light); color: var(--primary); }
.stat-icon-wrapper.bg-emerald { background: var(--success-light); color: var(--success); }
.stat-icon-wrapper.bg-purple { background: var(--purple-light); color: var(--purple); }
.stat-icon-wrapper.bg-amber { background: var(--warning-light); color: var(--warning); }

.stat-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 6px;
}
.text-emerald { color: var(--success) !important; }
.text-purple { color: var(--purple) !important; }

.stat-hint {
  font-size: 12px;
  color: var(--text-subtle);
}

/* 快捷操作条 */
.quick-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  margin-bottom: 28px;
  background: #FFFFFF;
}

.quick-action-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}
.quick-action-title .icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.quick-action-buttons {
  display: flex;
  gap: 10px;
}

/* 分组看板网格 */
.section-header {
  margin-bottom: 16px;
}
.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.2px;
}
.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.group-monitor-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.group-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.group-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}
.group-category {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  display: inline-block;
}
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-muted { background: var(--bg-subtle); color: var(--text-muted); }

/* 售出进度条 */
.progress-container {
  margin: 12px 0 16px;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.progress-track {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.group-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}
.group-stat-item .num {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}
.group-stat-item .label {
  font-size: 11px;
  color: var(--text-muted);
}

/* 向导卡片 (Import Wizard) */
.wizard-card {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px;
}

.wizard-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}
.wizard-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.wizard-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.steps-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}
.step-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
}
.step-badge.active {
  background: var(--primary);
  color: #FFFFFF;
}
.step-divider {
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.form-section {
  margin-bottom: 24px;
}
.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}
.label-required {
  color: var(--danger);
  margin-left: 2px;
}
.format-tag {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: all 0.15s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-with-action {
  display: flex;
  gap: 10px;
}
.input-with-action .form-select {
  flex: 1;
}

.import-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
}
.import-counter {
  display: flex;
  gap: 14px;
}

.import-preview-box {
  margin-top: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #FAFAFA;
  padding: 12px;
}
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.preview-title {
  font-size: 12px;
  font-weight: 700;
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.custom-checkbox input {
  display: none;
}
.checkbox-box {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.custom-checkbox input:checked + .checkbox-box {
  background: var(--primary);
  border-color: var(--primary);
}
.custom-checkbox input:checked + .checkbox-box::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

/* 数据表格模块 */
.table-card {
  padding: 20px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.search-box {
  position: relative;
  width: 280px;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-subtle);
}
.search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  font-size: 13px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
}
.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-group {
  display: flex;
  gap: 8px;
}
.select-sm {
  padding: 7px 10px;
  font-size: 12px;
}

.export-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
  background: #FFFFFF;
}

.data-table th {
  background: #F8FAFC;
  padding: 11px 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover {
  background-color: #F8FAFC;
}

.table-row-deleted {
  opacity: 0.55;
  background: #F8FAFC;
}

.table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 32px !important;
}

.card-key-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.btn-copy-mini {
  padding: 3px 6px;
  font-size: 11px;
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
}
.btn-copy-mini:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.status-unused, .status-chip-unused { background: #F1F5F9; color: #475569; }
.status-redeemed, .status-chip-redeemed { background: #ECFDF5; color: #059669; }
.status-running, .status-chip-running { background: #EFF6FF; color: #2563EB; animation: pulse 1.8s infinite; }
.status-deleted, .status-chip-deleted { background: #FEF2F2; color: #DC2626; }

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: var(--radius-xs);
}

.pagination-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.pagination-buttons {
  display: flex;
  gap: 8px;
}

/* 控制台日志卡片 */
.log-card {
  padding: 20px;
}
.log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.log-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--success);
  margin-left: 8px;
}
.log-actions {
  display: flex;
  gap: 8px;
}

.console-wrapper {
  background: #0B0F17;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
}
.console-body {
  color: #E2E8F0;
  font-size: 12px;
  line-height: 1.6;
  max-height: 480px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* 设置卡片 */
.settings-card {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}
.form-group.full-width {
  grid-column: span 2;
}
.field-hint {
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 4px;
  display: block;
}

/* 模态框系统 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-dialog {
  width: 100%;
  max-width: 520px;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  animation: modalEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
}
.btn-close {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.btn-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 20px 24px;
}
.modal-footer {
  padding: 14px 24px;
  background: #F8FAFC;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.credential-display-box {
  background: var(--bg-subtle);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.cred-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.cred-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-all;
}

/* 全局 Toast 通知 */
.toast-container {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-success {
  border-left: 4px solid var(--success);
}
.toast-error {
  border-left: 4px solid var(--danger);
}
.toast-info {
  border-left: 4px solid var(--primary);
}

/* ==============================================================================
   前台用户兑换单页专用样式 (Cockpit Tools Echo)
   ============================================================================== */
.redeem-container {
  max-width: 720px;
  margin: 40px auto 80px;
  padding: 0 20px;
}
.redeem-card {
  padding: 36px 32px;
}
.redeem-header {
  text-align: center;
  margin-bottom: 28px;
}
.redeem-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}
.redeem-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.redeem-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
}

.redeem-input-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.input-code {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Cockpit 回显区域 */
.cockpit-view-card {
  margin-top: 28px;
  animation: fadeIn 0.3s ease;
}
.cockpit-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.totp-live-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}
.totp-digits {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--primary);
}
.totp-circle-wrap {
  width: 24px;
  height: 24px;
  position: relative;
}

.format-tabs-bar {
  display: flex;
  gap: 2px;
  padding: 8px 16px 0;
  background: #0B0F17;
  overflow-x: auto;
}
.format-tab-btn {
  background: transparent;
  color: #94A3B8;
  border: none;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: all 0.15s ease;
}
.format-tab-btn.active {
  background: #1E293B;
  color: #FFFFFF;
}

.cockpit-code-pane {
  background: #1E293B;
  color: #F8FAFC;
  padding: 20px;
  font-size: 13px;
  line-height: 1.6;
  max-height: 380px;
  overflow-y: auto;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* 响应式断点适配 */
@media (max-width: 768px) {
  .navbar {
    padding: 0 12px;
    height: auto;
    min-height: 54px;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .system-status-chip {
    display: none;
  }
  .nav-actions {
    gap: 6px;
    flex-wrap: wrap;
  }
  .nav-actions .btn {
    padding: 5px 8px;
    font-size: 11.5px;
  }
  .sub-nav {
    top: auto;
    position: relative;
  }
  .sub-nav-inner {
    padding: 0 8px;
    gap: 2px;
  }
  .nav-tab {
    padding: 10px 12px;
    font-size: 13px;
  }
  .admin-container {
    padding: 14px 10px 50px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .quick-action-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .quick-action-buttons {
    width: 100%;
    flex-wrap: wrap;
  }
  .search-box {
    width: 100%;
  }
  .export-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-group.full-width {
    grid-column: span 1;
  }
  .wizard-card {
    padding: 20px 16px;
  }
  .steps-indicator {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .step-divider {
    display: none;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 6px 10px;
  }
  .brand-title {
    font-size: 16px;
  }
  .brand-logo {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }
  .nav-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 4px;
  }
  .nav-actions .btn {
    padding: 4px 6px;
    font-size: 11px;
  }
  .nav-actions .btn span {
    font-size: 11px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .nav-tab {
    padding: 8px 10px;
    font-size: 12px;
    gap: 4px;
  }
  .nav-tab .icon {
    width: 14px;
    height: 14px;
  }
}

/* 批量导出与未提取库存看板组件 */
.inventory-status-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stat-pill {
  display: flex;
  flex-direction: column;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
}
.stat-pill-label {
  font-size: 11px;
  color: var(--text-muted);
}
.stat-pill-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}
.stat-pill.highlight-emerald {
  background: #ECFDF5;
  border-color: #A7F3D0;
}
.stat-pill.highlight-emerald .stat-pill-label {
  color: #065F46;
}
.stat-pill.highlight-emerald .stat-pill-val {
  color: #059669;
}
.quick-chips button {
  white-space: nowrap;
}

/* ==============================================================================
   策略卡片、状态动效与微交互体系 (Smooth Motion & Micro-interactions)
   ============================================================================== */
.btn {
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(1px) scale(0.98);
}

.group-monitor-card {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}
.group-monitor-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.strategy-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1.5px solid var(--border-color);
  user-select: none;
}
.strategy-card:hover {
  border-color: #93C5FD;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}
.strategy-card.selected {
  border-color: var(--primary) !important;
  background: #F0F7FF !important;
}

/* 状态动态微光呼吸灯 (Pulse Indicators) */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.status-dot.ready {
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: pulseGreenDot 2s infinite;
}
.status-dot.logging {
  background: var(--warning);
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6);
  animation: pulseAmberDot 1.5s infinite;
}
.status-dot.failed {
  background: var(--danger);
}
.status-dot.pending {
  background: var(--text-subtle);
}

@keyframes pulseGreenDot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes pulseAmberDot {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

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

.tab-content.active {
  display: block;
  animation: tabFadeSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-container {
  display: none;
  animation: resultSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

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