:root {
  color-scheme: dark;
  --bg: #07110f;
  --surface: rgba(9, 25, 23, 0.86);
  --surface-strong: rgba(12, 35, 32, 0.94);
  --surface-soft: rgba(35, 255, 218, 0.08);
  --text: #eefcf8;
  --muted: #9ec4ba;
  --line: rgba(89, 255, 226, 0.2);
  --accent: #26f0d1;
  --accent-2: #74ff8d;
  --accent-3: #d8b36a;
  --danger: #ff6b6b;
  --success: #64ff9a;
  --warn: #ffca6a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(38, 240, 209, 0.18), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(116, 255, 141, 0.11), transparent 30%),
    linear-gradient(135deg, #050b0c 0%, #071411 46%, #0f0908 100%);
  color: var(--text);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(89, 255, 226, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(89, 255, 226, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  padding: clamp(18px, 3vw, 42px);
}

.workspace {
  width: min(1180px, 100%);
  margin: 0 auto;
}

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

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.3rem, 6vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(38, 240, 209, 0.2);
}

h2 {
  margin-bottom: 18px;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.status-pill {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 25, 23, 0.72);
  color: var(--muted);
  white-space: nowrap;
  box-shadow: inset 0 0 24px rgba(38, 240, 209, 0.06);
}

.lang-toggle {
  min-height: 40px;
  border: 1px solid rgba(38, 240, 209, 0.36);
  border-radius: 8px;
  background: rgba(38, 240, 209, 0.08);
  color: var(--accent);
  padding: 0 13px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: inset 0 0 24px rgba(38, 240, 209, 0.05);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.lang-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(116, 255, 141, 0.48);
  background: rgba(116, 255, 141, 0.08);
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(100, 255, 154, 0.12), 0 0 18px rgba(100, 255, 154, 0.9);
  animation: pulse 1.8s ease-in-out infinite;
}

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

.tool-panel,
.side-panel,
.guide-box {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow), inset 0 0 42px rgba(38, 240, 209, 0.04);
  overflow: hidden;
}

.tool-panel::before,
.side-panel::before,
.guide-box::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(120deg, rgba(38, 240, 209, 0.18), transparent 28%, transparent 70%, rgba(216, 179, 106, 0.12));
  opacity: 0.7;
}

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

.side-panel {
  padding: 24px;
}

.tool-panel > *,
.side-panel > *,
.guide-box > * {
  position: relative;
}

form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 9px;
}

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

label {
  color: var(--text);
  font-weight: 900;
  font-size: 0.94rem;
}

input[type="text"] {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(89, 255, 226, 0.28);
  border-radius: 8px;
  background: rgba(4, 12, 12, 0.74);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

input[type="text"]:focus {
  border-color: var(--accent);
  background: rgba(3, 17, 16, 0.94);
  box-shadow: 0 0 0 4px rgba(38, 240, 209, 0.12), 0 0 22px rgba(38, 240, 209, 0.16);
}

input::placeholder {
  color: #6f9289;
}

.field-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.scan-line {
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: rgba(89, 255, 226, 0.12);
  overflow: hidden;
}

.scan-line::before {
  display: block;
  width: 34%;
  height: 100%;
  content: "";
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateX(-120%);
}

.scan-line.running::before {
  animation: scan 1.15s ease-in-out infinite;
}

.inline-state {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.inline-state.checking {
  color: var(--warn);
  border-color: rgba(255, 202, 106, 0.36);
  box-shadow: 0 0 18px rgba(255, 202, 106, 0.12);
}

.inline-state.success {
  color: var(--success);
  border-color: rgba(100, 255, 154, 0.36);
}

.inline-state.warning {
  color: var(--warn);
  border-color: rgba(255, 202, 106, 0.36);
}

.inline-state.error {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.36);
}

.inline-state.neutral {
  color: var(--accent);
  border-color: rgba(38, 240, 209, 0.34);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(89, 255, 226, 0.18);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  line-height: 1.45;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.primary-button,
.query-row button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #03110e;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(38, 240, 209, 0.22);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease;
}

.primary-button:hover,
.query-row button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(38, 240, 209, 0.28);
}

.primary-button:active,
.query-row button:active {
  transform: translateY(1px);
}

.primary-button:disabled,
.query-row button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.result-box,
.status-result {
  margin-top: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 16px;
  background: rgba(4, 12, 12, 0.62);
  line-height: 1.6;
}

.result-box.success,
.status-result.success {
  border-color: rgba(100, 255, 154, 0.45);
  box-shadow: inset 0 0 28px rgba(100, 255, 154, 0.06);
}

.result-box.warning,
.status-result.warning {
  border-color: rgba(255, 202, 106, 0.48);
  box-shadow: inset 0 0 28px rgba(255, 202, 106, 0.06);
}

.result-box.error,
.status-result.error {
  border-color: rgba(255, 107, 107, 0.45);
  box-shadow: inset 0 0 28px rgba(255, 107, 107, 0.06);
}

.result-title {
  margin-bottom: 8px;
  font-weight: 950;
}

.meta-grid {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.meta-grid div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  color: var(--muted);
}

.meta-grid code {
  color: var(--text);
  overflow-wrap: anywhere;
}

.status-form {
  gap: 8px;
}

.query-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 8px;
}

.query-row input,
.query-row button {
  min-height: 46px;
}

.state-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.state-list div {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid rgba(89, 255, 226, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.state-list strong {
  color: var(--accent);
  font-size: 0.88rem;
}

.state-list span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.guide-box {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: clamp(20px, 4vw, 30px);
}

.guide-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.guide-header h2 {
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 2rem);
}

.guide-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.guide-actions a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(38, 240, 209, 0.35);
  border-radius: 8px;
  color: var(--accent);
  padding: 0 12px;
  text-decoration: none;
  font-weight: 950;
  background: rgba(38, 240, 209, 0.06);
}

.guide-copy {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.guide-copy div {
  border: 1px solid rgba(89, 255, 226, 0.15);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.guide-copy strong {
  display: block;
  margin-bottom: 8px;
}

.guide-copy p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.guide-copy code {
  color: var(--accent);
  background: rgba(38, 240, 209, 0.08);
  border: 1px solid rgba(38, 240, 209, 0.22);
  border-radius: 6px;
  padding: 2px 5px;
  overflow-wrap: anywhere;
}

.guide-shot {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 30px;
  min-height: 310px;
  padding: 30px;
  border: 1px solid rgba(238, 252, 248, 0.22);
  border-radius: 8px;
  background: #f5f6f2;
  color: #161a18;
  overflow: hidden;
}

.guide-sidebar {
  display: grid;
  align-content: start;
  gap: 6px;
}

.guide-sidebar span,
.guide-sidebar strong {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 600;
}

.guide-sidebar strong {
  background: #ebede8;
}

.guide-main {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.guide-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e1e2dd;
}

.guide-row button {
  min-height: 34px;
  border: 1px solid #d5d6d0;
  border-radius: 8px;
  background: #ffffff;
  color: #161a18;
  padding: 0 12px;
}

.guide-row.muted button {
  background: #999b99;
  color: #ffffff;
  border-color: #999b99;
}

.org-row code {
  max-width: 100%;
  border: 2px solid #ff3b22;
  background: #fff8f6;
  color: #696969;
  padding: 8px 10px;
  overflow-wrap: anywhere;
  animation: highlight 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.28);
  }
}

@keyframes scan {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

@keyframes highlight {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(255, 59, 34, 0);
  }
  50% {
    box-shadow: 0 0 22px rgba(255, 59, 34, 0.34);
  }
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .content-grid,
  .guide-copy {
    grid-template-columns: 1fr;
  }

  .guide-shot {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 16px;
    padding: 18px;
  }
}

@media (max-width: 520px) {
  .page-shell {
    padding: 14px;
  }

  .query-row,
  .meta-grid div,
  .guide-shot,
  .guide-row {
    grid-template-columns: 1fr;
  }

  .field-head,
  .guide-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
