:root {
  color-scheme: dark;
  --bg: #08111f;
  --panel: rgba(15, 23, 42, 0.78);
  --field: rgba(15, 23, 42, 0.72);
  --line: rgba(148, 163, 184, 0.24);
  --ink: #f8fafc;
  --muted: #b6c3d4;
  --brand: #7dd3fc;
  --brand-strong: #a78bfa;
  --success: #86efac;
  --error: #fca5a5;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(125, 211, 252, 0.18), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(167, 139, 250, 0.22), transparent 30%),
    linear-gradient(135deg, #08111f 0%, #0f172a 58%, #111827 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  box-shadow: 0 12px 38px rgba(125, 211, 252, 0.22);
}

.site-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.site-nav a:hover {
  color: var(--ink);
}

.tool-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto 38px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 22px;
  align-items: stretch;
}

.tool-panel,
.info-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tool-panel {
  padding: clamp(24px, 4vw, 44px);
}

.info-panel {
  padding: 28px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
}

h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.sub {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.8;
}

.file-drop {
  margin-top: 28px;
  min-height: 150px;
  border: 1px dashed rgba(125, 211, 252, 0.44);
  border-radius: 18px;
  background: rgba(125, 211, 252, 0.08);
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
}

.file-drop:hover {
  border-color: var(--brand);
  background: rgba(125, 211, 252, 0.12);
}

.file-drop input {
  display: none;
}

.file-title {
  font-size: 18px;
  font-weight: 800;
}

.file-desc {
  color: var(--muted);
  font-size: 14px;
}

.control-card {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(248, 250, 252, 0.05);
}

.control-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.control-title h2 {
  margin: 0;
  font-size: 16px;
}

.params-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

.field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.14);
}

.field input:disabled {
  color: rgba(248, 250, 252, 0.38);
  background: rgba(248, 250, 252, 0.05);
}

.toggle-row {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(248, 250, 252, 0.06);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.toggle-row input {
  accent-color: var(--brand);
}

.anchor-grid {
  display: grid;
  gap: 12px;
}

.segmented-field {
  display: grid;
  gap: 7px;
}

.segmented-field > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.7);
}

.segmented-field:nth-child(2) .segmented {
  grid-template-columns: repeat(2, 1fr);
}

.segmented label {
  min-width: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  min-height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.segmented input:checked + span {
  color: #06111f;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
}

.actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #06111f;
}

.btn.ghost {
  color: var(--ink);
  border-color: rgba(248, 250, 252, 0.14);
  background: rgba(248, 250, 252, 0.08);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.status {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.status.ok {
  color: var(--success);
}

.status.error {
  color: var(--error);
}

.info-panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.85;
}

.info-panel p {
  color: var(--muted);
  line-height: 1.85;
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    flex-wrap: wrap;
  }

  .tool-shell {
    grid-template-columns: 1fr;
  }

  .params-grid {
    grid-template-columns: 1fr;
  }

  .toggle-row {
    justify-content: flex-start;
  }
}
