:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #697386;
  --line: #dfe6ef;
  --blue: #2457a6;
  --blue-dark: #173b78;
  --gold: #b68735;
  --green: #237a57;
  --red: #b24848;
  --soft-blue: #eaf1fb;
  --soft-gold: #fbf4e8;
  --shadow: 0 18px 50px rgba(24, 39, 75, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #eef4fb 0, #f8fafc 340px, var(--bg) 100%);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 22px;
  align-items: end;
  padding: 26px 0 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.05;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero-copy {
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
  margin-bottom: 0;
}

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

.hero-stats div {
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(36, 87, 166, 0.18);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
}

.hero-stats span,
.mini-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.hero-stats strong {
  display: block;
  margin-top: 10px;
  color: var(--blue-dark);
  font-size: 20px;
  line-height: 1.2;
}

.workbench {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

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

.input-panel,
.result-panel,
.details-grid .panel,
.table-panel {
  padding: 20px;
}

.panel-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-title.compact {
  margin-bottom: 12px;
}

.panel-title h2 {
  margin-bottom: 4px;
  font-size: 20px;
}

.panel-title p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 0;
}

.step-dot {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  font-size: 14px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #384252;
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid #cfd8e5;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

input:focus,
select:focus {
  outline: 2px solid rgba(36, 87, 166, 0.22);
  border-color: var(--blue);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.toggle-line {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}

.art-fields {
  display: none;
  margin: 4px 0 14px;
  padding: 12px;
  border: 1px solid #d8e4f2;
  background: #f5f8fd;
}

.art-fields.is-visible {
  display: block;
}

.formula-note {
  margin-bottom: 10px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.toggle-line input {
  width: 18px;
  height: 18px;
}

button {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--blue-dark);
}

.result-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.result-card div {
  padding: 16px;
  background: var(--soft-blue);
  border: 1px solid #d7e5f7;
}

.result-card strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  line-height: 1.1;
  color: var(--blue-dark);
}

.insight {
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--soft-gold);
  border-left: 4px solid var(--gold);
  color: #4e3b1d;
  line-height: 1.65;
}

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

.recommendation-columns > div {
  border: 1px solid var(--line);
  padding: 14px;
  min-height: 180px;
}

.recommendation-columns h3 {
  margin-bottom: 10px;
  font-size: 16px;
  color: var(--blue-dark);
}

ul {
  margin: 0;
  padding-left: 18px;
}

li {
  margin-bottom: 8px;
  line-height: 1.45;
}

.major-meta {
  color: var(--muted);
  font-size: 12px;
}

.empty-recommendation {
  padding: 10px 0;
  color: var(--red);
}

.empty-recommendation .major-meta {
  margin-top: 4px;
  color: #7a4a28;
}

.details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  gap: 18px;
  margin-top: 18px;
}

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

.direction-card,
.risk-item {
  border: 1px solid var(--line);
  padding: 14px;
  background: #fff;
}

.direction-card h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.direction-card p,
.risk-item p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.risk-item {
  margin-bottom: 10px;
}

.risk-item strong {
  display: block;
  margin-bottom: 5px;
  color: var(--red);
}

.table-panel {
  margin-top: 18px;
}

.table-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
}

.table-toolbar h2 {
  margin-bottom: 4px;
  font-size: 20px;
}

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

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

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

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.45;
}

th {
  position: sticky;
  top: 0;
  background: #eef4fb;
  color: var(--blue-dark);
  z-index: 1;
}

.tag {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 12px;
}

.sources {
  margin-top: 18px;
  padding: 16px 18px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.6;
}

.sources a {
  color: var(--blue);
  text-decoration: none;
}

.sources a:hover {
  text-decoration: underline;
}

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

  .hero-stats,
  .result-card,
  .recommendation-columns,
  .direction-cards,
  .table-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 16px;
  }

  .input-panel,
  .result-panel,
  .details-grid .panel,
  .table-panel {
    padding: 14px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
    line-height: 1.18;
  }
}
