:root {
  color-scheme: light;
  font-family: ui-rounded, "SF Pro Rounded", "Noto Sans TC", system-ui, sans-serif;
  background: #fff7f2;
  color: #1f1a18;
  line-height: 1.55;
}

* { box-sizing: border-box; }

body { margin: 0; }

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

.shell { width: min(100% - 2rem, 48rem); margin: 0 auto; padding: 3.5rem 0 5rem; }

.hero { padding: 1rem 0 2rem; }

.eyebrow, .step { color: #c13d21; font-size: .78rem; font-weight: 800; letter-spacing: .1em; margin: 0; }

h1, h2, p { margin-top: 0; }

h1 { font-size: clamp(2.25rem, 9vw, 4.25rem); letter-spacing: -.06em; line-height: 1.03; margin-bottom: .75rem; }

h2 { font-size: 1.2rem; margin: 0; }

.hero > p:last-child { color: #665b55; font-size: 1.05rem; max-width: 40rem; }

.card { background: #fff; border: 1px solid #f0d9ce; border-radius: 1.25rem; box-shadow: 0 8px 24px rgba(88, 41, 25, .06); margin: 1rem 0; padding: 1.4rem; }

.section-heading { align-items: baseline; display: flex; gap: .7rem; margin-bottom: .85rem; }

.hint { color: #756a64; font-size: .9rem; }

.warning { color: #9a4b20; margin: 1rem 0 0; }

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

label { color: #453a35; display: grid; font-size: .86rem; font-weight: 700; gap: .4rem; }

input, select, textarea { background: #fffdfa; border: 1px solid #d9c8be; border-radius: .65rem; color: #241f1d; min-height: 2.8rem; padding: .6rem .7rem; width: 100%; }

textarea { line-height: 1.6; resize: vertical; }

input:focus, select:focus, textarea:focus { border-color: #e45131; box-shadow: 0 0 0 3px #ffe0d5; outline: none; }

.wide { grid-column: 1 / -1; }

.actions { align-items: center; display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .25rem; }

.button { background: #e45131; border: 1px solid #e45131; border-radius: .65rem; color: #fff; cursor: pointer; font-weight: 800; min-height: 2.7rem; padding: .55rem .9rem; }

.button:hover:not(:disabled) { background: #c83c20; border-color: #c83c20; }

.button:disabled { cursor: not-allowed; opacity: .48; }

.secondary { background: #fff; color: #a63b25; }
.secondary:hover:not(:disabled) { background: #fff1ea; color: #8f2e1b; }
.tertiary { background: #f8eee9; border-color: #f8eee9; color: #703323; }
.danger { background: #fff; border-color: #d8a092; color: #a2291d; }
.danger:hover:not(:disabled) { background: #fff0ed; border-color: #c66a5a; color: #8c1d13; }

.status, .result { border-radius: .7rem; font-size: .92rem; margin: 1rem 0; padding: .8rem .9rem; }
.neutral { background: #f8eee9; color: #604d45; }
.success { background: #e9f7ed; color: #1d6b3a; }
.error { background: #fff0ed; color: #98291d; }
.working { background: #fff5d9; color: #805c00; }
.result a { color: inherit; font-weight: 800; }

.details { color: #645852; font-size: .9rem; padding: 1.5rem .25rem; }
.details h2 { font-size: 1rem; }
.details ul { padding-left: 1.2rem; }

.editor-card { border-color: #efd2c2; }
.editor-surface { display: grid; gap: .55rem; }
.format-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; }
.format-toolbar button { background: #fff7f2; border: 1px solid #d9c8be; border-radius: .45rem; color: #703323; cursor: pointer; min-height: 2.25rem; padding: .35rem .55rem; }
.format-toolbar button:hover { background: #ffe0d5; }
.visual-editor { background: #fffdfa; border: 1px solid #d9c8be; border-radius: .65rem; min-height: 14rem; padding: .8rem; }
.visual-editor:empty::before { color: #8a7d76; content: attr(data-placeholder); pointer-events: none; }
.visual-editor:focus { border-color: #e45131; box-shadow: 0 0 0 3px #ffe0d5; outline: none; }
.visual-editor h2,.visual-editor h3,.visual-editor p,.visual-editor blockquote,.visual-editor pre { margin: .55rem 0; }
.visual-editor blockquote { border-left: 3px solid #e45131; color: #6a554b; padding-left: .75rem; }
.visual-editor pre { background: #2a2421; border-radius: .5rem; color: #fff8f4; overflow: auto; padding: .7rem; }

.post-library { display: grid; gap: .6rem; margin-top: 1rem; }
.library-tools { display: grid; gap: .8rem; grid-template-columns: 1fr minmax(9rem, .35fr); margin: 1rem 0; }
.post-library button { align-items: center; background: #fffdfa; border: 1px solid #ead7ca; border-radius: .7rem; color: inherit; cursor: pointer; display: grid; gap: .15rem; grid-template-columns: auto 1fr auto; padding: .7rem .8rem; text-align: left; }
.post-library button[aria-current="true"] { border-color: #e45131; box-shadow: 0 0 0 2px #ffe0d5; }
.post-library .type { color: #a2462c; font-size: .8rem; font-weight: 800; }
.post-library .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-library .meta { color: #756a64; font-size: .8rem; }

.preview-row { align-items: stretch; display: grid; gap: 1rem; grid-template-columns: minmax(12rem, 18rem) 1fr; }

.photo-preview { align-items: center; background: #fff7f2; border: 1px dashed #d9b4a5; border-radius: .8rem; display: grid; margin: 0; min-height: 12rem; overflow: hidden; position: relative; }

.photo-preview img { display: block; height: 100%; inset: 0; object-fit: cover; position: absolute; width: 100%; }

.photo-preview figcaption { align-self: end; background: rgba(255, 247, 242, .92); color: #6b5d56; font-size: .82rem; padding: .55rem .7rem; position: relative; width: 100%; }

.media-list { display: grid; gap: .7rem; }
.media-row { align-items: start; border-top: 1px solid #ead7ca; display: grid; gap: .8rem; grid-template-columns: 6rem 1fr; padding-top: .8rem; }
.media-row img { background: #fff7f2; border-radius: .55rem; height: 6rem; object-fit: cover; width: 6rem; }
.media-row .hint { margin: .45rem 0; }

.revision-panel { border-top: 1px solid #ead7ca; margin-top: .5rem; padding-top: 1rem; }
.revision-panel h3 { font-size: 1rem; margin: 0 0 .35rem; }
.revision-list { display: grid; gap: .45rem; }
.revision-row { align-items: center; border: 1px solid #ead7ca; border-radius: .55rem; display: flex; gap: .7rem; justify-content: space-between; padding: .55rem .65rem; }
.revision-row p { color: #756a64; font-size: .85rem; margin: 0; }

.result p { margin-bottom: .45rem; }

.result code { background: #fff7f2; border-radius: .35rem; padding: .1rem .35rem; }

@media (max-width: 40rem) {
  .shell { padding-top: 2rem; }
  .form-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .preview-row { grid-template-columns: 1fr; }
  .library-tools { grid-template-columns: 1fr; }
}
