:root { color-scheme: light; font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif; color: #262b25; background: #eeeae1; }
* { box-sizing: border-box; }
body { margin: 0; }
.free-header { display: flex; justify-content: space-between; padding: .9rem clamp(1rem, 5vw, 4rem); background: #252e28; color: #f8f5eb; }
.free-header a { color: inherit; text-decoration: none; }
.free-story { width: min(1120px, 100%); margin: auto; padding: clamp(1rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem); }
.free-intro, .free-chapter, .free-sidebar section { border: 1px solid #d6d0c0; border-radius: 14px; background: #fffcf5; }
.free-intro { max-width: 860px; margin: min(3vh, 1.5rem) auto; padding: clamp(1.2rem, 5vw, 2.7rem); }
.free-kicker { color: #42645a; letter-spacing: .1em; font-size: .88rem; font-weight: 700; }
h1 { margin: .35rem 0 1rem; font-family: "Noto Serif SC", "Songti SC", SimSun, serif; font-size: clamp(2rem, 5vw, 3.35rem); line-height: 1.22; }
h2 { margin: 0 0 .65rem; font-size: 1.14rem; }
p { line-height: 1.8; }
.free-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 270px); align-items: start; gap: 1.2rem; }
.free-chapter { min-width: 0; padding: clamp(1rem, 4vw, 2.4rem); }
.free-prose { padding-block: .6rem; font-size: 1.075rem; }
.free-prose p { line-height: 1.9; }
.free-consequence { padding: .6rem .8rem; background: #edf2e9; border-inline-start: 2px solid #64847a; }
.free-consequence strong { display: block; margin-bottom: .12rem; color: #2e544a; }
.free-model { color: #586056; }
.free-next { margin-top: 1.5rem; border-top: 1px solid #ded9c9; padding-top: 1.4rem; }
.free-story label { display: block; margin: 1rem 0 .4rem; font-weight: 700; }
.free-story textarea { display: block; width: 100%; margin-bottom: .8rem; padding: .7rem; resize: vertical; border: 1px solid #b8c3b6; border-radius: 8px; background: #fff; color: inherit; font: inherit; line-height: 1.6; }
.free-opening-setup { display: grid; grid-template-columns: minmax(180px, .85fr) minmax(0, 1.6fr); gap: clamp(.9rem, 3vw, 1.5rem); margin: 1.35rem 0; }
.free-opening-setup fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.free-opening-setup legend { margin: 0 0 .6rem; padding: 0; color: #385b51; font-size: .92rem; font-weight: 700; }
.free-opening-options { display: grid; gap: .5rem; }
.free-story .free-opening-option {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: 0;
  padding: .55rem .65rem;
  border: 1px solid #d7ded3;
  border-radius: 8px;
  background: #faf9f0;
  cursor: pointer;
  font-weight: 400;
}
.free-opening-option:has(input:checked) { border-color: #5c8375; background: #edf3e9; }
.free-opening-option:has(input:focus-visible) { outline: 2px solid #427a6b; outline-offset: 2px; }
.free-opening-option:has(input:disabled) { cursor: wait; opacity: .75; }
.free-opening-option input[type=radio] { flex: none; margin: .2rem 0 0; accent-color: #2e5c50; }
.free-opening-option strong, .free-opening-option small { display: block; }
.free-opening-option small { margin-top: .15rem; color: #4e6057; font-size: .82rem; }
.free-opening-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.free-opening-fields .free-opening-wide { grid-column: 1 / -1; }
.free-opening-fields label { margin: 0 0 .3rem; font-size: .93rem; }
.free-opening-fields input, .free-opening-fields textarea {
  width: 100%;
  margin: 0;
  padding: .55rem .65rem;
  border: 1px solid #b8c3b6;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
  line-height: 1.55;
}
.free-story button { min-height: 42px; padding: .45rem .8rem; border: 1px solid #a9bbae; border-radius: 8px; background: #fffefa; color: #2e5047; font: inherit; cursor: pointer; }
.free-story button:disabled { opacity: .65; cursor: wait; }
.free-story :is(button,input,textarea,summary):focus-visible, .free-header a:focus-visible { outline: 2px solid #427a6b; outline-offset: 3px; }
.free-story .free-primary { background: #2e5c50; border-color: #2e5c50; color: #fff; }
.free-options { display: grid; gap: .55rem; }
.free-options button { text-align: left; padding: .8rem; }
.free-options button:hover { border-color: #496e61; background: #f0f6ee; }
.free-options span { display: block; margin-top: .3rem; color: #4e6057; font-size: .91rem; }
.free-actions, .free-live { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.free-live:not(:empty) { margin-top: .8rem; }
.free-spinner { width: .9rem; height: .9rem; border: 2px solid #b1c1b8; border-top-color: #2e5c50; border-radius: 50%; animation: free-spin .75s linear infinite; }
@keyframes free-spin { to { transform: rotate(360deg); } }
.free-sidebar { display: grid; grid-auto-rows: min-content; gap: .85rem; }
.free-sidebar section { padding: .9rem; }
.free-metrics, .free-changes { padding: 0; margin: 0; list-style: none; }
.free-metrics li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .2rem; margin: .55rem 0; }
.free-metrics meter { width: 100%; grid-column: 1 / -1; accent-color: #467466; }
.free-changes { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.free-changes li { border-radius: 4px; padding: .2rem .4rem; background: #edf2e9; }
.free-history { padding-inline-start: 1.35rem; margin: 0; }
.free-history li { margin-bottom: .6rem; }
.free-history summary { cursor: pointer; }
.free-history p { margin: .3rem 0; font-size: .9rem; }
@media (max-width: 760px) { .free-layout { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .free-opening-setup { grid-template-columns: 1fr; }
  .free-opening-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .free-opening-option:last-child { grid-column: 1 / -1; }
}
@media (max-width: 390px) { .free-opening-fields { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .free-spinner { animation: none; } }
