:root {
  --paper: #f3f4f1; --surface: #fff; --surface-alt: #e8ebe7; --ink: #17201d;
  --muted: #63706b; --line: #d5dad6; --strong-line: #adb7b1; --green: #0f6b4b;
  --green-dark: #084a34; --red: #b43c34; --blue: #285d85;
  --shadow: 0 12px 34px rgba(20, 38, 31, .08); --radius: 6px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
.site-header { position: sticky; top: 0; z-index: 20; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px clamp(18px, 4vw, 56px); background: rgba(243, 244, 241, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand > span:last-child { display: flex; flex-direction: column; }
.brand b { font-size: 18px; line-height: 1.2; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.brand-mark { width: 38px; height: 38px; position: relative; display: grid; place-items: center; background: var(--ink); border-radius: 4px; }
.brand-mark i { position: absolute; display: block; background: #8ed1ad; }
.brand-mark i:nth-child(1) { width: 21px; height: 3px; }
.brand-mark i:nth-child(2) { width: 3px; height: 21px; }
.brand-mark i:nth-child(3) { width: 7px; height: 7px; border: 2px solid #8ed1ad; background: var(--ink); border-radius: 50%; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.user-badge { font-size: 12px; color: var(--muted); padding-right: 6px; }
.icon-button { width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 4px; cursor: pointer; }
.icon-button:hover { background: var(--surface); border-color: var(--line); }
.icon-button:focus-visible, .button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(15, 107, 75, .2); outline-offset: 2px; }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#app { min-height: calc(100vh - 142px); }
.shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }
.catalog-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 410px); align-items: end; gap: clamp(30px, 7vw, 96px); padding: clamp(46px, 8vw, 92px) 0 38px; border-bottom: 1px solid var(--strong-line); }
.eyebrow { display: block; color: var(--green); font-size: 11px; font-weight: 750; letter-spacing: 1.6px; margin-bottom: 12px; }
.catalog-intro h1 { max-width: 760px; margin: 0; font-size: 62px; line-height: 1.02; font-weight: 720; letter-spacing: 0; }
.catalog-intro p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.intro-meta { display: flex; gap: 24px; margin-top: 24px; color: var(--muted); font-size: 12px; }
.intro-meta b { display: block; margin-bottom: 2px; color: var(--ink); font-size: 20px; font-weight: 650; }
.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 180px 180px auto; gap: 10px; align-items: center; padding: 22px 0; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 13px; top: 50%; width: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.8; }
.control { width: 100%; min-height: 42px; padding: 9px 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.search-wrap .control { padding-left: 40px; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--strong-line); border-radius: 4px; font-weight: 650; font-size: 13px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.button:hover { border-color: var(--ink); }
.button.primary { color: white; background: var(--green); border-color: var(--green); }
.button.primary:hover { background: var(--green-dark); }
.button.danger { color: var(--red); border-color: #d7aaa7; }
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button.full { width: 100%; }
.catalog-meta { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0 14px; color: var(--muted); font-size: 12px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding-bottom: 66px; }
.project-card { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.project-card:hover { transform: translateY(-3px); border-color: var(--strong-line); box-shadow: var(--shadow); }
.project-cover { display: block; position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #dfe5e1; border-bottom: 1px solid var(--line); }
.project-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.project-card:hover .project-cover img { transform: scale(1.025); }
.cover-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #718078; }
.cover-placeholder svg { width: 72px; height: 72px; fill: none; stroke: currentColor; stroke-width: 1; }
.card-flags { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 8px; }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 3px; color: var(--green-dark); background: rgba(232, 244, 237, .94); border: 1px solid rgba(15, 107, 75, .2); font-size: 11px; font-weight: 700; }
.status.testing { color: #80500c; background: rgba(255, 244, 220, .95); border-color: #e8c887; }
.status.designing { color: var(--blue); background: rgba(231, 240, 247, .95); border-color: #b6ccdc; }
.status.paused, .status.archived { color: var(--muted); background: rgba(240, 241, 240, .95); border-color: #ced3d0; }
.visibility { padding: 4px 8px; color: #fff; background: rgba(23, 32, 29, .8); border-radius: 3px; font-size: 10px; }
.card-content { padding: 18px; }
.card-kicker { display: flex; align-items: center; justify-content: space-between; min-height: 20px; color: var(--muted); font-size: 11px; }
.project-card h2 { margin: 9px 0 8px; font-size: 20px; line-height: 1.28; }
.project-card h2 a { text-decoration: none; }
.project-card p { min-height: 66px; margin: 0; color: var(--muted); line-height: 1.58; font-size: 13px; }
.tag-row { min-height: 26px; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 16px; }
.tag { display: inline-flex; padding: 3px 7px; color: #42504a; background: var(--surface-alt); border-radius: 3px; font-size: 10px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.card-link { color: var(--green); font-weight: 700; text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.empty-state { grid-column: 1 / -1; padding: 70px 24px; text-align: center; border: 1px dashed var(--strong-line); background: rgba(255,255,255,.4); }
.empty-state svg { width: 48px; fill: none; stroke: var(--muted); stroke-width: 1.3; }
.empty-state h2 { margin: 16px 0 6px; font-size: 20px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); }
.detail-shell { width: min(1100px, calc(100% - 36px)); margin: 0 auto; padding: 34px 0 76px; }
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; text-decoration: none; }
.back-link:hover { color: var(--green); }
.back-link svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.detail-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: clamp(32px, 6vw, 78px); align-items: center; padding: 34px 0 46px; border-bottom: 1px solid var(--strong-line); }
.detail-cover { width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #dde3df; border: 1px solid var(--line); border-radius: var(--radius); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-heading h1 { margin: 12px 0; font-size: 54px; line-height: 1.04; }
.detail-summary { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.72; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.project-facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0; margin-top: 28px; border-top: 1px solid var(--line); }
.fact { padding: 12px 0; border-bottom: 1px solid var(--line); }
.fact:nth-child(odd) { padding-right: 16px; }
.fact small { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; text-transform: uppercase; }
.fact b { font-size: 13px; font-weight: 650; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 245px; gap: clamp(36px, 7vw, 86px); padding-top: 42px; }
.prose { min-width: 0; font-size: 15px; line-height: 1.78; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3 { line-height: 1.28; margin: 1.7em 0 .65em; }
.prose h1 { font-size: 29px; }
.prose h2 { padding-bottom: 8px; font-size: 23px; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 18px; }
.prose p, .prose ul, .prose ol { margin: .7em 0; }
.prose img { max-width: 100%; height: auto; border-radius: 4px; }
.prose a { color: var(--green); text-underline-offset: 3px; }
.prose code { padding: 2px 5px; background: #e5e9e6; border-radius: 3px; }
.prose pre { max-width: 100%; overflow: auto; padding: 16px; color: #e9f1ed; background: #1c2823; border-radius: 4px; }
.prose pre code { padding: 0; background: transparent; }
.mermaid-diagram { width: 100%; margin: 22px 0; overflow-x: auto; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; text-align: center; }
.mermaid-diagram svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.mermaid-diagram.mermaid-error { color: var(--red); text-align: left; white-space: pre-wrap; }
.prose blockquote { margin-left: 0; padding-left: 18px; color: var(--muted); border-left: 3px solid var(--green); }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { padding: 8px; border: 1px solid var(--line); text-align: left; }
.detail-aside { font-size: 12px; }
.aside-section { padding: 16px 0; border-top: 1px solid var(--line); }
.aside-section h3 { margin: 0 0 10px; font-size: 11px; text-transform: uppercase; color: var(--muted); }
.aside-links { display: flex; flex-direction: column; gap: 8px; }
.aside-links a { color: var(--green); overflow-wrap: anywhere; }
.editor-shell { width: min(1480px, calc(100% - 28px)); margin: 0 auto; padding: 24px 0 70px; }
.editor-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.editor-header h1 { margin: 3px 0 0; font-size: 27px; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.editor-layout { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.editor-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.meta-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; padding: 18px 20px 6px; }
.meta-panel .panel-title { grid-column: 1 / -1; }
.meta-panel > .field { min-width: 0; }
.meta-panel > .link-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; }
.meta-panel > .link-fields > .field-grid { grid-column: 1 / -1; }
.panel-title { margin: 0 0 16px; padding-bottom: 10px; font-size: 14px; border-bottom: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { color: #43504b; font-size: 11px; font-weight: 700; }
.field em { color: var(--red); font-style: normal; }
.field input, .field textarea, .field select { width: 100%; min-height: 40px; padding: 9px 10px; color: var(--ink); background: #fbfcfb; border: 1px solid var(--line); border-radius: 3px; }
.field textarea { min-height: 82px; resize: vertical; line-height: 1.5; }
.field-help { margin-top: -1px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field input[readonly] { color: var(--muted); background: var(--surface-alt); }
.link-fields { padding-top: 10px; border-top: 1px solid var(--line); }
.content-panel { min-width: 0; overflow: hidden; }
.editor-tabs { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-alt); border-radius: 4px; }
.segment { min-height: 32px; padding: 5px 12px; background: transparent; border: 0; border-radius: 3px; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.segment.active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.upload-button { position: relative; overflow: hidden; }
.upload-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.content-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 68vh; }
#content-input { width: 100%; height: 68vh; min-height: 520px; display: block; resize: none; overflow: auto; padding: 22px; border: 0; outline: 0; background: #fbfcfb; line-height: 1.65; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.editor-preview-pane { min-width: 0; height: 68vh; min-height: 520px; overflow: auto; border-left: 1px solid var(--line); }
.editor-preview { min-height: 100%; padding: 24px 30px; }
.content-panel.mode-write .editor-preview-pane { display: none; }
.content-panel.mode-write .content-workspace { grid-template-columns: 1fr; }
.content-panel.mode-preview #content-input { display: none; }
.content-panel.mode-preview .editor-preview-pane { border-left: 0; height: auto; min-height: 68vh; }
.content-panel.mode-preview .content-workspace { grid-template-columns: 1fr; }
.editor-status { min-height: 20px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.editor-status.error, .form-message.error { color: var(--red); }
.history-panel { margin-top: 18px; padding: 18px; }
.revision-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 12px; }
.revision-row small { display: block; color: var(--muted); margin-top: 3px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; background: rgba(16, 25, 21, .62); }
.modal { width: min(430px, 100%); padding: 25px; background: var(--surface); border-radius: var(--radius); box-shadow: 0 24px 80px rgba(0,0,0,.25); }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.modal-heading h2 { margin: 0 0 8px; font-size: 24px; }
.modal-copy { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.form-message { min-height: 20px; margin: 3px 0 10px; font-size: 12px; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { max-width: min(360px, calc(100vw - 36px)); padding: 11px 14px; color: white; background: var(--ink); border-radius: 4px; box-shadow: var(--shadow); font-size: 12px; }
.toast.error { background: var(--red); }
.site-footer { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px clamp(18px, 4vw, 56px); color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
.site-footer a { color: var(--green); }
.loading { padding: 100px 24px; color: var(--muted); text-align: center; }
@media (max-width: 960px) { .catalog-intro h1 { font-size: 52px; } .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .meta-panel, .meta-panel > .link-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .detail-hero { grid-template-columns: 1fr; } .detail-cover { max-width: 720px; } }
@media (max-width: 760px) { .catalog-intro { grid-template-columns: 1fr; gap: 22px; padding-top: 44px; } .toolbar { grid-template-columns: 1fr 1fr; } .search-wrap { grid-column: 1 / -1; } .toolbar .button { grid-column: 1 / -1; } .detail-layout { grid-template-columns: 1fr; } .detail-aside { order: -1; } .meta-panel, .meta-panel > .link-fields { grid-template-columns: 1fr; } .meta-panel > .link-fields > .field-grid { grid-template-columns: 1fr; } .content-workspace { grid-template-columns: 1fr; } .editor-preview-pane { border-left: 0; border-top: 1px solid var(--line); } #content-input, .editor-preview-pane { min-height: 480px; height: 58vh; } .content-panel.mode-write .editor-preview-pane { display: none; } .content-panel.mode-preview #content-input { display: none; } }
@media (max-width: 560px) { .site-header { min-height: 62px; padding: 8px 14px; } .brand small, .user-badge { display: none; } .shell, .detail-shell { width: min(100% - 24px, 1180px); } .catalog-intro h1 { font-size: 38px; } .project-grid { grid-template-columns: 1fr; } .toolbar { grid-template-columns: 1fr; } .search-wrap, .toolbar .button { grid-column: auto; } .catalog-meta { flex-direction: column; } .detail-shell { padding-top: 22px; } .detail-hero { padding-top: 24px; } .project-facts { grid-template-columns: 1fr; } .fact:nth-child(odd) { padding-right: 0; } .editor-shell { width: min(100% - 18px, 1280px); padding-top: 14px; } .editor-header { align-items: flex-start; flex-direction: column; } .editor-actions { width: 100%; justify-content: flex-start; } .editor-actions .button { flex: 1; } .field-grid { grid-template-columns: 1fr; gap: 0; } .editor-tabs { align-items: stretch; flex-direction: column; } .upload-button { width: 100%; } .editor-preview { padding: 18px; } .site-footer { align-items: flex-start; flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
