:root {
  --paper: #e9e7e2;
  --paper-2: #dedad3;
  --ink: #161513;
  --muted: #6a6560;
  --faint: #9a948c;
  --line: rgba(22, 21, 19, 0.1);
  --line-strong: rgba(22, 21, 19, 0.2);
  --card: #f4f2ed;
  --white: #fbfaf7;
  --marker: #2a5a45;
  --marker-soft: rgba(42, 90, 69, 0.12);
  --accent: #2a5a45;
  --blue: #2c4a6e;
  --shadow: 0 1px 0 rgba(22, 21, 19, 0.04), 0 18px 40px rgba(22, 21, 19, 0.06);
  --shadow-lg: 0 24px 60px rgba(22, 21, 19, 0.1);
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(42, 90, 69, 0.07), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(44, 74, 110, 0.05), transparent 50%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.in-tool { height: 100%; overflow: hidden; background: var(--paper); }
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
#app { min-height: 100vh; }
body.in-tool #app { height: 100dvh; min-height: 0; }

.home {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 100px;
  position: relative;
}
.home::before {
  content: "";
  position: absolute;
  inset: 80px -40px auto;
  height: 280px;
  background: linear-gradient(180deg, rgba(251, 250, 247, 0.7), transparent);
  border-radius: 40px;
  pointer-events: none;
  z-index: 0;
}
.home > * { position: relative; z-index: 1; }
.home-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 64px;
}
.brand {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
  font-size: 17px;
}
.home-top a.quiet, a.quiet {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.02em;
}
a.quiet:hover { color: var(--ink); }
.home h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 6vw, 52px);
  line-height: 1.12;
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: -0.03em;
}
.lede {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 22px;
  max-width: 36em;
  line-height: 1.75;
}
.path {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 32px;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: none;
}
.path span {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(22,21,19,0.03);
}
.path i { color: var(--faint); font-style: normal; }

.idea-box, .sheet, .inspector, .chat, .rail, .topbar {
  background: var(--white);
}
.idea-box {
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  transition: box-shadow 0.35s var(--ease), border-color 0.25s ease;
}
.idea-box:focus-within {
  border-color: rgba(42, 90, 69, 0.35);
  box-shadow: var(--shadow-lg);
}
.idea-box textarea, .chat-form textarea, .edit-form textarea, .doc textarea, .name-input, .plain-input {
  width: 100%;
  border: 0;
  resize: vertical;
  background: transparent;
  outline: none;
  font-size: 16px;
  line-height: 1.65;
}
.idea-box textarea { min-height: 96px; }
.idea-actions, .row-actions, .tool-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip, .btn, .icon-btn {
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.chip:hover, .btn:hover, .icon-btn:hover { background: var(--paper); }
.btn-primary {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}
.btn-primary:hover { background: #2a2825; transform: translateY(-1px); }
.btn-marker {
  background: var(--marker);
  color: white;
  border-color: var(--marker);
}
.btn-marker:hover { filter: brightness(1.05); }
.btn[disabled], .icon-btn[disabled] { opacity: 0.45; cursor: default; transform: none; }
.icon-btn { border-radius: 10px; padding: 6px 10px; }
.icon-btn.on {
  background: var(--marker-soft);
  border-color: var(--marker);
  color: var(--marker);
}

.recent-head {
  margin: 48px 0 12px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.recent {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 4px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.2s ease;
}
.recent:hover { background: rgba(255,255,255,0.45); }
.recent strong { display: block; font-weight: 600; }
.recent em { font-style: normal; color: var(--muted); font-size: 13px; }
.danger { color: var(--muted); border: 0; background: transparent; font-size: 12px; }
.danger:hover { color: #9a3b2a; }

.tool { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.top-stack { display: flex; flex-direction: column; min-width: 0; }
.chat, .doc, .viewport, .inspector, .page-rail { height: 100%; }
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 56px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(12px);
}
.topbar .brand { font-size: 16px; }
.name-input {
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  flex: 1;
  max-width: 280px;
  border-bottom: 1px dashed transparent;
  border-radius: 0;
  padding: 4px 2px;
}
.name-input:focus { border-bottom-color: var(--ink); }
.spacer { flex: 1; }
.seg {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper);
}
.seg button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 0;
}
.seg button.on {
  background: var(--ink);
  color: white;
}

.notice {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 9px 16px;
  background: #eef4f0;
  color: #1f4636;
  font-size: 13px;
  border-bottom: 1px solid rgba(42, 90, 69, 0.12);
}
.notice button { border: 0; background: transparent; color: inherit; text-decoration: underline; }

.agent-strip {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f3f1ec, #eceae4);
  overflow-x: auto;
}
.agent-pill {
  flex: 1;
  min-width: 128px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  opacity: 0.5;
  transition: opacity 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.agent-pill strong { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.agent-pill em { display: block; font-style: normal; font-size: 11px; color: var(--muted); margin-top: 3px; }
.agent-pill.on {
  opacity: 1;
  background: var(--white);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.agent-arrow { align-self: center; color: var(--faint); font-size: 12px; padding: 0 2px; }
.agent-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: 1px;
}
.agent-ideas { background: #e7eef6; color: #2c4a6e; }
.agent-flow { background: var(--marker-soft); color: var(--marker); }
.agent-page { background: #efe8df; color: #6a4a2a; }
.agent-scope { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.scope-btn {
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}
.scope-btn.on { background: var(--ink); color: white; border-color: var(--ink); }
.flow-chat-hint { margin: 0 0 10px; font-size: 11px; color: var(--faint); line-height: 1.45; }
.doc-ready {
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--marker-soft);
  color: #1f4636;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.guide-body, .canvas-body { min-height: 0; display: grid; }
.guide-body { grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.9fr); }
.canvas-body { grid-template-columns: 248px minmax(0, 1fr) 320px; }

.chat, .doc, .inspector { min-height: 0; overflow: auto; }
.page-rail { min-height: 0; overflow: hidden; }
.chat { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.chat-log { flex: 1; overflow: auto; padding: 20px 18px 10px; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 42em; white-space: pre-wrap; font-size: 14.5px; line-height: 1.65; }
.bubble.user {
  align-self: flex-end;
  background: var(--paper-2);
  border-radius: 14px 14px 4px 14px;
  padding: 9px 13px;
}
.bubble.assistant { align-self: flex-start; }
.pending-line { color: var(--faint); font-size: 13px; }
.chat-form, .edit-form { border-top: 1px solid var(--line); padding: 12px 14px 14px; background: rgba(251,250,247,0.8); }
.chat-form textarea, .edit-form textarea { min-height: 52px; max-height: 140px; font-size: 14px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.doc { padding: 40px 44px 80px; background: linear-gradient(180deg, #f6f4ef, #f0ede6); }
.prd { max-width: 40em; }
.prd-kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}
.prd h2 {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.25;
  margin: 10px 0 12px;
  font-weight: 700;
}
.prd .lede { font-size: 16px; line-height: 1.75; margin: 0 0 8px; color: var(--ink); }
.prd h3 { font-family: var(--serif); font-size: 19px; margin: 30px 0 8px; font-weight: 700; }
.prd h4 { font-size: 15px; margin: 0 0 4px; }
.prd p, .prd li { font-size: 14.5px; line-height: 1.75; }
.prd p { margin: 0 0 10px; }
.prd ul, .prd ol { margin: 0 0 12px; padding-left: 1.25em; }
.prd li { margin: 3px 0; }
.prd .kicker { margin: 8px 0 2px; font-size: 11px; letter-spacing: 0.06em; color: var(--muted); }
.prd .req { margin: 0 0 16px; }
.prd .doc-empty { color: var(--muted); margin-top: 18px; }

.page-rail {
  border-right: 1px solid var(--line);
  background: var(--card);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.rail-flow { padding-bottom: 0; }
.rail-brand {
  margin: 0 4px 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.rail-brand strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.rail-brand em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 12px;
  color: var(--faint);
}
.rail-empty { font-size: 12px; color: var(--faint); padding: 8px; margin: 0; }
.rail-add { width: 100%; margin-top: 8px; justify-content: center; }
.rail-chat {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 42%;
}
.rail-chat h3 { margin: 0 4px 8px; }
.rail-log {
  flex: 1;
  overflow: auto;
  font-size: 12px;
  line-height: 1.45;
  padding: 0 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 48px;
}
.rail-log .me { color: var(--muted); }
.rail-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 12px;
  border-top: 1px solid var(--line);
}
.rail-form textarea {
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  font-size: 13px;
  resize: vertical;
  background: var(--white);
}
.rail-form .btn { width: 100%; justify-content: center; }
.page-rail h3, .inspector h3 {
  margin: 4px 8px 10px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.08em;
}
.rail-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  transition: background 0.15s ease;
}
.rail-item:hover { background: rgba(255,255,255,0.55); }
.rail-item.on { background: white; box-shadow: inset 0 0 0 1px var(--line-strong); }
.rail-item small {
  display: block;
  color: var(--faint);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.art-tag {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--marker);
  border: 1px solid var(--marker-soft);
  background: var(--marker-soft);
  border-radius: 4px;
  padding: 1px 6px;
  font-style: normal;
}
.artboard-head .art-tag { vertical-align: middle; margin-left: 6px; }

.viewport {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, #d4cfc5 1.1px, transparent 1.1px);
  background-size: 22px 22px;
  background-color: #e2ddd4;
  touch-action: none;
  cursor: grab;
}
.viewport.panning { cursor: grabbing; }
.canvas-hint {
  position: absolute; left: 14px; bottom: 12px; z-index: 3;
  font-size: 12px; color: var(--muted); pointer-events: none;
  background: rgba(251,250,247,0.78);
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.canvas-empty {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--muted);
  pointer-events: none;
}
.canvas-empty p {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
}
.canvas-empty span { font-size: 13px; }

.world {
  position: absolute; left: 0; top: 0; width: 8000px; height: 8000px;
  transform-origin: 0 0;
}
.links { position: absolute; left: 0; top: 0; pointer-events: none; }

.artboard { position: absolute; width: 320px; user-select: none; }
.artboard.web { width: 480px; }
.artboard-head { cursor: grab; padding: 0 8px 12px; }
.artboard-head strong { display: block; font-size: 14px; letter-spacing: 0.01em; }
.artboard-head em { display: block; font-style: normal; color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 2px; }
.artboard.on { z-index: 2; }
.artboard.on .phone-shell {
  box-shadow: 0 0 0 2px var(--blue), 0 22px 48px rgba(22, 20, 16, 0.16);
}
.artboard.flash .phone-shell {
  box-shadow: 0 0 0 3px var(--marker), 0 22px 48px rgba(22, 20, 16, 0.16);
}

.phone-shell {
  background: #1a1a1c;
  border-radius: 38px;
  padding: 11px;
  box-shadow: 0 22px 48px rgba(22, 20, 16, 0.16);
}
.phone-shell.web {
  background: #d0cbc2;
  border-radius: 16px;
  padding: 8px;
}
.phone-notch {
  width: 92px;
  height: 8px;
  margin: 2px auto 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}
.screen {
  --ui-accent: #2a5a45;
  --ui-ink: #14161c;
  --ui-soft: #eef1f0;
  --ui-surface: #ffffff;
  --ui-muted: #667085;
  background: var(--ui-surface);
  color: var(--ui-ink);
  border-radius: 28px;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.screen.web { border-radius: 10px; min-height: 480px; }
.screen.dark { background: #0b0b0c; color: #fff; }
.status, .browser {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px 0; font-size: 11px; color: var(--ui-muted); font-weight: 600;
}
.screen.dark .status { color: rgba(255,255,255,0.45); }
.status-icons {
  width: 46px; height: 8px; border-radius: 8px;
  background: linear-gradient(90deg, currentColor, transparent);
  opacity: 0.35;
}
.browser { gap: 5px; justify-content: flex-start; padding: 10px 12px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.browser i { width: 8px; height: 8px; border-radius: 50%; background: #ddd; display: block; }
.browser span { margin-left: 8px; color: var(--ui-muted); font-size: 12px; }
.screen-body {
  flex: 1; display: flex; flex-direction: column; gap: 12px;
  padding: 8px 16px 16px; min-height: 0;
}
.ui.on { outline: 1.5px dashed var(--blue); outline-offset: 3px; border-radius: 12px; }

.ui.bar {
  display: flex; align-items: center; gap: 4px;
  min-height: 40px; font-weight: 700; font-size: 17px; letter-spacing: 0.01em;
}
.ui.bar .back {
  width: 28px; height: 28px; border: 0; background: transparent;
  font-size: 24px; line-height: 1; color: var(--ui-ink); padding: 0;
}
.ui.bar .ghost { visibility: hidden; }

.ui.hero { margin: 4px 0 2px; }
.ui.hero h2 {
  margin: 0; font-size: 24px; line-height: 1.3; font-weight: 700; letter-spacing: -0.02em;
}
.ui.hero p { margin: 8px 0 0; color: var(--ui-muted); font-size: 14px; line-height: 1.55; }

.ui.quote {
  font-size: 13.5px; font-style: italic; color: var(--ui-muted); line-height: 1.55;
}

.ui.title strong { display: block; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.ui.title small { display: block; margin-top: 4px; color: var(--ui-muted); font-size: 13px; }

.ui.text { font-size: 14px; color: var(--ui-ink); line-height: 1.6; opacity: 0.88; }

.ui.badge span {
  display: inline-flex; align-items: center;
  background: color-mix(in srgb, var(--ui-accent) 14%, white);
  color: var(--ui-accent); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; font-weight: 600;
}

.ui.search {
  border: 0; border-radius: 14px; color: var(--ui-muted); font-size: 13.5px;
  padding: 12px 14px; background: var(--ui-soft);
}

.ui.field {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid rgba(20, 22, 28, 0.08); border-radius: 14px;
  padding: 10px 12px; background: #fff;
}
.ui.field em { font-style: normal; font-size: 12px; color: var(--ui-muted); font-weight: 600; }
.ui.field span { font-size: 14px; color: rgba(20,22,28,0.28); }

.ui.image {
  height: 148px; border-radius: 18px; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: flex-start;
  color: rgba(255,255,255,0.92); font-size: 13px; font-weight: 600; padding: 14px;
  background:
    linear-gradient(180deg, transparent 40%, rgba(20, 22, 28, 0.45)),
    linear-gradient(135deg, color-mix(in srgb, var(--ui-accent) 35%, #ddd), #cfc8bc 55%, #b7b0a4);
}

.ui.btn {
  border: 0; background: var(--ui-soft); color: var(--ui-ink);
  border-radius: 16px; min-height: 48px; padding: 12px 14px;
  font-size: 15px; font-weight: 650; width: 100%;
}
.ui.btn.primary { background: var(--ui-accent); color: #fff; }
.ui.btn.ghost {
  background: transparent; color: var(--ui-ink);
  box-shadow: inset 0 0 0 1.5px rgba(20, 22, 28, 0.12);
}

.ui.pair { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }

.ui.bubble {
  align-self: flex-start; max-width: 85%;
  background: var(--ui-soft); border-radius: 16px 16px 16px 6px;
  padding: 10px 12px; font-size: 14px; line-height: 1.45;
}
.ui.bubble.mine {
  align-self: flex-end;
  background: color-mix(in srgb, var(--ui-accent) 18%, white);
  border-radius: 16px 16px 6px 16px;
}

.ui.list, .ui.cards { display: flex; flex-direction: column; gap: 8px; }
.ui.list .row, .ui.cards .card {
  border: 0; border-radius: 16px; padding: 12px 12px;
  background: var(--ui-soft); display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.ui.list .row div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ui.list .row strong { font-size: 14px; font-weight: 650; }
.ui.list .row small { color: var(--ui-muted); font-size: 12px; }
.ui.list .row i { color: var(--ui-muted); font-style: normal; }
.ui.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ui.cards .card { flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; background: var(--ui-soft); }
.ui.cards .card-media {
  height: 72px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--ui-accent) 30%, #ddd), #cfc8bc);
}
.ui.cards strong { padding: 8px 10px 0; font-size: 13px; }
.ui.cards small { padding: 2px 10px 10px; color: var(--ui-muted); font-size: 11px; }

.ui.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ui.chips span {
  border: 0; border-radius: 999px; padding: 6px 12px; font-size: 12.5px;
  background: var(--ui-soft); color: var(--ui-muted); font-weight: 600;
}
.ui.chips span.on { background: color-mix(in srgb, var(--ui-accent) 16%, white); color: var(--ui-accent); }

.ui.tabs {
  margin-top: auto;
  display: flex; border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 6px; margin-left: -16px; margin-right: -16px; padding-left: 8px; padding-right: 8px;
}
.ui.tabs button {
  flex: 1; border: 0; background: transparent; color: var(--ui-muted);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 6px 2px;
}
.ui.tabs button i {
  width: 18px; height: 3px; border-radius: 999px; background: transparent;
}
.ui.tabs button.on { color: var(--ui-ink); }
.ui.tabs button.on i { background: var(--ui-accent); }

.ui.note {
  font-size: 12px; color: #6a5530; background: #f7f1e4;
  border-radius: 12px; padding: 8px 10px; line-height: 1.45;
}
body.demo .hotspot { cursor: pointer; }
body.demo .hotspot:hover { filter: brightness(0.98); }

.screen.sketch {
  background: #faf8f4 !important;
  color: var(--ui-ink);
  box-shadow: inset 0 0 0 2px dashed rgba(28, 27, 25, 0.18);
}
.screen.sketch .ui.bar,
.screen.sketch .ui.title strong { color: var(--ui-ink); opacity: 0.85; }
.screen.sketch .ui.title small { color: var(--ui-muted); font-style: italic; }
.screen.sketch .ui.list .row,
.screen.sketch .ui.btn,
.screen.sketch .ui.field,
.screen.sketch .ui.search,
.screen.sketch .ui.image,
.screen.sketch .ui.pair .ui.btn {
  background: transparent;
  border: 2px dashed rgba(28, 27, 25, 0.2);
  border-radius: 10px;
  box-shadow: none;
}
.screen.sketch .ui.field { padding: 10px 12px; }
.screen.sketch .ui.field em { color: var(--ui-muted); }
.screen.sketch .ui.field span { color: rgba(20,22,28,0.35); }
.screen.sketch .ui.image {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 500;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(28,27,25,0.04) 6px,
    rgba(28,27,25,0.04) 12px
  );
}
.screen.sketch .ui.hero h2 { font-size: 22px; }
.screen.sketch .ui.chips span {
  border: 1.5px dashed rgba(28, 27, 25, 0.22);
  background: transparent;
}
.screen.sketch .ui.btn.primary {
  border-style: solid;
  border-color: color-mix(in srgb, var(--ui-accent) 55%, transparent);
  background: color-mix(in srgb, var(--ui-accent) 8%, white);
  color: var(--ui-accent);
}
.screen.sketch .ui.list .row strong { font-weight: 500; font-size: 13px; }
.screen.sketch .status,
.screen.sketch .browser { opacity: 0.35; }

.inspector { border-left: 1px solid var(--line); background: var(--white); display: flex; flex-direction: column; }
.inspector-scroll {
  flex: 1;
  overflow: auto;
  padding: 14px 14px 24px;
  padding-bottom: 8px;
}
.insp-chat-head { margin-bottom: 10px; }
.insp-chat-head h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.insp-mode {
  display: flex;
  gap: 6px;
  background: var(--paper);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.insp-mode-btn {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.insp-mode-btn.on {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.insp-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--faint);
  line-height: 1.45;
}
.insp-meta { margin: 16px 0 12px; }
.insp-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 10px 0 6px;
  font-weight: 600;
}
.insp-jumps { margin-top: 4px; }
.insp-fold {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  margin: 4px 0 8px;
  text-align: left;
}
.insp-fold em { font-style: normal; color: var(--faint); font-size: 12px; }
.insp-fold.open { border-color: var(--line-strong); background: #fff; }
.insp-blocks { display: none; }
.insp-blocks.open { display: block; margin-bottom: 12px; }
.inspector .edit-form {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: rgba(251,250,247,0.95);
  box-shadow: 0 -8px 24px rgba(22,21,19,0.04);
}
.inspector .edit-form .btn { width: 100%; justify-content: center; }
.inspector .edit-log {
  max-height: 160px;
  overflow: auto;
  margin-bottom: 4px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.inspector .plain-input, .inspector textarea, .inspector select {
  width: 100%; border: 1px solid var(--line); background: white; border-radius: 10px; padding: 8px 10px; font-size: 13px;
}
.inspector textarea { min-height: 52px; resize: vertical; }
.block-edit { border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 8px; background: #fff; }
.block-edit.on { border-color: var(--blue); }
.block-top { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.block-top span { margin-right: auto; }
.mini { border: 0; background: var(--paper); border-radius: 6px; padding: 2px 6px; font-size: 12px; }
.jump-list { font-size: 12px; color: var(--muted); margin: 0 0 10px; padding-left: 16px; }
.empty-side { color: var(--muted); font-size: 13px; padding: 8px; }
.edit-log { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.edit-log .me { color: var(--muted); }
.edit-form { margin-top: auto; }

/* Loading overlay */
.load-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(226, 221, 212, 0.72);
  backdrop-filter: blur(10px);
  animation: loadIn 0.35s var(--ease);
}
@keyframes loadIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.load-card {
  width: min(360px, calc(100% - 40px));
  padding: 28px 26px 24px;
  border-radius: 22px;
  background: var(--white);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.load-ghosts {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}
.load-ghost {
  width: 52px;
  height: 88px;
  border-radius: 12px;
  border: 1.5px dashed rgba(22, 21, 19, 0.2);
  background: linear-gradient(180deg, #f7f5f0, #ebe7df);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: ghostPulse 1.6s ease-in-out infinite;
}
.load-ghost i {
  display: block;
  height: 6px;
  border-radius: 4px;
  background: rgba(22, 21, 19, 0.1);
}
.load-ghost i:first-child { width: 60%; }
.load-ghost i:nth-child(2) { width: 100%; height: 18px; }
.load-ghost i:nth-child(3) { width: 80%; }
.load-ghost i:nth-child(4) { width: 100%; margin-top: auto; height: 10px; }
@keyframes ghostPulse {
  0%, 100% { opacity: 0.45; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}
.load-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--marker);
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.load-title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  min-height: 1.4em;
}
.load-steps {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}
.load-steps span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.25s ease, transform 0.25s ease;
}
.load-steps span.on {
  background: var(--marker);
  transform: scale(1.2);
}
.load-sub {
  margin: 0;
  font-size: 12px;
  color: var(--faint);
}

#toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: white; padding: 10px 16px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: 0.25s var(--ease); z-index: 20;
  max-width: min(520px, calc(100% - 32px));
  box-shadow: var(--shadow-lg);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* —— 个人产品档案：阶段导航与文档台 —— */
.stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 4px 2px;
  padding: 8px 14px 10px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.stage-sep {
  color: var(--faint);
  font-style: normal;
  align-self: center;
  font-size: 11px;
  padding: 0 2px;
}
.stage-btn {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 6px 10px;
  text-align: left;
  min-width: 72px;
}
.stage-btn em {
  display: block;
  font-style: normal;
  font-size: 13px;
  font-weight: 600;
}
.stage-btn span {
  display: block;
  font-size: 10px;
  color: var(--faint);
  margin-top: 1px;
}
.stage-btn:hover { background: var(--paper); }
.stage-btn.on {
  background: var(--marker-soft);
  border-color: rgba(42, 90, 69, 0.25);
}
.stage-btn.ok em::after {
  content: " ·";
  color: var(--marker);
}
.stage-hint {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--blue);
  background: rgba(44, 74, 110, 0.06);
  border-bottom: 1px solid var(--line);
}
.studio-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.studio-body.with-chat {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.85fr);
}
.paper-doc, .reqs-body, .pack-body {
  overflow: auto;
  padding: 28px 28px 80px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
.reqs-body, .pack-body { max-width: 900px; }
.paper-kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.paper-doc h2, .reqs-toolbar h2, .pack-body h2 {
  font-family: var(--serif);
  font-size: 28px;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.lede.soft { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.doc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.doc-field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.doc-field textarea, .doc-field select, .doc-field .plain-input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--white);
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
}
.doc-field textarea:focus, .doc-field select:focus, .doc-field .plain-input:focus {
  outline: 2px solid rgba(42, 90, 69, 0.25);
  border-color: var(--marker);
}
.paper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.studio-chat {
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
}
.doc-side {
  border-left: 1px solid var(--line);
  padding: 28px 20px;
  background: var(--card);
}
.btn-ghost, .file-btn {
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}
.file-btn { display: inline-flex; align-items: center; cursor: pointer; }
.reqs-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.req-card {
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.req-card header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.req-card header strong { flex: 1; font-size: 15px; }
.req-pri, .req-st {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
}
.req-card.status-locked { border-color: rgba(42, 90, 69, 0.35); }
.req-card.status-done { opacity: 0.72; }
.req-card .kicker { font-size: 11px; color: var(--faint); margin: 4px 0 0; }
.req-card ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.req-pages { font-size: 12px; color: var(--blue); margin: 0; }
.bind-row { display: flex; flex-wrap: wrap; gap: 8px; }
.bind-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  cursor: pointer;
}
.faint { color: var(--faint); font-size: 13px; }
.pack-md {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 18px 20px;
  font-size: 12.5px;
  line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  max-height: calc(100dvh - 220px);
  overflow: auto;
}
.log-list { display: flex; flex-direction: column; gap: 10px; }
.log-item {
  display: grid;
  grid-template-columns: 72px 72px 1fr;
  gap: 10px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
}
.log-item time { color: var(--faint); font-variant-numeric: tabular-nums; }
.log-item strong { color: var(--marker); font-weight: 600; }

/* —— 想法本 / 提案 / 页面阶段 —— */
.journal-compose, .req-compose {
  margin-bottom: 22px;
}
.journal-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.journal-kinds .chip.on {
  background: var(--marker-soft);
  border-color: rgba(42, 90, 69, 0.35);
  color: var(--marker);
}
.journal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.journal-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.journal-item header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.journal-item time { color: var(--faint); font-size: 12px; margin-right: auto; }
.journal-item p { margin: 0; white-space: pre-wrap; font-size: 14px; line-height: 1.65; }
.proposal-card {
  background: var(--white);
  border: 1px solid rgba(42, 90, 69, 0.28);
  border-radius: 16px;
  padding: 18px 18px 14px;
  margin: 8px 0 20px;
}
.proposal-card h3 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 0 0 8px;
}
.proposal-card ul { margin: 6px 0 10px; padding-left: 18px; color: var(--muted); }
.phase-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0 0 14px;
  padding: 8px;
  background: var(--paper);
  border-radius: 12px;
}
.phase-bar i { color: var(--faint); font-style: normal; font-size: 11px; }
.phase-step {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.phase-step.on {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line-strong);
}
.phase-step.done { color: var(--marker); }
.artboard.brief-card {
  width: 280px;
}
.brief-shell {
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 18px 16px 20px;
  min-height: 160px;
}
.brief-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.brief-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
}
.art-tag.phase-brief { background: rgba(44, 74, 110, 0.12); color: var(--blue); }
.art-tag.phase-sketch { background: var(--marker-soft); color: var(--marker); }
.art-tag.phase-interact { background: rgba(196, 92, 38, 0.12); color: #a04a1e; }
.art-tag.phase-ready { background: rgba(22, 21, 19, 0.08); color: var(--ink); }
.interact-note {
  margin-top: 8px;
  max-width: 280px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  padding: 8px 10px;
  background: rgba(255,255,255,0.7);
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
}
.mini {
  border: 0;
  background: transparent;
  color: var(--faint);
  font-size: 12px;
  padding: 2px 6px;
}

@media (max-width: 960px) {
  .guide-body { grid-template-columns: 1fr; }
  .canvas-body { grid-template-columns: 1fr; }
  .studio-body.with-chat { grid-template-columns: 1fr; }
  .studio-chat, .doc-side { display: none; }
  .page-rail, .doc { display: none; }
  .home h1 { font-size: 34px; }
  .stage-btn span { display: none; }
  .log-item { grid-template-columns: 1fr; gap: 4px; }
  .paper-doc, .reqs-body, .pack-body { padding: 20px 16px 72px; }
}
