:root {
  color-scheme: light;
  --bg: #f4f7f2;
  --panel: #ffffff;
  --ink: #1c2a22;
  --muted: #65746c;
  --line: #dce5dc;
  --brand: #19744d;
  --brand-dark: #105538;
  --accent: #d9822b;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(24, 52, 38, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #eef6ef 0%, var(--bg) 38%, #f9faf6 100%);
  color: var(--ink);
}

.topbar {
  min-height: 148px;
  padding: 28px clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #123b2b;
  color: #fff;
}
.eyebrow {
  margin: 0 0 6px;
  color: #a9ddbc;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
}
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(28px, 4vw, 46px); }
h2 { margin-bottom: 8px; font-size: 22px; }
.status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.status span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  color: #dff2e6;
}

.shell { max-width: 1220px; margin: -28px auto 48px; padding: 0 18px; }
.tabs {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.tab {
  min-width: 112px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px 18px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}
.tab.active { background: var(--brand); color: #fff; }
.panel { display: none; padding-top: 18px; }
.panel.active { display: block; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.workspace {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 10px 28px rgba(44, 66, 52, .08);
}
.section-head p { color: var(--muted); line-height: 1.6; margin-bottom: 18px; }

input, textarea, select {
  width: 100%;
  border: 1px solid #cfdacf;
  border-radius: 8px;
  padding: 12px 13px;
  margin-bottom: 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
textarea { resize: vertical; line-height: 1.6; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.filebox {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  margin-bottom: 12px;
  border: 1px dashed #9db7a7;
  border-radius: 8px;
  background: #f6fbf7;
  color: var(--brand-dark);
  cursor: pointer;
  text-align: center;
}
.filebox input { display: none; }
button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  min-height: 42px;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
}
button:hover { background: var(--brand-dark); }
button.ghost {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
}
button.danger { background: var(--danger); }
.answer-box pre {
  min-height: 250px;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 16px;
  border-radius: 8px;
  background: #f7f8f4;
  border: 1px solid var(--line);
  line-height: 1.7;
}
.context-list, .item-list { display: grid; gap: 12px; }
.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}
.item h3 { margin: 0 0 8px; font-size: 17px; }
.item p { color: var(--muted); line-height: 1.6; margin-bottom: 10px; }
.meta { color: var(--accent); font-size: 13px; margin-bottom: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.media-grid img, .media-grid video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.hidden { display: none !important; }
.locked {
  opacity: .6;
  pointer-events: none;
}
dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(14, 30, 22, .42); }
.login-card { width: min(420px, calc(100vw - 36px)); padding: 24px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 16px;
  border-radius: 8px;
  background: #10291f;
  color: #fff;
  box-shadow: var(--shadow);
}

@media (max-width: 860px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .grid.two, .row { grid-template-columns: 1fr; }
  .workspace { padding: 18px; }
}
