:root {
  color-scheme:light;
  --paper:#f6f5ee;
  --white:#fffef9;
  --ink:#243b35;
  --muted:#697870;
  --line:#d9dfd4;
  --mint:#dfebe2;
  --deep:#35634f;
  --gold:#ae8144;
  --warning:#855418;
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  line-height:1.6;
}
button,input,a {
  -webkit-tap-highlight-color:transparent;
}
button,input {
  font:inherit;
}
button,a {
  touch-action:manipulation;
}
button {
  cursor:pointer;
}
button:disabled {
  cursor:default;
  opacity:.45;
}
button:focus-visible,a:focus-visible,input:focus-visible {
  outline:3px solid #527fbc;
  outline-offset:3px;
}
button {
  color:inherit;
}
a {
  color:var(--deep);
}
[hidden] {
  display:none!important;
}
.site-header {
  max-width:1248px;
  margin:0 auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px 28px;
  gap:16px;
}
.home-link {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  text-decoration:none;
  font-size:14px;
}
.edition {
  font-size:12px;
  letter-spacing:.08em;
  color:var(--muted);
}
main {
  max-width:1192px;
  margin:auto;
  padding:18px 28px 28px;
}
.intro {
  padding:10px 0 20px;
}
.eyebrow {
  font-size:12px;
  letter-spacing:.14em;
  color:var(--deep);
  margin:0 0 8px;
}
h1 {
  font-family:"Songti SC",STSong,serif;
  font-size:44px;
  letter-spacing:.08em;
  font-weight:600;
  line-height:1.25;
  margin:0 0 12px;
}
h1 span {
  margin-left:.28em;
  font-weight:400;
}
h2 {
  font-size:18px;
  line-height:1.5;
  margin:0;
  font-weight:600;
}
.intro>p:last-child {
  margin:0;
  color:var(--muted);
  font-size:15px;
}
.notice {
  font-size:12px;
  margin:0 0 12px;
  padding:10px 13px;
  border-radius:8px;
  background:#ebece3;
  color:#5d6b60;
  overflow-wrap:anywhere;
}
.warning {
  background:#fff0d9;
  color:var(--warning);
  border:1px solid #e5cc9f;
}
.storage-note[data-state="locked"] {
  background:#fff0d9;
  color:var(--warning);
}
.workspace {
  display:grid;
  grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);
  gap:26px;
  align-items:start;
}
.preview-panel,.editor-panel {
  min-width:0;
}
.section-top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:7px 0 15px;
}
.little-seal {
  border:1px solid #b78f69;
  color:#a27850;
  font-family:serif;
  line-height:1;
  padding:5px 4px;
  font-size:11px;
  letter-spacing:.15em;
  transform:rotate(-5deg);
}
.step-label {
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
}
.poem-paper {
  position:relative;
  background:var(--white);
  border:1px solid #e4e2d5;
  border-radius:3px 3px 20px 3px;
  box-shadow:0 8px 24px #2b43320a;
  padding:45px 28px 20px;
  min-height:278px;
}
.paper-mark {
  position:absolute;
  top:4px;
  left:22px;
  color:#d3dbcc;
  font-family:Georgia,serif;
  font-size:54px;
  line-height:1;
}
.preview-row {
  font-family:"Songti SC",STSong,serif;
  font-size:clamp(22px,2.2vw,28px);
  font-weight:500;
  line-height:1.95;
  letter-spacing:.1em;
  margin:8px 0;
  overflow-wrap:anywhere;
  word-break:break-all;
  min-height:1.95em;
}
.poem-line {
  font:inherit;
  letter-spacing:inherit;
  overflow-wrap:anywhere;
  word-break:break-all;
}
.empty-line {
  color:#9a9f93;
  font:14px/3.9 -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif;
  letter-spacing:0;
}
.paper-footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:26px;
  color:#86917f;
  font-size:12px;
}
.share-panel {
  margin-top:20px;
}
.share-panel legend {
  font-size:14px;
  font-weight:600;
}
.share-explanation {
  font-size:12px;
  color:var(--muted);
  margin:8px 0 13px;
}
.button {
  min-height:44px;
  min-width:44px;
  border-radius:8px;
  border:1px solid transparent;
  padding:9px 13px;
  font-size:13px;
  line-height:1.6;
}
.primary {
  background:var(--deep);
  color:white;
  border-color:var(--deep);
}
.primary:hover:not(:disabled) {
  background:#284e3d;
}
.secondary {
  background:#fffdf7;
  border-color:var(--line);
}
.secondary:hover:not(:disabled) {
  background:#f0f3e9;
}
.danger {
  color:#946149;
}
.text-button {
  background:transparent;
  color:var(--muted);
  padding-left:8px;
  padding-right:8px;
}
.button[aria-busy="true"] {
  border-style:dashed;
}
.small-status {
  font-size:12px;
  min-height:1.6em;
  overflow-wrap:anywhere;
  margin:9px 0;
  color:var(--deep);
}
#manual-copy {
  background:#edf1e7;
  border-radius:8px;
  padding:12px;
  font-size:12px;
}
#manual-copy label {
  display:block;
  margin-bottom:8px;
}
#share-link {
  width:100%;
  min-width:0;
  min-height:44px;
  background:white;
  color:var(--ink);
  border:1px solid #c4d2c1;
  border-radius:6px;
  padding:8px;
  font-size:12px;
}
#select-link {
  margin-top:8px;
}
fieldset {
  border:0;
  padding:0;
  margin:0;
  min-width:0;
}
.rules {
  font-size:12px;
  color:var(--muted);
  margin:-5px 0 13px;
}
.editing-lines {
  display:grid;
  gap:10px;
}
.editing-line {
  border:1px solid var(--line);
  border-radius:10px;
  background:#fdfcf5;
  padding:8px;
  min-width:0;
}
.editing-line.is-active {
  border-color:#6c937d;
  box-shadow:inset 3px 0 0 #6c937d;
  background:#f8fbf3;
}
.line-head {
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:6px;
}
.line-select {
  font-size:12px;
  min-height:44px;
  min-width:80px;
  padding:7px 10px;
  border-radius:6px;
  border:1px solid transparent;
  background:#e9eee3;
}
.line-select[aria-pressed="true"] {
  color:#fff;
  background:var(--deep);
}
.line-counter {
  font-size:11px;
  color:var(--muted);
}
.line-words {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  min-height:44px;
  align-items:center;
}
.placed-word {
  min-width:44px;
  min-height:44px;
  padding:8px 10px;
  border-radius:5px;
  border:1px solid #ccd9cc;
  background:#e5eee1;
  font-size:14px;
  box-shadow:0 2px 0 #d3dccd;
}
.placed-word[aria-pressed="true"] {
  border-color:var(--deep);
  box-shadow:inset 0 0 0 1px var(--deep),0 2px 0 #8aab92;
  background:#cfe1d0;
}
.line-placeholder {
  font-size:12px;
  color:#8a9487;
  padding-left:5px;
}
.selection-tools {
  margin:12px 0 19px;
}
.selection-tools>span {
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-bottom:7px;
}
.tool-buttons {
  display:flex;
  gap:7px;
  flex-wrap:wrap;
}
.theme-buttons {
  display:flex;
  gap:7px;
  padding-bottom:10px;
  border-bottom:1px solid var(--line);
  margin-bottom:11px;
}
.theme-button {
  background:transparent;
  min-height:44px;
  min-width:60px;
  border:1px solid transparent;
  border-radius:20px;
  font-size:13px;
  padding:8px 14px;
}
.theme-button[aria-pressed="true"] {
  background:var(--ink);
  color:var(--white);
}
.word-bank {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}
.word-button {
  min-width:0;
  min-height:44px;
  border:1px solid #d9dece;
  background:var(--white);
  border-radius:6px;
  padding:9px 5px;
  font-size:14px;
  box-shadow:0 2px 0 #e2e6da;
}
.word-button:hover:not(:disabled) {
  background:#e8f0e1;
  border-color:#93af98;
}
.history-tools {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:17px;
  padding-top:15px;
  border-top:1px solid var(--line);
}
.presets {
  margin-top:22px;
}
.presets legend {
  font-size:13px;
  font-weight:600;
}
.presets p {
  font-size:11px;
  color:var(--muted);
  margin:4px 0 8px;
}
#preset-buttons {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.preset-button {
  background:#eeeee2;
  border:1px solid #dfe2d3;
}
.edit-status {
  min-height:1.6em;
  font-size:12px;
  color:var(--deep);
  margin:14px 0 8px;
}
.footnote {
  font-size:11px;
  color:#7c887b;
  margin:0;
}
.page-footer {
  margin-top:34px;
  padding-top:18px;
  border-top:1px solid var(--line);
  font-size:12px;
  color:var(--muted);
  display:flex;
  gap:12px;
  justify-content:space-between;
}
dialog {
  max-width:440px;
  width:calc(100% - 32px);
  max-height:calc(100% - 32px);
  overflow:auto;
  padding:0;
  border:1px solid #c6d1bd;
  border-radius:16px;
  background:var(--white);
  color:var(--ink);
  box-shadow:0 24px 80px #1d33274d;
}
dialog::backdrop {
  background:#20362966;
}
.dialog-body {
  padding:25px;
}
.dialog-body>p:not(.eyebrow) {
  font-size:13px;
  color:var(--muted);
}
.invite-summary {
  background:#f0f2e7;
  border-radius:9px;
  padding:15px;
  margin:18px 0;
  font-family:"Songti SC",STSong,serif;
  font-size:19px;
  line-height:1.8;
  overflow-wrap:anywhere;
  word-break:break-all;
}
.invite-summary p {
  margin:4px 0;
}
.invite-summary .invite-empty {
  font:12px/1.8 sans-serif;
  color:var(--muted);
}
.dialog-actions {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.dialog-actions button {
  flex:1;
  white-space:nowrap;
}
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
}
@media(max-width:700px) {
  .site-header {
    padding:10px 18px;
    gap:8px;
  }
  .edition {
    font-size:10px;
    letter-spacing:0;
  }
  .home-link {
    font-size:12px;
  }
  main {
    padding:9px 18px 24px;
  }
  .intro {
    padding:4px 0 17px;
  }
  h1 {
    font-size:35px;
    margin-bottom:9px;
  }
  .intro>p:last-child {
    font-size:13px;
  }
  .eyebrow {
    font-size:10px;
  }
  .workspace {
    display:flex;
    flex-direction:column;
    gap:23px;
  }
  .preview-panel,.editor-panel {
    width:100%;
  }
  .section-top {
    margin:4px 0 12px;
  }
  h2 {
    font-size:16px;
  }
  .poem-paper {
    padding:29px 22px 15px;
    min-height:0;
  }
  .paper-mark {
    font-size:42px;
    top:0;
    left:16px;
  }
  .preview-row {
    font-size:24px;
    margin:4px 0;
    line-height:1.75;
    min-height:1.75em;
  }
  .empty-line {
    font-size:13px;
    line-height:3.2;
  }
  .paper-footer {
    margin-top:14px;
  }
  .share-panel {
    margin-top:14px;
  }
  .share-explanation {
    margin:5px 0 10px;
  }
  .small-status:empty {
    display:none;
  }
  .share-panel legend {
    font-size:13px;
  }
  .preview-panel {
    display:flex;
    flex-direction:column;
  }
  .share-panel {
    order:3;
  }
  .notice {
    padding:8px 10px;
    font-size:11px;
  }
  .editing-line {
    padding:7px;
  }
  .line-head {
    margin-bottom:5px;
  }
  .line-select {
    min-width:84px;
  }
  .placed-word {
    padding-left:9px;
    padding-right:9px;
  }
  .selection-tools {
    margin-bottom:14px;
  }
  .page-footer {
    margin-top:25px;
    display:block;
  }
  .page-footer span {
    display:block;
    margin-top:3px;
  }
  .dialog-body {
    padding:21px;
  }
  .dialog-actions {
    flex-direction:column;
  }
  .dialog-actions button {
    width:100%;
  }
}
@media(min-width:701px) {
  .preview-panel {
    position:sticky;
    top:18px;
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    scroll-behavior:auto!important;
    animation:none!important;
    transition:none!important;
  }
}
