:root {
  --ink: #17202b;
  --muted: #667085;
  --line: #d9e2e8;
  --paper: #f5f7f2;
  --surface: #ffffff;
  --deep: #21384a;
  --green: #557a61;
  --coral: #bd6f58;
  --gold: #aa8342;
  --blue: #52758f;
  --soft: #edf4ea;
  --shadow: 0 16px 42px rgba(22, 38, 54, 0.08);
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}

button:hover {
  border-color: #9eb1bf;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}

.rail {
  background: #203244;
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8efd9;
  color: var(--deep);
  font-weight: 900;
  font-size: 22px;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
}

.brand p,
.rail-card p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.5;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  color: #fff;
  text-align: left;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active,
.nav-item:hover {
  color: var(--deep);
  background: #eef4ea;
}

.rail-card {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 16px;
}

.rail-card h2 {
  margin: 0;
  font-size: 16px;
}

.main {
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.topbar,
.top-actions,
.panel-head,
.field-row {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
}

.top-actions {
  gap: 10px;
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.topbar h2 {
  margin: 2px 0 0;
  font-size: 30px;
}

.hero {
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(33, 56, 74, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(33, 56, 74, 0.08) 1px, transparent 1px),
    #fbfbf8;
  background-size: 44px 44px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.hero h3 {
  margin: 0;
  font-size: 28px;
}

.hero p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  gap: 10px;
  min-width: 310px;
}

.hero-metrics div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

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

.hero-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

.grid.two {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1.2fr);
  gap: 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h3 {
  margin: 0;
  font-size: 18px;
}

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

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

.field-row {
  gap: 12px;
}

.primary {
  background: var(--deep);
  border-color: var(--deep);
  color: #fff;
}

.output-panel {
  min-height: 480px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  min-height: 360px;
  color: var(--muted);
  line-height: 1.7;
  background: #fbfcfb;
}

.result-block {
  border: 1px solid #eef1f3;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fbfcfb;
}

.result-block h4 {
  margin: 0 0 8px;
  color: var(--deep);
}

.result-block p,
.result-block ul {
  margin: 0;
  line-height: 1.75;
}

.result-block ul {
  padding-left: 20px;
}

.task-grid,
.cards,
.history-list,
.lead-board {
  display: grid;
  gap: 12px;
}

.task-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.task,
.product-card,
.lead-card,
.history-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 13px;
}

.task {
  border-left: 4px solid var(--coral);
}

.task h4,
.product-card h4,
.lead-card h4,
.history-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.task p,
.product-card p,
.lead-card p,
.history-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: #3f654e;
  font-size: 12px;
  margin-bottom: 8px;
}

.card-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.card-actions button {
  padding: 7px 10px;
  font-size: 13px;
}

.lead-score {
  color: var(--coral);
  font-size: 22px;
  font-weight: 900;
}

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

  .rail {
    min-height: auto;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rail-card {
    margin-top: 0;
  }

  .grid.two,
  .task-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .main,
  .rail {
    padding: 16px;
  }

  .topbar,
  .hero,
  .field-row {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions button {
    flex: 1;
  }

  .nav,
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    min-width: 0;
  }
}
