/* 墨页 Markdown — cobalt ink, coral marks, editorial preview. Shared shell: base.css */
:root {
  --accent: #25527a;
  --accent-dark: #15334d;
  --accent-soft: #dce9f2;
  --md-blue: #25527a;
  --md-blue-deep: #132b40;
  --md-blue-ink: #0e2233;
  --md-coral: #df674e;
  --md-coral-dark: #a8432f;
  --md-gold: #e8b44f;
  --md-paper: #fffdf7;
  --md-soft: #f3eee3;
  --md-line: #d8cdbb;
  --md-green: #397a61;
}

body {
  background-image:
    radial-gradient(circle at 94% 3%, rgba(37, 82, 122, .16), transparent 31rem),
    radial-gradient(circle at 0% 48%, rgba(223, 103, 78, .07), transparent 27rem),
    linear-gradient(rgba(25, 21, 16, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 21, 16, .035) 1px, transparent 1px);
  background-size: auto, auto, 28px 28px, 28px 28px;
}

::selection { color: var(--md-paper); background: var(--md-blue-deep); }
.brand-mark.md-brand-mark {
  color: var(--md-paper);
  background: var(--md-blue);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: -.08em;
}
.eyebrow span { background: var(--md-blue-deep); }
.top-nav a::after { background: var(--md-coral); }
.site-footer { background: #142b3e; }
.premium-chip { background: var(--md-coral-dark); border-color: var(--md-coral-dark); }
.lock-dot { background: var(--md-coral-dark); }

/* Hero */
.md-hero {
  grid-template-columns: minmax(0, 1.14fr) minmax(330px, .86fr);
  gap: clamp(38px, 7vw, 92px);
  padding-block: clamp(54px, 7.5vw, 98px) 70px;
}
.md-hero .hero-lead { max-width: 620px; }
.md-hero h1 em { color: var(--md-blue-deep); }
.md-hero h1 em::after { background: var(--md-coral); opacity: .28; }
.md-hero .hero-facts span {
  border-color: #c8baa5;
  background: rgba(255, 253, 247, .68);
}

.md-hero-art {
  position: relative;
  width: min(100%, 486px);
  justify-self: end;
  padding: 9px 18px 27px 0;
}
.hero-sheet {
  position: relative;
  z-index: 1;
  padding: 16px;
  color: #e8efe8;
  background: var(--md-blue-ink);
  border: 2px solid var(--ink);
  border-radius: 22px;
  box-shadow: 12px 12px 0 var(--md-coral);
  transform: rotate(1.3deg);
}
.hero-sheet::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(220, 233, 242, .12);
  border-radius: 16px;
  pointer-events: none;
}
.hero-sheet-top,
.hero-sheet-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #9eb2c3;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
}
.hero-sheet-top { padding: 1px 4px 13px; border-bottom: 1px dashed rgba(220, 233, 242, .2); }
.hero-sheet-top > span { display: inline-flex; align-items: center; gap: 8px; color: #d9e5ec; letter-spacing: .03em; }
.hero-sheet-top > span i { width: 8px; height: 8px; border-radius: 50%; background: var(--md-coral); box-shadow: 0 0 0 4px rgba(223, 103, 78, .16); }
.hero-sheet-top b {
  padding: 4px 7px;
  color: var(--md-blue-ink);
  background: #9ed6a9;
  border-radius: 3px;
  font-size: 8px;
  letter-spacing: .1em;
}
.hero-sheet-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  gap: 10px;
  padding: 13px 0;
}
.hero-source {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 11px 9px;
  min-width: 0;
  background: #0a1c2b;
  border: 1px solid #29445a;
  border-radius: 8px;
}
.src-line {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 5px;
  align-items: baseline;
  min-width: 0;
  min-height: 20px;
  color: #c7d3d8;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.85;
}
.src-line > i { color: #597185; font-size: 7px; font-style: normal; text-align: right; }
.src-line > code { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.src-line b { color: var(--md-gold); font-weight: 500; }
.src-line.is-hot { margin-inline: -3px; padding-inline: 3px; background: rgba(223, 103, 78, .15); border-left: 2px solid var(--md-coral); }
.src-line.is-hot b { color: #f2a188; }
.hero-rendered {
  min-width: 0;
  padding: 12px 12px 11px;
  color: #28313a;
  background: var(--md-paper);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px #e3dacb;
}
.rendered-kicker { display: block; margin-bottom: 7px; color: var(--md-coral-dark); font-family: var(--font-mono); font-size: 6.5px; letter-spacing: .12em; }
.rendered-title { display: block; font-family: var(--font-display); font-size: 15px; line-height: 1.25; }
.hero-rendered p { margin: 7px 0 8px; color: #62707b; font-size: 8px; line-height: 1.55; }
.hero-rendered ul { display: grid; gap: 3px; margin: 0 0 9px; padding-left: 13px; color: #4f5d66; font-size: 7.5px; line-height: 1.4; }
.rendered-table { display: grid; grid-template-columns: 1fr 1fr; font-size: 6.8px; border: 1px solid #ded4c4; border-radius: 3px; overflow: hidden; }
.rendered-table span { padding: 2px 3px; color: var(--md-blue-deep); background: #e7eef2; font-weight: 700; }
.rendered-table i { padding: 2px 3px; color: #64717a; border-top: 1px solid #e9e1d4; font-style: normal; }
.hero-sheet-foot { padding: 12px 4px 2px; border-top: 1px dashed rgba(220, 233, 242, .2); font-size: 7.5px; }
.hero-seal {
  position: absolute;
  z-index: 2;
  right: -8px;
  bottom: 2px;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  color: #fff7f2;
  background: var(--md-coral);
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.22;
  text-align: center;
  transform: rotate(-8deg);
}

/* Workbench */
.md-workbench {
  scroll-margin-top: 24px;
}
.desk-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 34px;
  padding-bottom: 16px;
  border-bottom: 1px dashed #bfae97;
}
.desk-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -.05em;
}
.desk-heading > p {
  max-width: 450px;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}
.mobile-switch {
  display: none;
  gap: 4px;
  width: min(100%, 360px);
  margin: 18px 0 0;
  padding: 4px;
  background: #e8dfcf;
  border: 1px solid #bfae97;
  border-radius: 12px;
}
.mobile-tab {
  flex: 1;
  min-height: 44px;
  padding: 8px 13px;
  color: var(--md-blue-deep);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.mobile-tab.is-active { color: var(--md-paper); background: var(--md-blue); box-shadow: 2px 2px 0 var(--ink); }

.md-split {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  gap: 24px;
  align-items: start;
  margin-top: 22px;
}
.md-editor-card,
.md-preview-card { min-width: 0; border-radius: 20px; }
.md-editor-card {
  background: rgba(255, 252, 245, .97);
  box-shadow: 6px 6px 0 var(--md-blue);
}
.md-preview-card {
  position: sticky;
  top: 22px;
  background: rgba(255, 253, 247, .98);
  box-shadow: 6px 6px 0 var(--md-coral);
}
.md-editor-card .status-pill { background: #f6eee0; border-color: #d2c4b0; }
.md-editor-card .status-pill.is-ok { color: var(--card); background: var(--md-green); border-color: var(--md-green); }
.md-preview-card .status-pill { background: #f1e6dc; border-color: #dcc7bc; }
.md-preview-card .status-pill.is-live { color: #fff; background: var(--md-coral-dark); border-color: var(--md-coral-dark); }
.md-editor-card .card-heading,
.md-preview-card .card-heading { margin-bottom: 17px; }

.editor-chrome,
.preview-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 7px 11px;
  color: #67717a;
  background: #ece4d5;
  border: 1px solid #d3c5b1;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .05em;
}
.chrome-dots { display: inline-flex; gap: 4px; }
.chrome-dots i { width: 6px; height: 6px; border-radius: 50%; background: #b9a68d; }
.chrome-dots i:first-child { background: var(--md-coral); }
.chrome-file,
.preview-file { color: var(--md-blue-deep); font-weight: 700; }
.chrome-meta { margin-left: auto; color: #7d7468; }
.md-editor {
  display: block;
  width: 100%;
  min-height: 420px;
  height: 440px;
  margin: 0;
  padding: 18px 19px;
  resize: vertical;
  color: #28333c;
  background:
    linear-gradient(90deg, rgba(37, 82, 122, .036) 1px, transparent 1px) 0 0 / 34px 100%,
    #fffdf8;
  border: 1px solid #d3c5b1;
  border-radius: 0 0 11px 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.8;
  tab-size: 2;
}
.md-editor:focus { border-color: var(--md-blue); outline: none; box-shadow: 0 0 0 3px rgba(37, 82, 122, .15); }
.md-editor::placeholder { color: #9b9183; }

.format-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #d4c7b4;
}
.format-button {
  min-height: 38px;
  padding: 6px 10px;
  color: var(--md-blue-deep);
  background: #f5eddf;
  border: 1px solid #cbbdaa;
  border-radius: 7px;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.format-button:hover { background: #fffaf0; transform: translateY(-1px); }
.format-button:active { transform: translateY(0); }
.format-button strong { font-weight: 850; }
.format-button em { font-family: var(--font-display); font-size: 13px; }
.format-button.is-soft { color: #62594d; }
.format-spacer { flex: 1 1 12px; }

.run-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}
.run-main { flex: 1 1 190px; }
.run-main span { font-family: var(--font-mono); font-size: 16px; }
.run-secondary { flex: 0 1 152px; background: #f5eddf; }
.field-help kbd {
  padding: 1px 4px;
  color: var(--md-blue-deep);
  background: #eee6d7;
  border: 1px solid #cec0ac;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
}
.md-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 17px;
}
.md-stats > div {
  min-width: 0;
  padding: 10px 8px;
  background: #f5eedf;
  border: 1px solid #d4c6b2;
  border-radius: 8px;
  text-align: center;
}
.md-stats strong { display: block; color: var(--md-blue-deep); font-family: var(--font-mono); font-size: 17px; line-height: 1.2; }
.md-stats span { display: block; margin-top: 2px; color: #7b7164; font-size: 9px; }
.save-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 13px 0 0;
  color: #7c7265;
  font-size: 10.5px;
}
.save-note span { color: var(--md-green); font-size: 7px; }

/* Preview card */
.preview-chrome { background: #ece5dc; border-color: #dbcabf; }
.preview-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--md-coral); box-shadow: 0 0 0 4px rgba(223, 103, 78, .14); }
.preview-live { margin-left: auto; color: var(--md-green); font-size: 8px; letter-spacing: .08em; }
.preview-scroll {
  max-height: clamp(420px, 58vh, 620px);
  overflow: auto;
  background: var(--md-paper);
  border: 1px solid #dbcabf;
  border-radius: 0 0 11px 11px;
  scrollbar-color: #b7aa98 #f1e9dc;
}
#result.md-body {
  min-height: 380px;
  margin: 0;
  padding: 25px 27px 32px;
  color: #31363a;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 15px;
  line-height: 1.9;
  white-space: normal;
  overflow-wrap: anywhere;
}
#result.md-body:empty::before { content: none; }
.md-body > :first-child { margin-top: 0 !important; }
.md-body h1,
.md-body h2,
.md-body h3,
.md-body h4,
.md-body h5,
.md-body h6 {
  margin: 1.35em 0 .55em;
  color: #162b3e;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -.025em;
}
.md-body h1 {
  position: relative;
  margin-bottom: .8em;
  padding-bottom: .42em;
  font-size: clamp(28px, 3.1vw, 36px);
  line-height: 1.2;
  border-bottom: 2px solid #e7dac6;
}
.md-body h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 72px;
  height: 2px;
  background: var(--md-coral);
}
.md-body h2 { font-size: 25px; }
.md-body h3 { font-size: 20px; }
.md-body h4 { font-size: 17px; }
.md-body h5 { font-size: 15px; }
.md-body h6 { color: #64717a; font-size: 13px; letter-spacing: .06em; }
.md-body p { margin: 0 0 1.05em; }
.md-body strong { color: #192e42; font-weight: 750; }
.md-body em { color: #465864; }
.md-body del { color: #8b8377; }
.md-body a { color: var(--md-blue); text-decoration: underline; text-decoration-color: rgba(223, 103, 78, .7); text-underline-offset: 3px; }
.md-body a:hover { color: var(--md-coral-dark); }
.md-body ul,
.md-body ol { margin: .5em 0 1.2em; padding-left: 1.45em; }
.md-body li { margin: .28em 0; padding-left: .15em; }
.md-body li::marker { color: var(--md-coral-dark); }
.md-body li > ul,
.md-body li > ol { margin: .3em 0 .45em; }
.md-body blockquote {
  margin: 1.25em 0;
  padding: 13px 17px;
  color: #52616c;
  background: #eef4f7;
  border-left: 4px solid var(--md-blue);
  border-radius: 0 8px 8px 0;
}
.md-body blockquote > :last-child { margin-bottom: 0; }
.md-body blockquote blockquote { margin: .7em 0 0; background: #e5eef3; border-left-color: var(--md-coral); }
.md-body pre {
  margin: 1.3em 0;
  padding: 16px 17px;
  overflow: auto;
  color: #e7edf0;
  background: var(--md-blue-ink);
  border: 1px solid #0a1a28;
  border-radius: 10px;
  box-shadow: inset 3px 3px 0 rgba(0, 0, 0, .18);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}
.md-body pre code { padding: 0; color: inherit; background: transparent; border-radius: 0; font-size: inherit; }
.md-body code {
  padding: 2px 5px;
  color: #9a3f2c;
  background: #f2e8df;
  border: 1px solid #e7d7c9;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: .88em;
}
.md-body table {
  width: 100%;
  margin: 1.3em 0;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.65;
}
.md-body th,
.md-body td { padding: 8px 10px; border: 1px solid #d9cebd; text-align: left; vertical-align: top; }
.md-body th { color: var(--md-blue-deep); background: #ecf2f5; font-size: 12px; font-weight: 700; }
.md-body tbody tr:nth-child(even) td { background: #faf6ed; }
.md-body .align-center { text-align: center; }
.md-body .align-right { text-align: right; }
.md-body hr {
  height: 1px;
  margin: 2em 0;
  background: repeating-linear-gradient(90deg, #cbbda9 0 5px, transparent 5px 10px);
  border: 0;
}
.md-body br { line-height: 1.9; }
.md-placeholder { color: #8a8174; font-size: 13.5px; }
.preview-tip {
  margin: 14px 0 0;
  padding: 10px 12px;
  color: #5e594f;
  background: #f6efe3;
  border-left: 3px solid var(--md-coral);
  border-radius: 0 7px 7px 0;
  font-size: 11px;
  line-height: 1.65;
}
.preview-tip strong { color: var(--md-blue-deep); }
.privacy-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  color: #7b7165;
  border-top: 1px dashed #d5c8b5;
  font-size: 10.5px;
}
.privacy-strip span { color: var(--md-green); font-size: 7px; }

/* Publish bench */
.publish-shell { margin-top: 56px; scroll-margin-top: 28px; }
.publish-heading { margin-bottom: 22px; }
.publish-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}
.publish-card {
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 3vw, 30px);
  background: rgba(255, 252, 245, .97);
  border-radius: 20px;
}
.publish-card:first-child { box-shadow: 5px 5px 0 var(--md-blue); }
.publish-card:last-child { box-shadow: 5px 5px 0 var(--md-coral); }
.publish-art {
  position: relative;
  min-height: 148px;
  margin-bottom: 22px;
  padding: 16px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
}
.html-art {
  color: #d7e4ea;
  background:
    radial-gradient(circle at 100% 0%, rgba(232, 180, 79, .18), transparent 12rem),
    var(--md-blue-ink);
}
.art-file { display: flex; align-items: center; gap: 7px; margin-bottom: 14px; color: #f1e7d8; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .04em; }
.art-file i { padding: 2px 4px; color: var(--md-blue-ink); background: var(--md-gold); border-radius: 3px; font-size: 7px; font-style: normal; }
.art-line { display: block; height: 7px; margin-top: 9px; background: #35536a; border-radius: 10px; }
.art-line.w-90 { width: 90%; }
.art-line.w-84 { width: 84%; }
.art-line.w-72 { width: 72%; }
.art-line.w-48 { width: 48%; background: var(--md-coral); }
.art-badge {
  position: absolute;
  right: 13px;
  bottom: 12px;
  padding: 3px 7px;
  color: var(--md-blue-ink);
  background: #e8dcc9;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: .08em;
}
.rich-art {
  color: #31363a;
  background: #fffdf8;
  transform: rotate(.4deg);
}
.rich-bar { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; }
.rich-bar i { width: 6px; height: 6px; background: #d5c9b7; border-radius: 50%; }
.rich-bar i:first-child { background: var(--md-coral); }
.rich-title-line { display: block; margin-bottom: 12px; color: var(--md-blue-deep); font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.rich-line { display: inline-block; width: 82%; height: 6px; margin: 0 3px 7px 0; background: #dfd6c8; border-radius: 10px; vertical-align: middle; }
.rich-line.w-88 { width: 88%; }
.rich-line.w-64 { width: 64%; }
.rich-line.w-52 { width: 52%; }
.rich-strong { display: inline-block; margin-right: 4px; padding: 2px 5px; color: #fff; background: var(--md-coral-dark); border-radius: 3px; font-size: 7.5px; vertical-align: middle; }
.rich-art .art-badge { color: #fff; background: var(--md-blue); }
.publish-copy { display: flex; flex: 1; flex-direction: column; }
.publish-copy .section-index { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.publish-copy .premium-chip { min-height: 21px; padding: 2px 7px; font-size: 8px; }
.publish-copy h3 { margin: 0; font-family: var(--font-display); font-size: clamp(24px, 2.8vw, 30px); line-height: 1.2; letter-spacing: -.03em; }
.publish-copy > p:not(.section-index):not(.lock-note) { margin: 11px 0 18px; color: var(--muted); font-size: 12.5px; line-height: 1.75; }
.publish-copy .button { margin-top: auto; }
.publish-copy .lock-note { margin: 15px 0 0; }
.publish-copy .button .lock-dot { margin-left: 3px; }

/* FAQ accent */
.markdown-faq details[open] summary { color: var(--md-blue-deep); }
.markdown-faq summary::after { color: var(--md-coral-dark); }

@media (max-width: 980px) {
  .md-hero { grid-template-columns: 1fr; }
  .md-hero-art { justify-self: start; width: min(100%, 540px); transform: translateX(4px); }
  .publish-grid { gap: 18px; }
}

@media (max-height: 760px) and (min-width: 901px) {
  .md-preview-card { position: static; }
}

@media (max-width: 900px) {
  .md-split { grid-template-columns: 1fr; }
  .md-preview-card { position: static; }
  .mobile-switch { display: flex; }
  .md-split[data-view="edit"] .md-preview-card { display: none; }
  .md-split[data-view="preview"] .md-editor-card { display: none; }
  .md-split[data-view="preview"] { margin-top: 18px; }
  .preview-scroll { max-height: 640px; }
  .publish-grid { grid-template-columns: 1fr; }
  .publish-card { display: grid; grid-template-columns: minmax(160px, .62fr) minmax(0, 1.38fr); gap: 22px; align-items: center; }
  .publish-art { margin-bottom: 0; min-height: 178px; }
  .publish-copy { min-height: 178px; }
}

@media (max-width: 700px) {
  .md-hero { gap: 36px; padding-bottom: 48px; }
  .md-hero-art { padding-right: 10px; }
  .hero-sheet { padding: 13px; box-shadow: 8px 8px 0 var(--md-coral); }
  .hero-sheet-grid { gap: 7px; }
  .hero-source { padding: 9px 7px; }
  .hero-rendered { padding: 10px; }
  .hero-seal { right: -5px; bottom: 6px; width: 56px; height: 56px; font-size: 10px; }
  .desk-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .desk-heading > p { max-width: none; text-align: left; }
  .mobile-switch { width: 100%; }
  .md-editor { min-height: 350px; height: 370px; font-size: 12.8px; }
  .md-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .run-main { flex: 1 0 100%; }
  .run-secondary { flex: 1 1 100%; }
  .preview-scroll { max-height: none; overflow: visible; }
  #result.md-body { min-height: 320px; padding: 21px 18px 26px; font-size: 14.5px; }
  .md-body h1 { font-size: 28px; }
  .md-body h2 { font-size: 23px; }
  .md-body h3 { font-size: 19px; }
  .publish-card { display: flex; gap: 0; }
  .publish-art { width: 100%; margin-bottom: 20px; min-height: 136px; }
  .publish-copy { min-height: 0; width: 100%; }
  .publish-copy > p:not(.section-index):not(.lock-note) { margin-bottom: 16px; }
  .publish-copy .button { margin-top: 0; }
}

@media (max-width: 520px) {
  .site-header .header-inner { align-items: flex-start; }
  .brand-copy strong { font-size: 14px; letter-spacing: .04em; }
  .top-nav { justify-content: flex-end; gap: 1px 10px; padding-top: 4px; font-size: 11px; }
  .hero-source { display: none; }
  .hero-sheet-grid { grid-template-columns: 1fr; }
  .hero-rendered { padding: 14px; }
  .rendered-title { font-size: 20px; }
  .hero-rendered p { font-size: 9px; }
  .hero-rendered ul { font-size: 8.5px; }
  .rendered-table { font-size: 7.8px; }
  .hero-seal { width: 50px; height: 50px; font-size: 9px; }
}

@media (max-width: 400px) {
  .md-hero-art { width: 100%; padding-right: 5px; }
  .hero-sheet { width: 100%; box-shadow: 6px 6px 0 var(--md-coral); }
  .hero-sheet-top { font-size: 8px; }
  .hero-sheet-foot { font-size: 6.8px; }
  .hero-seal { display: none; }
  .md-editor-card,
  .md-preview-card,
  .publish-card { padding: 17px; }
  .md-split { gap: 18px; }
  .md-editor { min-height: 320px; height: 340px; padding: 14px; font-size: 12.2px; }
  .format-button { flex: 1 1 auto; min-height: 42px; }
  .format-spacer { flex-basis: 100%; height: 0; }
  .format-button.is-soft { flex: 1 1 calc(50% - 3px); }
  .md-stats strong { font-size: 15px; }
  .md-stats span { font-size: 8.5px; }
  #result.md-body { padding: 18px 15px 23px; font-size: 14px; }
  .md-body h1 { font-size: 25px; }
  .md-body h2 { font-size: 21px; }
  .md-body pre { padding: 12px; font-size: 11px; }
  .md-body table { font-size: 12px; }
  .md-body th,
  .md-body td { padding: 6px 7px; }
  .publish-art { min-height: 120px; padding: 13px; }
  .rich-title-line { font-size: 16px; }
}

@media (max-width: 700px), (pointer: coarse) {
  .format-button { min-height: 44px; }
  .mobile-tab { min-height: 46px; }
  .md-body a { padding-block: 2px; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-seal { animation: md-seal-float 5.4s ease-in-out infinite; }
  .src-line.is-hot { animation: md-focus 4.6s ease-in-out infinite; }
  .preview-dot { animation: md-live 2.4s ease-in-out infinite; }
  @keyframes md-seal-float {
    0%, 78%, 100% { transform: rotate(-8deg); }
    88% { transform: rotate(-3deg) translateY(-2px); }
  }
  @keyframes md-focus {
    0%, 55%, 100% { background: rgba(223, 103, 78, .15); }
    68% { background: rgba(223, 103, 78, .28); }
  }
  @keyframes md-live {
    0%, 100% { box-shadow: 0 0 0 4px rgba(223, 103, 78, .12); }
    50% { box-shadow: 0 0 0 6px rgba(223, 103, 78, .19); }
  }
}
