:root {
  --canvas: #eef2f2;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --ink: #172026;
  --muted: #65717a;
  --line: rgba(30, 45, 52, 0.12);
  --line-strong: rgba(30, 45, 52, 0.2);
  --teal: #22756c;
  --teal-dark: #185c55;
  --wine: #9a3339;
  --wine-dark: #79262b;
  --gold: #b28a42;
  --shadow: 0 20px 55px rgba(25, 41, 48, 0.14);
  --shadow-soft: 0 12px 30px rgba(25, 41, 48, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family:
    "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

.hero {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
  background: #eef4f3;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("/static/report-workspace-bg.png");
  background-position: center;
  background-size: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(244, 248, 247, 0.24);
  pointer-events: none;
}

.topbar,
.hero-copy,
.workspace,
.api-panel {
  width: min(1240px, calc(100% - 48px));
  margin-inline: auto;
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(34, 117, 108, 0.95), rgba(154, 51, 57, 0.92)),
    #22756c;
  box-shadow: 0 12px 30px rgba(24, 92, 85, 0.22);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.12;
  font-weight: 850;
}

h2 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 780;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  padding-top: 34px;
}

.hero-copy p {
  max-width: 520px;
  margin: 0;
  color: #263236;
  font-size: 18px;
  line-height: 1.7;
  font-weight: 560;
}

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

.hero-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  color: #21383a;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 8px 20px rgba(25, 41, 48, 0.07);
  backdrop-filter: blur(16px);
  font-size: 13px;
  font-weight: 720;
}

.workspace {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: -58px;
  margin-bottom: 22px;
}

.panel,
.api-panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.panel {
  padding: 18px;
}

.input-panel {
  position: sticky;
  top: 16px;
}

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

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.form {
  display: grid;
  gap: 14px;
}

.form-section {
  display: grid;
  gap: 13px;
}

.file-drop {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(34, 117, 108, 0.28);
  border-radius: 8px;
  background: rgba(247, 250, 249, 0.82);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.file-drop:hover {
  border-color: rgba(34, 117, 108, 0.58);
  box-shadow: 0 12px 28px rgba(34, 117, 108, 0.11);
  transform: translateY(-1px);
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  color: white;
  background: var(--teal);
  box-shadow: 0 10px 24px rgba(34, 117, 108, 0.22);
  font-size: 12px;
  font-weight: 840;
}

.file-drop strong {
  display: block;
  margin-bottom: 5px;
  line-height: 1.35;
  word-break: break-word;
}

.file-drop small,
label span {
  color: var(--muted);
  font-size: 12px;
}

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

label {
  display: grid;
  gap: 7px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

textarea {
  resize: vertical;
  min-height: 132px;
  line-height: 1.6;
}

input:focus,
textarea:focus {
  border-color: rgba(34, 117, 108, 0.68);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(34, 117, 108, 0.11);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 780;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

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

button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.primary {
  color: white;
  background: var(--wine);
  box-shadow: 0 12px 26px rgba(154, 51, 57, 0.22);
}

.primary:hover {
  background: var(--wine-dark);
}

.secondary {
  color: white;
  background: var(--teal);
  box-shadow: 0 12px 26px rgba(34, 117, 108, 0.2);
}

.secondary:hover {
  background: var(--teal-dark);
}

.ghost {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metrics div {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.metrics div:nth-child(1) {
  border-top: 3px solid var(--teal);
}

.metrics div:nth-child(2) {
  border-top: 3px solid var(--wine);
}

.metrics div:nth-child(3) {
  border-top: 3px solid var(--gold);
}

.metrics div:nth-child(4) {
  border-top: 3px solid #384b54;
}

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

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  line-height: 1;
  font-weight: 850;
}

.report {
  min-height: 540px;
  max-height: 72vh;
  overflow: auto;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  white-space: pre-wrap;
  line-height: 1.82;
  font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

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

.api-panel {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 18px;
  margin-bottom: 32px;
  padding: 18px;
}

.api-panel p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, monospace;
}

pre {
  margin: 0;
  overflow: auto;
  border: 1px solid rgba(34, 117, 108, 0.14);
  border-radius: 8px;
  padding: 14px;
  color: #203338;
  background: rgba(234, 244, 241, 0.88);
  line-height: 1.55;
  font-size: 13px;
}

.dingtalk-result {
  min-height: 230px;
  border: 1px solid rgba(34, 117, 108, 0.14);
  border-radius: 8px;
  padding: 16px;
  background: rgba(234, 244, 241, 0.88);
  color: #203338;
}

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

.dingtalk-head span {
  display: block;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

.dingtalk-head strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.35;
}

.dingtalk-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.dingtalk-meta span {
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(34, 117, 108, 0.16);
  border-radius: 8px;
  color: #355159;
  background: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.dingtalk-body {
  max-height: 360px;
  overflow: auto;
  border-top: 1px solid rgba(34, 117, 108, 0.12);
  padding-top: 12px;
  white-space: pre-wrap;
  line-height: 1.72;
  font-size: 14px;
}

.dingtalk-empty {
  margin: 0;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 8px;
  color: white;
  background: rgba(23, 32, 38, 0.94);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero {
    min-height: 360px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace,
  .api-panel {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .topbar,
  .hero-copy,
  .workspace,
  .api-panel {
    width: min(100% - 24px, 1240px);
  }

  .hero {
    min-height: 390px;
  }

  .hero-bg {
    background-position: 62% center;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  h1 {
    font-size: 27px;
  }

  .hero-copy {
    padding-top: 22px;
  }

  .hero-copy p {
    font-size: 16px;
  }

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

  .file-drop {
    grid-template-columns: 1fr;
  }

  .report {
    min-height: 390px;
    max-height: none;
    font-size: 14px;
  }
}
