/* 2FA 验证器 — 参考 arkasm 比例与布局 */
:root {
  --bg: #eef1f8;
  --card: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #64748b;
  --border: #e8ecf4;
  --purple: #7b61ff;
  --purple-dark: #5e43f3;
  --pink: #ec4899;
  --orange: #f59e0b;
  --cyan: #06b6d4;
  --green: #10b981;
  --red: #ef4444;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 10px 40px rgba(102, 126, 234, 0.1);
  --page-width: 780px;
}

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

html {
  color-scheme: light;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.is-hidden {
  display: none !important;
}

/* 背景 */
.bg-decoration {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}

.bg-blob-1 {
  width: 420px;
  height: 420px;
  background: #c7d2fe;
  top: -120px;
  left: -100px;
}

.bg-blob-2 {
  width: 360px;
  height: 360px;
  background: #fbcfe8;
  top: 20%;
  right: -80px;
}

.bg-blob-3 {
  width: 300px;
  height: 300px;
  background: #bfdbfe;
  bottom: -80px;
  left: 30%;
}

/* 页面 */
.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* 顶栏 */
.top-bar {
  margin-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.brand-name {
  font-size: 1.1875rem;
  font-weight: 700;
  flex: 1;
}

.brand-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(123, 97, 255, 0.12);
  color: var(--purple);
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 统计卡 */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  border-radius: 16px;
  padding: 18px 16px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  min-height: 112px;
}

.stat-purple { background: linear-gradient(135deg, #8b7cff, #7b61ff, #5e43f3); }
.stat-pink { background: linear-gradient(135deg, #ff6b95, #fe4a7e, #ec4899); }
.stat-orange { background: linear-gradient(135deg, #ffb347, #ff8c00, #f59e0b); }

.stat-label {
  font-size: 0.75rem;
  opacity: 0.92;
  display: block;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  display: block;
  line-height: 1.2;
  margin-top: 4px;
}

.stat-desc {
  font-size: 0.6875rem;
  opacity: 0.88;
  display: block;
  margin-top: 4px;
}

.stat-icon {
  opacity: 0.35;
  flex-shrink: 0;
  line-height: 0;
}

.stat-icon svg {
  width: 32px;
  height: 32px;
}

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 24px 24px 0;
}

.card-header-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b7cff, #7b61ff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-header-icon.icon-yellow {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.card-header-icon.icon-blue {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.card-body {
  padding: 20px 24px 24px;
}

/* 输入区 */
.input-section {
  margin-bottom: 4px;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.input-hint {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.input-wrapper {
  position: relative;
}

.secret-input {
  display: block;
  width: 100%;
  min-height: 200px;
  padding: 16px 48px 16px 18px;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.secret-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
  background: #fff;
}

.clear-input-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.clear-input-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text);
}

.error-msg {
  font-size: 0.8125rem;
  color: var(--red);
  margin-top: 8px;
  min-height: 0;
}

.error-msg:empty {
  display: none;
}

/* 生成按钮 */
.get-code-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 20px;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #8b7cff, #7b61ff, #5e43f3);
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(94, 67, 243, 0.38);
  transition: transform 0.15s, box-shadow 0.15s;
}

.get-code-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(94, 67, 243, 0.45);
}

.get-code-btn:active {
  transform: translateY(0);
}

/* 单码结果 */
.result-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.code-showcase {
  background: linear-gradient(135deg, #7b61ff 0%, #5e43f3 50%, #4f8cff 100%);
  border: none;
  border-radius: 18px;
  padding: 24px 28px 22px;
  box-shadow: 0 10px 36px rgba(94, 67, 243, 0.38);
}

.code-showcase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.code-showcase-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.code-timer-badge {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.code-timer-badge.urgent {
  background: rgba(255, 100, 100, 0.35);
  border-color: rgba(255, 255, 255, 0.4);
}

.timer-unit {
  font-size: 0.8125rem;
  font-weight: 600;
  opacity: 0.9;
}

.code-display-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  padding: 8px 0 16px;
}

.totp-code {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  cursor: pointer;
  user-select: all;
  line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.totp-code:hover {
  opacity: 0.92;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--purple-dark);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s, background 0.15s;
}

.copy-btn:hover {
  background: #fff;
  transform: translateY(-1px);
}

.expired-tip {
  display: block;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 10px;
}

.progress-bar-wrap {
  height: 5px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 3px;
  transition: width 0.9s linear;
}

.progress-bar.urgent {
  background: rgba(255, 220, 220, 0.95);
}

.secret-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 18px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  border: 1px solid var(--border);
}

.secret-info-label {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.secret-display {
  font-family: 'SF Mono', Consolas, monospace;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-buttons {
  margin-top: 16px;
}

.qr-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.qr-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(6, 182, 212, 0.42);
}

/* 多码列表 */
.multi-codes {
  margin-top: 0;
}

.multi-codes-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

.multi-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 3px 10px;
  background: #f1f5f9;
  border-radius: 20px;
  font-variant-numeric: tabular-nums;
}

.multi-count.urgent {
  color: var(--red);
  background: rgba(239, 68, 68, 0.08);
}

.multi-codes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.multi-code-item {
  background: linear-gradient(135deg, #7b61ff 0%, #5e43f3 50%, #4f8cff 100%);
  border: none;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 6px 24px rgba(94, 67, 243, 0.28);
}

.multi-code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.multi-code-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.multi-code-timer {
  font-size: 0.8125rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
}

.multi-code-value {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff;
  cursor: pointer;
  user-select: all;
}

.multi-code-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.multi-code-progress-bar {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  transition: width 0.9s linear;
}

.multi-code-progress-bar.urgent {
  background: linear-gradient(90deg, #f87171, var(--red));
}

/* 二维码 */
.qr-section {
  margin-top: 16px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

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

.qr-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}

.close-qr-btn {
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}

.qr-canvas-wrap {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
}

#qrContainer {
  line-height: 0;
}

.qr-tip {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 12px;
}

/* 步骤 */
.quick-card {
  padding-bottom: 8px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 10px 24px 20px;
}

.step-item {
  display: flex;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--border);
}

.step-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.step-icon-1 { background: linear-gradient(135deg, #818cf8, #667eea); }
.step-icon-2 { background: linear-gradient(135deg, #f472b6, #ec4899); }
.step-icon-3 { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.step-icon-4 { background: linear-gradient(135deg, #34d399, #10b981); }

.step-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.step-num-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--purple);
}

.step-title {
  font-size: 0.9375rem;
  font-weight: 600;
}

.step-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* FAQ */
.faq-body {
  padding-top: 0;
}

.notice-banner {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: rgba(102, 126, 234, 0.06);
  border: 1px solid rgba(102, 126, 234, 0.15);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.notice-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.notice-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.notice-text strong {
  color: var(--text);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.faq-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
}

.faq-q {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.faq-a {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 推广横幅 */
.ad-promo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 50%, #fef3c7 100%);
  border: 1px solid #fed7aa;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
}

.ad-promo:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.2);
}

.ad-promo-tag {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
}

.ad-promo-text {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #9a3412;
}

.ad-promo-url {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #c2410c;
  font-family: 'SF Mono', Consolas, monospace;
}

.ad-promo-arrow {
  font-size: 1.125rem;
  font-weight: 700;
  color: #ea580c;
  line-height: 1;
}

@media (max-width: 560px) {
  .ad-promo {
    padding: 14px 16px;
    gap: 8px;
  }

  .ad-promo-text {
    width: 100%;
    font-size: 0.875rem;
  }
}

/* 页脚 */
.page-footer {
  text-align: center;
  padding: 16px 0 8px;
}

.footer-content p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.footer-copy {
  font-size: 0.75rem;
  margin-top: 4px;
  opacity: 0.8;
}

/* 复制提示 */
.copy-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 10px 20px;
  background: rgba(30, 30, 46, 0.92);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 24px;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.copy-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* 响应式 */
@media (max-width: 560px) {
  .page-wrapper {
    padding: 16px 14px 36px;
  }

  .stat-card {
    min-height: 96px;
    padding: 14px 12px;
  }

  .stat-value {
    font-size: 1.375rem;
  }

  .totp-code {
    font-size: 2.5rem;
  }

  .secret-input {
    min-height: 160px;
  }

  .code-showcase {
    padding: 20px 18px 18px;
  }
}

@media (min-width: 768px) {
  .page-wrapper {
    padding-top: 32px;
    max-width: 820px;
  }
}

@media (max-width: 360px) {
  .stat-label,
  .stat-desc {
    font-size: 0.5625rem;
  }

  .stat-value {
    font-size: 1rem;
  }
}
