@charset "UTF-8";

:root {
  color-scheme: light;
  --font-sans: "Segoe UI Variable Display", "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --bg: #f6f9fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #f1f5f9;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --text-soft: #475569;
  --muted: #64748b;
  --sidebar: #0f172a;
  --sidebar-soft: #1e293b;
  --sidebar-active: #123b3a;
  --sidebar-line: rgba(255, 255, 255, 0.12);
  --primary: #0f766e;
  --primary-hover: #0d9488;
  --primary-active: #115e59;
  --primary-soft: #ccfbf1;
  --primary-bg: #ecfdf5;
  --accent: #2563eb;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-line: #bbf7d0;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-line: #fecaca;
  --warning: #b45309;
  --warning-strong: #92400e;
  --warning-bg: #fffbeb;
  --warning-line: #fde68a;
  --disabled-bg: #f1f5f9;
  --disabled-text: #94a3b8;
  --focus: rgba(15, 118, 110, 0.26);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px rgba(15, 23, 42, 0.05);
  font-family: var(--font-sans);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, #ffffff 0%, #f3f8fb 42%, #f0f6fa 100%);
  background-size:
    40px 40px,
    40px 40px,
    auto;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body,
button,
input,
textarea {
  font-family: var(--font-sans);
}

button,
input,
textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

.mock-mode .page-shell::before {
  content: attr(data-mock-label);
  min-height: 34px;
  margin-bottom: 10px;
  padding: 6px 11px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 10px;
  display: flex;
  align-items: center;
  color: #b45309;
  background: rgba(255, 251, 235, 0.72);
  font-size: 12px;
  font-weight: 750;
}

.page-header {
  min-height: 76px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.hero-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.header-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.language-switch {
  min-height: 46px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: inline-flex;
  gap: 4px;
  background: var(--surface-muted);
}

.language-option {
  min-width: 48px;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.language-option:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
}

.language-option.active {
  color: #ffffff;
  background: var(--primary);
}

.mode-switch {
  min-height: 46px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: inline-flex;
  gap: 4px;
  background: var(--surface-muted);
}

.mode-tab {
  min-width: 128px;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
  transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.mode-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
}

.mode-tab.active {
  color: #ffffff;
  background: var(--sidebar);
}

.mode-tab:active,
.language-option:active,
.btn:active,
.guide-link:active {
  transform: translateY(1px);
}

.mode-tab:focus-visible,
.language-option:focus-visible,
.btn:focus-visible,
.guide-link:focus-visible,
input:focus-visible,
textarea:focus-visible,
.switch input:focus-visible + .switch-track {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.panel[hidden],
.flow-step[hidden] {
  display: none;
}

.redeem-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.guide-card,
.flow-card,
.batch-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.guide-card {
  padding: 18px;
  background: var(--sidebar);
  color: #ffffff;
}

.guide-card h2,
.batch-head h2,
.flow-heading h2 {
  margin: 0;
  font-weight: 900;
  letter-spacing: 0;
}

.guide-card h2 {
  font-size: 22px;
}

.guide-card > p {
  margin: 6px 0 14px;
  color: #a7b1c2;
  font-size: 13px;
}

.guide-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.guide-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--sidebar-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  opacity: 0.72;
  transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.guide-number {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #dbeafe;
  background: var(--sidebar-soft);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.guide-item.active {
  border-color: rgba(45, 212, 191, 0.55);
  background: var(--sidebar-active);
  opacity: 1;
}

.guide-item.active .guide-number {
  color: #ffffff;
  background: var(--primary);
}

.guide-item.done {
  border-color: rgba(153, 246, 228, 0.28);
  opacity: 0.92;
}

.guide-item.done .guide-number {
  color: #99f6e4;
  background: rgba(15, 118, 110, 0.26);
}

.guide-item h3 {
  margin: 0;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 900;
}

.guide-item p {
  margin: 4px 0 0;
  color: #b7c3d4;
  font-size: 12px;
}

.guide-link {
  width: fit-content;
  min-height: 44px;
  margin-top: 8px;
  border: 1px solid rgba(94, 234, 212, 0.68);
  border-radius: 9px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.28);
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.guide-link:hover {
  border-color: rgba(153, 246, 228, 0.92);
  background: var(--primary-hover);
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.36);
}

.flow-card,
.batch-card {
  background: rgba(255, 255, 255, 0.94);
}

.flow-card {
  padding: 18px;
}

.flow-progress {
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
}

.progress-item {
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 850;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.progress-marker {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.progress-item.done {
  border-color: #99f6e4;
  color: var(--primary);
  background: var(--primary-bg);
}

.progress-item.done .progress-marker {
  background: var(--primary-soft);
  color: var(--primary);
}

.progress-item.active {
  border-color: #99f6e4;
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 0 0 2px rgba(20, 184, 166, 0.035);
}

.progress-item.active .progress-marker {
  background: var(--primary);
  color: #ffffff;
}

.flow-step,
.form-stack {
  display: grid;
  gap: 12px;
}

.flow-step {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.flow-heading {
  display: grid;
  gap: 4px;
}

.flow-heading h2 {
  color: var(--text);
  font-size: 28px;
  line-height: 1.16;
}

.flow-heading p,
.batch-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

label {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 850;
}

.required {
  color: var(--danger);
}

.hint {
  color: var(--muted);
  font-size: 12px;
}

input[type="text"],
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input[type="text"] {
  min-height: 46px;
  padding: 10px 13px;
}

textarea {
  min-height: 128px;
  padding: 11px 13px;
  resize: vertical;
  tab-size: 2;
}

textarea.session-input {
  min-height: 164px;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.batch-textarea {
  min-height: 180px;
  max-height: 240px;
}

input[type="text"]:hover,
textarea:hover {
  border-color: #8fa1b7;
}

input[type="text"]:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus);
}

textarea[aria-invalid="true"],
input[aria-invalid="true"] {
  border-color: var(--danger);
}

textarea[aria-invalid="true"]:focus,
input[aria-invalid="true"]:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.16);
}

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

.btn {
  min-height: 44px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.18);
  text-decoration: none;
  font-weight: 850;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
}

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

.btn:active:not(:disabled) {
  border-color: var(--primary-active);
  background: var(--primary-active);
}

.btn:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  color: var(--disabled-text);
  background: var(--disabled-bg);
  box-shadow: none;
  opacity: 0.85;
}

.btn.secondary {
  border-color: var(--line-strong);
  background: #ffffff;
  color: var(--text-soft);
  box-shadow: none;
}

.btn.secondary:hover:not(:disabled) {
  border-color: #8fa1b7;
  background: var(--surface-soft);
}

.btn.secondary:disabled {
  border-color: var(--line);
  color: var(--disabled-text);
  background: var(--disabled-bg);
  box-shadow: none;
}

.link-button {
  width: fit-content;
}

.switch-row {
  min-height: 56px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface-soft);
}

.warning-row {
  border-color: var(--warning-line);
  background: var(--warning-bg);
}

.switch-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.warning-row label {
  color: var(--warning-strong);
}

.switch-row .warning-note {
  color: var(--warning);
  font-weight: 850;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 50px;
  height: 30px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c8d3e1;
  pointer-events: none;
  transition: background 0.16s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.22);
  transition: transform 0.16s ease;
}

.switch input:checked + .switch-track {
  background: var(--primary);
}

.switch input:checked + .switch-track::after {
  transform: translateX(20px);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  display: grid;
  gap: 4px;
  background: var(--surface-soft);
}

.summary-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.summary-item strong {
  color: var(--text);
  word-break: break-word;
}

.status-line {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
}

.activate-result {
  display: grid;
  gap: 10px;
  scroll-margin-top: 14px;
}

#activate-form.activate-complete [data-flow-step="4"] .summary-grid,
#activate-form.activate-complete [data-flow-step="4"] .warning-row {
  display: none;
}

#activate-form.activate-complete [data-flow-step="4"] .activate-result {
  order: 1;
}

#activate-form.activate-complete [data-flow-step="4"] .actions {
  order: 2;
}

#activate-form.activate-complete #activate-submit,
#activate-form.activate-complete [data-step-back="3"] {
  display: none;
}

.message {
  display: none;
  border-radius: 11px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 750;
}

.message.visible {
  display: block;
}

.message.success {
  border-color: var(--success-line);
  background: var(--success-bg);
  color: var(--success);
}

.message.error {
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger);
}

.message.warning {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning);
}

.details {
  display: none;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: #ffffff;
}

.details.visible {
  display: block;
}

.detail-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.detail-row:first-child {
  border-top: 0;
}

.detail-key,
.detail-value {
  padding: 9px 12px;
  min-width: 0;
  word-break: break-word;
}

.detail-key {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.batch-card {
  margin: 0 auto;
  padding: 24px;
  background: var(--surface);
}

.batch-head {
  margin-bottom: 16px;
  display: grid;
  gap: 4px;
}

.batch-head h2 {
  color: var(--text);
  font-size: 30px;
}

.captcha-field {
  display: grid;
  gap: 8px;
}

.captcha-field[hidden] {
  display: none;
}

.captcha-box {
  min-height: 78px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #ffffff;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

th {
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

tbody tr:hover {
  background: var(--surface-soft);
}

tbody tr:has(.empty-cell):hover {
  background: transparent;
}

td {
  color: var(--text);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.empty-cell {
  height: 96px;
  color: var(--muted);
  text-align: center;
  vertical-align: middle;
}

.batch-stats {
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-soft);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 750;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.unused {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-line);
}

.badge.unavailable {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-line);
}

.badge.pending,
.badge.used {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-line);
}

.confirm-dialog {
  width: min(100% - 32px, 520px);
  border: 0;
  border-radius: 18px;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.confirm-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 16px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
}

.confirm-head {
  display: grid;
  gap: 5px;
}

.confirm-kicker {
  width: fit-content;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 900;
}

.confirm-head h2,
.confirm-head p {
  margin: 0;
}

.confirm-head h2 {
  font-size: 26px;
  line-height: 1.18;
}

.confirm-head p {
  color: var(--muted);
  font-size: 14px;
}

.confirm-summary {
  display: grid;
  gap: 10px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.mono {
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
}

.hero-copy h1,
.flow-heading h2,
.batch-head h2,
.guide-card h2,
.confirm-head h2 {
  font-weight: 800;
}

.eyebrow,
.language-option,
.mode-tab,
.progress-item,
.guide-item h3,
.guide-link,
label,
.btn,
.summary-item span,
.batch-stats,
.message,
.badge,
.detail-key,
.confirm-kicker {
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 920px) {
  .page-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .redeem-layout {
    grid-template-columns: 1fr;
  }

  .guide-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 14px;
  }

  .page-header,
  .guide-card,
  .flow-card,
  .batch-card {
    padding: 14px;
    border-radius: 15px;
  }

  .hero-copy h1 {
    font-size: 26px;
  }

  .flow-heading h2,
  .batch-head h2 {
    font-size: 24px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .language-switch,
  .mode-switch {
    width: 100%;
  }

  .language-option,
  .mode-tab {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 8px;
  }

  .guide-list,
  .flow-progress,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  #activate-form.activate-complete #activate-details .detail-row {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  #activate-form.activate-complete #activate-details .detail-key,
  #activate-form.activate-complete #activate-details .detail-value {
    padding: 8px 10px;
  }

  #activate-form.activate-complete #activate-details .detail-value {
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .btn,
  .guide-link,
  .link-button {
    width: 100%;
  }

  .confirm-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-row {
    grid-template-columns: 1fr;
  }

  .detail-value {
    border-top: 1px solid var(--line);
  }
}
