:root {
  --bg: #f8f9fc;
  --surface: #ffffff;
  --surface-soft: #fbfaff;
  --text: #151827;
  --muted: #73788a;
  --muted-soft: #9da2b3;
  --line: #e8eaf2;
  --line-strong: #dfe2ec;
  --purple: #6945ef;
  --purple-deep: #5632dc;
  --purple-soft: #f0edff;
  --purple-wash: #f8f6ff;
  --green: #25a46d;
  --green-soft: #e9f8f0;
  --amber: #d8842e;
  --blue: #4978d9;
  --shadow: 0 16px 38px rgba(45, 36, 95, .07);
  --shadow-small: 0 5px 18px rgba(45, 36, 95, .06);
  --sans: Manrope, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; text-rendering: optimizeLegibility; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(105, 69, 239, .25); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.topbar { position: sticky; top: 0; z-index: 20; min-height: 76px; display: grid; grid-template-columns: minmax(180px, 1fr) auto minmax(300px, 1fr); align-items: center; gap: 28px; padding: 0 clamp(22px, 4.3vw, 68px); border-bottom: 1px solid rgba(232,234,242,.86); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 11px; background: var(--purple); color: #fff; box-shadow: 0 7px 15px rgba(105,69,239,.24); }
.brand-mark svg { width: 24px; height: 24px; stroke-width: 1.75; }
.brand-copy strong { display: block; font-size: 18px; line-height: 1.05; letter-spacing: -.5px; font-weight: 800; }
.brand-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.main-nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 38px); height: 76px; }
.main-nav a { position: relative; display: grid; align-items: center; height: 100%; color: #44495b; font-size: 13px; font-weight: 600; white-space: nowrap; }
.main-nav a::after { content: ""; position: absolute; bottom: 0; left: 50%; width: 0; height: 2px; background: var(--purple); transform: translateX(-50%); transition: width .18s ease; }
.main-nav a:hover, .main-nav a.active { color: var(--purple); }
.main-nav a.active::after { width: 22px; }
.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.search-box { width: min(220px, 23vw); min-width: 165px; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--muted-soft); transition: border-color .18s, box-shadow .18s; }
.search-box:focus-within { border-color: rgba(105,69,239,.45); box-shadow: 0 0 0 3px rgba(105,69,239,.08); }
.search-box svg { width: 16px; height: 16px; flex: 0 0 auto; }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; }
.search-box input::placeholder { color: var(--muted-soft); }
.search-box kbd { display: none; color: var(--muted-soft); font: 10px var(--mono); white-space: nowrap; }
.button { min-height: 40px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 0 16px; border: 1px solid transparent; border-radius: 7px; font-size: 12px; font-weight: 700; transition: background .18s, border-color .18s, color .18s, transform .18s, box-shadow .18s; }
.button svg { width: 16px; height: 16px; }
.button-primary { background: var(--purple); color: #fff; box-shadow: 0 7px 15px rgba(105,69,239,.15); }
.button-primary:hover { background: var(--purple-deep); transform: translateY(-1px); box-shadow: 0 9px 18px rgba(105,69,239,.22); }
.button-ghost { border-color: var(--line-strong); background: var(--surface); color: #5d6375; }
.button-ghost:hover { border-color: #c9c4f8; color: var(--purple); background: var(--purple-wash); }
.button-danger { border-color: transparent; background: transparent; color: #c47782; }
.button-danger:hover { border-color: #f2d9dd; background: #fff7f8; color: #b6495b; }
.icon-button { width: 40px; height: 40px; display: none; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: #5d6375; }

.app-shell { max-width: 1520px; min-height: calc(100vh - 76px); margin: 0 auto; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { min-width: 0; display: flex; flex-direction: column; padding: 37px 18px 20px; border-right: 1px solid var(--line); background: rgba(255,255,255,.62); }
.sidebar-top { padding: 0 13px; }
.section-kicker { display: flex; align-items: center; justify-content: space-between; color: #a0a4b4; font: 500 9px var(--mono); letter-spacing: 1.35px; }
.section-kicker > span:last-child { color: var(--muted); font-size: 10px; letter-spacing: 0; }
.sidebar-intro { margin: 26px 0 31px; color: #333748; font-size: 16px; line-height: 1.65; font-weight: 700; letter-spacing: -.3px; }
.sidebar-intro em { color: var(--purple); font-style: normal; }
.category-nav { display: grid; gap: 4px; }
.category-button { min-height: 39px; display: flex; align-items: center; justify-content: space-between; padding: 0 11px; border: 0; border-radius: 6px; background: transparent; color: #707588; text-align: left; transition: background .18s, color .18s; }
.category-button span { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; }
.category-button svg { width: 16px; height: 16px; color: #9da2b3; }
.category-button b { min-width: 20px; color: #a8adbd; font: 10px var(--mono); text-align: right; font-weight: 400; }
.category-button:hover { background: var(--purple-wash); color: var(--purple); }
.category-button.active { background: var(--purple-soft); color: var(--purple); }
.category-button.active svg, .category-button.active b { color: var(--purple); }
.saved-section { min-width: 0; margin-top: 38px; }
.saved-section .section-kicker { padding: 0 13px; }
.quiet-button { padding: 0; border: 0; background: transparent; color: var(--muted-soft); font: 10px var(--sans); cursor: pointer; }
.quiet-button:hover { color: var(--purple); }
.prompt-list { display: grid; gap: 3px; margin-top: 13px; }
.prompt-list-empty { padding: 18px 13px; border: 1px dashed var(--line-strong); border-radius: 6px; color: var(--muted-soft); font-size: 11px; line-height: 1.7; }
.prompt-item { position: relative; min-width: 0; display: grid; grid-template-columns: 7px minmax(0,1fr); gap: 9px; align-items: center; padding: 10px 10px; border: 1px solid transparent; border-radius: 6px; background: transparent; text-align: left; transition: border-color .18s, background .18s; }
.prompt-item::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--purple-soft); }
.prompt-item:hover { border-color: var(--line); background: var(--surface); }
.prompt-item.active { border-color: #ded8ff; background: var(--surface); box-shadow: var(--shadow-small); }
.prompt-item.active::before { background: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.prompt-item-copy { min-width: 0; }
.prompt-item strong { display: block; overflow: hidden; color: #404556; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.prompt-item small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot { display: flex; align-items: center; gap: 7px; margin-top: auto; padding: 17px 12px 0; border-top: 1px solid var(--line); color: var(--muted-soft); font-size: 10px; }
.status-dot, .live-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.shortcut { margin-left: auto; color: #b2b5c2; font: 10px var(--mono); }

.workspace-content { min-width: 0; padding: 53px clamp(25px, 4.5vw, 76px) 56px; }
.workspace-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; max-width: 1080px; margin: 0 auto 33px; }
.eyebrow, .panel-label { margin: 0; color: var(--purple); font: 500 10px var(--mono); letter-spacing: 1.55px; }
.workspace-heading h1 { margin: 15px 0 10px; color: #171a28; font-size: clamp(28px, 3.6vw, 46px); line-height: 1.14; letter-spacing: -1.4px; font-weight: 800; }
.heading-copy { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.heading-meta { display: inline-flex; align-items: center; gap: 9px; padding-bottom: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1.44fr) minmax(260px, .8fr); gap: 21px; max-width: 1080px; margin: 0 auto; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-small); }
.editor-panel { padding: 28px 30px 25px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-head h2 { margin: 8px 0 0; color: #1c2030; font-size: 18px; letter-spacing: -.35px; font-weight: 800; }
.draft-badge { padding: 5px 8px; border-radius: 4px; background: var(--purple-wash); color: var(--purple); font-size: 10px; white-space: nowrap; }
#promptForm { display: grid; gap: 24px; margin-top: 29px; }
.field-group { position: relative; min-width: 0; }
.field-group > label, .label-row label { display: block; margin-bottom: 9px; color: #4c5263; font-size: 11px; font-weight: 700; }
.field-group input, .field-group select, .field-group textarea { width: 100%; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--text); outline: 0; transition: border-color .18s, box-shadow .18s, background .18s; }
.field-group input, .field-group select { height: 42px; padding: 0 12px; font-size: 12px; }
.field-group input::placeholder, .field-group textarea::placeholder { color: #b0b4c1; }
.field-group input:focus, .field-group select:focus, .field-group textarea:focus { border-color: #b9affd; box-shadow: 0 0 0 3px rgba(105,69,239,.08); }
.title-field input { padding-right: 70px; font-size: 14px; font-weight: 600; }
.field-count { position: absolute; right: 11px; bottom: 13px; color: #b0b4c1; font: 9px var(--mono); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 35px; }
.select-wrap svg { position: absolute; right: 11px; top: 12px; width: 16px; height: 16px; color: #a2a7b5; pointer-events: none; }
.prompt-field { min-width: 0; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.required-label { color: var(--muted-soft); font: 10px var(--mono); }
.field-group textarea { min-height: 250px; padding: 14px; resize: vertical; color: #303546; font-size: 13px; line-height: 1.85; }
.textarea-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: var(--muted-soft); font-size: 10px; }
.textarea-footer span:last-child { font: 10px var(--mono); }
.variable-row { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 11px 12px; border: 1px solid #eceaf8; border-radius: 5px; background: var(--surface-soft); }
.variable-label { margin-right: 2px; color: var(--muted); font-size: 10px; }
.variable-chip { padding: 5px 7px; border: 1px solid #ddd8ff; border-radius: 4px; background: #fff; color: var(--purple); font: 10px var(--mono); transition: background .18s, border-color .18s; }
.variable-chip:hover { border-color: var(--purple); background: var(--purple-soft); }
.variable-hint { margin-left: auto; color: #afb3c1; font-size: 10px; }
.editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; padding-top: 1px; }
.save-button { min-width: 137px; }
.keyboard-hint { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: #a7abb9; font-size: 10px; }
kbd { display: inline-grid; min-width: 18px; height: 18px; place-items: center; padding: 0 4px; border: 1px solid #e4e6ee; border-bottom-width: 2px; border-radius: 4px; background: #fff; color: #8e93a4; font: 10px var(--mono); }
.preview-column { display: grid; gap: 21px; }
.preview-panel, .guide-panel { padding: 24px; }
.preview-head { align-items: center; }
.preview-status { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 10px; white-space: nowrap; }
.preview-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.preview-card { margin-top: 23px; padding: 19px; border: 1px solid #e9e6fd; border-radius: 7px; background: var(--surface-soft); }
.preview-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.preview-category { padding: 4px 7px; border-radius: 4px; background: var(--purple-soft); color: var(--purple); font-size: 10px; }
.preview-context { color: #a0a5b4; font: 10px var(--mono); }
.preview-card h3 { margin: 19px 0 13px; overflow-wrap: anywhere; color: #262a3a; font-size: 15px; line-height: 1.35; font-weight: 800; }
.preview-body { min-height: 155px; max-height: 260px; overflow-y: auto; padding: 13px; border-radius: 5px; background: #fff; color: #4e5365; font-size: 12px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-placeholder { color: #b4b7c3; }
.preview-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 15px; color: #a0a5b4; font: 10px var(--mono); }
.icon-text-button { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: var(--purple); font: 600 11px var(--sans); }
.icon-text-button svg { width: 14px; height: 14px; }
.icon-text-button:hover { color: var(--purple-deep); }
.note-index { color: #c4c6d0; font: 10px var(--mono); }
.note-list { display: grid; gap: 18px; margin: 24px 0 1px; padding: 0; list-style: none; }
.note-list li { display: grid; grid-template-columns: 25px minmax(0,1fr); gap: 9px; }
.note-list li > span { color: #bbbeca; font: 10px var(--mono); }
.note-list p { margin: 0; }
.note-list b { display: block; color: #4c5262; font-size: 11px; }
.note-list small { display: block; margin-top: 5px; color: #9297a7; font-size: 10px; line-height: 1.55; }
.examples-section { max-width: 1080px; margin: 52px auto 0; }
.examples-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 17px; }
.examples-heading h2 { margin: 10px 0 0; color: #202435; font-size: 20px; letter-spacing: -.5px; }
.examples-heading > span { padding-bottom: 2px; color: #a4a8b7; font-size: 10px; }
.example-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.example-card { min-width: 0; min-height: 87px; display: grid; grid-template-columns: 35px minmax(0,1fr) 17px; align-items: center; gap: 11px; padding: 15px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); text-align: left; box-shadow: var(--shadow-small); transition: border-color .18s, transform .18s, box-shadow .18s; }
.example-card:hover { border-color: #cfc8ff; transform: translateY(-2px); box-shadow: var(--shadow); }
.example-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; }
.example-icon svg { width: 18px; height: 18px; }
.writing-icon { background: #f0edff; color: var(--purple); }.coding-icon { background: #e9f7f1; color: var(--green); }.design-icon { background: #fff3e6; color: var(--amber); }
.example-card b { display: block; overflow: hidden; color: #343949; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.example-card small { display: block; overflow: hidden; margin-top: 5px; color: #999ead; font-size: 10px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.arrow-icon { width: 16px; height: 16px; color: #b0b4c2; transition: color .18s, transform .18s; }.example-card:hover .arrow-icon { color: var(--purple); transform: translateX(2px); }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 50; max-width: calc(100vw - 30px); padding: 10px 15px; border: 1px solid var(--line); border-radius: 6px; background: #1d2030; color: #fff; box-shadow: 0 13px 28px rgba(18,18,35,.2); font-size: 12px; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .2s, transform .2s; }.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  .topbar { grid-template-columns: minmax(180px, 1fr) auto; }.main-nav { display: none; }.top-actions { grid-column: 2; }.search-box kbd { display: inline-block; }.app-shell { grid-template-columns: 216px minmax(0,1fr); }.workspace-content { padding-left: clamp(22px, 3.5vw, 48px); padding-right: clamp(22px, 3.5vw, 48px); }
}
@media (max-width: 900px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr) 280px; }.editor-panel { padding: 24px; }.preview-panel, .guide-panel { padding: 20px; }.field-group textarea { min-height: 220px; }.variable-hint { display: none; }.example-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }.example-card { grid-template-columns: 31px minmax(0,1fr); padding: 12px; }.example-icon { width: 31px; height: 31px; }.example-card .arrow-icon { display: none; }
}
@media (max-width: 760px) {
  .topbar { min-height: 68px; padding: 0 18px; }.top-actions { gap: 8px; }.search-box { min-width: 40px; width: 40px; padding: 0 11px; border-radius: 7px; }.search-box input, .search-box kbd { display: none; }.search-box svg { width: 17px; height: 17px; }.button-new { width: 40px; padding: 0; }.button-new span { display: none; }.button-new svg { width: 17px; height: 17px; }.icon-button { display: grid; }.app-shell { display: block; min-height: 0; }.sidebar { position: relative; padding: 22px 18px 14px; border-right: 0; border-bottom: 1px solid var(--line); }.sidebar.mobile-open .saved-section { display: block; }.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 4px; }.sidebar-intro { margin: 0; font-size: 13px; line-height: 1.4; }.sidebar-intro br { display: none; }.sidebar-top .section-kicker { display: none; }.category-nav { display: flex; overflow-x: auto; gap: 6px; margin-top: 20px; padding-bottom: 2px; scrollbar-width: none; }.category-nav::-webkit-scrollbar { display: none; }.category-button { min-height: 35px; flex: 0 0 auto; padding: 0 10px; }.category-button span { gap: 7px; font-size: 11px; }.category-button b { display: none; }.saved-section { display: none; }.sidebar-foot { display: none; }.workspace-content { padding: 32px 18px 40px; }.workspace-heading { align-items: start; margin-bottom: 24px; }.workspace-heading h1 { margin-top: 11px; font-size: 32px; }.heading-copy { font-size: 12px; }.heading-meta { padding-top: 5px; font-size: 10px; }.editor-layout { grid-template-columns: 1fr; gap: 16px; }.editor-panel { padding: 22px 18px 20px; }.panel-head h2 { font-size: 16px; }.preview-column { display: grid; grid-template-columns: 1fr; gap: 16px; }.preview-panel, .guide-panel { padding: 18px; }.preview-card { margin-top: 18px; }.guide-panel { display: none; }.examples-section { margin-top: 38px; }.examples-heading h2 { font-size: 18px; }.examples-heading > span { display: none; }.example-grid { grid-template-columns: 1fr; gap: 9px; }.example-card { min-height: 70px; grid-template-columns: 35px minmax(0,1fr) 17px; padding: 12px; }.example-card .arrow-icon { display: block; }.example-icon { width: 35px; height: 35px; }.keyboard-hint { display: none; }
}
@media (max-width: 430px) {
  .brand-copy strong { font-size: 16px; }.brand-copy small { font-size: 9px; }.brand-mark { width: 34px; height: 34px; }.brand-mark svg { width: 22px; height: 22px; }.workspace-heading { display: block; }.heading-meta { margin-top: 17px; }.field-grid { grid-template-columns: 1fr; gap: 18px; }.field-group textarea { min-height: 220px; }.editor-actions { gap: 8px; }.save-button { flex: 1; }.button-ghost { padding: 0 12px; }.variable-row { gap: 6px; }.variable-label { width: 100%; margin-bottom: 1px; }.preview-body { min-height: 130px; }
}
