:root {
  color-scheme: light;
  --white: #fff;
  --mist: #f6f9fc;
  --line: #e5ecf3;
  --ink: #172a40;
  --muted: #53687e;
  --accent: #245aad;
  --accent-hover: #194789;
  --focus: #427cc8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, h3, p, ul { margin: 0; }
img { display: block; width: 100%; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-underline-offset: 0.25em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.shell { width: min(100% - 32px, 948px); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); }
.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  min-height: 62px;
  padding-block: 12px;
  font-size: 0.93rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.brand-mark {
  width: 18px;
  height: 18px;
  margin-inline: 3px 5px;
  display: inline-block;
  flex: none;
  transform: rotate(45deg);
  border: 1px solid var(--accent);
  border-radius: 6px 1px 6px 1px;
  background: linear-gradient(135deg, var(--mist) 50%, #dce9fa 50%);
}
.brand-divider, .brand-description { color: var(--muted); font-weight: 500; }

.entry {
  margin-block: 22px 26px;
  padding: 20px 17px 17px;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 14px;
}
h1 {
  font-family: "Noto Serif CJK SC", "Songti SC", "SimSun", serif;
  font-size: clamp(1.92rem, 5vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.entry-intro p, #item-subtitle { margin-top: 9px; color: var(--muted); font-size: 0.94rem; }
.unlock-form { margin-top: 16px; }
.unlock-form label { display: block; font-weight: 700; font-size: 0.87rem; margin-bottom: 6px; }
.input-row, .actions { display: grid; gap: 8px; }
.unlock-form input {
  appearance: none;
  min-width: 0;
  width: 100%;
  min-height: 46px;
  border: 1px solid #c9d8e8;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--white);
  color: var(--ink);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.unlock-form input::placeholder { color: #63788d; opacity: 1; }
.unlock-form input[aria-invalid="true"] { border-color: #ad2b3e; }
.field-error { color: #a12235; font-size: 0.86rem; margin-top: 9px; }
.button {
  min-height: 46px;
  display: inline-grid;
  place-items: center;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.93rem;
  font-weight: 700;
  text-align: center;
}
.primary { color: var(--white); background: var(--accent); }
.primary:hover { background: var(--accent-hover); }
.primary:disabled { cursor: wait; opacity: 0.7; }
.secondary { color: var(--ink); background: var(--white); border-color: #c9d8e8; }
.secondary:hover { background: var(--mist); }

.showcase { margin-bottom: 32px; }
h2 { font-size: 1.09rem; font-weight: 700; }
.showcase h2 { margin-bottom: 10px; }
.showcase-grid {
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.scene { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.scene img { height: auto; aspect-ratio: 1.33; object-fit: cover; object-position: center 60%; background: #e7eff7; }
.scene > div { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 0.46rem; padding: 8px 9px 9px; }
.scene-number { color: var(--accent); font: 700 0.83rem/1.4 Consolas, monospace; letter-spacing: 0.05em; }
.scene h3 { font-size: 0.84rem; font-weight: 650; overflow-wrap: anywhere; }

.site-footer { border-top: 1px solid var(--line); background: var(--mist); }
.footer-content { display: grid; gap: 3px; padding-block: 16px 18px; font-size: 0.82rem; color: var(--muted); }
#portfolio-link { width: fit-content; font-weight: 700; }
#portfolio-link:not([href]) { color: var(--ink); }

.delivery { max-width: 780px; margin-inline: auto; padding-block: 14px 38px; }
.text-button { min-height: 44px; padding: 0 4px; color: var(--accent); background: none; border: 0; font-size: 0.9rem; }
.text-button:hover { text-decoration: underline; }
.cover-banner { display: block; position: relative; width: 100%; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--mist); }
.cover-banner img { aspect-ratio: 1.5; object-fit: cover; object-position: center 58%; }
.cover-banner span { position: absolute; inset: auto 8px 8px auto; padding: 4px 9px; border-radius: 6px; color: var(--white); background: #122033e8; font-size: 0.76rem; }
.delivery-heading { margin-block: 16px; }
.delivery-heading h1 { margin-top: 4px; font-size: clamp(1.8rem, 5vw, 2.7rem); }
.actions { grid-template-columns: repeat(auto-fit, minmax(min(100%, 164px), 1fr)); }
.guide { margin-block: 18px 22px; border: 1px solid var(--line); border-radius: 9px; background: var(--mist); }
.guide summary { cursor: pointer; min-height: 46px; padding: 11px 14px; font-weight: 700; }
.guide ol { margin: 0; padding: 1px 16px 14px 39px; }
.guide li + li { margin-top: 10px; }
.guide li p { margin-top: 3px; color: var(--muted); font-size: 0.93rem; }
.prompt-section h2 { margin-bottom: 8px; }
.reader { isolation: isolate; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--mist); }
.reader pre { position: relative; min-height: 160px; margin: 0; padding: 17px; font: 0.93rem/1.8 Consolas, "Microsoft YaHei", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.reader pre:focus-visible { outline-offset: -3px; }
.watermark {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: space-around;
  justify-items: center;
  gap: 55px;
  padding-block: 45px;
  color: #2e5c8c;
  opacity: 0.15;
  font-size: clamp(0.75rem, 2vw, 1.15rem);
  font-weight: 700;
  pointer-events: none;
  user-select: none;
}
.watermark span { width: max-content; transform: rotate(-16deg); }

#lightbox { max-width: min(96vw, 1050px); max-height: 94dvh; padding: 0; border: 0; border-radius: 10px; background: #101b2b; }
#lightbox::backdrop { background: #0b1420e8; }
#lightbox img { width: auto; max-width: min(96vw, 1050px); max-height: 90dvh; object-fit: contain; }
#close-lightbox { position: absolute; top: 7px; right: 7px; min-width: 44px; min-height: 44px; border: 1px solid #ffffff77; border-radius: 50%; background: #122033ee; color: var(--white); font-size: 1.55rem; }
.toast { position: fixed; z-index: 1; inset: auto 12px max(18px, env(safe-area-inset-bottom)); width: fit-content; max-width: calc(100vw - 24px); margin: auto; border-radius: 8px; background: var(--ink); color: var(--white); padding: 10px 15px; font-size: 0.92rem; }
.toast:empty { opacity: 0; pointer-events: none; padding: 0; }

@media (min-width: 420px) {
  .input-row { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (min-width: 680px) {
  .shell { width: min(100% - 64px, 948px); }
  .entry { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 26px; padding: 30px; margin-block: 34px 30px; }
  .unlock-form { margin-top: 0; }
  .showcase h2 { margin-bottom: 14px; }
  .showcase-grid { gap: 18px; }
  .scene img { aspect-ratio: 1.67; }
  .scene > div { padding: 11px 14px; gap: 0.7rem; }
  .scene h3 { font-size: 0.98rem; }
  .cover-banner img { aspect-ratio: 2; }
  .footer-content { grid-template-columns: auto 1fr; gap: 16px; }
}
