:root {
  --bg: #f5f2ec;
  --surface: #fffdf8;
  --surface-strong: #f0eadf;
  --ink: #1f2528;
  --muted: #66706c;
  --line: #ddd4c6;
  --green: #2f6b55;
  --green-dark: #214d3e;
  --rust: #a24d2f;
  --blue: #415f7d;
  --gold: #b28a35;
  --shadow: 0 18px 50px rgba(37, 45, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(31, 37, 40, 0.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(31, 37, 40, 0.03) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px;
  color: var(--ink);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    system-ui,
    sans-serif;
}

button,
input {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #202725;
  color: #f7f0e3;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 16px;
  border-bottom: 1px solid rgba(247, 240, 227, 0.16);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #d5b46a;
  color: #202725;
  font-weight: 800;
  border-radius: 7px;
}

.brand h1,
.brand p,
.topbar h2,
.hero-copy h3,
.panel h3,
.platform-panel h3 {
  margin: 0;
}

.brand h1 {
  margin-top: 3px;
  font-size: 18px;
  line-height: 1.25;
}

.brand-kicker,
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

.sidebar .brand-kicker,
.sidebar .eyebrow {
  color: rgba(247, 240, 227, 0.68);
}

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

.nav-item {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  color: rgba(247, 240, 227, 0.78);
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(247, 240, 227, 0.11);
  color: #fff9ed;
}

.nav-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(247, 240, 227, 0.2);
  border-radius: 6px;
  font-size: 13px;
}

.side-note {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(247, 240, 227, 0.16);
  border-radius: 8px;
  background: rgba(247, 240, 227, 0.07);
}

.side-note p {
  margin: 0 0 8px;
  color: rgba(247, 240, 227, 0.64);
  font-size: 12px;
}

.side-note strong {
  display: block;
  font-size: 15px;
  line-height: 1.65;
  font-weight: 600;
}

.workspace {
  padding: 28px;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar h2 {
  margin-top: 5px;
  font-size: clamp(24px, 3vw, 34px);
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-button,
.primary-link,
.text-button,
.segment,
.sample-tab,
.status-select {
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  text-decoration: none;
  cursor: pointer;
}

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

.text-button {
  color: var(--green-dark);
  background: transparent;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-panel,
.panel,
.platform-panel,
.sample-reader {
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 18px;
  padding: 24px;
  margin-bottom: 20px;
  overflow: hidden;
}

.hero-copy h3 {
  max-width: 780px;
  margin-top: 8px;
  font-size: clamp(25px, 4vw, 42px);
  line-height: 1.16;
}

.hero-copy p:not(.eyebrow) {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.9;
}

.hero-stats {
  display: grid;
  gap: 12px;
  align-content: center;
}

.hero-stats div {
  padding: 16px;
  border-radius: 7px;
  background: var(--surface-strong);
  border-left: 4px solid var(--gold);
}

.hero-stats strong {
  display: block;
  font-size: 30px;
}

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

.section-grid {
  display: grid;
  gap: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.overview-panel,
.workflow-panel {
  min-height: 0;
}

.funnel-grid {
  display: grid;
  gap: 10px;
}

.funnel-card {
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  position: relative;
}

.funnel-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 5px;
  border-radius: 0 999px 999px 0;
  background: var(--green);
}

.funnel-card.level-two::before {
  background: var(--blue);
}

.funnel-card.level-three::before {
  background: var(--gold);
}

.funnel-card.level-four::before {
  background: var(--rust);
}

.funnel-card strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: block;
  min-width: 56px;
  text-align: right;
  font-size: 34px;
  line-height: 1;
}

.funnel-label {
  display: block;
  font-weight: 700;
}

.funnel-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.platform-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.platform-mini article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.platform-mini span {
  color: var(--muted);
}

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

.panel,
.platform-panel {
  padding: 20px;
}

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

.panel-head h3,
.platform-panel h3 {
  margin-top: 4px;
  font-size: 20px;
}

.priority-list,
.rule-list,
.concept-grid,
.platform-grid,
.checklist-grid {
  display: grid;
  gap: 12px;
}

.priority-item,
.rule-item,
.concept-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 14px;
}

.priority-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.rank {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.priority-item h4,
.concept-card h3,
.rule-item h4 {
  margin: 0;
}

.priority-item p,
.concept-card p,
.rule-item p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e5eee8;
  color: var(--green-dark);
  font-size: 12px;
  white-space: nowrap;
}

.workflow {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.workflow li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 14px;
}

.workflow li:last-child {
  border-bottom: 1px solid var(--line);
}

.workflow li::before {
  content: counter(step);
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #e3ecf0;
  color: var(--blue);
  font-weight: 700;
}

.workflow span {
  grid-column: 2;
  display: block;
  font-weight: 700;
}

.workflow small {
  grid-column: 2;
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.55;
}

.tool-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 240px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 12px;
}

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

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  min-height: 32px;
}

.segmented,
.sample-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.segment.active,
.sample-tab.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

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

.concept-card {
  display: grid;
  gap: 12px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.concept-card:hover,
.concept-card.selected {
  border-color: rgba(47, 107, 85, 0.58);
  box-shadow: 0 10px 28px rgba(37, 45, 42, 0.08);
}

.concept-card.selected {
  background: #f7f3e8;
}

.concept-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.scene-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scene-pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1e5d7;
  color: #6c4a31;
  font-size: 12px;
}

.tag-stack {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e9edf0;
  color: #42515d;
  font-size: 12px;
  white-space: nowrap;
}

.status-badge.gold {
  background: #f1e1b5;
  color: #73521c;
}

.publish-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  background: #e8f0eb;
  color: var(--green-dark);
  font-size: 12px;
  white-space: nowrap;
}

.platform-badge.video {
  background: #f4e8e2;
  color: #7b3823;
}

.platform-badge.redbook {
  background: #eceff4;
  color: #384f6a;
}

.platform-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 700;
}

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

.concept-detail {
  max-height: none;
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.detail-page {
  max-width: 1080px;
}

.detail-toolbar {
  margin-bottom: 14px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.detail-head h3 {
  margin: 4px 0 0;
  font-size: 24px;
}

.detail-summary {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.75;
}

.detail-block {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.detail-block h4 {
  margin: 0 0 8px;
}

.detail-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.variant-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 14px;
}

.variant-tab {
  min-height: 34px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 6px 10px;
  cursor: pointer;
}

.variant-tab.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.wide-panel {
  margin-top: 18px;
}

.prompt-panel {
  max-width: 980px;
}

.prompt-text {
  max-height: calc(100vh - 190px);
  overflow: auto;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    system-ui,
    sans-serif;
  font-size: 15px;
  line-height: 1.85;
}

.format-strip,
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.format-strip div {
  min-height: 96px;
  padding: 16px;
  border-radius: 8px;
  background: var(--surface-strong);
}

.format-strip strong,
.format-strip span {
  display: block;
}

.format-strip span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.sample-tabs {
  margin-bottom: 14px;
}

.sample-reader {
  padding: 24px;
  max-width: 980px;
}

.compact-reader {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  max-width: none;
}

.sample-reader h3 {
  margin: 0 0 14px;
  font-size: 26px;
}

.sample-section {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.sample-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.sample-section h4 {
  margin: 0 0 10px;
  color: var(--green-dark);
}

.sample-section p,
.sample-section li {
  line-height: 1.95;
}

.sample-section p {
  margin: 0 0 12px;
}

.sample-raw {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    sans-serif;
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink);
}

.sample-section ol {
  margin: 0;
  padding-left: 22px;
}

.platform-panel {
  border-top: 5px solid var(--green);
}

.platform-panel:nth-child(2) {
  border-top-color: var(--rust);
}

.platform-panel:nth-child(3) {
  border-top-color: var(--blue);
}

.platform-panel ul {
  margin: 14px 0 0;
  padding-left: 20px;
}

.platform-panel li,
.checklist-grid label {
  line-height: 1.75;
}

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

.checklist-grid label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.checklist-grid input {
  margin-top: 5px;
  accent-color: var(--green);
}

.empty-variant {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.empty-variant h4 {
  margin: 0 0 10px;
  color: var(--green-dark);
}

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

.variant-head h4 {
  margin: 0;
}

.publish-button {
  min-height: 34px;
  border: 1px solid var(--green);
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  padding: 6px 10px;
  cursor: pointer;
}

.publish-button.published {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--muted);
  cursor: default;
}

.empty-variant p,
.empty-variant li {
  color: var(--muted);
  line-height: 1.75;
}

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

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

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

  .nav-item {
    justify-content: center;
  }

  .nav-item .nav-icon {
    display: none;
  }

  .hero-panel,
  .dashboard-grid,
  .two-columns,
  .concept-grid,
  .format-strip,
  .platform-grid,
  .checklist-grid {
    grid-template-columns: 1fr;
  }

  .platform-mini,
  .workflow {
    grid-template-columns: 1fr;
  }

  .overview-panel,
  .workflow-panel {
    min-height: auto;
  }


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

@media (max-width: 620px) {
  .workspace {
    padding: 18px;
  }

  .sidebar {
    padding: 18px;
  }

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

  .top-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .priority-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .priority-item .tag {
    grid-column: 2;
    justify-self: start;
  }
}
