:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --surface-blue: #f3f7ff;
  --surface-purple: #f7f5ff;
  --text: #151922;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e6e9ef;
  --line-strong: #d8dde7;
  --blue: #1f5eff;
  --blue-dark: #174bc7;
  --purple: #6941c6;
  --green: #0f9f6e;
  --amber: #b7791f;
  --red: #d92d20;
  --shadow: 0 10px 28px rgba(21, 25, 34, 0.06);
  --radius: 8px;
  --rightbar: 320px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: block;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 32px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  min-width: 220px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #151922;
  color: #fff;
  font-weight: 800;
}

.brand strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

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

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 16px;
  border-radius: 7px;
  color: #475467;
  font-weight: 650;
}

.nav-link:hover,
.nav-link.active {
  background: #f3f6fb;
  color: var(--text);
}

.nav-icon {
  width: 18px;
  color: var(--subtle);
  text-align: center;
  display: none;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 64px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.crumbs strong {
  color: var(--text);
}

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

.content {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 30px 32px 48px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.page-header p {
  margin: 8px 0 0;
  max-width: 720px;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  font-size: 13px;
  white-space: nowrap;
}

.btn:hover {
  border-color: #c7cfdb;
  background: #fafbfc;
}

.btn.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.btn.primary:hover {
  background: var(--blue-dark);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn.danger {
  border-color: #f4b4ac;
  color: var(--red);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 8px 11px;
  outline: none;
}

.textarea {
  min-height: 92px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 107, 254, 0.12);
}

.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 160px 160px auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f7;
}

.segmented button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 7px 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.segmented button.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(20, 34, 55, 0.12);
}

.grid {
  display: grid;
  gap: 16px;
}

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

.card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.card {
  padding: 20px;
}

.card:hover {
  border-color: #cfd6e2;
  box-shadow: var(--shadow);
}

.project-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  justify-content: space-between;
}

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

.card h2,
.panel h2,
.panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.card h2 {
  font-size: 18px;
}

.panel h2 {
  font-size: 18px;
}

.panel h3 {
  font-size: 15px;
}

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

.meta-item span {
  display: block;
  color: var(--subtle);
  font-size: 12px;
}

.meta-item strong {
  display: block;
  margin-top: 2px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f2f4f7;
  color: var(--muted);
  font-weight: 650;
  font-size: 12px;
  white-space: nowrap;
}

.status.blue {
  background: #eef4ff;
  color: #1849a9;
}

.status.green {
  background: #ecfdf3;
  color: #067647;
}

.status.amber {
  background: #fffaeb;
  color: #93370d;
}

.status.red {
  background: #fef3f2;
  color: #b42318;
}

.status.purple {
  background: #f4f3ff;
  color: #5925dc;
}

.progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8eef7;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--purple));
}

.progress-row {
  display: grid;
  gap: 8px;
}

.progress-row header,
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.subtle {
  color: var(--subtle);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
}

tr:last-child td {
  border-bottom: 0;
}

.hidden {
  display: none !important;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rightbar);
  gap: 20px;
}

.panel {
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

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

.stack {
  display: grid;
  gap: 16px;
}

.focus-panel {
  padding: 22px;
  border: 1px solid #d8e3f8;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #f7faff);
}

.focus-panel h2 {
  margin: 0;
  font-size: 20px;
}

.focus-panel p {
  margin: 8px 0 0;
  color: var(--muted);
}

.action-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.action-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.action-item strong {
  display: block;
  margin-bottom: 3px;
}

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

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

.entry-card {
  min-height: 188px;
  display: grid;
  align-content: space-between;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.entry-card:hover {
  border-color: #cfd6e2;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.entry-card h2 {
  margin: 12px 0 8px;
  font-size: 20px;
}

.entry-card p {
  margin: 0;
  color: var(--muted);
}

.entry-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
  color: var(--text);
  font-weight: 800;
}

.entry-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

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

.insight-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.insight-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.insight-card h2 {
  margin: 0;
  font-size: 20px;
}

.insight-card header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.conclusion-list {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.conclusion-list li {
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.conclusion-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.conclusion-list strong {
  display: block;
  margin-bottom: 4px;
}

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

.empty-gate {
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fbfcfe;
  color: var(--muted);
}

.quiet-details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.quiet-details summary {
  cursor: pointer;
  padding: 15px 18px;
  color: var(--text);
  font-weight: 700;
  list-style: none;
}

.quiet-details summary::-webkit-details-marker {
  display: none;
}

.quiet-details summary::after {
  content: "展开";
  float: right;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.quiet-details[open] summary::after {
  content: "收起";
}

.quiet-details-body {
  padding: 0 18px 18px;
}

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

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

.metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

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

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}

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

.step-node {
  position: relative;
  padding: 13px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.step-node.done {
  border-color: #abecd2;
  background: #f2fbf7;
}

.step-node.active {
  border-color: #abc6ff;
  background: #f4f8ff;
}

.step-node.risk {
  border-color: #f8d69a;
  background: #fffaf0;
}

.step-node span {
  color: var(--subtle);
  font-size: 12px;
}

.step-node strong {
  display: block;
  margin-top: 6px;
}

.todo-list,
.file-list,
.parse-list,
.version-list,
.issue-list {
  display: grid;
  gap: 10px;
}

.todo,
.file-row,
.parse-row,
.version-row,
.issue-row {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.todo {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.todo p,
.file-row p,
.parse-row p,
.issue-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ai-panel {
  position: sticky;
  top: 86px;
  align-self: start;
  border-color: var(--line);
  background: #fff;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.ai-dot {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #151922;
  color: #fff;
  font-weight: 900;
}

.ai-suggestion {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.ai-suggestion + .ai-suggestion {
  margin-top: 10px;
}

.form-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
}

.form-steps {
  padding: 14px;
}

.form-step {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 7px;
  color: var(--muted);
}

.form-step.active {
  background: var(--surface-blue);
  color: var(--blue-dark);
}

.form-step strong {
  display: block;
}

.form-step span {
  display: block;
  font-size: 12px;
}

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

.field.full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: #344054;
  font-weight: 800;
  font-size: 13px;
}

.upload-zone {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 22px;
  border: 1.5px dashed #aebbd0;
  border-radius: var(--radius);
  background: #fbfcfe;
  text-align: center;
}

.manual-note {
  display: grid;
  gap: 12px;
}

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

.note-type {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-weight: 650;
}

.note-type.active,
.note-type:hover {
  border-color: #c8d7f5;
  background: var(--surface-blue);
  color: var(--blue-dark);
}

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

.upload-zone.dragover,
.upload-zone:hover {
  border-color: var(--blue);
  background: var(--surface-blue);
}

.upload-zone strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

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

.category {
  min-height: 74px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.category strong {
  display: block;
}

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

.plan-viewer {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(36, 107, 254, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(36, 107, 254, 0.05) 1px, transparent 1px),
    #fbfcff;
  background-size: 28px 28px;
}

.plan-image {
  position: absolute;
  inset: 52px 74px 52px 64px;
  border: 2px solid rgba(24, 34, 48, 0.14);
  background: rgba(255, 255, 255, 0.72);
  transform-origin: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.room {
  position: absolute;
  display: grid;
  place-items: center;
  border: 3px solid #253041;
  background: rgba(255, 255, 255, 0.68);
  color: #253041;
  font-weight: 800;
  font-size: 13px;
}

.room.low {
  border-color: #f59e0b;
  background: rgba(255, 247, 237, 0.78);
}

.room.selected {
  outline: 3px solid rgba(36, 107, 254, 0.35);
}

.door,
.window,
.risk-pin {
  position: absolute;
  z-index: 3;
}

.door {
  width: 34px;
  height: 18px;
  border: 3px solid #16a34a;
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 24px 0 0;
}

.window {
  width: 58px;
  height: 7px;
  border-radius: 6px;
  background: #0ea5e9;
}

.risk-pin {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff7ed;
  color: var(--amber);
  border: 1px solid #f8c56b;
  font-weight: 900;
}

.plan-image.hide-ai .room,
.plan-image.hide-ai .door,
.plan-image.hide-ai .window,
.plan-image.hide-risk .risk-pin {
  opacity: 0.15;
}

.layer-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.editor-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 342px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  height: calc(100vh - 88px);
  padding: 12px;
}

.editor-topbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 54px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.editor-page .main {
  background: #eef2f7;
}

.tool-rail {
  position: absolute;
  left: 12px;
  top: 12px;
  bottom: 12px;
  z-index: 15;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.tool-btn {
  width: 42px;
  height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.tool-btn.active,
.tool-btn:hover {
  border-color: #abc6ff;
  background: var(--surface-blue);
  color: var(--blue-dark);
}

.canvas-panel {
  grid-row: 2;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #dfe6f0;
}

.canvas-toolbar {
  position: absolute;
  z-index: 5;
  top: 12px;
  left: 88px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.canvas-toolbar > * {
  pointer-events: auto;
}

.canvas-board {
  position: absolute;
  inset: 70px 52px 42px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(24, 34, 48, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(24, 34, 48, 0.06) 1px, transparent 1px),
    #fff;
  background-size: 24px 24px;
  box-shadow: 0 24px 80px rgba(20, 34, 55, 0.16);
  transition: transform 0.2s ease;
}

.editor-room {
  cursor: pointer;
}

.right-inspector {
  grid-row: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  flex: 1;
  border: 0;
  background: #f8fafc;
  padding: 12px;
  color: var(--muted);
  font-weight: 800;
}

.tabs button.active {
  background: #fff;
  color: var(--blue-dark);
  box-shadow: inset 0 -2px 0 var(--blue);
}

.tab-panel {
  display: none;
  overflow: auto;
  padding: 16px;
}

.tab-panel.active {
  display: block;
}

.chat-log {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.bubble {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f1f5f9;
}

.bubble.ai {
  border: 1px solid #ded9ff;
  background: #f7f4ff;
}

.bubble.user {
  margin-left: 28px;
  background: var(--surface-blue);
}

.preview-box {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #abc6ff;
  border-radius: var(--radius);
  background: #f4f8ff;
}

.preview-box.active {
  display: block;
}

.editor-bottom {
  grid-row: 3;
  grid-column: 2 / 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.bottom-panel {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.risk-note {
  padding: 12px;
  border: 1px solid #f8d69a;
  border-radius: var(--radius);
  background: #fffaf0;
  color: #7a4c08;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .project-grid,
  .split-3,
  .category-grid,
  .entry-grid,
  .insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .ai-panel {
    position: static;
  }

  .editor-shell {
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-rows: auto 520px auto auto;
    height: auto;
  }

  .right-inspector {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .editor-bottom {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    height: auto;
    min-height: 64px;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px;
  }

  .brand {
    min-width: 0;
  }

  .primary-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-link {
    white-space: nowrap;
  }

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

  .content {
    padding: 18px;
  }

  .page-header,
  .filters {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .project-grid,
  .split-2,
  .split-3,
  .entry-grid,
  .insight-grid,
  .source-tabs,
  .note-type-grid,
  .field-grid,
  .category-grid,
  .timeline,
  .form-shell,
  .editor-bottom {
    grid-template-columns: 1fr;
  }

  .editor-shell {
    padding: 8px;
    grid-template-columns: 1fr;
  }

  .editor-topbar {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    padding: 12px;
  }

  .editor-topbar .top-actions {
    width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 4px;
  }

  .tool-rail {
    grid-template-columns: repeat(8, 42px);
    overflow-x: auto;
  }

  .canvas-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .canvas-panel {
    min-height: 520px;
  }

  .canvas-board {
    inset: 132px 14px 28px;
  }
}

/* ── 版本历史滑出面板 ── */
.version-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(21, 25, 34, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.version-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.version-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 110;
  width: 380px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -8px 0 32px rgba(21, 25, 34, 0.12);
  transform: translateX(100%);
  transition: transform 0.28s ease;
}

.version-drawer.open {
  transform: translateX(0);
}

.version-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.version-drawer-header h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.version-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 24px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.version-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  gap: 8px;
}

.version-item.current {
  border-color: #abecd2;
  background: #f2fbf7;
}

.version-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.version-item-header strong {
  font-size: 14px;
}

.version-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.version-restore-btn {
  justify-self: start;
}
