@charset "utf-8";
:root {
  --ink: #163e39;
  --paper: #f6f3ea;
  --gold: #a6874f;
  --line: #d8d5c7;
  --soft: #ecebdc;
  --red: #a23b30;
  color-scheme: light;
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button,
.button {
  cursor: pointer;
  border: 1px solid var(--ink);
  padding: 12px 18px;
  border-radius: 5px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  line-height: 1.5;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:hover,
.button:hover {
  filter: brightness(0.95);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #b69254;
  outline-offset: 3px;
}
.primary,
.button:not(.quiet) {
  background: var(--ink);
  color: #fff;
}
.secondary {
  background: #fffdf5;
}
.quiet {
  border-color: var(--line);
  font-weight: 400;
}
.demo-banner {
  text-align: center;
  background: #e7dabc;
  color: #584622;
  font-size: 12px;
  padding: 7px 16px;
}
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  margin: auto;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Songti SC", SimSun, serif;
  font-size: 24px;
  font-weight: bold;
}
.brand b {
  font-size: 46px;
  font-weight: 400;
  letter-spacing: -3px;
  border-right: 1px solid var(--gold);
  padding-right: 16px;
  color: var(--gold);
}
.brand small {
  display: block;
  font: 11px/1.7 sans-serif;
  letter-spacing: 1px;
  margin-top: 3px;
}
main {
  max-width: 1200px;
  margin: auto;
  padding: 0 28px;
}
.hero {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  gap: 60px;
  padding: 60px 0 44px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2.8px;
  color: var(--gold);
  font-weight: 700;
}
h1,
h2,
h3 {
  font-family: "Songti SC", SimSun, serif;
  font-weight: 600;
}
h1 {
  font-size: 43px;
  line-height: 1.45;
  letter-spacing: 1px;
  margin: 20px 0;
}
h1 span {
  color: #987035;
}
h2 {
  font-size: 29px;
  margin: 10px 0 20px;
}
h3 {
  font-size: 22px;
}
p {
  line-height: 1.85;
  color: #52655a;
}
.hero .button {
  margin-top: 16px;
  min-width: 265px;
}
.fine {
  font-size: 12px;
  line-height: 1.75;
  color: #788074;
}
.hero-photo {
  position: relative;
  margin: 0;
  transform: rotate(1deg);
  border: 10px solid #fffefa;
  box-shadow: 0 12px 36px #183e3912;
}
.hero-photo img {
  width: 100%;
  height: 325px;
  object-fit: cover;
  display: block;
}
.hero-photo figcaption {
  font:
    13px/2.8 "Songti SC",
    serif;
  padding: 0 10px;
}
.edition {
  position: absolute;
  right: 16px;
  bottom: 58px;
  background: #f8f4e9ee;
  border: 1px solid var(--gold);
  padding: 12px 15px;
  font-family: serif;
  line-height: 1.5;
  letter-spacing: 3px;
}
.stepbar {
  display: flex;
  border-top: 3px double var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 15px 0;
  justify-content: space-around;
  font-family: serif;
  letter-spacing: 2px;
}
.section {
  padding: 48px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 20px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.section-head p {
  font-size: 13px;
}
.template-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.template-filters button {
  border-color: var(--line);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  min-height: 44px;
}
.template-filters button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.template-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 16px;
  margin: 12px 0;
}
.template-summary p { margin: 4px 0; }
.more-templates { margin-top: 22px; width: 100%; }
.templates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.template {
  display: block;
  text-align: left;
  border: 1px solid var(--line);
  padding: 0;
  overflow: hidden;
  background: #fffcf5;
  position: relative;
}
.template.selected {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.template img {
  width: 100%;
  aspect-ratio: 1.75;
  object-fit: cover;
  display: block;
}
.template img.contain { object-fit: contain; background: var(--soft); }
.template div {
  padding: 13px 15px;
}
.template strong {
  font-family: serif;
  font-size: 19px;
  display: block;
  margin-bottom: 4px;
}
.template small {
  font-size: 11px;
  color: #7b8274;
}
.template .badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #fffdf1ed;
  padding: 4px 9px;
  font-size: 11px;
  border-radius: 2px;
}
.studio {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
  align-items: start;
}
.canvas-wrap {
  background: #e9e6dc;
  padding: 12px;
  border: 1px solid var(--line);
  position: sticky;
  top: 20px;
}
canvas {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
  background: #e2e5da;
}
.canvas-wrap p {
  margin: 8px 0 0;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
}
legend {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 10px;
}
.route-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.route-options label {
  font-size: 13px;
  margin: 0;
}
label {
  display: block;
  margin: 0 0 15px;
  font-size: 14px;
  line-height: 1.7;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(
    [type="file"]
  ),
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  border: 1px solid #c5cbbb;
  border-radius: 4px;
  padding: 11px;
  background: #fffef8;
  color: var(--ink);
  min-height: 44px;
  font-size: 16px;
}
textarea {
  resize: vertical;
  line-height: 1.7;
}
input[type="range"] {
  display: block;
  width: 100%;
  margin-top: 10px;
  accent-color: var(--ink);
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--ink);
  width: 17px;
  height: 17px;
  vertical-align: middle;
  flex-shrink: 0;
}
.check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.8;
}
.check input {
  margin-top: 4px;
}
.upload {
  border: 1px dashed var(--gold);
  padding: 14px;
  background: #f0eddf;
  text-align: center;
}
.upload input {
  display: block;
  font-size: 12px;
  width: 100%;
  margin-top: 12px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.row label {
  flex: 1;
  min-width: 110px;
}
.row button {
  flex: 1;
}
.story-section,
.feedback {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 60px;
}
.consents {
  background: #ebeede;
  padding: 18px;
  margin: 20px 0;
}
.consents strong {
  display: block;
  font-size: 14px;
  margin-bottom: 14px;
}
form > .primary {
  width: 100%;
}
.works {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.work {
  padding: 20px;
  background: #fffef8;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  word-break: break-word;
}
.work img {
  width: 100%;
  aspect-ratio: 1.5;
  object-fit: contain;
  background: #e9e6dc;
}
.work p {
  font-size: 13px;
  white-space: pre-wrap;
}
.work h3 {
  font-size: 20px;
  margin: 12px 0;
}
.work .status {
  font-size: 11px;
  background: #e9edde;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 3px;
}
.work button {
  font-size: 12px;
  padding: 8px 12px;
  margin: 5px 5px 0 0;
}
.lottery {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 35px;
}
.lottery-panel {
  background: #eee6d1;
  border: 1px solid #d5c6a5;
  text-align: center;
  padding: 28px;
}
.gift {
  font-size: 80px;
  color: var(--gold);
  display: block;
}
.lottery-panel button {
  width: 100%;
}
.lottery-panel p {
  font-size: 13px;
}
.drawing .gift {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
#claim-form {
  grid-column: 1/-1;
  max-width: 650px;
  width: 100%;
  margin: auto;
}
.privacy p {
  font-size: 12px;
}
details {
  font-size: 13px;
  line-height: 1.9;
}
summary {
  cursor: pointer;
  color: var(--ink);
}
footer {
  max-width: 1200px;
  margin: auto;
  padding: 30px 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 11px;
  color: #778270;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  width: min(740px, 94vw);
  max-height: 92vh;
  padding: 28px;
  box-shadow: 0 20px 100px #0003;
}
dialog::backdrop {
  background: #102f2ccc;
}
dialog h2 {
  font-size: 24px;
}
#login-dialog {
  max-width: 440px;
}
dialog p {
  font-size: 13px;
}
.preview-paper {
  border: 1px solid #c8c6b6;
  background: #fffdf2;
  padding: 22px;
  font-family: "Songti SC", serif;
}
.preview-paper .paper-name {
  text-align: center;
  font-size: 32px;
  border-bottom: 3px double var(--ink);
  padding: 12px;
}
.preview-paper img {
  width: 100%;
  display: block;
  margin: 15px 0;
}
.preview-paper .story {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.9;
}
.preview-paper .paper-meta {
  font: 10px/2 sans-serif;
  display: flex;
  justify-content: space-between;
}
.preview-paper h3 {
  font-size: 24px;
}
.preview-paper .paper-footer {
  border-top: 1px solid var(--ink);
  padding-top: 10px;
  font: 11px/1.7 sans-serif;
  color: #72796e;
}
#export-images img {
  width: 100%;
  display: block;
  margin: 20px 0 10px;
  border: 1px solid var(--line);
  background: white;
}
#export-images a {
  display: inline-block;
  margin: 0 15px 15px 0;
  color: var(--ink);
}
#toast {
  position: fixed;
  z-index: 9999;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  box-shadow: 0 5px 30px #0003;
  border-radius: 6px;
  padding: 14px 22px;
  max-width: 90vw;
  line-height: 1.6;
  font-size: 14px;
}
.admin-main {
  max-width: 1250px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin: 25px 0;
}
.metric {
  border: 1px solid var(--line);
  padding: 18px;
  background: #fffdf5;
}
.metric strong {
  font-size: 28px;
  display: block;
}
.metric span {
  font-size: 12px;
}
.admin-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-top: 22px;
}
.admin-grid .work img {
  max-height: 330px;
}
.admin-grid .work pre,
pre {
  white-space: pre-wrap;
  word-break: break-word;
}
.admin-grid .work textarea {
  font-size: 14px;
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 13px;
}
th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.notice {
  border-left: 3px solid var(--gold);
  background: #eee8d6;
  padding: 12px 18px;
  font-size: 13px;
  line-height: 1.8;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
}
.admin-main form {
  max-width: 680px;
}
body.printing > :not(#export-dialog) {
  display: none;
}
body.printing #export-dialog {
  display: block;
  position: static;
  max-height: none;
  border: 0;
  width: auto;
  padding: 0;
}
.print-sheet {
  display: none;
}
[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  .masthead {
    flex-wrap: wrap;
    padding: 18px 18px;
    gap: 8px;
  }
  .brand {
    font-size: 18px;
    gap: 10px;
  }
  .brand b {
    font-size: 36px;
    padding-right: 12px;
  }
  .brand small {
    font-size: 9px;
  }
  .masthead button {
    font-size: 11px;
    padding: 8px;
  }
  main {
    padding: 0 18px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 32px 0;
  }
  h1 {
    font-size: 34px;
    margin: 15px 0;
  }
  h2 {
    font-size: 25px;
  }
  .hero p {
    font-size: 14px;
  }
  .hero-photo img {
    height: 240px;
  }
  .hero-photo {
    margin: 5px 4px;
  }
  .hero .button {
    width: 100%;
    margin-top: 10px;
  }
  .stepbar {
    font-size: 12px;
    letter-spacing: 0;
    gap: 8px;
  }
  .section {
    padding: 32px 0;
  }
  .section-head {
    align-items: flex-start;
  }
  .section-head > p {
    max-width: 140px;
    font-size: 11px;
  }
  .templates {
    grid-template-columns: repeat(2, 1fr);
    gap: 13px;
  }
  .template div {
    padding: 10px;
  }
  .template strong {
    font-size: 16px;
  }
  .template small {
    font-size: 10px;
  }
  .template .badge {
    top: 8px;
    left: 8px;
    font-size: 10px;
  }
  .studio,
  .story-section,
  .feedback,
  .lottery {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .canvas-wrap {
    position: static;
    padding: 8px;
  }
  .works {
    grid-template-columns: 1fr;
  }
  .work {
    padding: 17px;
  }
  .controls {
    padding: 0 4px;
  }
  .story-section > div p {
    font-size: 13px;
  }
  .feedback p {
    font-size: 13px;
  }
  footer {
    padding: 24px 18px;
    display: block;
    line-height: 2;
  }
  footer span {
    display: block;
  }
  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }
  .metric {
    padding: 12px;
  }
  .metric strong {
    font-size: 23px;
  }
  .admin-grid {
    grid-template-columns: 1fr;
  }
  dialog {
    padding: 18px;
  }
  .preview-paper {
    padding: 15px;
  }
  .preview-paper .paper-name {
    font-size: 26px;
  }
  #export-dialog .row {
    display: block;
  }
  #export-dialog .row button {
    margin: 5px 5px 5px 0;
  }
}
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }
  body > * {
    display: none !important;
  }
  #export-dialog[open] {
    display: block !important;
    position: static;
    width: 100%;
    padding: 0;
    border: 0;
    max-height: none;
    overflow: visible;
  }
  #export-dialog > * {
    display: none !important;
  }
  #export-dialog #export-images {
    display: block !important;
  }
  #export-images > * {
    display: none !important;
  }
  #export-images img.newspaper-export {
    display: block !important;
    width: 100%;
    height: auto;
    margin: 0;
    border: 0;
    page-break-inside: avoid;
  }
}
.gallery-large {
  width: 100%;
  height: auto;
}
.story {
  white-space: pre-wrap;
  word-break: break-word;
}

/* v0.5: authentic anniversary mark, optional copy, truthful progress, HTTP save. */
.brand-logo { width: 158px; height: auto; padding: 12px; background: var(--ink); border-radius: 3px; }
.paper-brand { background: var(--ink); display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 16px; }
.preview-paper .paper-brand img { width: 145px; height: auto; margin: 0; }
.paper-brand span { font: 11px/1.8 sans-serif; color: #efe3bf; text-align: right; white-space: pre-line; }
.segment-wait { border: 1px solid var(--line); padding: 12px; margin: 12px 0; background: #fffdf5; }
.segment-wait progress { width: calc(100% - 25px); height: 12px; accent-color: var(--ink); }
.working-dot { display: inline-block; width: 10px; height: 10px; margin-left: 10px; background: var(--gold); border-radius: 50%; animation: waiting-pulse 1s ease-in-out infinite alternate; }
@keyframes waiting-pulse { to { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .working-dot { animation: none; } }
.copy-trigger { font-size: 13px; padding: 8px 14px; margin: -5px 0 18px; }
.copy-candidate { padding: 20px; background: #ecebdc; font: 20px/1.9 "Songti SC", serif; color: var(--ink); }
#copy-dialog { max-width: 560px; }
#export-images img, #save-image { -webkit-touch-callout: default; user-select: auto; touch-action: auto; }
#export-images .save-original { font-weight: 700; text-decoration-thickness: 2px; }
.save-page main { max-width: 900px; padding-top: 28px; padding-bottom: 40px; }
.save-page h1 { font-size: 30px; }
#save-image { width: 100%; height: auto; margin: 15px 0; }
#save-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#save-actions[hidden] { display: none; }
@media (max-width: 600px) {
  .masthead { flex-wrap: wrap; gap: 10px; }
  .brand { width: 100%; font-size: 22px; gap: 12px; }
  .brand-logo { width: 125px; padding: 10px; }
  .brand small { font-size: 10px; letter-spacing: 0; }
  .preview-paper .paper-brand img { width: 130px; }
  .paper-brand { padding: 12px; gap: 10px; }
}
