:root {
  --paper: #fafaf7;
  --ink: #005c7a;
  --accent: #007675;
  --wash: #e7f1f2;
  --line: #cadbde;
  --text: #293f44;
  --muted: #52696e;
  --coral: #ff5e3a;
  --white: #fff;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--paper);
  line-height: 1.65;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--ink);
  text-underline-offset: 4px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.55rem 1rem;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  gap: 0.5rem;
}
button:hover,
.button:hover {
  border-color: var(--accent);
  background: var(--wash);
}
button.primary,
.button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
button.small,
.button.small {
  padding: 0.35rem 0.65rem;
  font-size: 0.9rem;
}
button[aria-current="page"] {
  background: var(--wash);
  border-color: var(--accent);
  font-weight: 650;
}
input,
select,
textarea {
  max-width: 100%;
  min-width: 0;
  width: 100%;
  border: 1px solid #91aab0;
  border-radius: 5px;
  background: white;
  color: var(--text);
  padding: 0.65rem 0.75rem;
  min-height: 44px;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
input[type="checkbox"] {
  min-height: 20px;
  width: 20px;
  height: 20px;
  flex: none;
}
label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}
label.check {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-weight: 400;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3.6rem);
  letter-spacing: -0.035em;
  line-height: 1.2;
  margin-bottom: 1.3rem;
}
h2 {
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1.35;
}
h3 {
  color: var(--ink);
  font-size: 1.15rem;
}
header {
  padding: 0.7rem max(1.3rem, calc((100vw - 1320px) / 2));
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border-bottom: 1px solid var(--line);
  background: white;
  min-height: 88px;
}
.brand {
  display: flex;
  flex: none;
}
.brand img {
  object-fit: contain;
}
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
#header-context {
  color: var(--muted);
  font-size: 0.92rem;
}
footer {
  max-width: 1320px;
  margin: auto;
  padding: 2rem 1.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.skip {
  position: fixed;
  left: 12px;
  top: -100px;
  z-index: 10;
  background: white;
  padding: 1rem;
}
.skip:focus {
  top: 8px;
}
:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.layout {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  max-width: 1360px;
  margin: auto;
  min-height: 75vh;
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 2rem 1.2rem;
}
.sidebar nav {
  display: grid;
  gap: 0.45rem;
  margin: 1.5rem 0;
}
.sidebar nav button {
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
}
.sidebar nav button[aria-current] {
  background: var(--wash);
}
.sidebar select {
  font-size: 0.92rem;
}
.sidebar .identity {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 2rem 0 0;
}
main {
  padding: 2.5rem 2.3rem;
  min-width: 0;
}
.public {
  max-width: 1120px;
  margin: auto;
  padding: 3.5rem 1.5rem;
}
.eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.intro {
  max-width: 780px;
  color: var(--muted);
  font-size: 1.15rem;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.toolbar h1,
.toolbar h2 {
  margin: 0;
}
.toolbar select,
.toolbar input {
  width: auto;
  max-width: 260px;
}
.muted {
  color: var(--muted);
  font-size: 0.92rem;
}
.notice {
  background: #fff0d9;
  border-bottom: 1px solid #e4c799;
  padding: 0.8rem max(1.5rem, calc((100vw - 1240px) / 2));
  font-size: 0.9rem;
}
#notice:not([hidden]) {
  background: #fff0d9;
  padding: 0.7rem 1.5rem;
  color: #6a491e;
}
.empty {
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.empty h2 {
  font-size: 1.25rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  margin: 2rem 0 2.5rem;
}
.stat {
  padding: 1rem 0;
  border-top: 2px solid var(--accent);
}
.stat strong {
  display: block;
  font-size: 2.2rem;
  line-height: 1.4;
  color: var(--ink);
}
.stat span {
  font-size: 0.85rem;
  color: var(--muted);
}
.panel {
  padding: 1.5rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 1.5rem 0;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.5rem;
}
.full {
  grid-column: 1/-1;
}
.form-note {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.feedback {
  color: #9c2e17;
  font-weight: 600;
  margin: 1rem 0;
  overflow-wrap: anywhere;
}
.feedback:empty {
  display: none;
}
.status {
  display: inline-flex;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  background: var(--wash);
  color: var(--ink);
  font-size: 0.8rem;
  white-space: nowrap;
}
.status.warn {
  background: #fff0d9;
  color: #805411;
}
.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
th,
td {
  padding: 0.85rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
th {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}
td .muted {
  max-width: 350px;
  font-size: 0.8rem;
}
td:first-child {
  min-width: 160px;
}
td:last-child {
  white-space: nowrap;
}
section + section {
  margin-top: 3rem;
}
.community-list article,
.challenge-list article {
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}
.community-list h2,
.challenge-list h3 {
  margin: 0.7rem 0;
}
.community-list p,
.challenge-list p {
  max-width: 760px;
  white-space: pre-line;
}
.public-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 3rem;
  margin-top: 3rem;
}
.partners {
  padding-left: 1.2rem;
}
.partners li {
  margin-bottom: 0.6rem;
}
.section-rule {
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}
.login {
  max-width: 760px;
  padding: 4rem 1.5rem;
  margin: auto;
}
.login button {
  margin: 0.5rem 0.5rem 0.5rem 0;
}
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.overdue {
  color: #a1331c;
  font-size: 0.8rem;
}
details {
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}
summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
}
.milestone {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.sticky-back {
  margin-bottom: 1.5rem;
}
.nowrap {
  white-space: nowrap;
}
@media (max-width: 950px) {
  .layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  main {
    padding: 2rem 1.2rem;
  }
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .public-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
@media (max-width: 650px) {
  header {
    padding: 0.6rem 1rem;
    gap: 0.6rem;
  }
  .brand img {
    width: 72px;
    height: 48px;
  }
  #header-context {
    display: none;
  }
  .header-actions {
    gap: 0.5rem;
    font-size: 0.88rem;
  }
  .header-actions button {
    padding: 0.4rem 0.65rem;
  }
  .layout {
    display: block;
  }
  .sidebar {
    padding: 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar nav {
    display: flex;
    overflow-x: auto;
    margin: 0.8rem 0 0;
    gap: 0.3rem;
  }
  .sidebar nav button {
    white-space: nowrap;
    font-size: 0.88rem;
  }
  .sidebar .identity {
    margin: 0.5rem 0 0;
  }
  .sidebar select {
    max-width: 100%;
  }
  main {
    padding: 1.5rem 1rem;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: auto;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .public {
    padding: 2.5rem 1rem;
  }
  .panel {
    padding: 1.1rem;
  }
  .public-grid {
    margin-top: 2rem;
  }
  h1 {
    font-size: 2.15rem;
  }
  .toolbar {
    align-items: flex-start;
  }
  .toolbar input {
    width: 100%;
    max-width: none;
  }
  .form-actions button {
    flex: 1;
  }
  .notice {
    padding: 0.7rem 1rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
/* Challenge studio */
.workflow-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
  border-bottom: 1px solid #d6e3df;
  padding-bottom: 1rem;
}
.workflow-tabs [aria-current="page"] {
  background: #173f36;
  color: #fff;
}
.phase-track {
  display: flex;
  list-style: none;
  padding: 0;
  gap: 0.4rem;
  overflow: auto;
  margin: 1.5rem 0;
}
.phase-track li {
  flex: 1;
  min-width: 85px;
  padding: 0.7rem;
  background: #edf3f0;
  border-radius: 0.6rem;
  font-size: 0.8rem;
  color: #415b52;
}
.phase-track li span {
  display: block;
  font-size: 0.75rem;
}
.phase-track .current {
  background: #173f36;
  color: #fff;
}
.phase-track .finished {
  background: #d9eadf;
}
.task-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(155px, 1fr));
  gap: 0.8rem;
  overflow: auto;
  padding-bottom: 1rem;
}
.task-column {
  background: #eff3f1;
  padding: 0.8rem;
  border-radius: 0.8rem;
  min-width: 0;
}
.task-column h2 {
  font-size: 1rem;
}
.task-card,
.challenge-card {
  display: block;
  text-align: left;
  background: #fff;
  color: #173f36;
  padding: 1rem;
  border: 1px solid #d6e3df;
  border-radius: 0.7rem;
  margin: 0.6rem 0;
  width: 100%;
  overflow-wrap: anywhere;
  text-decoration: none;
}
.task-card span,
.task-card small {
  display: block;
  margin-top: 0.5rem;
}
.task-card h3 {
  font-size: 1rem;
}
.challenge-card:hover {
  border-color: #387a63;
  box-shadow: 0 5px 20px #163c3210;
}
.workflow-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.workflow-form label:has([type="checkbox"]) {
  flex-direction: row;
  align-items: center;
}
.workflow-form [type="checkbox"] {
  width: auto;
}
.prose {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.public-page {
  max-width: 1120px;
  margin: auto;
  padding: 3rem 1.5rem;
}
.stats article span {
  display: block;
}
.workflow-form textarea {
  min-height: 110px;
}
.task-board button {
  white-space: normal;
}
.workflow-form {
  margin: 1.5rem 0;
}
@media (max-width: 700px) {
  .task-board {
    grid-template-columns: repeat(5, 200px);
  }
  .public-page {
    padding: 2rem 1rem;
  }
  .phase-track li {
    min-width: 100px;
  }
  .workflow-tabs button {
    font-size: 0.85rem;
  }
}
.task-board > section + section {
  margin-top: 0;
}
.task-board {
  align-items: stretch;
}
.task-card small {
  font-size: 0.75rem;
}
.task-column h2 {
  margin-bottom: 1rem;
}
.workflow-tabs button[aria-current="page"] {
  background: var(--accent);
  color: white;
}
.workflow-form [type="checkbox"] {
  min-height: 20px;
}
.header-actions {
  flex-wrap: wrap;
}
.city-map {
  height: 360px;
  min-height: 280px;
  max-width: 100%;
  border-radius: 10px;
  margin-top: 1rem;
  z-index: 0;
}
.place-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}
.city-draft-details {
  margin: 1.2rem 0;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.city-draft-details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.6rem 0;
}
.ai-copilot {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 900;
  background: white;
  border: 1px solid #cadbde;
  border-radius: 12px;
  box-shadow: 0 8px 30px #173f3620;
  max-width: calc(100vw - 2rem);
}
.ai-copilot > summary {
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-weight: 700;
  color: #005c7a;
  min-height: 44px;
}
.ai-body {
  width: 360px;
  max-width: calc(100vw - 2rem);
  padding: 1rem;
  max-height: 70vh;
  overflow: auto;
}
.ai-body p {
  font-size: 0.85rem;
}
.ai-body textarea {
  min-height: 100px;
}
.ai-body pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  font-size: 0.85rem;
}
.ai-body button {
  margin: 0.3rem 0;
}
.ai-copilot:not([open]) .ai-body {
  display: none;
}
body:has(.ai-copilot) {
  padding-bottom: 70px;
}
.leaflet-container {
  font-family: inherit;
}
.place-options button:focus-visible {
  outline: 3px solid var(--accent);
}
@media (max-width: 600px) {
  .city-map {
    height: 280px;
  }
  .ai-copilot {
    bottom: 0.6rem;
    right: 0.6rem;
  }
  .ai-body {
    width: 330px;
  }
}

.workspace-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem 2rem;
  padding: clamp(1rem, 3vw, 2rem);
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--wash);
}
.workspace-hero h1 {
  margin: 0;
  line-height: 1.2;
}
.workspace-hero > a {
  flex-shrink: 0;
}
.operations-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.operations-grid > .panel {
  min-width: 0;
}
.operations-grid h2,
.action-row h3,
.action-row p {
  margin: 0;
}
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.action-row:last-child {
  border-bottom: 0;
}
.workshop-pulse:has(button[aria-expanded="true"]) {
  flex-basis: 100%;
}
.workshop-pulse > div:not([hidden]) {
  padding-top: 0.65rem;
}
.workshop-pulse [role="status"]:empty {
  margin: 0;
}
.challenge-cta {
  flex: 0 1 16rem;
  padding: 0.85rem;
  border-radius: 8px;
  background: var(--white);
}
.challenge-cta p {
  margin: 0 0 0.6rem;
}
.proof-details dt {
  font-weight: 650;
}
.proof-details dd {
  margin: 0 0 0.65rem;
  overflow-wrap: anywhere;
}
.public-page pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.public-page summary {
  cursor: pointer;
}
@media (max-width: 740px) {
  .workspace-hero {
    flex-direction: column;
  }
  .challenge-cta {
    flex-basis: auto;
    width: 100%;
  }
  .operations-grid {
    grid-template-columns: 1fr;
  }
}
