:root {
  --ink: #172033;
  --muted: #667085;
  --line: #dfe5ef;
  --soft: #f5f7fb;
  --blue: #2154d8;
  --blue-soft: #edf3ff;
  --navy: #101828;
  --green: #087a55;
  --red: #b42318;
  --amber: #b54708;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, #e7efff 0, transparent 30%),
    var(--soft);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.6;
}

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

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding: 34px;
  margin-bottom: 18px;
  color: #fff;
  background: linear-gradient(135deg, #111b35 0%, #1e49b6 62%, #2f6de4 100%);
  border-radius: 24px;
  box-shadow: 0 22px 55px rgba(20, 43, 99, 0.2);
}

.hero h1 {
  margin: 4px 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.25;
}

.hero p {
  max-width: 760px;
  margin: 0;
  color: #d9e5ff;
}

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.hero-badge {
  align-self: center;
  min-width: 210px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.hero-badge strong,
.hero-badge span {
  display: block;
}

.hero-badge span {
  margin-top: 4px;
  color: #d9e5ff;
  font-size: 13px;
}

.card {
  padding: 22px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(16, 24, 40, 0.05);
}

.section-title,
.section-title > div {
  display: flex;
  align-items: center;
}

.section-title {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title > div {
  gap: 10px;
}

h2 {
  margin: 0;
  font-size: 21px;
}

.step {
  display: grid;
  width: 32px;
  height: 32px;
  color: #fff;
  background: var(--blue);
  border-radius: 10px;
  place-items: center;
  font-weight: 800;
}

.section-note,
.help,
.muted,
small {
  color: var(--muted);
  font-size: 13px;
}

.formula-panel {
  padding: 16px;
  margin: 14px 0 18px;
  color: #26364d;
  background: #fff8e7;
  border-left: 5px solid #e8a838;
  border-radius: 0 12px 12px 0;
}

.formula-panel > strong {
  color: #1a365d;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin-top: 9px;
  font-size: 13px;
}

.upload {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px;
  border: 1.5px dashed #9eb6e9;
  border-radius: 16px;
  background: #f8faff;
  cursor: pointer;
  transition: 0.2s ease;
}

.upload:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload span strong,
.upload span small {
  display: block;
}

.upload-icon {
  display: grid;
  width: 58px;
  height: 58px;
  color: var(--blue);
  background: #fff;
  border: 1px solid #cbd9f6;
  border-radius: 14px;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.status {
  padding: 10px 2px 0;
}

.status.success {
  color: var(--green);
}

.status.error {
  color: var(--red);
}

.period-info,
.logic-note {
  padding: 11px 14px;
  margin-top: 14px;
  color: #344054;
  background: #f8fafc;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  font-size: 13px;
}

.hidden {
  display: none;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.kpi {
  min-height: 112px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #e6eaf0;
  border-radius: 15px;
}

.kpi span,
.kpi strong,
.kpi small {
  display: block;
}

.kpi strong {
  margin: 3px 0;
  color: var(--navy);
  font-size: 23px;
}

.trend-up {
  color: var(--green) !important;
}

.trend-down {
  color: var(--red) !important;
}

.trend-warn {
  color: var(--amber) !important;
}

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

label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
}

select,
textarea,
input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  outline: none;
}

select:focus,
textarea:focus,
input[type="text"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(33, 84, 216, 0.1);
}

textarea {
  resize: vertical;
}

.button {
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
}

.button.primary {
  color: #fff;
  background: var(--blue);
}

.button.dark {
  color: #fff;
  background: var(--navy);
}

.button.ghost {
  color: #2348a5;
  background: #edf2ff;
}

.button.danger {
  color: var(--red);
  background: #fff0ee;
}

.button:hover {
  filter: brightness(0.97);
}

.empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: #fafbfc;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
}

.metric-row {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(220px, 1.5fr);
  gap: 12px;
  align-items: start;
  padding: 13px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.metric-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 5px;
}

.metric-main strong,
.metric-main span {
  display: block;
}

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

.analysis-list {
  margin-top: 14px;
}

.analysis-item {
  padding: 16px;
  margin-top: 12px;
  background: #fbfcff;
  border: 1px solid #dbe3f1;
  border-radius: 16px;
}

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

.analysis-head strong {
  color: #183b8f;
}

.product-data-panel {
  padding: 14px;
  background: #fff;
  border: 1px solid #d9e2ef;
  border-radius: 13px;
}

.product-data-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.product-data-title strong {
  color: #1a365d;
}

.product-data-title span {
  color: var(--muted);
  font-size: 12px;
}

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

.mini-kpi {
  padding: 9px;
  background: #f6f8fb;
  border-radius: 9px;
}

.mini-kpi span,
.mini-kpi strong,
.mini-kpi small {
  display: block;
}

.mini-kpi span {
  color: #667085;
  font-size: 11px;
}

.mini-kpi strong {
  color: #1a365d;
  font-size: 15px;
}

.mini-kpi small {
  font-size: 10px;
}

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

.field-wide {
  grid-column: 1 / -1;
}

.field label {
  margin-bottom: 5px;
  font-size: 13px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.report {
  min-height: 360px;
  padding: 0;
  color: #202939;
  background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
  border: 1px solid #d9dee8;
  border-radius: 16px;
  overflow: hidden;
}

.report-shell {
  background: #fff;
}

.report-header {
  padding: 38px;
  color: #fff;
  text-align: center;
  background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
}

.report-header h1 {
  margin: 4px 0 6px;
  font-size: 30px;
}

.report-kicker {
  color: #f4ca6b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.report-period {
  color: #e7eefb;
}

.report-source {
  margin-top: 10px;
  color: #bdcce5;
  font-size: 12px;
}

.report-body {
  padding: 34px;
}

.report-section {
  margin-bottom: 34px;
  page-break-inside: avoid;
}

.report-section > h2 {
  padding-bottom: 8px;
  margin: 0 0 18px;
  color: #1a365d;
  border-bottom: 3px solid #e8a838;
  font-size: 21px;
}

.report-section > h3 {
  margin: 18px 0 8px;
  color: #2c5282;
  font-size: 16px;
}

.report-highlight {
  padding: 18px;
  margin: 14px 0;
  background: #fff3cd;
  border-left: 5px solid #e8a838;
  border-radius: 0 8px 8px 0;
}

.report-highlight strong {
  color: #1a365d;
}

.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.report-kpi {
  padding: 17px;
  text-align: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #e9ecef;
  border-radius: 10px;
}

.report-kpi span,
.report-kpi strong,
.report-kpi small {
  display: block;
}

.report-kpi strong {
  margin: 6px 0;
  color: #1a365d;
  font-size: 22px;
}

.report-kpi small {
  color: #667085;
}

.report-formula {
  padding: 16px 18px;
  margin-bottom: 18px;
  background: #eef4fb;
  border-left: 5px solid #2c5282;
  border-radius: 0 8px 8px 0;
}

.report-formula p {
  margin: 5px 0;
}

.report-metric-list,
.report-cause-list {
  display: grid;
  gap: 10px;
}

.report-metric-item,
.report-cause {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px;
  background: #f8f9fa;
  border-left: 4px solid #e8a838;
  border-radius: 0 8px 8px 0;
}

.priority {
  display: inline-block;
  flex: 0 0 auto;
  padding: 3px 9px;
  color: #fff;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 800;
}

.priority-p1 {
  background: #dc3545;
}

.priority-p2 {
  background: #fd7e14;
}

.priority-p3 {
  color: #4a3a00;
  background: #ffc107;
}

.report-action-group {
  margin: 12px 0;
}

.report-action-category {
  margin-bottom: 7px;
  color: #1a365d;
  font-weight: 800;
}

.report-action-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 12px 14px;
  margin: 7px 0;
  background: #f8f9fa;
  border-left: 4px solid #e8a838;
  border-radius: 0 8px 8px 0;
}

.report-action-item strong {
  color: #2c5282;
}

.report-note {
  margin-bottom: 0;
}

.report p {
  margin: 7px 0;
  white-space: pre-wrap;
}

.report ul {
  margin: 7px 0;
  padding-left: 24px;
}

.report li {
  margin: 5px 0;
}

.report .data-table {
  width: 100%;
  margin: 10px 0;
  border-collapse: collapse;
}

.report .data-table th,
.report .data-table td {
  padding: 8px 10px;
  text-align: left;
  border: 1px solid #dfe5ef;
}

.report .data-table th {
  color: #fff;
  background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 4px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 860px) {
  .hero,
  .section-title,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-badge {
    width: 100%;
  }

  .kpi-grid,
  .two-columns,
  .form-grid,
  .formula-grid,
  .report-kpi-grid {
    grid-template-columns: 1fr;
  }

  .mini-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-row {
    grid-template-columns: auto 1fr;
  }

  .metric-row textarea {
    grid-column: 1 / -1;
  }

  .report-body,
  .report-header {
    padding: 22px;
  }

  .report-action-item {
    grid-template-columns: 1fr;
  }
}

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

  .hero,
  .card:not(:last-of-type),
  .section-title,
  .toolbar,
  footer {
    display: none !important;
  }

  .page,
  .card,
  .report {
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
  }
}
