:root {
  color-scheme: light;
  --ink: #171923;
  --muted: #737889;
  --surface: rgba(255, 255, 255, .94);
  --primary: #6c5ce7;
  --primary-dark: #5948d6;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(108, 92, 231, .13), transparent 32rem),
    radial-gradient(circle at 88% 92%, rgba(78, 205, 196, .15), transparent 28rem),
    #f6f7fb;
}

.page-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.card {
  width: min(100%, 540px);
  padding: 38px;
  text-align: center;
  background: var(--surface);
  border: 1px solid rgba(30, 34, 50, .07);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(42, 45, 64, .12);
  backdrop-filter: blur(14px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  color: white;
  border-radius: 19px;
  background: linear-gradient(135deg, #7c6cf2, #5745d4);
  box-shadow: 0 12px 30px rgba(108, 92, 231, .3);
}

.brand-mark svg { width: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 13px; font-weight: 700; letter-spacing: .12em; }
h1 { margin: 0; font-size: clamp(26px, 6vw, 36px); line-height: 1.22; letter-spacing: -.03em; }
.description { margin: 12px 0 24px; color: var(--muted); font-size: 15px; line-height: 1.7; }

.content-box {
  position: relative;
  margin-bottom: 18px;
  text-align: left;
  background: #f4f3fa;
  border: 1px solid #e7e4f4;
  border-radius: 18px;
  overflow: hidden;
}

.content-meta {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 10px 16px;
  color: #88869a;
  background: rgba(255, 255, 255, .58);
  border-bottom: 1px solid #e7e4f4;
  font-size: 12px;
}

pre {
  max-height: 52vh;
  margin: 0;
  padding: 20px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #29263a;
  font: 500 14px/1.75 ui-monospace, SFMono-Regular, Consolas, monospace;
  user-select: text;
  -webkit-user-select: text;
}

.copy-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  color: white;
  background: var(--primary);
  box-shadow: 0 12px 25px rgba(108, 92, 231, .24);
  font: 700 16px/1 inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .15s, background .15s, box-shadow .15s;
}

.copy-button:hover { background: var(--primary-dark); box-shadow: 0 14px 30px rgba(108, 92, 231, .3); }
.copy-button:active { transform: scale(.985); }
.copy-button:focus-visible { outline: 3px solid rgba(108, 92, 231, .25); outline-offset: 3px; }
.copy-button:disabled { cursor: wait; opacity: .8; }
.copy-button.is-copied { background: #18a874; }
.copy-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.hint { margin: 17px 0 0; color: var(--muted); font-size: 13px; }
.resource-id { margin: 8px 0 0; color: #a4a7b2; font-size: 11px; }

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100% - 32px);
  padding: 12px 17px;
  color: white;
  background: rgba(25, 29, 39, .94);
  border-radius: 999px;
  box-shadow: 0 12px 35px rgba(20, 23, 31, .24);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity .2s, transform .2s;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast-icon { display: grid; place-items: center; width: 20px; height: 20px; color: #15251f; background: #67e4b6; border-radius: 50%; font-weight: 800; }
.toast.is-error .toast-icon { background: #ffca72; }

@media (max-width: 560px) {
  .page-shell { place-items: start center; padding-top: max(18px, env(safe-area-inset-top)); }
  .card { padding: 30px 20px 24px; border-radius: 24px; }
  .brand-mark { width: 54px; height: 54px; border-radius: 17px; }
  pre { max-height: 52vh; padding: 17px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
