:root {
  --bg: #0c1325;
  --bg-soft: #101a31;
  --panel: rgba(14, 24, 46, 0.82);
  --panel-border: rgba(165, 196, 255, 0.18);
  --text: #eff5ff;
  --muted: #9ab0d8;
  --accent: #6ee7c8;
  --accent-strong: #23b49a;
  --warn: #ffbf69;
  --danger: #ff7b7b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family:
    "SF Pro Display",
    "PingFang SC",
    "Helvetica Neue",
    sans-serif;
  background:
    radial-gradient(circle at top left, rgba(68, 122, 255, 0.34), transparent 34%),
    radial-gradient(circle at 80% 20%, rgba(31, 185, 158, 0.3), transparent 28%),
    linear-gradient(180deg, #07101f, #0c1325 56%, #0d1730);
}

.page {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 0 60px;
}

.hero {
  padding: 14px 4px 26px;
}

.hero-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

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

.hero-text {
  max-width: 700px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.auth-summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.auth-username {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

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

.panel-header h2 {
  margin: 0;
  font-size: 20px;
}

.panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  padding: 18px;
  border: 1px solid rgba(165, 196, 255, 0.15);
  border-radius: 18px;
  background: rgba(6, 12, 24, 0.72);
  color: var(--text);
  font: inherit;
  line-height: 1.7;
}

textarea:focus {
  outline: 2px solid rgba(110, 231, 200, 0.35);
  border-color: rgba(110, 231, 200, 0.55);
}

input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(165, 196, 255, 0.15);
  border-radius: 14px;
  background: rgba(6, 12, 24, 0.72);
  color: var(--text);
  font: inherit;
}

input:focus {
  outline: 2px solid rgba(110, 231, 200, 0.35);
  border-color: rgba(110, 231, 200, 0.55);
}

button {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    background 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.primary-btn {
  min-width: 112px;
  padding: 12px 18px;
  font-weight: 700;
  color: #04131c;
  background: linear-gradient(135deg, var(--accent), #b4ffef);
}

.ghost-btn {
  padding: 10px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.auth-panel {
  position: relative;
  overflow: hidden;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.auth-card {
  padding: 18px;
  border: 1px solid rgba(165, 196, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-card h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.auth-btn {
  width: 100%;
  margin-top: 6px;
}

.form-field {
  display: block;
  margin-bottom: 14px;
}

.form-field span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.auth-message {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(110, 231, 200, 0.12);
  font-weight: 700;
}

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

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #62e6c3, #56a8ff);
  transition: width 0.2s ease;
}

.log-box,
.result-box,
.history-list {
  min-height: 220px;
}

.log-box {
  margin: 0;
  padding: 18px;
  overflow: auto;
  border-radius: 18px;
  background: rgba(4, 9, 19, 0.88);
  color: #c8f4dd;
  font-family:
    "SFMono-Regular",
    "JetBrains Mono",
    monospace;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.empty-state {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(165, 196, 255, 0.18);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.summary-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.summary-card.warning {
  border: 1px solid rgba(255, 191, 105, 0.35);
}

.summary-card.critical {
  border: 1px solid rgba(255, 123, 123, 0.35);
}

.summary-card.stable {
  border: 1px solid rgba(110, 231, 200, 0.28);
}

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

.summary-title h3,
.domain-card h3 {
  margin: 0;
  font-size: 18px;
}

.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
}

.metric {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 13px;
}

.domain-list,
.history-list {
  display: grid;
  gap: 14px;
}

.domain-card,
.history-card {
  padding: 18px;
  border: 1px solid rgba(165, 196, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.domain-card p,
.history-card p,
.summary-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.recommend-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.7;
}

.recommend-list li + li {
  margin-top: 6px;
}

.probe-details {
  margin-top: 14px;
}

.probe-details summary {
  cursor: pointer;
  color: var(--accent);
}

.probe-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
}

.input-history-block {
  margin-top: 18px;
}

.input-history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.input-history-header h3 {
  margin: 0;
  font-size: 17px;
}

.input-history-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.input-history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(165, 196, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.input-history-text {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}

.small-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .hero-topbar,
  .grid {
    grid-template-columns: 1fr;
  }

  .hero-topbar,
  .auth-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .panel-header {
    flex-direction: column;
  }

  .primary-btn,
  .ghost-btn {
    width: 100%;
  }
}
