/* ==========================================================================
   Gemini 自动化开通平台 - 现代极简教程风格设计系统 (Modern Clean Documentation / SaaS)
   100% 对齐 antigravity-windows-guide 教程视觉规范：纯净白底、深灰蓝文字、科技蓝高亮
   ========================================================================== */

:root {
  /* 主体色板 (参考反重力教程网设计) */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  
  /* 文字 */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-subtle: #94a3b8;
  
  /* 边框与圆角 */
  --border: #e2e8f0;
  --border-focus: #2563eb;
  --border-focus-ring: rgba(37, 99, 235, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 10px 30px -10px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 25px 60px -15px rgba(15, 23, 42, 0.25);
  --shadow-primary: 0 4px 14px rgba(37, 99, 235, 0.28);
  
  /* 状态色彩 */
  --success: #16a34a;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;
  
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
  
  --danger: #e11d48;
  --danger-bg: #fff1f2;
  --danger-border: #fecdd3;
  --danger-text: #881337;
  
  /* 字体系统 */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;
}

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

html {
  font-size: 14px;
  background-color: var(--bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   顶部导航栏 (Top Navbar - 参考教程网规范)
   ========================================================================== */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 32px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text-main);
}

.mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.15);
}

.brand-img-icon {
  width: 20px;
  height: 20px;
  display: block;
}

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

.nav-help-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.nav-help-link:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary-border);
}

.lang-selector-wrap {
  position: relative;
}

.nav-lang-btn {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.nav-lang-btn:hover {
  background: #e2e8f0;
}

.nav-lang-btn i {
  width: 14px;
  height: 14px;
  color: var(--text-dim);
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  min-width: 110px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.lang-option {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
}

.lang-option:hover, .lang-option.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* ==========================================================================
   页面主体与居中纯白卡片
   ========================================================================== */
.page-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 80px;
}

.card-shell {
  width: 100%;
  max-width: 580px;
}

.redeem-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 48px 36px;
  box-shadow: var(--shadow-card);
}

/* 卡片头部 */
.card-header {
  text-align: center;
  margin-bottom: 20px;
}

.eyebrow {
  display: inline-block;
  color: var(--primary);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.title-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.card-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.card-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* 提示卡片 (参考教程警示框规范) */
.guide-warning-card {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border: 1px solid var(--primary-border);
  border-left: 4px solid var(--primary);
  color: #1e3a8a;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.06);
}

.warn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--primary);
  margin-top: 2px;
}

.warn-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
}

/* 表单组件 */
.main-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.quota-badge i {
  width: 13px;
  height: 13px;
}

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

.form-control, .form-select, .form-textarea {
  width: 100%;
  height: 48px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0 16px;
  color: var(--text-main);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s ease;
}

.form-control.mono, .form-textarea.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

.form-control::placeholder, .form-textarea::placeholder {
  color: var(--text-subtle);
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  background: #ffffff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--border-focus-ring);
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.clear-btn, .toggle-pwd-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.clear-btn:hover, .toggle-pwd-btn:hover {
  color: var(--text-main);
}

.clear-btn i, .toggle-pwd-btn i {
  width: 16px;
  height: 16px;
}

/* 按钮规范 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text-main);
}

.btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* 提交按钮 */
.btn-submit {
  height: 50px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn-submit.btn-disabled, .btn-submit:disabled {
  background: #94a3b8;
  color: #ffffff;
  cursor: not-allowed;
  opacity: 0.85;
  box-shadow: none;
}

.btn-submit.active {
  background: #16a34a;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.3);
}

.btn-submit.active:hover {
  background: #15803d;
  transform: translateY(-1px);
}

/* 历史卡密 */
.history-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.hist-label {
  color: var(--text-dim);
}

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

.hist-tag {
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.hist-tag:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

/* 模式 Tabs */
.tab-pill-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.tab-pill {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-pill:hover {
  color: var(--text-main);
}

.tab-pill.active {
  background: #ffffff;
  border-color: var(--border);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* 双列表单 (验证类型 + 验证输入) */
.form-row-2col {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 12px;
}

.col-type, .col-twofa {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chip-link-btn {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  transition: all 0.15s;
}

.chip-link-btn i {
  width: 14px;
  height: 14px;
}

.chip-link-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary-hover);
  transform: translateY(-1px);
}

/* 2 组 8 位备用码并排输入 */
.backup-dual-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.totp-single-input {
  width: 100%;
}

.field-alert-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.field-alert-box i {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
}

/* 批量视图 */
.batch-hint-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11px;
  margin-bottom: 8px;
}

.batch-hint-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.link-action-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 0;
  text-decoration: none;
}

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

.sep {
  color: var(--text-subtle);
  margin: 0 4px;
}

.batch-code-examples code {
  display: inline-block;
  font-family: var(--font-mono);
  background: #e2e8f0;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-main);
  margin-right: 6px;
}

.form-textarea {
  height: 110px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}

.batch-stats-bar {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.batch-stats-bar b {
  color: var(--primary);
}

.batch-progress-box {
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 6px;
}

.progress-info-line {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.progress-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.2s ease;
}

/* 底部操作区 */
.card-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.footer-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-btn:hover {
  color: var(--primary);
}

.footer-btn i {
  width: 16px;
  height: 16px;
}

.footer-sep {
  color: var(--text-subtle);
}

.pill-count {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
}

/* ==========================================================================
   弹窗与抽屉 (Modals & Drawer - 现代白底卡片)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-container {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  box-shadow: var(--shadow-modal);
  border: 1px solid var(--border);
}

.modal-wide {
  max-width: 720px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

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

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

.header-mark {
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-left h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.header-left p {
  font-size: 12px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-action-icon {
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-action-icon:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-action-icon i {
  width: 16px;
  height: 16px;
}

.queue-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px 24px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.q-stat-card {
  display: flex;
  flex-direction: column;
}

.q-label {
  font-size: 11px;
  color: var(--text-dim);
}

.q-num {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
}

.filter-group {
  display: flex;
  gap: 4px;
}

.pill-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pill-btn:hover {
  color: var(--text-main);
}

.pill-btn.active {
  background: var(--primary-light);
  color: var(--primary);
}

.export-group {
  display: flex;
  gap: 6px;
}

.task-list-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 抽屉内任务卡片 */
.task-item-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.15s;
}

.task-item-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.task-card-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.task-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
}

.task-email {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

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

.task-meta {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  gap: 8px;
}

.task-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-pending { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.badge-running { background: var(--primary-light); color: var(--primary); border: 1px solid var(--primary-border); }
.badge-abnormal { background: #fdf4ff; color: #a21caf; border: 1px solid #f0abfc; }
.badge-success { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.badge-failed { background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-border); }
.badge-cancelled { background: #f1f5f9; color: var(--text-dim); border: 1px solid var(--border); }

.empty-placeholder {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}

.empty-placeholder i {
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
  opacity: 0.5;
}

/* Toast 提示 */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 260px;
  max-width: 380px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  animation: toastSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast-success { border-left: 4px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }

.toast-error { border-left: 4px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }

.toast-warning { border-left: 4px solid var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* 响应式 */
@media (max-width: 560px) {
  .top { padding: 12px 16px; }
  .page-body { padding: 20px 14px; }
  .redeem-card { padding: 24px 18px; }
  .form-row-2col { grid-template-columns: 1fr; }
}
