:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", sans-serif;
  background: #080b12;
  color: #eef1f7;
  --panel: rgba(20, 24, 36, 0.86);
  --panel-strong: #111522;
  --line: rgba(255, 255, 255, 0.1);
  --muted: #929bad;
  --blue: #7aa2ff;
  --cyan: #67e8d1;
  --good: #52d7a5;
  --bad: #ff7c91;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(75, 103, 217, 0.2), transparent 32rem),
    radial-gradient(circle at 88% 18%, rgba(51, 203, 181, 0.12), transparent 28rem),
    linear-gradient(180deg, #0a0d15 0%, #070910 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.page-shell {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.hero {
  max-width: 940px;
  margin-bottom: 38px;
}

.eyebrow,
.step {
  margin: 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 99px;
  background: var(--cyan);
  box-shadow: 0 0 18px var(--cyan);
}

h1 {
  margin: 14px 0 18px;
  font-size: clamp(44px, 6vw, 82px);
  line-height: 0.95;
  letter-spacing: -0.065em;
}

h1 span {
  color: #9aabff;
}

.hero-copy {
  max-width: 760px;
  margin: 0;
  color: #b9c0cf;
  font-size: 18px;
  line-height: 1.75;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.trust-row span,
.file-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #aeb7c8;
  padding: 7px 12px;
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  padding: 26px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

h2 {
  margin: 6px 0 0;
  font-size: 27px;
  letter-spacing: -0.035em;
}

.ghost-button,
.secondary-button,
.primary-button,
.download-button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 750;
}

.ghost-button {
  border: 1px solid var(--line);
  background: transparent;
  color: #c7cdd8;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed rgba(122, 162, 255, 0.48);
  border-radius: 17px;
  background: rgba(83, 112, 230, 0.055);
  text-align: center;
  outline: 0;
  transition: 160ms ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.dragging {
  border-color: var(--cyan);
  background: rgba(103, 232, 209, 0.07);
  transform: translateY(-1px);
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: var(--cyan);
  font-size: 24px;
}

.drop-zone strong {
  margin-top: 7px;
}

.drop-zone span {
  color: var(--muted);
  font-size: 13px;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 4px;
}

.field-label {
  display: block;
  margin: 18px 0 9px;
  color: #c6ccda;
  font-size: 13px;
  font-weight: 700;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: #0b0e17;
  color: #dfe4ee;
}

textarea {
  min-height: 235px;
  resize: vertical;
  padding: 15px;
  font: 12px/1.65 "Cascadia Code", Consolas, monospace;
}

textarea:focus {
  border-color: rgba(122, 162, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.1);
}

.proxy-input {
  min-height: 84px;
  padding: 12px 13px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: end;
}

.proxy-note {
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.action-row {
  display: grid;
  grid-template-columns: 0.65fr 0.82fr 1.28fr;
  gap: 10px;
  margin-top: 20px;
}

.probe-button {
  color: #b9f6eb;
}

.probe-note {
  margin: 10px 1px 0;
  color: #697386;
  font-size: 11px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #171c2a;
  color: #dbe1ec;
}

.primary-button,
.download-button {
  background: linear-gradient(135deg, #8fa9ff, #65e0ce);
  color: #071018;
  box-shadow: 0 11px 28px rgba(86, 193, 185, 0.15);
}

.message {
  min-height: 22px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.message[data-tone="good"] {
  color: var(--good);
}

.message[data-tone="error"] {
  color: var(--bad);
}

.state-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: #a8b0c0;
  font-size: 12px;
}

.state-pill[data-tone="good"] {
  border-color: rgba(82, 215, 165, 0.3);
  background: rgba(82, 215, 165, 0.08);
  color: var(--good);
}

.state-pill[data-tone="error"] {
  border-color: rgba(255, 124, 145, 0.3);
  background: rgba(255, 124, 145, 0.08);
  color: var(--bad);
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
}

.stats div {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  padding: 15px;
}

.stats strong,
.stats span {
  display: block;
}

.stats strong {
  font-size: 24px;
}

.stats span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.progress-wrap {
  margin-top: 17px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #aeb6c6;
  font-size: 12px;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8ca8ff, #64dfcf);
  transition: width 220ms ease;
}

.table-wrap {
  max-height: 504px;
  overflow: auto;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 12px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #151a27;
  color: #8e98aa;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td:first-child {
  width: 38px;
  color: #687186;
}

td small {
  display: block;
  max-width: 320px;
  margin-top: 3px;
  overflow: hidden;
  color: #697387;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name {
  display: block;
  max-width: 300px;
  overflow: hidden;
  color: #d6dce8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-row td {
  padding: 55px 16px;
  color: #687186;
  text-align: center;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 800;
}

.status-ready,
.status-ok,
.status-success {
  background: rgba(82, 215, 165, 0.1);
  color: var(--good);
}

.status-probing,
.status-registering {
  background: rgba(122, 162, 255, 0.12);
  color: #9ab4ff;
}

.status-invalid,
.status-401,
.status-402,
.status-403_other,
.status-error {
  background: rgba(255, 124, 145, 0.1);
  color: var(--bad);
}

.status-duplicate {
  background: rgba(250, 204, 92, 0.1);
  color: #f3ce72;
}

.status-429,
.status-network,
.status-probe_error {
  background: rgba(250, 204, 92, 0.1);
  color: #f3ce72;
}

.output-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #0d111b;
  padding: 16px;
}

.output-card p {
  margin: 0;
}

.output-title {
  font-weight: 800;
}

#outputHint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.download-button {
  flex: 0 0 auto;
}

.fine-print {
  margin: 13px 2px 0;
  color: #697386;
  font-size: 11px;
  line-height: 1.6;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    margin-bottom: 28px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 22px, 1480px);
    padding: 32px 0 48px;
  }

  .panel {
    border-radius: 17px;
    padding: 18px;
  }

  .field-grid,
  .action-row {
    grid-template-columns: 1fr;
  }

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

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

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