:root {
  color-scheme: light;

  /* ===== Legacy tokens (后台仍在用，保留) ===== */
  --ink: #141414;
  --muted: #6b6f76;
  --line: #d8dde3;
  --soft: #f5f7fa;
  --panel: #ffffff;
  --night: #050505;
  --night-2: #151515;
  --gold: #f6b939;
  --lemon: #f7ec43;
  --green: #18a058;
  --teal: #0f8b8d;
  --blue: #276ef1;
  --red: #d94841;
  --orange: #f08b2f;
  --radius: 8px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.22);

  /* ===== Enthra 前台 Design Tokens (浅色柔和关怀风) ===== */
  --bg-primary: #fafbfc;
  --bg-secondary: #f4f6f8;
  --surface: #ffffff;
  --ink-deep: #1a2332;
  --ink-soft: #5a6478;
  --ink-muted: #94a0b4;

  /* 品牌色：竹纤维绿（呼应 93% 竹纤维卖点）*/
  --brand: #2dbe60;
  --brand-deep: #1a9e4a;
  --brand-soft: #e8f8ee;
  --brand-glow: rgba(45, 190, 96, 0.12);

  /* 辅助色 */
  --accent: #5b8def;
  --warm: #ff8a65;
  --warm-soft: #fff0eb;
  --error: #e5484d;
  --error-soft: #fdeced;

  /* 圆角 */
  --radius-sm: 8px;
  --r-card: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  /* 阴影 */
  --shadow-soft: 0 2px 8px rgba(26, 35, 50, 0.04), 0 1px 2px rgba(26, 35, 50, 0.06);
  --shadow-card: 0 4px 24px rgba(26, 35, 50, 0.06);
  --shadow-hover: 0 8px 32px rgba(45, 190, 96, 0.12);
  --shadow-brand: 0 6px 20px rgba(45, 190, 96, 0.25);

  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #eef2f5;
  color: var(--ink);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 60px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.brand-lockup {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.topbar-logo-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(45, 190, 96, 0.25);
  color: #fff;
  display: grid;
  height: 36px;
  place-items: center;
  width: 36px;
}

.topbar-logo-mark svg {
  height: 20px;
  width: 20px;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(45, 190, 96, 0.25);
  color: #fff;
  display: grid;
  font-weight: 800;
  height: 36px;
  place-items: center;
  width: 36px;
}

.brand-name {
  color: var(--ink-deep);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-name-accent {
  color: var(--brand-deep);
  font-weight: 600;
}

.brand-sub {
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.2;
}

.nav-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.ghost-button,
.solid-button,
.danger-button,
.soft-button,
.icon-button {
  align-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  display: inline-flex;
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.ghost-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-soft);
}

.ghost-button:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.soft-button {
  background: var(--brand-soft);
  border-color: rgba(45, 190, 96, 0.2);
  color: var(--brand-deep);
}

.soft-button:hover {
  background: var(--brand);
  color: #fff;
}

.solid-button {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border: 0;
  box-shadow: 0 4px 12px rgba(45, 190, 96, 0.2);
  color: #fff;
}

.solid-button:hover {
  box-shadow: 0 6px 16px rgba(45, 190, 96, 0.3);
}

.danger-button {
  background: var(--error-soft);
  border-color: rgba(229, 72, 77, 0.2);
  color: var(--error);
}

.danger-button:hover {
  background: var(--error);
  color: #fff;
}

.icon-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-soft);
  height: 38px;
  min-height: 38px;
  padding: 0;
  width: 38px;
}

.ghost-button:hover,
.solid-button:hover,
.danger-button:hover,
.soft-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

/* ========================================================================
   ENTHRA 前台 — 浅色柔和关怀风 × 竹纤维绿品牌
   彻底移除"两层式"黑卡片，改为全屏柔和渐变 + 内容居中
   ======================================================================== */

.buyer-shell {
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  min-height: calc(100vh - 58px);
  padding: 0;
  position: relative;
}

/* 装饰性背景光晕（极淡，不抢注意力）*/
.buyer-shell::before {
  background:
    radial-gradient(circle at 15% 10%, var(--brand-glow), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(91, 141, 239, 0.06), transparent 40%);
  content: "";
  inset: 0;
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

/* 内容容器：移动端全宽，PC 端 480px 居中 */
.buyer-container {
  margin: 0 auto;
  max-width: 480px;
  min-height: calc(100vh - 58px);
  padding: 24px 20px 48px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}
/* Widen the container on the activation page so the marketing side panel can
   sit beside the form. Modern browsers support :has(); older ones simply keep
   the narrow single-column layout. */
.buyer-container:has(.activation-split) {
  max-width: 760px;
}

/* ===== 品牌 Header（sticky，含 logo + 进度条）===== */
.brand-header {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.brand-logo {
  align-items: center;
  display: flex;
  gap: 10px;
}

.brand-logo-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border-radius: 12px;
  color: #fff;
  display: grid;
  height: 40px;
  place-items: center;
  width: 40px;
  box-shadow: var(--shadow-brand);
}

.brand-logo-mark svg {
  height: 22px;
  width: 22px;
}

.brand-logo-text {
  color: var(--ink-deep);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-tagline {
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ===== 主内容卡片 ===== */
.stage-card {
  animation: enthra-fade-up 0.4s ease;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 32px 24px;
  width: 100%;
}

@keyframes enthra-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flow-title {
  color: var(--ink-deep);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0 0 12px;
}

.flow-copy {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 20px;
}

.label {
  color: var(--ink-deep);
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 18px 0 8px;
}

/* ===== 输入框（浅灰底无边框，focus 绿色光晕）===== */
.field,
.select,
.textarea {
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-deep);
  font-size: 16px;
  min-height: 56px;
  min-width: 0;
  outline: 0;
  padding: 0 16px;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field:focus,
.select:focus,
.textarea:focus {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-glow);
}

.textarea {
  min-height: 120px;
  padding: 14px 16px;
  resize: vertical;
}

.field-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 44px minmax(0, 1fr);
}

.field-icon {
  align-items: center;
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  color: var(--brand-deep);
  display: grid;
  font-size: 18px;
  font-weight: 700;
  height: 56px;
  place-items: center;
  width: 44px;
}

/* ===== 礼品预告徽章 ===== */
.gift-badge {
  align-items: center;
  background: var(--brand-soft);
  border: 1px solid rgba(45, 190, 96, 0.2);
  border-radius: var(--r-card);
  color: var(--brand-deep);
  display: flex;
  font-size: 14px;
  font-weight: 600;
  gap: 10px;
  margin: 20px 0;
  padding: 14px 18px;
}

.gift-badge-icon {
  font-size: 22px;
}

/* ===== 激活页：左侧营销侧栏 + 右侧表单 ===== */
.activation-split {
  align-items: stretch;
  display: flex;
  flex-direction: row;
  gap: 20px;
  width: 100%;
}
.activation-form {
  flex: 1 1 auto;
  min-width: 0;
}
.activation-pitch {
  background: var(--bg-secondary);
  border-radius: var(--r-card);
  color: var(--ink-soft);
  display: none;
  flex: 0 0 260px;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.65;
  padding: 28px 24px;
}
/* Only show the side panel on wide screens. */
@media (min-width: 720px) {
  .activation-pitch {
    display: flex;
    flex-direction: column;
  }
}
.activation-pitch-title {
  color: var(--ink-deep);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 10px;
}
.activation-pitch-title span {
  color: var(--brand-deep);
}
.activation-pitch-sub {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 0 0 18px;
  text-transform: uppercase;
}
.activation-pitch-terms {
  border-top: 1px solid var(--line, rgba(0, 0, 0, 0.08));
  color: var(--ink-muted);
  flex: 1 1 auto;
  font-size: 12.5px;
  margin-top: auto;
  padding-top: 14px;
}
.activation-pitch-terms p {
  line-height: 1.6;
  margin: 0 0 10px;
}
.activation-pitch-terms ol {
  margin: 0;
  padding-left: 18px;
}
.activation-pitch-terms li {
  line-height: 1.6;
  margin-bottom: 9px;
}
.activation-pitch-terms strong {
  color: var(--ink-soft);
  font-weight: 700;
}

/* ===== 主 CTA 按钮（品牌绿渐变）===== */
.gold-cta {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border: 0;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-brand);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-top: 24px;
  min-height: 56px;
  padding: 0 32px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  width: 100%;
}

.gold-cta:hover:not(:disabled) {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.gold-cta:not(:disabled):active {
  transform: scale(0.98);
}

.gold-cta.wide {
  width: 100%;
}

.gold-cta.is-loading {
  opacity: 0.92;
}

/* 次级按钮 */
.dark-cta {
  background: linear-gradient(135deg, var(--accent), #4a7bd8);
  border: 0;
  border-radius: var(--r-pill);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  min-height: 52px;
  width: 100%;
  transition: transform 0.15s ease;
}

.dark-cta:hover {
  transform: translateY(-2px);
}

.silver-cta {
  background: var(--surface);
  border: 1.5px solid var(--ink-muted);
  border-radius: var(--r-pill);
  color: var(--ink-deep);
  font-size: 16px;
  font-weight: 600;
  min-height: 52px;
  width: 100%;
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.silver-cta:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
  transform: translateY(-2px);
}

/* ===== 帮助链接 ===== */
.field-help {
  align-items: center;
  background: none;
  border: 0;
  color: var(--accent);
  display: inline-flex;
  font-size: 14px;
  gap: 6px;
  margin-top: 14px;
  padding: 0;
  text-decoration: none;
}

.field-help:hover {
  text-decoration: underline;
}

.privacy-note {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 16px 0 0;
}

/* ===== 错误提示（柔和红色卡片 + 呼吸光晕）===== */
.form-error,
.form-error-breathing {
  animation: enthra-breathe 1.8s ease-in-out infinite;
  background: var(--error-soft);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-weight: 600;
  line-height: 1.5;
  margin: 12px 0;
  padding: 14px 16px;
}

@keyframes enthra-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); }
  50% { box-shadow: 0 0 0 6px rgba(229, 72, 77, 0.1); }
}

.form-error a {
  color: var(--accent);
  font-weight: 600;
}

.retry-button {
  background: var(--surface);
  border: 1.5px solid var(--error);
  border-radius: var(--r-pill);
  color: var(--error);
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
  min-height: 44px;
  padding: 0 24px;
  transition: all 0.15s ease;
}

.retry-button:hover {
  background: var(--error);
  color: #fff;
}

/* ===== 成功 banner（激活成功页）===== */
.success-banner {
  align-items: center;
  background: var(--brand-soft);
  border-radius: var(--r-card);
  display: grid;
  gap: 16px;
  grid-template-columns: 64px 1fr;
  margin: 0 0 24px;
  padding: 20px;
}

.success-dot {
  align-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border-radius: 50%;
  box-shadow: 0 0 0 6px var(--brand-glow);
  color: #fff;
  display: grid;
  font-size: 32px;
  font-weight: 700;
  height: 64px;
  place-items: center;
  width: 64px;
  animation: enthra-pulse 2s ease-in-out infinite;
}

@keyframes enthra-pulse {
  0%, 100% { box-shadow: 0 0 0 6px var(--brand-glow); }
  50% { box-shadow: 0 0 0 12px rgba(45, 190, 96, 0.04); }
}

.success-banner .flow-copy {
  color: var(--brand-deep);
  font-weight: 600;
  margin: 0;
}

/* ===== 礼品卡片 ===== */
.gift-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--r-card);
  margin: 16px 0;
  padding: 24px;
}

.gift-title {
  color: var(--ink-deep);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 10px;
}

.gift-list {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
  margin: 0;
  padding-left: 20px;
}

.gift-list li {
  margin-bottom: 4px;
}

/* ===== 进度指示器 ===== */
.flow-progress {
  margin: 0 0 24px;
}

.flow-progress-label {
  color: var(--ink-muted);
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.flow-progress-bar {
  background: var(--bg-secondary);
  border-radius: var(--r-pill);
  height: 6px;
  overflow: hidden;
}

.flow-progress-fill {
  background: linear-gradient(90deg, var(--brand), var(--brand-deep));
  border-radius: var(--r-pill);
  height: 100%;
  transition: width 0.5s ease;
}

/* ===== 星星评分 ===== */
.stars {
  display: flex;
  gap: clamp(8px, 3vw, 14px);
  justify-content: center;
  margin: 20px 0 28px;
}

.star-button {
  background: transparent;
  border: 0;
  color: var(--ink-muted);
  font-size: clamp(40px, 10vw, 56px);
  line-height: 1;
  padding: 6px;
  text-shadow: none;
  transition: transform 0.12s ease, color 0.15s ease;
}

.star-button:hover {
  transform: scale(1.15);
}

.star-button:active {
  transform: scale(1.25);
}

.star-button.is-on {
  color: var(--gold);
}

/* ===== 操作按钮组 ===== */
.flow-actions {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
  margin-top: 24px;
}

/* ===== 评论展示框（Amazon 页）===== */
.review-box {
  background: var(--brand-soft);
  border: 1px solid rgba(45, 190, 96, 0.15);
  border-radius: var(--radius-sm);
  color: var(--ink-deep);
  font-size: 15px;
  line-height: 1.6;
  min-height: 88px;
  padding: 16px;
  width: 100%;
}

/* ===== 复选框行 ===== */
.check-row {
  align-items: flex-start;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 12px;
  grid-template-columns: 24px 1fr;
  margin: 16px 0;
  padding: 14px 16px;
}

.check-row input {
  accent-color: var(--brand);
  height: 20px;
  margin-top: 2px;
  width: 20px;
}

.check-row span {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

/* ===== 售后路径暖色调（区别于好评绿色）===== */
.stage-card.is-warm {
  border-top: 4px solid var(--warm);
}

.stage-card.is-warm .label {
  color: var(--ink-deep);
}

/* ===== 完成页庆祝 ===== */
.finish-icon {
  align-items: center;
  display: grid;
  font-size: 64px;
  height: 96px;
  justify-items: center;
  margin: 0 auto 16px;
  place-items: center;
  width: 96px;
}

/* ===== 客服邮箱卡片（完成页）===== */
.support-email-card {
  align-items: center;
  background: var(--bg-secondary);
  border-radius: var(--r-card);
  color: var(--ink-deep);
  display: inline-flex;
  font-size: 15px;
  font-weight: 600;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
  padding: 14px 24px;
  text-decoration: none;
}

.support-email-card:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

/* ===== 已激活管理页（重复订单·已完成）===== */
.already-box {
  background: var(--bg-secondary);
  border-radius: var(--r-card);
  margin: 14px 0;
  padding: 14px 18px;
  text-align: left;
}
.already-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding: 6px 0;
}
.already-row + .already-row {
  border-top: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.06));
}
.already-label {
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 600;
}
.already-value {
  color: var(--ink-deep);
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}
.already-stars {
  color: #f5a623;
  font-size: 18px;
  letter-spacing: 2px;
}

/* ===== 信任 Footer ===== */
.footer-trust {
  align-items: center;
  color: var(--ink-muted);
  display: flex;
  font-size: 12px;
  gap: 20px;
  justify-content: center;
  margin-top: 32px;
  padding: 16px 0;
}

.footer-trust-item {
  align-items: center;
  display: flex;
  gap: 6px;
}

.footer-trust-item svg {
  height: 14px;
  width: 14px;
}

/* Discreet admin entry — appears as a dim dot, reveals on hover */
.admin-entry-link {
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1;
  opacity: 0.35;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.admin-entry-link:hover {
  opacity: 1;
}

/* ===== 关闭按钮（重启流程，移到右上角小图标）===== */
.close-pill {
  align-items: center;
  background: var(--bg-secondary);
  border: 0;
  border-radius: 50%;
  color: var(--ink-muted);
  display: grid;
  font-size: 20px;
  height: 36px;
  line-height: 1;
  place-items: center;
  position: absolute;
  right: 16px;
  top: 16px;
  transition: all 0.15s ease;
  width: 36px;
  z-index: 10;
}

.close-pill:hover {
  background: var(--error-soft);
  color: var(--error);
}

/* 保留给后台用的 white-card（后台不依赖，但兼容）*/
.white-card {
  background: var(--surface);
  border-radius: var(--r-card);
  color: var(--ink-deep);
  padding: 24px;
}

.white-card + .white-card {
  margin-top: 16px;
}

.modal-language {
  display: none;
}

.stepper,
.step,
.step-line,
.step.is-muted {
  display: none;
}

/* ========================================================================
   ENTHRA 后台 — 与前台统一的浅色品牌风
   深蓝灰侧边栏（非纯黑）+ 品牌绿点缀 + 现代表格
   ======================================================================== */

.admin-app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 58px);
}

/* 侧边栏：深蓝灰（更现代，非纯黑）+ 顶部品牌色条 */
.admin-sidebar {
  background: linear-gradient(180deg, #1a2332 0%, #141b29 100%);
  border-top: 3px solid var(--brand);
  color: #fff;
  padding: 20px 14px;
}

.admin-tenant {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
  padding: 0 8px 18px;
}

.admin-tenant strong {
  color: #fff;
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.admin-tenant span {
  color: rgba(255, 255, 255, 0.5);
  display: block;
  font-size: 11px;
  margin-top: 4px;
}

.side-section {
  color: rgba(255, 255, 255, 0.35);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 22px 10px 8px;
  text-transform: uppercase;
}

.side-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  font-size: 14px;
  font-weight: 600;
  gap: 9px;
  min-height: 38px;
  padding: 0 12px;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}

.side-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.side-button.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(45, 190, 96, 0.25);
}

/* 主区域：柔和背景 */
.admin-main {
  background: var(--bg-secondary);
  min-width: 0;
  padding: 28px 32px;
}

.admin-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-title {
  color: var(--ink-deep);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.admin-desc {
  color: var(--ink-muted);
  font-size: 13px;
  margin: 6px 0 0;
}

/* Metric 卡片：白底 + 顶部品牌色细条 + 柔和阴影 */
.metrics-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  min-height: 110px;
  padding: 18px;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.metric::before {
  background: var(--brand);
  border-radius: 0 0 4px 4px;
  content: "";
  height: 3px;
  left: 18px;
  position: absolute;
  top: 0;
  width: 32px;
}

.metric:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.metric-label {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.metric-value {
  align-items: baseline;
  color: var(--ink-deep);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 10px;
}

.metric-today {
  background: var(--brand-soft);
  border-radius: 6px;
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 700;
  margin-left: 8px;
  padding: 2px 8px;
}

.metric-note {
  color: var(--ink-muted);
  font-size: 11px;
  margin-top: 6px;
}

/* 面板：白底大圆角 */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  margin-top: 16px;
  padding: 20px;
}

.panel-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-title {
  color: var(--ink-deep);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

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

.toolbar .field,
.toolbar .select {
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: 38px;
  min-width: 180px;
  width: auto;
}

.toolbar .field:focus,
.toolbar .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

/* 表格：现代化，去重边框 */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  max-height: 70vh;
  overflow: auto;
  position: relative;
}
/* Sticky header so users can horizontally scroll the table without losing
   column labels, and the scrollbar sits within the visible viewport. */
.data-table thead th {
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1080px;
  width: 100%;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--bg-secondary);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 1;
}

.data-table tbody tr {
  transition: background 0.12s ease;
}

.data-table tbody tr:hover td {
  background: var(--brand-soft);
}

.status-pill,
.path-pill,
.rating-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
  white-space: nowrap;
}

.status-pill.success,
.path-pill.positive {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.status-pill.failed,
.path-pill.negative {
  background: var(--error-soft);
  color: var(--error);
}

.status-pill.pending,
.path-pill.neutral {
  background: var(--warm-soft);
  color: #c4622e;
}

.rating-pill {
  background: #fff8e6;
  color: #8a6500;
}

.progress-stack {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  max-width: 360px;
  overflow: hidden;
  white-space: nowrap;
}

.progress-chip {
  background: var(--bg-secondary);
  border-radius: 999px;
  color: var(--ink-soft);
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
}

.progress-sep {
  color: var(--ink-muted);
  flex-shrink: 0;
  font-size: 11px;
}

/* ===== 6-step sequential progress (green check / grey) ===== */
.step-progress {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  min-width: 320px;
}
.step-dot {
  align-items: center;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 3px;
}
.step-check {
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: var(--ink-muted);
  display: flex;
  font-size: 10px;
  font-weight: 700;
  height: 20px;
  justify-content: center;
  width: 20px;
}
.step-dot.is-done .step-check {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.step-label {
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 600;
  max-width: 84px;
  text-align: center;
  white-space: normal;
  word-break: break-word;
}
.step-dot.is-done .step-label {
  color: var(--brand-deep);
}
.step-line {
  background: var(--line);
  flex-shrink: 0;
  height: 2px;
  margin-top: -14px;
  width: 10px;
}

/* ===== buyer review cell ===== */
.cell-stars {
  color: #f5a623;
  font-size: 13px;
  letter-spacing: 1px;
}
.cell-stars-num {
  color: var(--ink-muted);
  font-size: 11px;
  letter-spacing: 0;
}
.cell-review {
  color: var(--ink-soft);
  font-size: 12px;
  font-style: italic;
  line-height: 1.5;
  margin-top: 4px;
  max-width: 200px;
}

/* ===== note area (auto-save) ===== */
.note-area {
  font-size: 12px;
  min-height: 60px;
  min-width: 160px;
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 240px;
}

/* Keep action buttons on one line inside narrow table cells instead of
   stacking vertically. The table scrolls horizontally to accommodate. */
.mini-actions .mini-button {
  white-space: nowrap;
}

.mini-button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  min-height: 30px;
  padding: 0 10px;
}

.mini-button:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.mini-button.is-on {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-deep);
}

.split-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.35fr 0.65fr;
}

.chart-bars {
  display: grid;
  gap: 14px;
}

.bar-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 120px 1fr 56px;
}

.bar-track {
  background: var(--bg-secondary);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.bar-fill {
  background: linear-gradient(90deg, var(--brand), var(--brand-deep));
  border-radius: 999px;
  height: 100%;
  min-width: 4px;
  transition: width 0.5s ease;
}

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

.reference-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.reference-card img {
  display: block;
  height: 150px;
  object-fit: cover;
  object-position: top center;
  width: 100%;
}

.reference-card span {
  color: var(--ink-muted);
  display: block;
  font-size: 12px;
  padding: 8px;
}

.login-wrap {
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  display: grid;
  min-height: calc(100vh - 58px);
  padding: 24px;
  place-items: center;
  position: relative;
}

.login-wrap::before {
  background:
    radial-gradient(circle at 20% 20%, var(--brand-glow), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(91, 141, 239, 0.05), transparent 45%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.login-panel {
  animation: enthra-fade-up 0.4s ease;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  max-width: 420px;
  padding: 36px 32px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.login-panel .admin-title {
  margin-bottom: 6px;
}

.demo-note {
  background: var(--brand-soft);
  border: 1px solid rgba(45, 190, 96, 0.2);
  border-radius: var(--radius-sm);
  color: var(--brand-deep);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 16px;
  padding: 12px 14px;
}

.empty-state {
  color: var(--ink-muted);
  padding: 32px 24px;
  text-align: center;
}

.toast {
  background: var(--ink-deep);
  border-radius: var(--r-pill);
  bottom: 22px;
  color: #fff;
  font-weight: 750;
  left: 50%;
  max-width: calc(100vw - 28px);
  padding: 12px 18px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 80;
}

@media (max-width: 1180px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .split-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 10px 14px;
  }

  .nav-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 0;
    width: 100%;
  }

  .nav-actions button {
    font-size: 13px;
    min-width: 0;
    padding: 0 8px;
    text-align: center;
    white-space: normal;
  }

  .nav-actions .danger-button {
    display: none;
  }

  .admin-app {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    border-right: 0;
    border-top: 3px solid var(--brand);
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 12px;
  }

  .admin-tenant,
  .side-section {
    display: none;
  }

  .side-button {
    border-radius: var(--r-pill);
    flex: 0 0 auto;
    font-size: 13px;
    min-height: 36px;
    padding: 0 14px;
    white-space: nowrap;
    width: auto;
  }

  .admin-main {
    padding: 18px 14px;
  }

  .admin-head {
    flex-direction: column;
  }

  .admin-title {
    font-size: 22px;
  }

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

  .metric {
    min-height: 90px;
    padding: 14px;
  }

  .metric-value {
    font-size: 24px;
  }

  .panel {
    padding: 16px 14px;
  }

  .buyer-container {
    padding: 20px 16px 40px;
  }

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

@media (max-width: 560px) {
  .brand-sub {
    display: none;
  }

  .buyer-container {
    padding: 16px 14px 32px;
  }

  .stage-card {
    padding: 24px 18px;
  }

  .flow-title {
    font-size: 22px;
  }

  .gold-cta,
  .retry-button {
    min-height: 54px;
  }

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

  .footer-trust {
    flex-wrap: wrap;
    gap: 12px;
  }

  .white-card {
    padding: 22px 18px;
  }

  .success-banner {
    grid-template-columns: 56px 1fr;
    padding: 16px;
  }

  .success-dot {
    font-size: 28px;
    height: 56px;
    width: 56px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar .field,
  .toolbar .select,
  .toolbar button,
  .toolbar label {
    width: 100%;
  }

  .reference-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Round 2 additions ===== */
.date-filter-panel {
  margin-bottom: 14px;
}

.date-filter-panel .panel-head {
  flex-wrap: wrap;
  gap: 10px;
}

.ghost-button.is-active-filter {
  background: linear-gradient(90deg, var(--gold), var(--lemon));
  border-color: var(--gold);
  color: #fff;
}

/* Flow status quick-tabs (replaces standalone breakpoints/reviews tabs) */
.flow-tabs {
  align-items: center;
  display: inline-flex;
  gap: 4px;
}

.flow-tab {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  min-height: 32px;
  padding: 0 12px;
  white-space: nowrap;
}

.flow-tab:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.flow-tab.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-deep);
}

.mini-select {
  font-size: 12px;
  min-width: 110px;
  padding: 4px 8px;
}

.date-filter-panel .field[type="date"] {
  min-height: 38px;
  min-width: 140px;
  width: auto;
}

/* ===== Round 3: humanized interaction ===== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: middle;
  animation: enthra-spin 0.7s linear infinite;
}

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

.gold-cta.is-loading {
  opacity: 0.9;
}

.form-error-breathing {
  animation: enthra-breathe 1.6s ease-in-out infinite;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff5f5;
}

@keyframes enthra-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 72, 65, 0); }
  50% { box-shadow: 0 0 0 6px rgba(217, 72, 65, 0.12); }
}

.retry-button {
  background: #fff;
  border: 1px solid var(--red);
  border-radius: 999px;
  color: var(--red);
  font-weight: 800;
  margin-top: 10px;
  min-height: 40px;
  padding: 0 22px;
}

.retry-button:hover {
  background: var(--red);
  color: #fff;
}

.flow-progress {
  margin: 0 0 22px;
}

.flow-progress-label {
  color: rgba(255, 255, 255, 0.78);
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.flow-progress-bar {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.flow-progress-fill {
  background: linear-gradient(90deg, var(--gold), var(--lemon));
  border-radius: 999px;
  height: 100%;
  transition: width 0.5s ease;
}

.star-button {
  transition: transform 0.12s ease;
}

.star-button:active {
  transform: scale(1.18);
}

.gold-cta {
  transition: transform 0.12s ease, opacity 0.2s ease;
}

.gold-cta:not(:disabled):active {
  transform: scale(0.98);
}

@media (max-width: 560px) {
  .gold-cta,
  .retry-button {
    min-height: 52px;
  }

  .star-button {
    padding: 6px;
  }
}

/* ===== Pagination ===== */
.pagination {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: 14px;
}

.pagination-info {
  color: var(--ink-muted);
  font-size: 13px;
}

/* ===== page size selector ===== */
.page-size-select {
  margin-left: 8px;
  min-height: 32px;
  padding: 0 8px;
}

/* ===== row selection (batch check) ===== */
.check-col {
  text-align: center;
  width: 40px;
}
.check-col input[type="checkbox"] {
  cursor: pointer;
  height: 16px;
  width: 16px;
}
.data-table tbody tr.row-selected {
  background: var(--brand-soft, #e8f5e9);
}
.data-table tbody tr.row-selected td {
  border-bottom-color: rgba(45, 190, 96, 0.2);
}

.page-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.page-btn {
  min-height: 34px;
  min-width: 34px;
  padding: 0 10px;
}

.page-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.page-btn.active:hover {
  border-color: var(--brand-deep);
}

.page-btn.disabled,
.page-btn:disabled {
  color: var(--ink-muted);
  cursor: not-allowed;
  opacity: 0.5;
}

.page-btn.disabled:hover,
.page-btn:disabled:hover {
  border-color: var(--line);
  color: var(--ink-muted);
}

.page-ellipsis {
  color: var(--ink-muted);
  padding: 0 4px;
}

/* ===== Export modal ===== */
.modal-overlay {
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  left: 0;
  min-height: 100vh;
  padding: 24px;
  position: fixed;
  top: 0;
  width: 100vw;
  z-index: 1000;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  max-width: 420px;
  padding: 24px;
  width: 100%;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 18px;
}

.modal-row {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.modal-label {
  color: var(--ink-soft);
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  width: 44px;
}

.modal-options {
  display: flex;
  gap: 8px;
}

.export-option {
  min-height: 34px;
  padding: 0 14px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}

/* ===== How to find Order ID modal ===== */
.order-help-card {
  max-width: 480px;
}
.order-help-head {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
}
.order-help-head .modal-title {
  margin: 0;
  padding-right: 24px;
}
.order-help-close {
  background: transparent;
  border: 0;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
  padding: 0 4px;
}
.order-help-close:hover {
  color: var(--ink-deep);
}
.order-help-intro {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
  margin: 14px 0 18px;
}
.order-help-intro strong,
.help-step-text strong {
  color: var(--ink-deep);
  font-weight: 600;
}
.help-step {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}
.help-step-num {
  align-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border-radius: 50%;
  color: #fff;
  display: flex;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  height: 32px;
  justify-content: center;
  width: 32px;
}
.help-step-title {
  color: var(--ink-deep);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.help-step-text {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}
.help-step-text code {
  background: var(--bg-secondary);
  border-radius: 4px;
  color: var(--brand-deep);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  padding: 1px 6px;
}
.order-help-example {
  align-items: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  padding: 12px 14px;
}
.order-help-example-label {
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 600;
}
.order-help-example-id {
  background: var(--brand-soft);
  border-radius: 6px;
  color: var(--brand-deep);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
}
