:root {
  --ink: #1c1917;
  --muted: #78716c;
  --paper: #f5f0e8;
  --card: #fffcf7;
  --line: #e7e0d4;
  --accent: #9a3412;
  --accent-hover: #7c2d12;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 "Iowan Old Style", "Palatino Linotype", "Songti SC", serif;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.head h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

@media (max-width: 800px) {
  .board { grid-template-columns: 1fr; }
}

.composer, .preview-wrap, .code-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: 15px/1.45 ui-sans-serif, "PingFang SC", "Noto Sans SC", sans-serif;
  background: #fff;
  color: var(--ink);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.chips button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink);
}

.actions {
  display: flex;
  gap: 8px;
}

button#go, button.ghost {
  font: 15px/1 ui-sans-serif, "PingFang SC", sans-serif;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
}

button#go {
  border: 0;
  background: var(--accent);
  color: #fff;
}

button#go:hover { background: var(--accent-hover); }
button#go:disabled { opacity: 0.5; cursor: not-allowed; }

button.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

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

.progress {
  margin-top: 12px;
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: 35%;
  background: var(--accent);
  animation: progress-slide 1.1s ease-in-out infinite;
}

@keyframes progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.error { color: #b91c1c; font-size: 13px; margin: 10px 0 0; }

.canvas {
  min-height: 320px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(45deg, #efe8dc 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, #efe8dc 25%, transparent 25%) 0 0 / 16px 16px,
    #fff;
  border-radius: 8px;
}

.canvas svg {
  width: min(100%, 360px);
  height: auto;
  background: #fff;
}

.canvas metadata,
.canvas dc\:title,
.canvas dc\:creator,
.canvas dc\:description {
  display: none !important;
}

.placeholder { color: var(--muted); font-size: 14px; }

.code-wrap { margin-top: 20px; }

#code {
  font: 12px/1.4 ui-monospace, "SF Mono", Menlo, monospace;
  min-height: 140px;
}

/* 7.a.4 年龄闸门 */
.gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(28, 25, 23, 0.55);
}

.gate-card {
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}

.gate-card h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
}

.gate-lead { margin: 0 0 16px; font-size: 14px; }

.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}

.check input { margin-top: 3px; }

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.gate-actions button {
  font: 15px/1 ui-sans-serif, "PingFang SC", sans-serif;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
}

#gate-ok {
  border: 0;
  background: var(--accent);
  color: #fff;
}

#gate-ok:hover { background: var(--accent-hover); }
#gate-ok:disabled { opacity: 0.5; cursor: not-allowed; }

.gate-note { margin: 14px 0 0; font-size: 12px; color: var(--muted); }

/* 7.b.1 / 7.b.2 首页公示、7.f 投诉 */
.notice {
  margin-top: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.notice h2 {
  margin: 0 0 14px;
  font-size: 19px;
  font-weight: 600;
}

.notice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}

@media (max-width: 800px) {
  .notice-grid { grid-template-columns: 1fr; }
}

.notice-grid h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.notice-grid p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #44403c;
}

.notice-grid code {
  font: 12px/1 ui-monospace, Menlo, monospace;
  background: var(--paper);
  padding: 1px 4px;
  border-radius: 4px;
}

.notice-foot {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.cform { margin-top: 16px; }
.cform-row { margin-bottom: 12px; }

.cform select,
.cform input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: 15px/1.45 ui-sans-serif, "PingFang SC", "Noto Sans SC", sans-serif;
  background: #fff;
  color: var(--ink);
}

#c-submit {
  font: 15px/1 ui-sans-serif, "PingFang SC", sans-serif;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

#c-submit:hover { background: var(--accent-hover); }
#c-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.cmsg { margin: 10px 0 0; font-size: 13px; color: #15803d; }
.cmsg.bad { color: #b91c1c; }
