:root {
  color-scheme: light;
  --ink: #202522;
  --muted: #6c746e;
  --line: #dfe4df;
  --paper: #f5f7f3;
  --panel: #ffffff;
  --accent: #2d6a55;
  --accent-dark: #214b3d;
  --soft-accent: #e7f0eb;
  --warm: #f4eee4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

button, textarea { font: inherit; }
button { cursor: pointer; }

.shell { width: min(960px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 28px; }

.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 24px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 11px; letter-spacing: 1.5px; font-weight: 700; }
h1 { margin: 0; font-size: clamp(25px, 4vw, 40px); line-height: 1.12; letter-spacing: 0; font-weight: 700; }
.connection { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #65a581; }

.intro-strip { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.intro-mark { color: var(--accent); font-size: 11px; font-weight: 700; }

.game-panel { margin-top: 18px; border: 1px solid var(--line); background: var(--panel); }
.chat { min-height: 480px; max-height: 62vh; overflow-y: auto; padding: 26px clamp(16px, 5vw, 52px); }
.message { display: flex; margin: 0 0 20px; }
.message.assistant { justify-content: flex-start; }
.message.user { justify-content: flex-end; }
.bubble { max-width: min(700px, 92%); white-space: pre-wrap; line-height: 1.85; font-size: 15px; }
.assistant .bubble { padding-left: 15px; border-left: 3px solid var(--accent); }
.user .bubble { padding: 11px 14px; border: 1px solid #d6e3dc; background: var(--soft-accent); }
.message.pending .bubble { color: var(--muted); }

.composer { border-top: 1px solid var(--line); padding: 16px; background: #fbfcfa; }
textarea { display: block; width: 100%; resize: vertical; min-height: 76px; max-height: 220px; padding: 12px 13px; border: 1px solid #cdd6cf; border-radius: 3px; outline: none; background: #fff; color: var(--ink); line-height: 1.6; }
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(45, 106, 85, .12); }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 11px; }
.composer-actions { display: flex; align-items: center; gap: 8px; }
.hint { color: var(--muted); font-size: 12px; }
.primary-button { min-width: 76px; padding: 9px 18px; border: 0; border-radius: 3px; background: var(--accent); color: #fff; font-weight: 700; }
.primary-button:hover { background: var(--accent-dark); }
.primary-button:disabled { cursor: wait; opacity: .55; }
.secondary-button { padding: 8px 13px; border: 1px solid #cdd6cf; border-radius: 3px; background: #fff; color: var(--accent-dark); font-weight: 700; }
.secondary-button:hover { border-color: var(--accent); background: var(--soft-accent); }
.secondary-button:disabled { cursor: wait; opacity: .55; }
.actions { display: flex; justify-content: flex-end; gap: 16px; padding-top: 15px; }
.text-button { padding: 5px 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.text-button:hover { color: var(--accent); }
.text-link { color: var(--accent); font-size: 13px; text-decoration: none; }
.text-link:hover { color: var(--accent-dark); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Home cover layout */
.home-shell {
  width: min(1160px, calc(100% - 64px));
  margin: 0 auto;
  padding: 32px 0 24px;
}

.home-shell a { color: inherit; text-decoration: none; }

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid #c9cdc4;
}

.home-brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background: var(--accent);
  color: #f7f3ea;
  font-family: Georgia, serif;
  font-size: 22px;
  line-height: 1;
}
.home-brand strong,
.home-brand small { display: block; }
.home-brand strong { color: var(--accent-dark); font-size: 13px; letter-spacing: 1.5px; }
.home-brand small { margin-top: 3px; color: var(--muted); font-size: 9px; letter-spacing: 1.2px; }
.issue-note { color: var(--muted); font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; }

.cover-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: 56px 0 30px;
}
.home-kicker { margin: 0 0 12px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 2px; }
.cover-intro h1 { max-width: 650px; color: var(--ink); font-family: Georgia, "Songti SC", serif; font-size: clamp(38px, 6vw, 76px); font-weight: 500; line-height: .98; }
.home-subtitle { max-width: 190px; margin: 0 0 5px; color: var(--muted); font-size: 13px; line-height: 1.75; }

.cover-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 24px; align-items: stretch; }
.cover-feature {
  display: grid;
  grid-template-columns: minmax(160px, .72fr) minmax(240px, 1.28fr);
  grid-template-rows: auto 1fr;
  min-height: 510px;
  overflow: hidden;
  background: var(--accent-dark);
  color: #f7f3ea !important;
  transition: transform .2s ease, box-shadow .2s ease;
}
.cover-feature:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(33, 75, 61, .18); }
.cover-feature-top { grid-column: 1 / -1; display: flex; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid rgba(247, 243, 234, .3); color: #dfe9df; font-size: 10px; font-weight: 700; letter-spacing: 1.6px; }
.cover-art { position: relative; overflow: hidden; min-height: 420px; background: #d96d45; }
.art-label { position: absolute; top: 25px; left: 22px; color: #f7f3ea; font-family: Georgia, serif; font-size: clamp(72px, 12vw, 150px); font-style: italic; line-height: .7; letter-spacing: -8px; }
.art-line { position: absolute; display: block; width: 170%; height: 2px; background: #f7f3ea; transform: rotate(-48deg); transform-origin: left center; }
.art-line-one { top: 43%; left: -30%; }
.art-line-two { top: 55%; left: -15%; opacity: .55; }
.art-stamp { position: absolute; right: 20px; bottom: 84px; display: grid; width: 72px; height: 72px; place-items: center; border: 1px solid #f7f3ea; border-radius: 50%; color: #f7f3ea; font-size: 10px; font-weight: 700; letter-spacing: 1px; line-height: 1.15; text-align: center; transform: rotate(12deg); }
.art-caption { position: absolute; right: 22px; bottom: 22px; color: #f7f3ea; font-family: Georgia, serif; font-size: 13px; font-style: italic; line-height: 1.1; text-align: right; }
.cover-feature-copy { display: flex; flex-direction: column; justify-content: end; gap: 13px; padding: 28px; }
.cover-feature-title { font-family: Georgia, "Songti SC", serif; font-size: clamp(29px, 4vw, 50px); line-height: 1; }
.cover-feature-meta { color: #c9d9cb; font-size: 12px; }
.cover-cta { align-self: flex-start; margin-top: 15px; padding-bottom: 5px; border-bottom: 1px solid #dfe9df; font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.cover-cta span { margin-left: 7px; font-size: 16px; }

.story-index { display: flex; flex-direction: column; border-top: 3px solid var(--accent); }
.index-heading { display: flex; justify-content: space-between; padding: 14px 0 16px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }
.story-entry { display: grid; grid-template-columns: 42px 1fr 22px; gap: 14px; align-items: start; padding: 21px 0 25px; border-top: 1px solid #c9cdc4; transition: padding-left .2s ease, color .2s ease; }
.story-entry:hover { padding-left: 8px; color: var(--accent) !important; }
.story-entry-number { color: var(--accent); font-family: Georgia, serif; font-size: 24px; line-height: 1; }
.story-entry-copy strong { display: block; color: var(--ink); font-family: Georgia, "Songti SC", serif; font-size: 22px; font-weight: 500; line-height: 1.2; }
.story-entry-copy small { display: block; margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.story-entry-arrow { color: var(--accent); font-size: 20px; line-height: 1; }
.index-note { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 24px; border-top: 1px solid #c9cdc4; color: var(--muted); font-size: 11px; }
.status-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #65a581; }
.home-footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 28px; color: var(--muted); font-size: 10px; letter-spacing: 1.5px; }

@media (max-width: 600px) {
  .shell { width: min(100% - 20px, 960px); padding-top: 20px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 14px; }
  .connection { align-self: flex-start; }
  .chat { min-height: 56vh; padding: 20px 15px; }
  .bubble { max-width: 96%; font-size: 14px; }
  .composer { padding: 12px; }
  .composer-footer { align-items: flex-start; flex-direction: column; }
  .composer-actions { width: 100%; justify-content: flex-end; }

  .home-shell { width: min(100% - 32px, 1160px); padding-top: 20px; }
  .home-header { align-items: flex-start; }
  .issue-note { display: none; }
  .cover-intro { display: block; padding: 42px 0 24px; }
  .cover-intro h1 { font-size: clamp(42px, 14vw, 64px); }
  .home-subtitle { max-width: 230px; margin-top: 20px; }
  .cover-layout { display: block; }
  .cover-feature { grid-template-columns: 1fr; min-height: auto; }
  .cover-art { min-height: 255px; }
  .art-label { font-size: 100px; }
  .cover-feature-copy { min-height: 230px; padding: 24px 22px 28px; }
  .cover-feature-title { font-size: 38px; }
  .story-index { margin-top: 34px; }
  .index-note { margin-top: 12px; padding-bottom: 10px; }
  .home-footer { padding-bottom: 4px; font-size: 9px; }
}
