:root {
  --bg: #f5f6f2;
  --ink: #1e2528;
  --muted: #687276;
  --panel: #ffffff;
  --line: #dde3df;
  --green: #1d7356;
  --blue: #2f5e9e;
  --amber: #b36b18;
  --red: #a94438;
  --soft-green: #e6f3ec;
  --soft-blue: #e9eff8;
  --soft-amber: #fff0d7;
  --soft-red: #f9e9e6;
  --nav: #172424;
  --shadow: 0 14px 34px rgba(29, 38, 35, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body.modal-open {
  overflow: hidden;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a,
li,
p,
span,
strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

button,
input,
textarea {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: var(--nav);
  color: #f6faf8;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--nav);
  background: #f0c36a;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.side-search {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.side-search::placeholder {
  color: rgba(255, 255, 255, 0.58);
}

.search-wrap {
  display: grid;
  gap: 8px;
}

.search-wrap span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 700;
}

.side-group {
  margin-top: 22px;
}

.side-title {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  text-transform: uppercase;
}

.nav-link {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.nav-button {
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.empty-nav {
  padding: 10px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.nav-link em {
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 246, 242, 0.92);
  backdrop-filter: blur(12px);
}

.tabs {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

.tab,
.top-action {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.tab.active {
  border-color: #9db8aa;
  color: var(--green);
  background: var(--soft-green);
  font-weight: 700;
}

.top-action {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  padding: 24px 28px 42px;
}

.content {
  min-width: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 18px;
  margin-bottom: 20px;
}

.hero-copy,
.visual,
.panel,
.step-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy {
  min-width: 0;
  padding: 24px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  color: #4f5b57;
  background: #eef1ed;
  font-size: 12px;
  font-weight: 700;
}

.badge.green {
  color: var(--green);
  background: var(--soft-green);
}

.badge.blue {
  color: var(--blue);
  background: var(--soft-blue);
}

.badge.amber {
  color: var(--amber);
  background: var(--soft-amber);
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: 0;
}

.lead {
  margin: 14px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

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

.metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

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

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

.visual {
  min-height: 310px;
  padding: 16px;
  background: #223330;
  overflow: hidden;
}

.path-map {
  min-height: 276px;
  height: 100%;
  display: grid;
  grid-template-rows: auto 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.map-node {
  width: max-content;
  max-width: 100%;
  justify-self: center;
  padding: 10px 18px;
  border-radius: 8px;
  color: #172424;
  background: #f0c36a;
  font-weight: 800;
}

.map-line {
  width: 2px;
  height: 28px;
  justify-self: center;
  background: rgba(255, 255, 255, 0.34);
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.map-step {
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #f6faf8;
  background: rgba(255, 255, 255, 0.08);
}

.map-step:hover {
  background: rgba(255, 255, 255, 0.13);
  text-decoration: none;
}

.map-step span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #172424;
  background: #e6f3ec;
  font-weight: 800;
}

.map-step strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #edc7bd;
  border-radius: 8px;
  color: #6d342b;
  background: var(--soft-red);
  line-height: 1.6;
  font-size: 14px;
}

.notice strong {
  color: var(--red);
}

.path-overview {
  display: grid;
  grid-template-columns: 1fr 180px 1.35fr;
  gap: 12px;
  margin-bottom: 18px;
}

.overview-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.overview-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.overview-item strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

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

.directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.directory-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.directory-card:hover {
  border-color: #bdd0c5;
}

.directory-meta,
.directory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.directory-meta span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 7px;
  color: #4f5b57;
  background: #eef1ed;
  font-size: 12px;
  font-weight: 700;
}

.directory-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.directory-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.directory-open {
  width: max-content;
  max-width: 100%;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--green);
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.step-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.step-number {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--green);
  background: var(--soft-green);
  font-weight: 800;
  font-size: 18px;
}

.step-main {
  min-width: 0;
}

.step-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.step-card h3 {
  margin: 0;
  font-size: 18px;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.comment-trigger {
  min-width: 88px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #bdd0c5;
  border-radius: 8px;
  color: var(--green);
  background: var(--soft-green);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.info-block {
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.info-block h4 {
  margin: 0 0 8px;
  color: #35413f;
  font-size: 13px;
}

.info-block ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.info-block li {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.info-block a,
.rail-line a,
.plain-list a,
.checklist a {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.keyword {
  min-width: 0;
  max-width: 100%;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #d8dfd8;
  border-radius: 7px;
  color: #4d5855;
  background: #fff;
  font-size: 12px;
  white-space: normal;
}

.rail {
  display: grid;
  align-content: start;
  gap: 14px;
}

.panel {
  padding: 18px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.dot {
  width: 12px;
  height: 12px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px var(--soft-green);
}

.dot.blue {
  background: var(--blue);
  box-shadow: 0 0 0 5px var(--soft-blue);
}

.dot.amber {
  background: var(--amber);
  box-shadow: 0 0 0 5px var(--soft-amber);
}

.plain-list,
.checklist {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain-list-wrap {
  display: grid;
  gap: 10px;
}

.rail-line {
  margin: 0;
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.rail-line:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.plain-list li {
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.plain-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.plain-list strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.checklist li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.checklist span {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  border: 2px solid #9cb7a8;
  border-radius: 4px;
  background: var(--soft-green);
}

.floating-goal {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  min-width: 104px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 14px 34px rgba(29, 115, 86, 0.28);
  cursor: pointer;
}

.floating-goal span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green);
  background: #fff;
  font-size: 18px;
  line-height: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(12, 20, 18, 0.56);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(760px, 100%);
  max-height: min(780px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.goal-modal {
  grid-template-rows: auto auto;
  width: min(620px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-kicker {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.modal h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.comment-form,
.goal-form {
  display: grid;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.goal-form {
  border-bottom: 0;
}

.comment-form input,
.comment-form textarea,
.goal-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.comment-form input {
  height: 38px;
  padding: 0 12px;
}

.comment-form textarea,
.goal-form textarea {
  resize: vertical;
  min-height: 100px;
  padding: 10px 12px;
  line-height: 1.55;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-actions span {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.form-actions button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 700;
  cursor: pointer;
}

.comment-list {
  min-height: 180px;
  overflow-y: auto;
  padding: 16px 20px 20px;
}

.empty-comments {
  min-height: 148px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed #cdd7d0;
  border-radius: 8px;
  background: #fbfcfb;
  font-size: 14px;
}

.comment-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.comment-item:first-child {
  padding-top: 0;
}

.comment-item:last-child {
  border-bottom: 0;
}

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.comment-name {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.comment-text {
  margin: 0 0 10px;
  color: #394441;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.comment-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #4d5855;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.comment-actions button.is-used {
  border-color: #bdd0c5;
  color: var(--green);
  background: var(--soft-green);
}

.comment-actions button.report.is-used {
  border-color: #edc7bd;
  color: var(--red);
  background: var(--soft-red);
}

@media (max-width: 1180px) {
  .workspace,
  .hero {
    grid-template-columns: 1fr;
  }

  .path-overview {
    grid-template-columns: 1fr;
  }

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

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

  .sidebar {
    position: static;
    height: auto;
  }

  .topbar {
    position: static;
    height: auto;
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .workspace {
    padding: 16px;
  }

  .metrics,
  .step-grid,
  .directory-grid,
  .rail,
  .map-grid {
    grid-template-columns: 1fr;
  }

  .step-card {
    grid-template-columns: 1fr;
  }

  .step-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .comment-trigger {
    width: 100%;
  }

  h1 {
    font-size: 26px;
  }

  .floating-goal {
    right: 16px;
    bottom: 16px;
  }
}
