/**
 * ElementShot 官网设计系统
 * 中性灰文字 · 白底留白 · Teal 品牌点缀 · Orange CTA
 * 8px 间距系统 · 1.25 字号阶梯 · 微交互统一
 */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  /* —— 中性色（文字与背景主体）—— */
  --es-ink: #0f172a;        /* 标题 / 强强调 */
  --es-body: #334155;       /* 正文 */
  --es-muted: #64748b;      /* 次要文字 */
  --es-faint: #94a3b8;      /* 辅助说明 */
  --es-line: #e2e8f0;       /* 分割线 */
  --es-line-strong: #cbd5e1;
  --es-bg: #f8fafc;         /* 页面浅灰底 */
  --es-bg-soft: #f1f5f9;    /* 浅灰块 */
  --es-surface: #ffffff;    /* 卡片白 */

  /* —— 品牌点缀色 —— */
  --es-accent: #0d9488;
  --es-accent-hover: #0f766e;
  --es-accent-soft: #ccfbf1;
  --es-accent-faint: #f0fdfa;
  --es-cta: #ea580c;
  --es-cta-hover: #c2410c;
  --es-cta-soft: #fff7ed;

  /* —— 语义色 —— */
  --es-warn: #b45309;
  --es-warn-soft: #fffbeb;
  --es-success: #047857;
  --es-success-soft: #ecfdf5;
  --es-danger: #dc2626;
  --es-danger-soft: #fef2f2;

  --font-display: "Plus Jakarta Sans", "Bahnschrift", "Microsoft YaHei UI", sans-serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", "Microsoft YaHei UI", sans-serif;

  --es-max: 960px;
  --es-max-wide: 1120px;

  /* 8px 间距系统 */
  --space-0: 0;
  --space-1: 8px;
  --space-1h: 12px;
  --space-2: 16px;
  --space-2h: 20px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;

  /* 圆角梯度 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --es-radius-sm: var(--radius-sm);
  --es-radius: var(--radius-md);

  /* 阴影层级（中性灰调） */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1), 0 4px 8px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 24px 56px rgba(15, 23, 42, 0.12), 0 8px 16px rgba(15, 23, 42, 0.05);
  --es-shadow: var(--shadow-md);

  /* 1.25 字号阶梯（基准 16px） */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.563rem;
  --text-3xl: 1.953rem;
  --text-4xl: 2.441rem;
  --text-5xl: 3.052rem;

  --es-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --es-dur: 200ms;
  --es-space: var(--space-1);
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  color: var(--es-body);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  min-height: 100dvh;
  background: var(--es-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--es-ink);
  letter-spacing: -0.03em;
  line-height: 1.18;
}
h1 { font-size: var(--text-4xl); font-weight: 800; }
h2 { font-size: var(--text-3xl); font-weight: 700; }
h3 { font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.02em; }
h4 { font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.015em; }

::selection {
  background: rgba(13, 148, 136, 0.2);
}

a {
  color: var(--es-accent);
  text-underline-offset: 3px;
  transition: color var(--es-dur) var(--es-ease);
}
a:hover {
  color: var(--es-accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

.wrap {
  position: relative;
  width: min(100% - var(--space-4), var(--es-max));
  margin-inline: auto;
}
.wrap-wide {
  width: min(100% - var(--space-4), var(--es-max-wide));
}

/* —— Header —— */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2h) 0;
}
.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  letter-spacing: -0.03em;
  color: var(--es-ink);
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: var(--space-1) 6px;
  margin-left: -6px;
  transition: opacity var(--es-dur) var(--es-ease);
}
.brand:hover {
  opacity: 0.8;
  color: var(--es-ink);
}
.brand span {
  color: var(--es-accent);
}
.top-nav,
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px var(--space-1h);
  align-items: center;
  font-size: var(--text-sm);
}
.top-nav a,
.nav a {
  color: var(--es-muted);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  transition:
    color var(--es-dur) var(--es-ease),
    background var(--es-dur) var(--es-ease),
    transform 120ms var(--es-ease);
}
.top-nav a:hover,
.nav a:hover {
  color: var(--es-ink);
  background: var(--es-bg-soft);
}
.top-nav a:active,
.nav a:active {
  transform: scale(0.97);
}
.top-nav a:focus-visible,
.nav a:focus-visible,
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--es-accent);
  outline-offset: 2px;
}
.top-nav a.nav-account,
.nav a.nav-account {
  color: var(--es-ink);
  max-width: 11.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-ligatures: none;
}
.top-nav .nav-logout,
.nav .nav-logout {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--es-muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  min-height: 40px;
  cursor: pointer;
  transition:
    color var(--es-dur) var(--es-ease),
    background var(--es-dur) var(--es-ease),
    transform 120ms var(--es-ease);
}
.top-nav .nav-logout:hover,
.nav .nav-logout:hover {
  color: var(--es-ink);
  background: var(--es-bg-soft);
}
.top-nav .nav-logout:active,
.nav .nav-logout:active {
  transform: scale(0.97);
}
.top-nav a[aria-current="page"],
.nav a[aria-current="page"] {
  color: var(--es-accent);
  background: var(--es-accent-soft);
  font-weight: 600;
}

/* —— Hero —— */
.hero {
  padding: var(--space-6) 0 var(--space-5);
  animation: es-rise 420ms var(--es-ease) both;
}
.hero h1 {
  margin: 0 0 var(--space-1h);
  font-size: clamp(var(--text-3xl), 4.5vw, var(--text-4xl));
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
}
.hero p,
.hero .lead {
  margin: 0;
  max-width: 36em;
  color: var(--es-muted);
  font-size: var(--text-lg);
  line-height: 1.6;
}

@keyframes es-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* —— Region / segmented —— */
.region-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: var(--space-3) 0 var(--space-1);
  padding: 4px;
  background: var(--es-surface);
  border: 1px solid var(--es-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}
.region-bar button {
  border: 0;
  background: transparent;
  color: var(--es-muted);
  border-radius: var(--radius-sm);
  padding: 10px var(--space-2);
  min-height: 44px;
  font: inherit;
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  transition:
    background var(--es-dur) var(--es-ease),
    color var(--es-dur) var(--es-ease),
    transform 120ms var(--es-ease);
}
.region-bar button:active {
  transform: scale(0.97);
}
.region-bar button[aria-pressed="true"] {
  background: var(--es-accent);
  color: #fff;
}
.region-bar button:hover:not([aria-pressed="true"]) {
  background: var(--es-accent-faint);
  color: var(--es-accent);
}
.region-bar button:focus-visible {
  outline: 2px solid var(--es-accent);
  outline-offset: 2px;
}

/* —— Cards / plans —— */
.plans {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-4) 0 var(--space-5);
}
@media (min-width: 720px) {
  .plans {
    grid-template-columns: 1fr 1.12fr 1fr;
    align-items: stretch;
  }
}

.plan,
.team-card,
.surface-card {
  position: relative;
  padding: var(--space-3);
  border: 1px solid var(--es-line);
  border-radius: var(--radius-lg);
  background: var(--es-surface);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--es-dur) var(--es-ease),
    border-color var(--es-dur) var(--es-ease),
    box-shadow var(--es-dur) var(--es-ease);
}
.plan:hover {
  transform: translateY(-3px);
  border-color: var(--es-line-strong);
  box-shadow: var(--shadow-lg);
}
.plan:active {
  transform: translateY(-1px);
}
.plan.featured {
  border-color: var(--es-accent);
  background:
    linear-gradient(165deg, var(--es-accent-faint) 0%, var(--es-surface) 46%),
    var(--es-surface);
  box-shadow: var(--shadow-md);
}
.plan.featured:hover {
  border-color: var(--es-accent-hover);
  box-shadow: var(--shadow-xl);
}
.plan .badge {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  background: var(--es-cta);
  padding: 4px 10px;
  border-radius: 6px;
}
.plan h2,
.team-card h2 {
  margin: 0 0 4px;
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
}
.plan .price {
  margin: var(--space-1h) 0 4px;
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--es-ink);
}
.plan .price small {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--es-muted);
}
.plan .desc {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  color: var(--es-muted);
}
.plan ul {
  margin: 0 0 var(--space-2h);
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  color: var(--es-body);
}
.plan li {
  padding: 5px 0 5px 18px;
  position: relative;
}
.plan li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--es-accent);
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  width: 100%;
  min-height: 48px;
  padding: 12px var(--space-2h);
  border: 0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--es-dur) var(--es-ease),
    transform 120ms var(--es-ease),
    box-shadow var(--es-dur) var(--es-ease),
    border-color var(--es-dur) var(--es-ease);
  touch-action: manipulation;
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn-primary {
  background: var(--es-cta);
  color: #fff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.28);
}
.btn-primary:hover {
  background: var(--es-cta-hover);
  color: #fff;
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.34);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
}
.btn-accent {
  background: var(--es-accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.24);
}
.btn-accent:hover {
  background: var(--es-accent-hover);
  color: #fff;
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.3);
  transform: translateY(-1px);
}
.btn-accent:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
}
.btn-secondary {
  background: var(--es-surface);
  color: var(--es-ink);
  border: 1px solid var(--es-line);
}
.btn-secondary:hover {
  background: var(--es-accent-faint);
  border-color: var(--es-accent);
  color: var(--es-ink);
  transform: translateY(-1px);
}
.btn-danger {
  background: var(--es-danger);
  color: #fff;
}
.btn-danger:hover {
  background: #b91c1c;
  color: #fff;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn:focus-visible {
  outline: 2px solid var(--es-accent);
  outline-offset: 2px;
}
.btn.secondary {
  /* alias used by team page */
  background: var(--es-surface);
  color: var(--es-ink);
  border: 1px solid var(--es-line);
}

.pay-note {
  margin: 0 0 var(--space-5);
  font-size: var(--text-sm);
  color: var(--es-muted);
}

/* —— Checkout / forms —— */
.checkout {
  display: none;
  margin: 0 0 var(--space-6);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--es-line);
  background: var(--es-surface);
  box-shadow: var(--shadow-md);
}
.checkout.open {
  display: block;
  animation: es-rise 240ms var(--es-ease) both;
}
.checkout h2 {
  margin: 0 0 4px;
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
}
.checkout .sub {
  margin: 0 0 var(--space-2h);
  color: var(--es-muted);
  font-size: var(--text-base);
}

.checkout-grid {
  display: grid;
  gap: var(--space-3);
}
@media (min-width: 700px) {
  .checkout-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: var(--space-2);
}
.field label {
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--es-muted);
}
.field input,
.field select,
.field textarea,
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--es-line);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--es-surface);
  color: var(--es-ink);
  transition: border-color var(--es-dur) var(--es-ease), box-shadow var(--es-dur) var(--es-ease);
}
.field input:focus,
.field select:focus,
.field textarea:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--es-accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}
.field-hint {
  font-size: var(--text-xs);
  color: var(--es-faint);
}

.provider-list {
  display: grid;
  gap: var(--space-1);
}
.provider {
  display: flex;
  align-items: center;
  gap: var(--space-1h);
  padding: 14px var(--space-2);
  border: 1px solid var(--es-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--es-surface);
  min-height: 56px;
  transition:
    border-color var(--es-dur) var(--es-ease),
    background var(--es-dur) var(--es-ease),
    transform 120ms var(--es-ease),
    box-shadow var(--es-dur) var(--es-ease);
}
.provider:hover {
  border-color: var(--es-accent);
  box-shadow: var(--shadow-sm);
}
.provider:active {
  transform: scale(0.99);
}
.provider[data-active="true"] {
  border-color: var(--es-accent);
  background: var(--es-accent-faint);
}
.provider input {
  accent-color: var(--es-accent);
  width: 18px;
  height: 18px;
}
.provider strong {
  display: block;
  font-size: var(--text-base);
  color: var(--es-ink);
}
.provider span {
  font-size: var(--text-xs);
  color: var(--es-muted);
}

.qr-box {
  display: none;
  text-align: center;
  padding: var(--space-2h);
  border-radius: var(--radius-sm);
  background: var(--es-bg-soft);
  border: 1px dashed var(--es-line-strong);
}
.qr-box.show {
  display: block;
  animation: es-rise 200ms var(--es-ease) both;
}
.qr-box img,
.qr-box canvas {
  width: 200px;
  height: 200px;
  margin: var(--space-1) auto;
  background: #fff;
  border-radius: var(--radius-sm);
}
.qr-placeholder {
  width: 200px;
  height: 200px;
  margin: var(--space-1h) auto;
  display: grid;
  place-items: center;
  background:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%),
    #fff;
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--es-line);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--es-muted);
  text-align: center;
  padding: var(--space-2);
  white-space: pre-line;
}

.status {
  margin-top: var(--space-1h);
  padding: 14px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  display: none;
  animation: es-rise 180ms var(--es-ease) both;
}
.status.show {
  display: block;
}
.status.info {
  background: var(--es-accent-faint);
  color: var(--es-accent-hover);
  border: 1px solid rgba(13, 148, 136, 0.25);
}
.status.warn {
  background: var(--es-warn-soft);
  color: var(--es-warn);
  border: 1px solid rgba(180, 83, 9, 0.25);
}
.status.ok {
  background: var(--es-success-soft);
  color: var(--es-success);
  border: 1px solid rgba(4, 120, 87, 0.25);
}

/* —— Footer —— */
.footer {
  padding: var(--space-4) 0 var(--space-6);
  font-size: var(--text-sm);
  color: var(--es-muted);
  border-top: 1px solid var(--es-line);
  display: grid;
  gap: 10px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
}
.footer-contact {
  font-size: var(--text-sm);
}
.footer a {
  color: var(--es-muted);
  text-decoration: none;
  border-radius: 4px;
  transition: color var(--es-dur) var(--es-ease);
}
.footer a:hover {
  color: var(--es-accent);
}

.demo-banner {
  margin: 0 0 var(--space-2);
  padding: var(--space-1h) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--es-cta-soft);
  color: var(--es-warn);
  font-size: var(--text-sm);
  border: 1px solid rgba(234, 88, 12, 0.2);
}
.demo-banner code {
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.65);
  padding: 2px 6px;
  border-radius: 4px;
}

/* —— Layout helpers —— */
.inline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.status-line {
  color: var(--es-muted);
  font-size: var(--text-sm);
}
.page-shell {
  max-width: 480px;
  margin: var(--space-3) auto var(--space-6);
  padding: 0 var(--space-2h);
}
.page-shell h1 {
  font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl));
  margin: 0 0 var(--space-1h);
}

.auth-panel {
  margin-top: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--es-line);
  background: var(--es-surface);
  box-shadow: var(--shadow-md);
  animation: es-rise 360ms var(--es-ease) both;
}
.auth-panel h2 {
  margin: 0 0 4px;
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
}

.success-hero {
  max-width: 34rem;
  padding: var(--space-4) 0 var(--space-6);
}
.success-hero .icon-check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--es-success-soft);
  color: var(--es-success);
  margin-bottom: var(--space-2);
  border: 1px solid rgba(4, 120, 87, 0.2);
  box-shadow: var(--shadow-sm);
}
.success-hero .icon-check svg {
  width: 28px;
  height: 28px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--es-ink);
  color: #fff;
  padding: 10px var(--space-2);
  z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

/* —— Legal / prose —— */
.prose {
  max-width: 42rem;
  margin: var(--space-2) auto var(--space-6);
}
.prose h1 {
  font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl));
}
.prose h2 {
  font-size: var(--text-xl);
  margin-top: var(--space-4);
  letter-spacing: -0.02em;
}
.prose p,
.prose li {
  color: var(--es-body);
  line-height: 1.7;
}

@media (max-width: 640px) {
  .top-nav a:not([aria-current="page"]):not([data-nav-auth]):nth-child(n + 4) {
    display: none;
  }
  .plan:hover {
    transform: none;
  }
}
