:root {
  color-scheme: light;
  --bg: #eef4fb;
  --panel: #ffffff;
  --ink: #102033;
  --muted: #607086;
  --line: #d7e1ee;
  --primary: #1e3a8a;
  --primary-strong: #1d4ed8;
  --success: #167a3a;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button {
  font: inherit;
}

.share-shell {
  min-height: 100vh;
  padding: 32px 16px;
}

.share-panel {
  width: min(1040px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 24px;
}

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

.share-head span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.share-head h1 {
  margin: 6px 0 0;
  font-size: 34px;
  letter-spacing: 0;
}

.share-head p,
.stats-grid span,
.list-head span,
.card-meta,
.captcha-actions span {
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stats-grid article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px;
}

.stats-grid strong {
  font-size: 26px;
}

.captcha-panel {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

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

.captcha-actions span {
  min-width: 0;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.captcha-actions button {
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  padding: 7px 12px;
  cursor: pointer;
  font-weight: 800;
}

.captcha-actions button:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.captcha-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.geetest-captcha-box {
  min-height: 46px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 8px;
}

.captcha-panel.captcha-verified .geetest-captcha-box {
  pointer-events: none;
  border-color: #86efac;
  background: #f0fdf4;
}

.captcha-panel.captcha-success-state #captchaStatus {
  color: var(--success);
  font-weight: 800;
}

.captcha-panel.captcha-error .geetest-captcha-box {
  border-color: #ef4444;
  background: #fef2f2;
}

.captcha-panel.captcha-error #captchaStatus {
  color: var(--danger);
  font-weight: 800;
}

.captcha-panel.captcha-shake {
  animation: captchaShake 360ms ease;
}

@keyframes captchaShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(7px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(4px);
  }
}

.captcha-success {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 46px;
  color: #166534;
  text-align: center;
}

.captcha-success strong {
  font-size: 14px;
  font-weight: 800;
}

.captcha-success span {
  color: #15803d;
  font-size: 12px;
}

.list-section {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.list-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.card-list {
  display: grid;
  gap: 10px;
}

.card-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.card-code {
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
  padding: 2px 4px;
  text-align: left;
  overflow-wrap: anywhere;
}

.card-code:hover,
.card-code:focus-visible {
  background: #eaf2ff;
  color: var(--primary-strong);
  outline: none;
}

.card-code:focus-visible {
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.18);
}

.card-code.is-copied {
  background: #dcfce7;
  color: var(--success);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  padding: 5px 10px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.used {
  background: #f1f5f9;
  color: #64748b;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

@media (max-width: 640px) {
  .share-shell {
    padding: 18px 12px;
  }

  .share-panel {
    padding: 18px;
  }

  .share-head,
  .list-head,
  .captcha-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .share-head h1 {
    font-size: 28px;
  }

  .stats-grid,
  .card-item {
    grid-template-columns: 1fr;
  }

  .captcha-actions button {
    width: 100%;
  }

  .status-badge {
    width: max-content;
  }
}
