:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-soft: #fbfbfc;
  --ink: #15171d;
  --muted: #667085;
  --line: #e6e8ee;
  --orange: #ff6a00;
  --orange-dark: #d95500;
  --orange-soft: #fff1e8;
  --blue: #2563eb;
  --blue-soft: #eef4ff;
  --green: #16a36a;
  --green-soft: #eafaf2;
  --yellow: #ad6b00;
  --yellow-soft: #fff7df;
  --red: #e5484d;
  --red-soft: #fff0f0;
  --shadow: 0 18px 45px rgba(18, 25, 38, 0.08);
  --radius: 8px;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 250px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(255, 106, 0, 0.24);
}

.brand-logo-img {
  display: block;
  width: 118px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  flex: 0 0 auto;
}

.brand-name {
  color: var(--ink);
  font-weight: 900;
  font-size: 18px;
  line-height: 1.05;
}

.brand-sub {
  color: var(--muted);
  font-size: 10px;
  margin-top: 6px;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.topbar-actions,
.toolbar-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.server-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--yellow);
  background: var(--yellow-soft);
  font-size: 12px;
  font-weight: 900;
}

.server-status.online {
  color: var(--green);
  background: var(--green-soft);
}

.server-status.offline {
  color: var(--red);
  background: var(--red-soft);
}

.primary-button,
.ghost-button,
.analyze-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  white-space: nowrap;
}

.primary-button,
.analyze-button {
  background: var(--orange);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(255, 106, 0, 0.22);
}

.primary-button:hover,
.analyze-button:hover {
  background: var(--orange-dark);
  transform: translateY(-1px);
}

.primary-button:disabled,
.analyze-button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.ghost-button {
  background: #fff;
  color: #303743;
  border: 1px solid var(--line);
  font-weight: 800;
  text-decoration: none;
}

.ghost-button:hover {
  border-color: #cfd5df;
  background: #f8fafc;
}

.ghost-button.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.home-link {
  border-color: rgba(255, 106, 0, 0.28);
  color: var(--orange-dark);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.input-panel,
.report-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.input-panel {
  position: sticky;
  top: 83px;
  max-height: calc(100vh - 102px);
  overflow: auto;
}

.panel-head {
  padding: 22px 22px 12px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-head h1,
.report-toolbar h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.18;
}

.panel-head p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.diagnosis-form {
  padding: 18px 22px 22px;
}

.form-section {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.form-section:last-of-type {
  border-bottom: 0;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #303743;
  font-size: 13px;
  font-weight: 900;
}

.section-label span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 11px;
}

.search-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
}

input,
textarea {
  width: 100%;
  border: 1px solid #d8dde7;
  border-radius: 7px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  resize: vertical;
  min-height: 118px;
}

input:focus,
textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: #9aa3af;
}

.hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.hint.loading {
  color: var(--orange);
  font-weight: 900;
}

.hint.error {
  color: var(--red);
  font-weight: 900;
}

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

.budget-grid label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #303743;
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}

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

.budget-grid label:has(input:checked) {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.upload-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px dashed #cbd3df;
  border-radius: 7px;
  color: #3d4654;
  background: #fafbfc;
  cursor: pointer;
  font-weight: 800;
}

.upload-zone input {
  display: none;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 20px;
}

.file-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
}

.file-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: #3d4654;
  font-size: 12px;
}

.file-item span:last-child {
  color: var(--muted);
  white-space: nowrap;
}

.channel-fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0;
  border: 0;
}

.channel-fieldset label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #3d4654;
  background: #fff;
  font-weight: 800;
}

.channel-fieldset input {
  width: 16px;
  height: 16px;
  accent-color: var(--orange);
}

.analyze-button {
  width: 100%;
  min-height: 46px;
  font-size: 15px;
}

.report-panel {
  min-width: 0;
  overflow: hidden;
}

.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.report-canvas {
  padding: 20px;
  background: #fff;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: center;
  min-height: 238px;
  padding: 26px;
  border-radius: var(--radius);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(28, 31, 38, 0.96), rgba(32, 43, 57, 0.92)),
    linear-gradient(90deg, #ff6a00, #2563eb);
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 106, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffb179;
  font-size: 12px;
  font-weight: 900;
}

.hero-band h2 {
  margin: 14px 0 8px;
  max-width: 760px;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.05;
}

.hero-band p {
  max-width: 700px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
}

.hero-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-pills span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 800;
}

.score-orbit {
  position: relative;
  width: 190px;
  height: 190px;
  margin: 0 auto;
}

.score-orbit svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg,
.gauge-value {
  fill: none;
  stroke-width: 14;
}

.gauge-bg {
  stroke: rgba(255, 255, 255, 0.12);
}

.gauge-value {
  stroke: var(--orange);
  stroke-linecap: round;
  stroke-dasharray: 389.56;
  stroke-dashoffset: 389.56;
  transition: stroke-dashoffset 700ms ease;
}

.score-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.score-center strong {
  display: block;
  color: #fff;
  font-size: 50px;
  line-height: 1;
  font-weight: 900;
}

.score-center span {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.auto-profile-section,
.report-section {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.report-section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 15px;
}

.report-section-head > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-weight: 900;
  flex: 0 0 auto;
}

.report-section h3,
.auto-profile-section h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.report-section p,
.auto-profile-section p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.profile-card {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.profile-card.wide {
  grid-column: span 2;
}

.profile-card h4 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  color: #303743;
  font-size: 13px;
}

.confidence {
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 11px;
  white-space: nowrap;
}

.confidence.mid {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.confidence.low {
  color: var(--red);
  background: var(--red-soft);
}

.profile-card .value {
  color: var(--ink);
  font-weight: 900;
  word-break: break-word;
}

.profile-card .source {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.profile-card a,
.source-list a {
  color: var(--blue);
  text-decoration: none;
  word-break: break-all;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 20px;
}

.metric-card {
  min-height: 110px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin: 6px 0 2px;
  color: var(--ink);
  font-size: 27px;
  line-height: 1;
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
}

.metric-card.orange strong {
  color: var(--orange);
}

.metric-card.blue strong {
  color: var(--blue);
}

.metric-card.green strong {
  color: var(--green);
}

.score-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(280px, 0.9fr);
  gap: 14px;
}

.radar-card,
.insight-card,
.service-card,
.roadmap-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.radar-card {
  min-height: 320px;
  display: grid;
  place-items: center;
  padding: 8px;
}

.radar-card svg {
  width: 100%;
  max-width: 520px;
  height: auto;
}

.radar-grid {
  stroke: #dde2ea;
  stroke-width: 1;
  fill: none;
}

.radar-axis {
  stroke: #e7ebf2;
  stroke-width: 1;
}

.radar-shape {
  fill: rgba(255, 106, 0, 0.22);
  stroke: var(--orange);
  stroke-width: 3;
}

.radar-dot {
  fill: #fff;
  stroke: var(--orange);
  stroke-width: 3;
}

.radar-label {
  fill: #344054;
  font-size: 12px;
  font-weight: 800;
}

.insight-card {
  padding: 18px;
}

.insight-card h4 {
  margin: 0 0 12px;
  font-size: 16px;
}

.insight-card ul,
.service-card ul,
.roadmap-card ul {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.insight-card li {
  position: relative;
  padding-left: 20px;
  color: #3d4654;
}

.insight-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--orange);
}

.competitor-bars {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 12px;
}

.bar-name {
  color: #303743;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  height: 16px;
  border-radius: 999px;
  background: #eff2f7;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), #5f8ff5);
  transition: width 700ms ease;
}

.bar-row.brand .bar-fill {
  background: linear-gradient(90deg, var(--orange), #ff9b43);
}

.bar-value {
  color: #303743;
  font-weight: 900;
  text-align: right;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: #475467;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
}

td {
  color: #303743;
}

tr:last-child td {
  border-bottom: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.tag.good {
  color: var(--green);
  background: var(--green-soft);
}

.tag.warn {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.tag.risk {
  color: var(--red);
  background: var(--red-soft);
}

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

.platform-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.platform-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.platform-top strong {
  font-size: 15px;
}

.mini-score {
  color: var(--orange);
  font-weight: 900;
}

.progress-row {
  display: grid;
  gap: 5px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eff2f7;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--orange);
}

.progress-fill.blue {
  background: var(--blue);
}

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

.service-card {
  padding: 15px;
  display: grid;
  gap: 12px;
}

.service-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
}

.service-card h4 span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--orange-soft);
  color: var(--orange);
  font-weight: 900;
}

.service-card p {
  margin: 0;
  color: #475467;
  min-height: 66px;
}

.service-card li {
  display: flex;
  gap: 7px;
  color: #344054;
}

.service-card li::before {
  content: "✓";
  color: var(--green);
  font-weight: 900;
}

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

.roadmap-card {
  padding: 16px;
}

.roadmap-card .phase {
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
}

.roadmap-card h4 {
  margin: 4px 0 10px;
  font-size: 17px;
}

.roadmap-card li {
  color: #3d4654;
}

.roadmap-card li strong {
  color: var(--ink);
}

.source-list {
  display: grid;
  gap: 10px;
}

.source-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.source-item strong {
  color: #303743;
}

.source-item p {
  margin: 0;
  color: var(--muted);
}

.report-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  padding: 10px 14px;
  border-radius: 7px;
  background: #1d222d;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: static;
    max-height: none;
  }

  .metric-grid,
  .service-plan,
  .auto-profile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .brand-lockup {
    min-width: 0;
  }

  .topbar-actions,
  .toolbar-buttons {
    justify-content: flex-start;
  }

  .workspace {
    padding: 10px;
    gap: 10px;
  }

  .report-toolbar,
  .hero-band,
  .score-layout {
    grid-template-columns: 1fr;
  }

  .report-toolbar {
    display: grid;
  }

  .hero-band {
    padding: 20px;
  }

  .score-orbit {
    width: 170px;
    height: 170px;
  }

  .metric-grid,
  .platform-grid,
  .service-plan,
  .roadmap,
  .auto-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-card.wide {
    grid-column: span 2;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 13px;
  }

  .topbar {
    padding: 12px;
  }

  .brand-logo-img {
    width: 104px;
    height: 36px;
  }

  .search-field,
  .budget-grid,
  .channel-fieldset,
  .metric-grid,
  .platform-grid,
  .service-plan,
  .roadmap,
  .auto-profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-card.wide {
    grid-column: span 1;
  }

  .panel-head,
  .diagnosis-form,
  .report-canvas,
  .report-toolbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero-band h2 {
    font-size: 30px;
  }

  .bar-row {
    grid-template-columns: 88px minmax(0, 1fr) 42px;
    gap: 8px;
  }

  .report-footer {
    display: grid;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .input-panel,
  .report-toolbar,
  .toast {
    display: none !important;
  }

  .workspace {
    display: block;
    padding: 0;
  }

  .report-panel,
  .report-canvas {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .report-section,
  .auto-profile-section {
    break-inside: avoid;
  }

  .hero-band {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
