:root {
  color-scheme: light;
  --paper: #f6f5ed;
  --ink: #2c4036;
  --muted: #5d6c5f;
  --line: #dcded2;
  --green: #34563e;
  --card: #f8f6eb;
  --bar: #faf9f0;
  --focus: #8a6a2c;
  --notice: #f1efdc;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Helvetica Neue", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

button,
select,
input {
  font: inherit;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
iframe:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.masthead {
  max-width: 1320px;
  min-height: 88px;
  margin: auto;
  padding: 16px 64px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font: 28px Georgia, "Times New Roman", serif;
  letter-spacing: -1px;
}

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

.language {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}

.layout {
  max-width: 1320px;
  margin: auto;
  padding: 56px 64px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 72px;
  align-items: start;
}

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

h1 {
  margin: 0 0 20px;
  font: 400 56px/1.08 Georgia, "Times New Roman", "Songti SC", serif;
  letter-spacing: -2px;
  overflow-wrap: anywhere;
}

.description {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.dev-guide {
  margin-top: 40px;
  max-width: 440px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.dev-guide h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.dev-guide ol {
  margin: 0;
  padding-left: 20px;
  font-size: 15px;
  color: var(--muted);
}

.dev-guide li + li {
  margin-top: 8px;
}

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

.experience {
  width: 100%;
}

.identity-controls {
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.identity-controls label {
  font-size: 14px;
  color: var(--muted);
}

.identity-controls select {
  min-width: 220px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fbfaf5;
  color: var(--ink);
  font-size: 15px;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid #cfd5c5;
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 25px 50px #35583b0c, 0 4px 10px #35583b07;
}

.host-bar {
  min-height: 72px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #dfe3d5;
  background: var(--bar);
}

.author-avatar {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #d2d9c5;
  border-radius: 50%;
  background: #edf0df;
  font: 20px Georgia, serif;
}

.author strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.author span {
  display: block;
  font-size: 14px;
  color: var(--muted);
}

.exit {
  margin-left: auto;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #dce2d0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
}

.preview,
.runtime {
  height: 628px;
}

.cover-frame {
  position: relative;
  height: 440px;
  overflow: hidden;
  background: #eaf0d8;
}

.cover-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  color: #4f6b45;
}

.cover-placeholder span {
  font: 80px Georgia, serif;
}

.cover-placeholder p {
  margin: 0;
  font-size: 15px;
}

.cover-overlay {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 24px;
}

.cover-badge {
  display: inline-block;
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fbfaf2e6;
  color: var(--ink);
  font-size: 14px;
}

.cover-overlay h2 {
  margin: 14px 0 0;
  font: 30px/1.2 Georgia, "Songti SC", serif;
  letter-spacing: -0.5px;
  overflow-wrap: anywhere;
}

.preview-bottom {
  padding: 20px 24px;
}

.participate {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  border: 0;
  border-radius: 4px;
  background: var(--green);
  color: #fffcf1;
  font-size: 16px;
  cursor: pointer;
}

.participate:disabled {
  opacity: 0.55;
  cursor: default;
}

.preview-bottom p {
  margin: 12px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.post-body {
  min-height: 240px;
  padding: 24px;
}

.post-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.post-read > * + * {
  margin-top: 16px;
}

.post-gallery {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.post-gallery img,
.post-cover {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: #eaf0d8;
}

.post-video {
  display: block;
  width: 100%;
  max-height: 480px;
  border-radius: 8px;
  background: #1f2a22;
}

.post-message {
  padding: 32px 8px;
  text-align: center;
}

.post-message-title {
  margin: 0 0 12px;
  font: 24px/1.3 Georgia, "Songti SC", serif;
}

.post-note {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

.runtime iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--card);
}

.host-foot {
  padding: 12px 20px;
  border-top: 1px solid #dfe3d5;
  background: var(--bar);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.status-line {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-line p {
  margin: 0;
  flex: 1;
}

.status-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7f9a62;
}

.status-action,
.notice button {
  min-height: 36px;
  padding: 4px 12px;
  border: 1px solid #c7cfb9;
  border-radius: 4px;
  background: #fbfaf5;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}

.notices {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.notice {
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  background: var(--notice);
  color: var(--ink);
}

.notice p {
  margin: 0;
  flex: 1 1 200px;
}

.share-row {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.share-row button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--green);
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
}

.share-row span {
  font-size: 14px;
  color: var(--muted);
}

.share-fallback {
  margin-top: 8px;
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.share-fallback input {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
}

.share-fallback p {
  margin: 0;
}

dialog {
  width: min(440px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid #d2d8c2;
  border-radius: 12px;
  background: #faf9ef;
  color: var(--ink);
  box-shadow: 0 25px 80px #1f342533;
}

dialog::backdrop {
  background: #23352960;
  backdrop-filter: blur(4px);
}

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

dialog h2 {
  margin: 12px 0;
  font: 26px/1.25 Georgia, "Songti SC", serif;
  letter-spacing: -0.5px;
  overflow-wrap: anywhere;
}

dialog p {
  font-size: 15px;
  line-height: 1.8;
}

.dialog-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-actions button {
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 4px;
  background: #eef0e1;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}

.dialog-actions .dialog-confirm {
  background: var(--green);
  color: #fff;
}

@media (max-width: 1000px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 48px;
  }

  h1 {
    font-size: 46px;
  }
}

@media (max-width: 800px) {
  .masthead {
    padding: 12px 20px;
  }

  .layout {
    display: block;
    padding: 24px 16px 48px;
  }

  .story {
    padding-bottom: 24px;
  }

  h1 {
    font-size: 34px;
    letter-spacing: -1px;
  }

  .dev-guide {
    margin-top: 24px;
  }

  .card {
    border-radius: 14px;
  }

  .preview,
  .runtime {
    height: 600px;
  }

  .cover-frame {
    height: 420px;
  }
}
