:root {
  --bg: #eef2ff;
  --bg2: #f8fafc;
  --panel: rgba(255, 255, 255, 0.72);
  --line: rgba(148, 163, 184, 0.22);
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0f172a;
  --primary-2: #1e293b;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg2), var(--bg));
}

code {
  background: rgba(15, 23, 42, 0.06);
  padding: 2px 6px;
  border-radius: 8px;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.45;
}

.orb-1 {
  top: -80px;
  left: -40px;
  width: 320px;
  height: 320px;
  background: rgba(99, 102, 241, 0.28);
}

.orb-2 {
  right: -40px;
  top: 160px;
  width: 280px;
  height: 280px;
  background: rgba(14, 165, 233, 0.18);
}

.container {
  position: relative;
  width: min(1240px, calc(100% - 32px));
  margin: 28px auto 60px;
  display: grid;
  gap: 22px;
}

.glass {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
}

.hero {
  border-radius: var(--radius-xl);
  padding: 28px;
  display: grid;
  gap: 24px;
  grid-template-columns: 1.4fr 0.8fr;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.05;
  margin: 14px 0 10px;
  letter-spacing: -0.04em;
}

.hero p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  max-width: 760px;
}

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

.hero-tags span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  font-size: 13px;
  color: #334155;
  font-weight: 600;
}

.hero-panel {
  background: linear-gradient(180deg, #0f172a, #111827);
  color: white;
  border-radius: 28px;
  padding: 24px;
}

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

.hero-panel .muted {
  color: rgba(255, 255, 255, 0.64);
}

.hero-panel h3 {
  margin: 6px 0 0;
  font-size: 24px;
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.06);
}

.status-dot.active {
  background: var(--success);
}

.status-dot.loading {
  background: #f59e0b;
}

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

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 10px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.progress-value {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #818cf8, #22d3ee);
  transition: width 0.25s ease;
}

.mini-stats {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mini-card {
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.1);
}

.mini-card span {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.mini-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

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

.stat-card {
  border-radius: 26px;
  padding: 22px;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.stat-value {
  display: block;
  margin-top: 10px;
  font-size: 40px;
  letter-spacing: -0.04em;
}

.stat-card small {
  color: var(--muted);
}

.workspace-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 22px;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 24px;
}

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

.panel-head h2 {
  margin: 4px 0 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

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

.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  color: #334155;
  font-weight: 600;
}

.input-row {
  display: flex;
  gap: 12px;
}

input[type="url"],
input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  border-radius: 18px;
  min-height: 54px;
  padding: 0 16px;
  outline: none;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.search-input {
  max-width: 260px;
}

.btn {
  border: 0;
  border-radius: 18px;
  min-height: 54px;
  padding: 0 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease, background 0.2s ease;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
}

.btn-secondary {
  background: white;
  border: 1px solid var(--line);
  color: #1e293b;
}

.btn-ghost {
  background: rgba(241, 245, 249, 0.9);
  color: #334155;
}

.helper-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 12px 0 0;
}

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

.source-box {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid var(--line);
}

.source-box span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.source-box strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  word-break: break-all;
}

.message {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.message.error {
  background: rgba(254, 242, 242, 0.95);
  color: #b91c1c;
  border: 1px solid rgba(248, 113, 113, 0.22);
}

.message.success {
  background: rgba(240, 253, 244, 0.95);
  color: #166534;
  border: 1px solid rgba(74, 222, 128, 0.22);
}

.hidden {
  display: none;
}

.results-toolbar {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.results-list,
.sitemap-list {
  display: grid;
  gap: 12px;
  max-height: 620px;
  overflow: auto;
  padding-right: 2px;
}

.result-item,
.sitemap-item {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  padding: 14px 16px;
}

.result-index {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.result-link,
.sitemap-link {
  color: #0f172a;
  text-decoration: none;
  word-break: break-all;
  line-height: 1.7;
}

.result-link:hover,
.sitemap-link:hover {
  text-decoration: underline;
}

.warning-text {
  margin-top: 8px;
  color: #b45309;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 24px;
  padding: 40px 18px;
  text-align: center;
  color: var(--muted);
  background: rgba(248, 250, 252, 0.7);
}

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

  .search-input {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 20px, 1240px);
    margin-top: 12px;
  }

  .hero,
  .panel,
  .stat-card {
    padding: 18px;
  }

  .input-row,
  .actions-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .panel-head,
  .results-head {
    flex-direction: column;
  }
}