/* ===== 设计令牌 / Design Tokens ===== */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-soft: rgba(37, 99, 235, 0.08);

  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-light: #fef2f2;

  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #d97706;
  --warning-light: #fffbeb;

  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-sunken: #f1f5f9;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-disabled: #cbd5e1;

  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.08);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.08);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);

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

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }

/* ===== 布局 ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 24px; }

/* ===== 卡片 ===== */
.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 表单 ===== */
.form-item { margin-bottom: 20px; }
.form-item label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  pointer-events: none;
  z-index: 1;
}
.input-wrapper input,
.input-wrapper textarea,
.form-item input,
.form-item textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.input-wrapper input { padding-left: 38px; }
.form-item input::placeholder,
.form-item textarea::placeholder { color: var(--text-disabled); }

.form-item input:focus,
.form-item textarea:focus,
.input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-item textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
}
.form-tip { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-primary:disabled {
  background: #93c5fd;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
}
.btn-danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-sunken);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary-light);
  border-color: var(--primary-hover);
  color: var(--primary-hover);
}

.btn-icon {
  padding: 8px 14px;
}
.btn .btn-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-ghost .btn-spinner {
  border-color: rgba(0,0,0,0.15);
  border-top-color: var(--text-secondary);
}

/* ===== 表格 ===== */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td {
  padding: 14px 12px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}
th {
  background: var(--bg-sunken);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
th:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
tr:hover td { background: var(--primary-soft); transition: background 0.15s; }

/* ===== 标签 ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.tag-success { background: var(--success-light); color: var(--success); border-color: #bbf7d0; }
.tag-success::before { background: var(--success); }
.tag-warning { background: var(--warning-light); color: var(--warning); border-color: #fde68a; }
.tag-warning::before { background: var(--warning); }
.tag-error { background: var(--danger-light); color: var(--danger); border-color: #fecaca; }
.tag-error::before { background: var(--danger); }
.tag-orange { background: #fff7ed; color: #ea580c; border-color: #fed7aa; }
.tag-orange::before { background: #ea580c; }
.tag-info { background: #dbeafe; color: #2563eb; border-color: #bfdbfe; }
.tag-info::before { background: #2563eb; }
.tag-default { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }
.tag-default::before { background: #6b7280; }

/* ===== Toast 通知 ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  min-width: 260px;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.toast.show { transform: translateX(0); }
.toast-icon { width: 18px; height: 18px; flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.4; }
.toast-close {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.toast-close:hover { opacity: 1; }
.toast-success { border-left: 3px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }

/* ===== 确认对话框 ===== */
.confirm-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.confirm-box {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 380px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.confirm-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.confirm-icon svg { width: 22px; height: 22px; }
.confirm-icon-danger { background: var(--danger-light); color: var(--danger); }
.confirm-icon-danger svg { color: var(--danger); }
.confirm-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.confirm-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.modal-box {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 440px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); padding-bottom: 16px; border-bottom: 1px solid var(--border-light); margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-16 { margin-top: 16px; }
.flex { display: flex; }
.flex-between { justify-content: space-between; align-items: center; }

/* ===== 空状态 ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  color: var(--text-tertiary);
}
.empty-state-icon {
  width: 72px;
  height: 72px;
  color: var(--border);
  margin-bottom: 16px;
}
.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.empty-state-desc {
  font-size: 14px;
}

/* ===== 页面加载 ===== */
.page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  gap: 16px;
  color: var(--text-tertiary);
  font-size: 14px;
}
.page-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== 工具栏 ===== */
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box input {
  width: 220px;
  padding: 8px 32px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.search-box input::placeholder { color: var(--text-disabled); }
.search-icon { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--text-tertiary); pointer-events: none; }
.search-clear { position: absolute; right: 8px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 4px; cursor: pointer; color: var(--text-tertiary); transition: var(--transition); }
.search-clear:hover { color: var(--text-primary); background: var(--bg-sunken); }

/* ===== 多选下拉 ===== */
.multi-select { position: relative; user-select: none; }
.multi-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  min-width: 140px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; cursor: pointer; background: var(--bg-elevated); color: var(--text-primary);
  transition: var(--transition);
}
.multi-select-trigger:hover { border-color: var(--primary); }
.multi-select-trigger .placeholder { color: var(--text-disabled); }
.multi-select-trigger .arrow { width: 12px; height: 12px; color: var(--text-tertiary); transition: transform 0.2s; }
.multi-select-trigger .arrow.open { transform: rotate(180deg); }
.multi-select-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
  max-height: 220px; overflow-y: auto;
  margin-top: 4px; padding: 4px 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elevated); box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.multi-select-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; cursor: pointer; font-size: 13px; color: var(--text-primary);
  transition: background 0.15s;
}
.multi-select-item:hover { background: var(--bg-sunken); }
.multi-select-item input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; }

/* ===== 到期时间文字颜色 ===== */
.expire-inactive { color: #d97706; font-weight: 500; }
.expire-active { color: #16a34a; font-weight: 500; }
.expire-soon { color: #ea580c; font-weight: 500; }
.expire-expired { color: #dc2626; font-weight: 500; }

/* ===== 等宽字体 ===== */
.mono { font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Menlo', 'Consolas', monospace; font-size: 13px; }
.mono { font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Menlo', 'Consolas', monospace; font-size: 13px; }

/* ===== 配置管理列表 ===== */
.config-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.config-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-sunken);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}
.config-group-header:hover { background: var(--border-light); }
.config-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.config-group-title svg { color: var(--text-secondary); }
.config-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: 9999px;
}
.config-badge-empty { color: var(--text-disabled); }
.config-chevron {
  color: var(--text-tertiary);
  transition: transform 0.2s;
}
.config-chevron.expanded { transform: rotate(180deg); }
.config-group-body {
  padding: 12px;
  background: var(--bg-elevated);
}
.config-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.config-row:last-child { border-bottom: none; }
.config-row-key {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 30%;
  flex-shrink: 0;
}
.config-key-text { font-size: 13px; color: var(--text-secondary); }
.config-key-lock { color: var(--text-disabled); display: flex; align-items: center; }
.config-row-value { flex: 1; min-width: 0; }
.config-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.config-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: inherit;
}
.config-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1); }
.config-input-key { color: var(--text-primary); font-weight: 500; }
.config-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-tertiary);
  font-size: 13px;
}
.config-add-btn {
  margin-top: 8px;
  width: 100%;
  border: 1px dashed var(--border);
  justify-content: center;
  color: var(--text-tertiary);
}
.config-add-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ===== 小按钮 ===== */
.btn-sm { padding: 5px 8px; font-size: 13px; }

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
}
.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.pagination-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pagination-info {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 0 8px;
  font-weight: 500;
}

/* ===== 操作链接 ===== */
.action-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.action-link-primary { color: var(--primary); }
.action-link-primary:hover { color: var(--primary-hover); }
.action-link-danger { color: var(--danger); }
.action-link-danger:hover { color: var(--danger-hover); }
.action-link-warning { color: var(--warning); }
.action-link-warning:hover { color: #b45309; }

/* 全局卡密 - 广告选择下拉 */
.ad-select {
  margin-left: 8px;
  padding: 5px 28px 5px 10px;
  font-size: 12px;
  color: #374151;
  background-color: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='m1 1 4 4 4-4' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ad-select:hover {
  border-color: #9ca3af;
}
.ad-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

/* ===== 下载链接文本 ===== */
.link-text { display: flex; align-items: center; gap: 8px; }
.link-url { color: var(--text-secondary); font-size: 12px; }

/* ===== 文件上传控件 ===== */
.file-upload-wrapper { display: flex; align-items: center; gap: 12px; }
.file-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0, 0, 0, 0); }
.file-name { color: var(--text-primary); font-size: 13px; }
.file-name-placeholder { color: var(--text-tertiary); font-size: 13px; }

/* ===== 详情网格 ===== */
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.detail-item { font-size: 14px; padding: 12px; background: var(--bg-sunken); border-radius: var(--radius); }
.detail-item .label { color: var(--text-tertiary); margin-bottom: 4px; font-size: 12px; font-weight: 500; }
.detail-item .value { color: var(--text-primary); font-weight: 600; }

/* ===== 头部导航 ===== */
.header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
}
.header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  margin-left: 48px;
}
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.nav-item:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.nav-item.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}
.nav-item svg {
  width: 18px;
  height: 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

/* ===== 登录页 ===== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
}
.login-brand {
  flex: 1;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 50%, #2563eb 150%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}
.brand-decoration {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.25) 0%, transparent 70%);
  top: -100px;
  right: -100px;
}
.brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
}
.brand-logo {
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px;
  border: 1px solid rgba(255,255,255,0.15);
}
.brand-logo svg {
  width: 32px;
  height: 32px;
  color: #fff;
}
.brand-content h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.brand-content p {
  font-size: 16px;
  color: rgba(255,255,255,0.6);
  font-weight: 400;
}

.login-form-section {
  width: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
  background: var(--bg);
}
.login-form-card {
  width: 100%;
  max-width: 360px;
}
.login-header {
  margin-bottom: 32px;
}
.login-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.login-header p {
  font-size: 14px;
  color: var(--text-tertiary);
}

.login-card .form-item {
  margin-bottom: 20px;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }

/* ===== 返回按钮 ===== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
  font-weight: 500;
  padding: 6px 0;
  transition: var(--transition);
}
.back-btn:hover { color: var(--primary); }
.back-btn svg {
  width: 16px;
  height: 16px;
}

/* ===== 加载遮罩 ===== */
.loading-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 区块卡片 ===== */
.section-card {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 20px;
  padding: 20px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.section-tip {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 6px;
  line-height: 1.5;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .login-brand { display: none; }
  .login-form-section { width: 100%; }
  .header-nav { display: none; }
  .container { padding: 16px; }
}

/* ===== 全局卡密（卡片式，无横向滚动）===== */
.gc-list { display: flex; flex-direction: column; gap: 10px; }

.gc-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: var(--transition);
}
.gc-row:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.gc-row.checked {
  border-color: var(--primary);
  background: var(--primary-light);
}

.gc-check { padding-top: 3px; flex: none; }
.gc-check input { width: 16px; height: 16px; cursor: pointer; }

.gc-main { flex: 1 1 auto; min-width: 0; }

.gc-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  line-height: 1.6;
}
.gc-line + .gc-line { margin-top: 6px; }

.gc-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--text-tertiary);
  flex: none;
}

.gc-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  user-select: all;
  cursor: copy;
  word-break: break-all;
}
.gc-acct {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--text-secondary);
  user-select: all;
  cursor: copy;
  word-break: break-all;
}

.gc-label {
  font-size: 13px;
  color: var(--text-tertiary);
  flex: none;
}
.gc-val { font-size: 14.5px; color: var(--text-primary); }

.gc-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  flex: none;
}
.gc-dot-on  { background: var(--success); box-shadow: 0 0 0 3px var(--success-light); }
.gc-dot-off { background: var(--text-disabled); }

.gc-st {
  display: inline-flex;
  align-items: center;
  font-size: 14.5px;
  color: var(--text-primary);
  white-space: nowrap;
}

.gc-ip {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-sunken);
  border-radius: 5px;
  padding: 2px 8px;
  white-space: nowrap;
}

.gc-pill {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 12px;
  white-space: nowrap;
}
.gc-pill-direct { background: var(--success-light); color: var(--success); }
.gc-pill-relay  { background: var(--warning-light); color: var(--warning); }
.gc-pill-none   { background: var(--bg-sunken);     color: var(--text-disabled); }

.gc-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: none;
  font-size: 14px;
  padding-top: 2px;
}
.gc-actions a { white-space: nowrap; }

@media (max-width: 860px) {
  .gc-row { flex-wrap: wrap; }
  .gc-actions { flex-direction: row; align-items: center; width: 100%; justify-content: flex-end; }
}
