:root {
  color-scheme: light;
  --ink: #22201c;
  --muted: #6b665f;
  --quiet: #918a80;
  --line: #d7d0c5;
  --paper: #f4f0e8;
  --panel: #fffaf1;
  --panel-strong: #fff6e6;
  --coal: #1d1b18;
  --green: #0d6b57;
  --green-soft: #d9eee6;
  --red: #b64032;
  --yellow: #e8b84a;
  --blue: #2f628f;
  --shadow: 0 18px 54px rgba(51, 42, 27, 0.12);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(34, 32, 28, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(34, 32, 28, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 22px 22px;
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

.svg-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.svg-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

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

.side-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  background: var(--coal);
  color: #fff7e8;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark,
.panel-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: var(--coal);
  border: 1px solid rgba(29, 27, 24, 0.25);
}

.brand-block h1,
.top-bar h2,
.panel-header h2,
.reference-head h3,
.entry-card h3 {
  margin: 0;
}

.brand-block h1 {
  font-size: 23px;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-rail .eyebrow {
  color: #efc45b;
}

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

.flow-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 12px;
  border: 1px solid rgba(255, 247, 232, 0.16);
  background: rgba(255, 247, 232, 0.06);
}

.nav-item {
  width: 100%;
  color: #fff7e8;
  text-align: left;
}

.nav-item.active {
  background: #fff7e8;
  color: var(--coal);
  border-color: #fff7e8;
}

.nav-item.active span {
  color: var(--muted);
}

.flow-item div {
  display: grid;
  gap: 3px;
}

.flow-item strong {
  font-size: 15px;
}

.flow-item span,
.mobile-entry p {
  color: rgba(255, 247, 232, 0.68);
  font-size: 12px;
}

.mobile-entry {
  margin-top: auto;
  padding: 15px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff7e8;
  color: var(--coal);
  border-left: 5px solid var(--yellow);
}

.mobile-entry p {
  margin: 0;
  color: var(--coal);
  line-height: 1.6;
}

.mobile-entry span {
  display: inline-block;
  font-weight: 800;
  color: var(--red);
}

.workspace {
  padding: 28px;
  min-width: 0;
}

.top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.top-bar h2 {
  font-size: clamp(24px, 4vw, 42px);
  max-width: 820px;
  line-height: 1.12;
}

.top-note {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(78px, 1fr));
  gap: 8px;
  min-width: 420px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 13px 12px;
  display: grid;
  gap: 2px;
}

.metric strong {
  font-size: 26px;
  line-height: 1;
}

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

.main-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(330px, 0.8fr);
  grid-template-areas:
    "capture topic"
    "library reference";
  gap: 18px;
  align-items: start;
}

.capture-panel {
  grid-area: capture;
}

.topic-panel {
  grid-area: topic;
}

.reference-panel {
  grid-area: reference;
}

.library-panel {
  grid-area: library;
}

.database-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(380px, 1.05fr);
  grid-template-areas:
    "status feishu"
    "sediment topics"
    "library library"
    "blueprint blueprint";
  gap: 18px;
  align-items: start;
}

.single-flow {
  grid-template-columns: 1fr;
  grid-template-areas: none;
}

.single-flow > .panel {
  grid-area: auto;
}

.knowledge-layout {
  display: grid;
  grid-template-columns: 300px minmax(330px, 0.9fr) minmax(420px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.kb-tree-panel,
.kb-list-panel,
.document-panel {
  min-height: calc(100vh - 184px);
}

.kb-tree-panel {
  position: sticky;
  top: 20px;
}

.document-panel {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.status-panel {
  grid-area: status;
}

.system-readiness-panel {
  display: grid;
  gap: 14px;
}

.feishu-panel {
  grid-area: feishu;
}

.wiki-compiler-panel {
  display: grid;
  gap: 14px;
}

.sediment-panel {
  grid-area: sediment;
}

.topic-mirror-panel {
  grid-area: topics;
}

.task-mirror-panel {
  display: grid;
  gap: 14px;
}

.database-library-panel {
  grid-area: library;
}

.blueprint-panel {
  grid-area: blueprint;
}

.panel {
  background: rgba(255, 250, 241, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
}

.kb-root {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px;
  background: var(--coal);
  color: #fff7e8;
  margin-bottom: 10px;
  font-size: 14px;
}

.kb-root div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.kb-tree {
  display: grid;
  gap: 7px;
}

.kb-section-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
}

.kb-section {
  width: 100%;
  border: 1px solid var(--line);
  background: #fffcf6;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px;
  text-align: left;
}

.kb-section div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.kb-section span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-section strong {
  color: var(--green);
  font-size: 13px;
}

.kb-section.active {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: inset 4px 0 0 var(--green);
}

.kb-section-row.active .kb-section {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: inset 4px 0 0 var(--green);
}

.child-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.child-tab-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
}

.child-tab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fffcf6;
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
  min-height: 42px;
}

.child-tab-wrap.active .child-tab {
  background: var(--coal);
  color: #fff7e8;
  border-color: var(--coal);
}

.child-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.child-tab strong {
  color: var(--green);
  font-size: 13px;
}

.child-tab.active {
  background: var(--coal);
  color: #fff7e8;
  border-color: var(--coal);
}

.child-tab.active strong {
  color: var(--yellow);
}

.child-tab-wrap.active strong {
  color: var(--yellow);
}

.rename-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fffcf6;
  color: var(--muted);
}

.rename-button:hover {
  color: var(--green);
  border-color: var(--green);
}

.rename-button.light {
  background: rgba(255, 247, 232, 0.12);
  color: #fff7e8;
  border-color: rgba(255, 247, 232, 0.28);
}

.document-list {
  display: grid;
  gap: 9px;
}

.document-row {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  text-align: left;
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 11px;
  color: var(--ink);
}

.document-row.active {
  border-color: var(--green);
  box-shadow: inset 4px 0 0 var(--green);
}

.doc-row-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--panel-strong);
  color: var(--green);
}

.document-row strong {
  display: block;
  line-height: 1.35;
}

.document-row p {
  margin: 5px 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.document-row small {
  color: var(--green);
  font-weight: 900;
  white-space: nowrap;
}

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

.reader-head h3 {
  margin: 0;
  font-size: 25px;
  line-height: 1.25;
}

.reader-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.secondary-link,
.doc-badge,
.danger-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fffcf6;
  color: var(--green);
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.secondary-link,
.danger-link {
  cursor: pointer;
}

.doc-badge {
  color: var(--muted);
}

.danger-link {
  color: var(--red);
  border-color: rgba(182, 64, 50, 0.35);
}

.small-control {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.reader-meta,
.reader-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.reader-meta span,
.reader-reasons span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.reader-reasons span {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(13, 107, 87, 0.18);
}

.video-analysis-box {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(47, 98, 143, 0.24);
  background: #eef5f7;
  padding: 12px;
  margin-bottom: 12px;
}

.video-analysis-box > .svg-icon {
  width: 34px !important;
  height: 34px !important;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  padding: 8px;
}

.video-analysis-box strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.video-analysis-box p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.video-analysis-box.waiting {
  background: var(--panel-strong);
  border-color: var(--line);
}

.video-analysis-box.waiting > .svg-icon {
  background: var(--yellow);
  color: var(--coal);
}

.video-analysis-box.fallback {
  border-color: rgba(196, 74, 57, 0.28);
  background: #fff4ef;
}

.video-analysis-box.fallback > .svg-icon {
  background: var(--red);
}

.video-analysis-box.ready {
  border-color: rgba(13, 107, 87, 0.24);
  background: #eef8f3;
}

.video-analysis-box.ready > .svg-icon {
  background: var(--green);
}

.video-analysis-box .video-analysis-meta {
  margin-top: 4px;
  color: var(--ink);
}

.video-analysis-missing {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.video-analysis-missing span {
  border: 1px solid rgba(196, 74, 57, 0.24);
  background: rgba(196, 74, 57, 0.08);
  color: var(--red);
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 800;
}

.video-source-panel {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  padding: 12px;
  margin-bottom: 12px;
  display: grid;
  gap: 10px;
}

.video-source-panel strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.video-source-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.video-source-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
}

.video-source-form input {
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}

.video-upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.video-upload-form input[type="file"] {
  min-width: 0;
  border: 1px dashed var(--line);
  background: #fff;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 13px;
}

.reader-body {
  display: grid;
  gap: 12px;
}

.reader-section {
  background: #fffcf6;
  border: 1px solid var(--line);
  padding: 14px;
}

.reader-section h4 {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 15px;
}

.reader-section p,
.reader-section blockquote {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}

.reader-section blockquote {
  border-left: 4px solid var(--yellow);
  background: var(--panel-strong);
  padding: 10px 12px;
}

.reader-bullet::before {
  content: "• ";
  color: var(--green);
  font-weight: 900;
}

.document-placeholder {
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  padding: 28px;
}

.document-placeholder h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.document-placeholder p {
  margin: 0;
  max-width: 420px;
  line-height: 1.7;
}

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

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

.status-card {
  background: #fffcf6;
  border: 1px solid var(--line);
  padding: 13px;
  display: grid;
  gap: 7px;
  min-height: 140px;
}

.status-card div {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
}

.status-card strong {
  font-size: 23px;
  line-height: 1;
}

.status-card span {
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
}

.status-card p,
.boundary-note span,
.workspace-node p,
.workspace-node span,
.schema-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.readiness-hero {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(13, 107, 87, 0.2);
  background: var(--green-soft);
  padding: 14px;
}

.system-readiness-panel.blocked .readiness-hero {
  border-color: rgba(182, 64, 50, 0.28);
  background: #fff2ed;
}

.system-readiness-panel.warning .readiness-hero {
  border-color: rgba(232, 184, 74, 0.55);
  background: var(--panel-strong);
}

.readiness-hero > div {
  display: grid;
  gap: 4px;
}

.readiness-hero strong {
  font-size: 38px;
  line-height: 1;
}

.readiness-hero span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.readiness-hero p {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.55;
}

.readiness-hero small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.readiness-card {
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 12px;
  display: grid;
  gap: 8px;
  min-height: 150px;
}

.readiness-card.ready {
  border-left: 4px solid var(--green);
}

.readiness-card.warning {
  border-left: 4px solid var(--yellow);
}

.readiness-card.blocked {
  border-left: 4px solid var(--red);
}

.readiness-card > div {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.readiness-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.readiness-card span {
  width: fit-content;
  background: var(--green-soft);
  color: var(--green);
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 900;
}

.readiness-card.warning span {
  background: #fff1cf;
  color: #8a6412;
}

.readiness-card.blocked span {
  background: #fff2ed;
  color: var(--red);
}

.readiness-card p,
.readiness-card small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.readiness-card small {
  color: var(--ink);
  font-weight: 700;
}

.readiness-next {
  display: grid;
  grid-template-columns: minmax(170px, 0.32fr) minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 13px;
}

.readiness-next h3,
.readiness-next p {
  margin: 0;
}

.readiness-next h3 {
  font-size: 15px;
}

.readiness-next p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin-top: 5px;
}

.next-action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.next-action-list span {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
}

.boundary-note {
  margin-top: 12px;
  padding: 13px;
  display: grid;
  gap: 5px;
  background: var(--panel-strong);
  border-left: 5px solid var(--yellow);
}

.boundary-note strong {
  font-size: 14px;
}

.workspace-map {
  display: grid;
  gap: 10px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.feishu-live-panel {
  display: grid;
  gap: 14px;
}

.bitable-actions-panel {
  display: grid;
  gap: 14px;
}

.mobile-shortcut-panel {
  display: grid;
  gap: 14px;
}

.bitable-action-grid,
.bitable-columns,
.shortcut-endpoints,
.shortcut-template-grid,
.recommended-view-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bitable-action-card,
.shortcut-card,
.bitable-columns > div,
.recommended-view-card,
.code-block-wrap {
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 13px;
}

.bitable-action-card h3,
.shortcut-card h3,
.bitable-columns h3,
.recommended-view-card h3,
.code-block-wrap h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.bitable-action-card code,
.shortcut-card code,
.code-block {
  display: block;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.bitable-action-card p,
.shortcut-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.recommended-view-card p {
  display: grid;
  grid-template-columns: minmax(84px, 0.42fr) minmax(0, 1fr);
  gap: 8px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.recommended-view-card strong {
  color: var(--green);
}

.recommended-view-card span {
  overflow-wrap: anywhere;
}

.task-mode-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 13px;
}

.task-mode-panel.ready {
  border-left: 4px solid var(--green);
}

.task-mode-panel.missing {
  border-left: 4px solid var(--yellow);
}

.task-mode-panel h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  font-size: 15px;
}

.task-mode-panel p,
.task-mode-panel code {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.task-mode-panel code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.task-mode-meta {
  display: grid;
  gap: 7px;
}

.task-mode-meta span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.task-mode-panel.missing .task-mode-meta span {
  color: #8a6412;
}

.notification-config-form {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.notification-config-form label {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.notification-config-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.35fr) auto;
  gap: 8px;
}

.notification-config-form input,
.notification-config-form select {
  min-width: 0;
  height: 36px;
}

.notification-config-form .notification-app-message-row {
  grid-template-columns: minmax(0, 1fr) 120px auto auto;
}

.notification-config-form p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.notification-chat-results {
  display: grid;
  gap: 6px;
}

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

.chat-result-row {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fffcf6;
  min-height: 34px;
  padding: 6px 8px;
  text-align: left;
}

.chat-result-row strong,
.chat-result-row code {
  min-width: 0;
  overflow-wrap: anywhere;
}

.public-url-config {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 13px;
}

.public-url-config h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  font-size: 15px;
}

.public-url-config p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.public-url-form {
  display: grid;
  gap: 8px;
}

.public-url-form label {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.public-url-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.public-url-form input {
  min-width: 0;
  height: 36px;
}

.public-url-form code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.public-url-steps {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
}

.public-url-steps span {
  border-left: 3px solid var(--yellow);
  padding-left: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.action-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(174, 51, 39, 0.25);
  background: #fff2ed;
  color: var(--red);
  padding: 11px 13px;
  font-size: 13px;
  font-weight: 800;
}

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

.sync-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 13px;
  display: grid;
  gap: 7px;
  min-height: 112px;
}

.sync-card div {
  display: grid;
  gap: 4px;
}

.sync-card strong {
  font-size: 24px;
  line-height: 1;
}

.sync-card span {
  color: var(--ink);
  font-weight: 900;
  font-size: 13px;
}

.sync-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.sync-card i {
  display: block;
  height: 5px;
  background: var(--line);
  margin-top: auto;
}

.sync-card i::after {
  content: "";
  display: block;
  width: var(--progress);
  height: 100%;
  background: var(--green);
}

.feishu-readiness {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(13, 107, 87, 0.18);
  background: var(--green-soft);
  padding: 14px;
}

.feishu-readiness strong {
  display: block;
  margin-bottom: 4px;
}

.feishu-readiness p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.feishu-readiness > span {
  min-width: 72px;
  text-align: right;
  color: var(--green);
  font-size: 30px;
  font-weight: 900;
}

.sync-error {
  color: var(--red) !important;
  font-weight: 800;
}

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

.feishu-table-card {
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 13px;
  display: grid;
  gap: 10px;
}

.feishu-table-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.feishu-table-card span {
  font-size: 12px;
  font-weight: 900;
}

.feishu-table-card .ready,
.env-row .ready {
  color: var(--green);
}

.feishu-table-card .missing,
.env-row .missing {
  color: var(--red);
}

.feishu-table-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.field-check-panel {
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 13px;
  display: grid;
  gap: 12px;
}

.field-check-panel h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.field-check-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

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

.field-check-card {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 11px;
  display: grid;
  gap: 8px;
}

.field-check-card > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.field-check-card strong {
  font-size: 13px;
}

.field-check-card span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.field-check-card.missing span {
  color: var(--red);
}

.env-check.compact {
  margin-top: 0;
}

.setup-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.setup-steps p {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  padding: 11px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.setup-steps strong {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 7px;
  background: var(--coal);
  color: #fff7e8;
  font-size: 12px;
}

.workspace-node {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 13px;
}

.workspace-node .node-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
}

.workspace-node h3,
.count-list h3,
.reusable-strip h3,
.schema-card h3,
.env-check h3 {
  margin: 0 0 7px;
  font-size: 15px;
}

.workspace-node span {
  display: block;
  margin-top: 5px;
  color: var(--green);
  font-weight: 800;
}

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

.count-list {
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 12px;
  min-height: 160px;
}

.count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(215, 208, 197, 0.7);
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.count-row strong {
  color: var(--ink);
}

.reusable-strip {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  padding: 12px;
}

.reusable-strip div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.reusable-strip span,
.schema-fields span {
  background: var(--green-soft);
  color: var(--green);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.topic-list.readonly {
  max-height: 350px;
}

.topic-flow-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  padding: 10px 12px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.topic-flow-note strong {
  color: var(--ink);
}

.topic-item.mirror {
  cursor: default;
}

.topic-item.manageable {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  align-items: start;
}

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

.topic-action-item p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.topic-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  max-width: 260px;
}

.task-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.task-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 12px;
}

.task-item strong {
  display: block;
  line-height: 1.35;
}

.task-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

.task-item p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.task-item small {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.task-summary-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.task-quality-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.task-quality-card {
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 12px;
  min-height: 160px;
}

.task-quality-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.task-quality-row {
  border-top: 1px solid rgba(215, 208, 197, 0.7);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 0;
  align-items: start;
}

.task-quality-row strong,
.task-quality-row span {
  display: block;
}

.task-quality-row strong {
  font-size: 13px;
  line-height: 1.35;
}

.task-quality-row span,
.task-quality-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.task-quality-row small {
  text-align: right;
  max-width: 210px;
}

.task-quality-row.blocked small {
  color: var(--red);
  font-weight: 800;
}

.project-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.project-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 34px;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 12px;
}

.project-main strong,
.project-stage strong {
  display: block;
  line-height: 1.35;
}

.project-main span,
.project-stage span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

.project-main p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.project-stage strong {
  color: var(--green);
}

.project-chips {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-chips span {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--muted);
  padding: 5px 7px;
  font-size: 12px;
  font-weight: 800;
}

.platform-snapshot-strip {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0 2px;
}

.platform-snapshot-strip span {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
}

.platform-snapshot-strip span.done {
  border-color: rgba(13, 107, 87, 0.45);
  background: var(--green-soft);
  color: var(--green);
}

.platform-snapshot-strip span.pending {
  border-style: dashed;
}

.project-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 2px;
}

.project-actions .small-control {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 12px;
}

.compact-note {
  margin: 10px 0 0;
}

.danger-icon-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(182, 64, 50, 0.35);
  background: #fff6f2;
  color: var(--red);
}

.pack-summary {
  margin-top: 12px;
}

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

.schema-card {
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 13px;
}

.schema-fields {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.env-check {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  padding: 13px;
}

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

.compiler-paths div,
.recent-log {
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 12px;
}

.compiler-paths strong {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 13px;
}

.compiler-paths code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.recent-log h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.recent-log p {
  margin: 0;
  border-top: 1px solid rgba(215, 208, 197, 0.7);
  padding: 7px 0;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.env-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(215, 208, 197, 0.7);
  padding: 9px 0;
}

.env-row code {
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--ink);
}

.env-row span {
  font-size: 12px;
  font-weight: 900;
}

.env-row .ready {
  color: var(--green);
}

.env-row .missing {
  color: var(--red);
}

.panel-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.panel-header h2 {
  font-size: 20px;
}

.panel-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.form-stack.compact {
  gap: 12px;
}

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

label {
  display: grid;
  gap: 7px;
}

label span,
legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fffcf6;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  border-radius: 0;
}

textarea {
  resize: vertical;
  min-height: 82px;
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(13, 107, 87, 0.15);
}

fieldset {
  border: 1px dashed var(--line);
  padding: 11px;
  margin: 0;
}

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

.chip,
.segmented,
.filter-tab {
  border: 1px solid var(--line);
  background: #fffcf6;
  color: var(--ink);
  padding: 7px 10px;
  min-height: 34px;
  border-radius: 0;
}

.chip.active,
.segmented.active,
.filter-tab.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.toggle-row,
.action-row,
.button-pair,
.library-toolbar,
.reference-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-row,
.action-row {
  flex-wrap: wrap;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  background: #fffcf6;
  color: var(--ink);
}

.toggle span {
  width: 22px;
  height: 14px;
  border: 1px solid var(--quiet);
  background: var(--line);
  position: relative;
}

.toggle span::after {
  content: "";
  width: 8px;
  height: 8px;
  background: #fff;
  position: absolute;
  left: 2px;
  top: 2px;
  transition: transform 160ms ease;
}

.toggle.active {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}

.toggle.active span {
  background: var(--green);
  border-color: var(--green);
}

.toggle.active span::after {
  transform: translateX(8px);
}

.primary-button,
.secondary-button {
  border: 1px solid var(--coal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 10px 14px;
  font-weight: 800;
}

.primary-button {
  background: var(--coal);
  color: #fff7e8;
}

.secondary-button {
  background: var(--yellow);
  color: var(--coal);
}

.primary-button.small {
  min-height: 36px;
  padding: 8px 11px;
  white-space: nowrap;
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.spin {
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.topic-list {
  margin-top: 16px;
  display: grid;
  gap: 9px;
  max-height: 480px;
  overflow: auto;
  padding-right: 3px;
}

.topic-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 12px;
}

.topic-item.active {
  border-color: var(--green);
  box-shadow: inset 4px 0 0 var(--green);
}

.topic-item strong {
  display: block;
  line-height: 1.35;
}

.topic-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

.topic-item small {
  color: var(--green);
  font-weight: 800;
  white-space: nowrap;
}

.task-item em {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.task-item em.blocked {
  color: var(--red);
}

.reference-content {
  display: grid;
  gap: 16px;
}

.reference-head {
  justify-content: space-between;
  align-items: flex-start;
}

.reference-head h3 {
  font-size: 19px;
  line-height: 1.35;
}

.pre-pack,
.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  padding: 24px;
}

.pre-pack {
  align-content: center;
  gap: 12px;
}

.pre-pack p,
.empty-state p {
  margin: 0;
  max-width: 420px;
  line-height: 1.6;
}

.pack-grid {
  display: grid;
  gap: 12px;
}

.pack-section {
  border: 1px solid var(--line);
  background: #fffcf6;
  padding: 13px;
}

.pack-section.wide {
  background: var(--panel-strong);
}

.pack-section h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--green);
}

.pack-section p,
.pack-section li {
  margin: 0;
  color: var(--ink);
  line-height: 1.58;
  font-size: 14px;
}

.pack-section ul {
  margin: 0;
  padding-left: 18px;
}

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

.doc-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.doc-item strong,
.doc-item span {
  display: block;
}

.doc-item span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.muted {
  color: var(--muted) !important;
}

.library-toolbar {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.filter-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.entry-card {
  background: #fffcf6;
  border: 1px solid var(--line);
  padding: 13px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry-card-head,
.entry-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.entry-card-head span {
  color: #fff;
  background: var(--blue);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.entry-card-head small {
  color: var(--green);
  font-weight: 800;
}

.entry-card h3 {
  font-size: 18px;
  line-height: 1.35;
}

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

.reason-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reason-row.compact span {
  font-size: 11px;
  padding: 3px 6px;
}

.reason-row span {
  background: var(--green-soft);
  color: var(--green);
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 800;
}

.entry-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: auto;
}

.entry-meta span,
.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.doc-link {
  color: var(--red);
  font-weight: 800;
}

.button-link {
  width: fit-content;
  border: 0;
  background: transparent;
  padding: 0;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: #fff;
  padding: 13px 15px;
  box-shadow: var(--shadow);
  z-index: 10;
}

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

  .side-rail {
    position: static;
    height: auto;
    padding: 18px;
  }

  .flow-list {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    overflow-x: auto;
  }

  .mobile-entry {
    margin-top: 0;
  }

  .top-bar {
    flex-direction: column;
  }

  .stats-strip {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 980px) {
  .main-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "capture"
      "topic"
      "reference"
      "library";
  }

  .database-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "status"
      "feishu"
      "sediment"
      "topics"
      "library"
      "blueprint";
  }

  .knowledge-layout {
    grid-template-columns: 1fr;
  }

  .kb-tree-panel,
  .document-panel {
    position: static;
    min-height: auto;
    max-height: none;
  }

  .blueprint-grid,
  .bitable-action-grid,
  .bitable-columns,
  .field-check-grid,
  .readiness-grid,
  .readiness-hero,
  .readiness-next,
  .shortcut-endpoints,
  .shortcut-template-grid,
  .recommended-view-grid,
  .insight-columns {
    grid-template-columns: 1fr;
  }

  .readiness-hero small {
    white-space: normal;
  }

  .video-source-form {
    grid-template-columns: 1fr;
  }

  .video-upload-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .workspace {
    padding: 14px;
  }

  .side-rail {
    gap: 15px;
  }

  .flow-list {
    grid-template-columns: repeat(5, 180px);
  }

  .top-bar h2 {
    font-size: 26px;
  }

  .stats-strip,
  .two-col,
  .feishu-sync-grid,
  .feishu-table-grid,
  .status-matrix {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }

  .button-pair,
  .reference-head,
  .library-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}
