:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d9dee7;
  --panel: #ffffff;
  --page: #f6f7f9;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warning: #b54708;
  --danger: #b42318;
  --focus: #175cd3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
textarea,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

.topbar p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.layout {
  padding: 24px 32px 36px;
}

.input-panel,
.items,
.briefing {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.input-panel {
  padding: 18px;
}

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

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  line-height: 1.6;
  color: var(--ink);
  background: #fff;
}

textarea:focus,
select:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

.ghost-button,
.icon-button {
  color: var(--ink);
  background: #eef2f6;
}

.ghost-button:hover,
.icon-button:hover {
  background: #e4e9f0;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
}

#formStatus {
  color: var(--muted);
  font-size: 14px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.metric strong {
  display: block;
  font-size: 24px;
}

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

.workbench {
  display: grid;
  grid-template-columns: 160px minmax(380px, 1.15fr) minmax(340px, 0.85fr);
  gap: 16px;
  align-items: start;
}

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

.filter {
  width: 100%;
  color: var(--ink);
  background: #e9edf3;
  text-align: left;
}

.filter.active {
  color: #fff;
  background: var(--accent);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.section-title h2 {
  font-size: 16px;
}

select {
  min-width: 148px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

.item-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
}

.item.done {
  opacity: 0.62;
}

.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.item-title {
  font-weight: 700;
  line-height: 1.4;
}

.item-meta,
.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  color: #344054;
  background: #eef2f6;
  font-size: 12px;
}

.pill.risk {
  color: var(--danger);
  background: #fee4e2;
}

.pill.decision {
  color: var(--focus);
  background: #dbeafe;
}

.pill.waiting {
  color: var(--warning);
  background: #fef0c7;
}

.item-summary {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.item-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.item-actions button {
  padding: 7px 10px;
  color: var(--ink);
  background: #eef2f6;
}

.item-actions button:hover {
  background: #e4e9f0;
}

.briefing pre {
  min-height: 520px;
  margin: 0;
  padding: 16px;
  white-space: pre-wrap;
  line-height: 1.65;
  color: #344054;
  font-family: inherit;
}

.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

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

  .briefing {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .topbar,
  .layout {
    padding-left: 16px;
    padding-right: 16px;
  }

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

  .summary-strip,
  .workbench {
    grid-template-columns: 1fr;
  }

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