:root {
  --color-background: #0f172a;
  --color-background-deep: #080e1d;
  --color-card: #192134;
  --color-card-strong: #1d2940;
  --color-foreground: #f8fafc;
  --color-muted-foreground: #9bacbf;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-strong: rgba(255, 255, 255, 0.18);
  --color-primary: #1e3a5f;
  --color-accent: #34d399;
  --color-accent-strong: #6ee7b7;
  --color-on-accent: #052e24;
  --color-destructive: #f87171;
  --color-ring: #a7f3d0;
  --shadow-panel: 0 28px 80px rgba(0, 0, 0, 0.28);
  --radius-panel: 24px;
  --radius-control: 12px;
  --font-sans:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% -10%, rgba(52, 211, 153, 0.11), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(59, 130, 246, 0.14), transparent 32%),
    linear-gradient(180deg, var(--color-background-deep), var(--color-background));
  color: var(--color-foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

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

a {
  color: var(--color-accent-strong);
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(110px);
  opacity: 0.12;
  pointer-events: none;
}

.ambient-one {
  top: 14rem;
  left: -16rem;
  background: var(--color-accent);
}

.ambient-two {
  right: -18rem;
  bottom: 4rem;
  background: #3b82f6;
}

.site-header,
.page-shell,
.site-footer {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 0 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(110, 231, 183, 0.3);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(52, 211, 153, 0.2), rgba(30, 58, 95, 0.6));
  color: var(--color-accent-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

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

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand-copy small {
  color: var(--color-muted-foreground);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: var(--color-muted-foreground);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(12px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #fbbf24;
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.1);
}

.status-pill.is-online .status-dot {
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.11);
}

.status-pill.is-offline .status-dot {
  background: var(--color-destructive);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.1);
}

.page-shell {
  padding-bottom: 72px;
}

.intro {
  max-width: 850px;
  padding: clamp(58px, 9vw, 112px) 0 clamp(46px, 7vw, 82px);
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--color-accent-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.55rem, 7vw, 5rem);
  font-weight: 640;
  letter-spacing: -0.055em;
  line-height: 1.03;
}

.intro h1 span {
  display: block;
  color: var(--color-accent-strong);
}

.intro-copy {
  max-width: 660px;
  margin: 26px 0 0;
  color: var(--color-muted-foreground);
  font-size: clamp(1rem, 2vw, 1.14rem);
  line-height: 1.75;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 38%),
    rgba(25, 33, 52, 0.86);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(18px);
}

.form-panel,
.process-panel {
  padding: clamp(24px, 4vw, 38px);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.panel-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  letter-spacing: -0.03em;
}

.panel-heading .section-kicker {
  margin-bottom: 6px;
}

.step-badge {
  display: grid;
  width: 42px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted-foreground);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

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

.field label,
.label-row label {
  color: #edf2f7;
  font-size: 13px;
  font-weight: 650;
}

.label-row span {
  color: var(--color-muted-foreground);
  font-size: 11px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  outline: none;
  background: rgba(8, 14, 29, 0.66);
  color: var(--color-foreground);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

input,
select {
  padding: 0 14px;
}

textarea {
  min-height: 116px;
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
  color: #64748b;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--color-border-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(110, 231, 183, 0.72);
  background: rgba(8, 14, 29, 0.86);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--color-destructive);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #94a3b8 50%),
    linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 21px,
    calc(100% - 13px) 21px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.input-with-action {
  position: relative;
}

.input-with-action input {
  padding-right: 56px;
}

.icon-button {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--color-muted-foreground);
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--color-foreground);
}

.icon-button svg {
  width: 21px;
  height: 21px;
}

.icon-button .eye-closed {
  display: none;
}

.icon-button[aria-pressed="true"] .eye-open {
  display: none;
}

.icon-button[aria-pressed="true"] .eye-closed {
  display: block;
}

.field-help,
.field-error,
.form-meta {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.field-help,
.form-meta {
  color: var(--color-muted-foreground);
}

.field-error {
  min-height: 0;
  color: #fca5a5;
}

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

.form-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr);
  gap: 16px;
}

.primary-button,
.copy-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 4px;
  border: 1px solid rgba(110, 231, 183, 0.3);
  background: linear-gradient(135deg, var(--color-accent-strong), var(--color-accent));
  color: var(--color-on-accent);
  box-shadow: 0 14px 30px rgba(16, 185, 129, 0.16);
}

.primary-button svg {
  width: 19px;
  height: 19px;
  transition: transform 180ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #a7f3d0, var(--color-accent-strong));
}

.primary-button:hover:not(:disabled) svg {
  transform: translateX(2px);
}

.form-meta {
  margin-top: 13px;
  text-align: center;
}

.error-summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -8px 0 22px;
  padding: 12px 14px;
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 12px;
  background: rgba(127, 29, 29, 0.2);
  color: #fecaca;
  font-size: 13px;
}

.error-summary svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.process-panel {
  background:
    radial-gradient(circle at 100% 0, rgba(52, 211, 153, 0.1), transparent 36%),
    rgba(25, 33, 52, 0.68);
}

.steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  padding: 0 0 26px;
}

.steps li:not(:last-child)::after {
  position: absolute;
  top: 34px;
  bottom: 8px;
  left: 16px;
  width: 1px;
  background: linear-gradient(var(--color-border-strong), transparent);
  content: "";
}

.step-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(110, 231, 183, 0.22);
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.06);
  color: var(--color-accent-strong);
  font-size: 12px;
  font-weight: 750;
}

.steps strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
}

.steps p {
  margin: 5px 0 0;
  color: var(--color-muted-foreground);
  font-size: 13px;
  line-height: 1.6;
}

.guardrail {
  display: flex;
  gap: 13px;
  margin-top: 8px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: rgba(8, 14, 29, 0.4);
}

.guardrail > svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: var(--color-accent-strong);
}

.guardrail strong {
  font-size: 13px;
}

.guardrail p {
  margin: 5px 0 0;
  color: var(--color-muted-foreground);
  font-size: 12px;
  line-height: 1.65;
}

.result-panel {
  margin-top: 22px;
  padding: clamp(24px, 4vw, 36px);
  border-color: rgba(110, 231, 183, 0.2);
  background:
    radial-gradient(circle at 0 0, rgba(52, 211, 153, 0.1), transparent 35%),
    rgba(25, 33, 52, 0.86);
  outline: none;
}

.result-panel:focus-visible {
  box-shadow:
    var(--shadow-panel),
    0 0 0 3px rgba(52, 211, 153, 0.22);
}

.result-heading {
  display: flex;
  align-items: center;
  gap: 16px;
}

.success-mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(110, 231, 183, 0.28);
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.1);
  color: var(--color-accent-strong);
}

.success-mark svg {
  width: 25px;
  height: 25px;
}

.result-copy {
  min-width: 0;
}

.result-copy .section-kicker {
  margin-bottom: 3px;
}

.result-copy h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

.result-copy > p:last-child {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--color-muted-foreground);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.countdown {
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-accent-strong);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.short-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 24px;
}

.short-link-row input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.copy-button {
  min-width: 104px;
  border: 1px solid rgba(110, 231, 183, 0.28);
  background: rgba(52, 211, 153, 0.09);
  color: var(--color-accent-strong);
  padding: 0 16px;
}

.copy-button svg {
  width: 18px;
  height: 18px;
}

.copy-button:hover:not(:disabled) {
  border-color: rgba(110, 231, 183, 0.5);
  background: rgba(52, 211, 153, 0.14);
}

.result-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
}

.result-footer > p {
  margin: 0;
  color: var(--color-muted-foreground);
  font-size: 12px;
}

.result-actions {
  display: flex;
  gap: 10px;
}

.secondary-button,
.danger-button {
  min-height: 44px;
  padding: 0 15px;
}

.secondary-button {
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--color-foreground);
}

.secondary-button:hover {
  border-color: var(--color-border-strong);
  background: rgba(255, 255, 255, 0.065);
}

.danger-button {
  border: 1px solid rgba(248, 113, 113, 0.22);
  background: rgba(248, 113, 113, 0.06);
  color: #fca5a5;
}

.danger-button:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.1);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 38px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #718096;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.site-footer p {
  margin: 0;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
  background: #111c31;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  color: var(--color-foreground);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.noscript {
  position: fixed;
  inset: auto 20px 20px;
  padding: 14px;
  border: 1px solid var(--color-destructive);
  border-radius: 12px;
  background: #2a1117;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 3px;
}

@media (max-width: 880px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .process-panel {
    order: 2;
  }
}

@media (max-width: 620px) {
  .site-header,
  .page-shell,
  .site-footer {
    width: min(100% - 28px, 1120px);
  }

  .site-header {
    align-items: flex-start;
    padding-top: 22px;
  }

  .brand-copy small {
    display: none;
  }

  .status-pill {
    min-height: 34px;
    padding: 0 10px;
  }

  .intro {
    padding-top: 58px;
  }

  .intro h1 {
    letter-spacing: -0.045em;
  }

  .form-panel,
  .process-panel,
  .result-panel {
    border-radius: 19px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .label-row {
    align-items: flex-start;
  }

  .label-row span {
    max-width: 48%;
    text-align: right;
  }

  .result-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .countdown {
    margin-left: 62px;
  }

  .short-link-row {
    grid-template-columns: 1fr;
  }

  .copy-button {
    width: 100%;
  }

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

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

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    max-width: calc(100vw - 28px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
