:root {
  color-scheme: light;
  --bg: #eef3f8;
  --panel: #ffffff;
  --panel-soft: #f7faff;
  --ink: #101827;
  --muted: #657287;
  --line: #d9e2ee;
  --line-strong: #c6d3e2;
  --blue: #1769ff;
  --blue-dark: #0d3c91;
  --cyan: #20b7d8;
  --green: #12a879;
  --amber: #d99922;
  --red: #db4d55;
  --navy: #07111f;
  --shadow: 0 20px 70px rgba(17, 35, 64, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(23, 105, 255, 0.12), transparent 28%),
    linear-gradient(225deg, rgba(32, 183, 216, 0.1), transparent 26%),
    var(--bg);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 18px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(300px, 1fr);
  align-items: center;
  gap: 22px;
  max-width: 1780px;
  min-height: 76px;
  margin: 0 auto 18px;
  padding: 14px 18px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(7, 17, 31, 0.98), rgba(12, 31, 56, 0.94)),
    var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 16px 50px rgba(7, 17, 31, 0.26);
}

.brand-block strong,
.brand-block span {
  display: block;
}

.brand-block strong {
  font-size: 22px;
  line-height: 1.05;
}

.brand-block span {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
}

.mode-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  cursor: default;
}

.mode-tabs span {
  padding: 9px 12px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  user-select: none;
}

.mode-tabs span:first-child {
  color: rgba(255, 255, 255, 0.78);
}

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

.ghost-button,
.demo-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 13px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 14px;
  color: #ccecff;
  background: rgba(23, 105, 255, 0.18);
  border: 1px solid rgba(32, 183, 216, 0.36);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.live-pill i {
  width: 9px;
  height: 9px;
  background: #20d8a2;
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(32, 216, 162, 0.12);
  animation: pulse 1.4s ease-in-out infinite;
}

main {
  max-width: 1780px;
  margin: 0 auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(340px, 420px) 1fr;
  gap: 18px;
  min-height: calc(100vh - 130px);
}

.input-panel,
.stage-panel,
.data-card,
.overall-card,
.score-grid article {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(198, 211, 226, 0.82);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.input-panel {
  padding: 24px;
}

.panel-heading p,
.stage-header p,
.card-title p {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-heading h1,
.stage-header h2,
.card-title h2 {
  margin: 0;
  color: var(--ink);
  line-height: 1.1;
}

.panel-heading h1 {
  font-size: 30px;
}

.analysis-form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.analysis-form label,
.market-field {
  display: grid;
  gap: 8px;
}

.analysis-form span,
.market-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.analysis-form input,
.analysis-form select {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
}

.analysis-form input:focus,
.analysis-form select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(23, 105, 255, 0.1);
}

.market-combobox {
  position: relative;
}

.market-combobox::after {
  content: "";
  position: absolute;
  top: 20px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  pointer-events: none;
  transform: rotate(45deg);
}

.market-combobox input[type="text"] {
  padding-right: 38px;
}

.market-options {
  position: absolute;
  z-index: 45;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 278px;
  padding: 6px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 22px 60px rgba(17, 35, 64, 0.18);
}

.market-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
}

.market-option:hover,
.market-option.is-active {
  background: #eef5ff;
}

.market-option strong {
  font-size: 14px;
}

.market-option small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.market-empty {
  padding: 13px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  place-items: center;
  min-height: 62px;
  margin-top: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #0d8ed6);
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 18px 38px rgba(23, 105, 255, 0.28);
  font-size: 17px;
  font-weight: 900;
}

.primary-button small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.demo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.demo-row button {
  color: var(--blue-dark);
  background: #eef5ff;
  border-color: #cdddf3;
}

.stage-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 670px;
  padding: 26px;
  overflow: hidden;
}

.stage-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(23, 105, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 105, 255, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 78%);
  pointer-events: none;
}

.stage-header,
.card-title {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.stage-header h2 {
  font-size: 34px;
}

#modeBadge,
.card-title > span,
.card-title > b {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  color: var(--blue-dark);
  background: #eef5ff;
  border: 1px solid #d6e4f6;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.analysis-progress {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 430px) 1fr;
  align-items: center;
  gap: 46px;
}

.orbital-score {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
}

.orbital-score svg {
  width: 100%;
  max-width: 420px;
  filter: drop-shadow(0 24px 44px rgba(23, 105, 255, 0.22));
}

.orbital-score circle {
  fill: none;
  stroke: rgba(23, 105, 255, 0.1);
  stroke-width: 14;
}

#progressRing {
  stroke: url("#progressGradient");
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-dasharray: 427;
  stroke-dashoffset: 427;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 220ms ease;
}

.orbital-score strong {
  position: absolute;
  color: var(--navy);
  font-size: clamp(54px, 7vw, 92px);
  line-height: 1;
}

.analysis-steps {
  display: grid;
  gap: 14px;
}

.analysis-steps span {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 800;
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.analysis-steps span.is-active {
  color: var(--blue-dark);
  background: #eaf3ff;
  border-color: rgba(23, 105, 255, 0.34);
  transform: translateX(8px);
}

.analysis-steps span.is-done {
  color: var(--green);
}

.preview-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.preview-metrics article {
  padding: 16px;
  background: rgba(7, 17, 31, 0.94);
  border-radius: var(--radius);
}

.preview-metrics span,
.overall-card p,
.score-grid span,
.content-stats span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.preview-metrics strong {
  color: #fff;
  font-size: 22px;
}

.results {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.score-section {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
}

.overall-card {
  padding: 24px;
  color: #fff;
  background:
    linear-gradient(140deg, rgba(23, 105, 255, 0.94), rgba(7, 17, 31, 0.98)),
    var(--navy);
}

.overall-card p {
  color: rgba(255, 255, 255, 0.72);
}

.overall-card div {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 18px 0;
}

.overall-card strong {
  font-size: 78px;
  line-height: 0.9;
}

.overall-card span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 24px;
  font-weight: 800;
}

.overall-card b {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  color: #dff7ff;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 13px;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.score-grid article {
  padding: 18px;
}

.score-grid strong {
  display: block;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 38px;
  line-height: 1;
}

.mini-bar,
.intent-bar-track,
.metric-track {
  height: 8px;
  overflow: hidden;
  background: #e8eef6;
  border-radius: 999px;
}

.mini-bar i,
.intent-bar-track i,
.metric-track i {
  display: block;
  width: var(--value);
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border-radius: inherit;
}

.dashboard-grid {
  display: grid;
  gap: 18px;
}

.two-col {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.85fr);
}

.data-card {
  padding: 22px;
  overflow: hidden;
}

.wide-card {
  min-width: 0;
}

.keyword-table-wrap {
  margin-top: 20px;
  overflow: auto;
}

.keyword-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.keyword-table th,
.keyword-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

.keyword-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.keyword-table td:first-child {
  color: var(--ink);
  font-weight: 900;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: var(--blue-dark);
  background: #eef5ff;
  border: 1px solid #d6e4f6;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.intent-bars,
.geo-metrics,
.content-stats,
.question-list,
.competitor-points,
.decision-grid {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.intent-item,
.geo-metric,
.question-item,
.competitor-points div,
.decision-grid div {
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.intent-item header,
.geo-metric header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 900;
}

.site-tree {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.tree-node {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding-left: calc(var(--level) * 22px);
  color: var(--ink);
  font-weight: 800;
}

.tree-node::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--blue);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(23, 105, 255, 0.1);
}

.tree-node small {
  margin-left: auto;
}

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

.content-stats article {
  padding: 16px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.content-stats strong {
  color: var(--blue-dark);
  font-size: 28px;
}

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

.topic-list span,
.question-item b {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.ai-card {
  background:
    linear-gradient(135deg, rgba(23, 105, 255, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.88);
}

.insight-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.insight-columns h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.insight-columns ul,
.recommendations {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.insight-columns li,
.recommendations li {
  margin: 9px 0;
  line-height: 1.45;
}

.question-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--ink);
  font-weight: 850;
}

.question-item b {
  flex: none;
  color: var(--blue-dark);
  background: #eaf3ff;
}

.leader-copy {
  margin: 18px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.competitor-points div {
  position: relative;
  padding-left: 38px;
  color: var(--ink);
  font-weight: 800;
}

.competitor-points div::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 19px;
  width: 8px;
  height: 8px;
  background: var(--blue);
  border-radius: 50%;
}

.radar-wrap {
  margin-top: 18px;
  min-height: 290px;
}

.radar-wrap svg {
  width: 100%;
  height: 300px;
}

.roadmap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.phase-card {
  padding: 18px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.phase-card span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.phase-card h3 {
  margin: 8px 0 4px;
  font-size: 24px;
}

.phase-card b {
  color: var(--muted);
}

.phase-card ul {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.phase-card li {
  margin: 8px 0;
}

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

.decision-grid div {
  display: grid;
  gap: 8px;
}

.decision-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.decision-grid strong {
  color: var(--blue-dark);
  font-size: 22px;
}

.disclaimer {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

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

@media (max-width: 1180px) {
  .topbar,
  .hero-grid,
  .score-section,
  .two-col {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .analysis-progress {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 10px;
  }

  .topbar {
    top: 10px;
  }

  .mode-tabs,
  .live-pill {
    display: none;
  }

  .score-grid,
  .preview-metrics,
  .content-stats,
  .insight-columns,
  .roadmap,
  .decision-grid {
    grid-template-columns: 1fr;
  }

  .stage-panel {
    min-height: auto;
  }

  .overall-card strong {
    font-size: 58px;
  }
}
