:root {
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  color: #17233b;
  background: #eef7fb;
  font-synthesis: none;
  --navy: #063d91;
  --blue: #0876df;
  --cyan: #79e4ec;
  --lime: #a7ee45;
  --ink: #17233b;
  --muted: #66768e;
  --line: #c9dce8;
  --surface: #ffffff;
  --selected: #efffd8;
  --shadow: 0 14px 40px rgba(8, 71, 132, 0.13);
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: hidden; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #eef7fb; }
body::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 156px 0 0;
  pointer-events: none;
  background: url("./assets/glm-header.png") center top / cover no-repeat;
  opacity: 0.055;
  filter: saturate(0.7);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 82%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 82%);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible {
  outline: 3px solid rgba(167, 238, 69, 0.72);
  outline-offset: 3px;
}

.brand-header {
  position: relative;
  min-height: 196px;
  overflow: hidden;
  color: #fff;
  background: #0754a5;
}
.brand-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 42, 110, 0.42), transparent 70%);
  pointer-events: none;
}
.brand-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 40px;
  background: linear-gradient(180deg, rgba(238, 247, 251, 0), #eef7fb);
  pointer-events: none;
}
.brand-watermark {
  position: absolute;
  right: 13vw;
  top: 4px;
  color: rgba(207, 243, 255, 0.11);
  font-size: 128px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}
.brand-copy {
  position: absolute;
  z-index: 1;
  left: max(10vw, calc((100vw - 1500px) / 2));
  top: 48px;
  display: grid;
  max-width: min(940px, 66vw);
  gap: 5px;
}
.brand-copy span { color: var(--lime); font-size: 13px; font-weight: 800; }
.brand-copy h1 { margin: 0; font-size: 42px; line-height: 1.12; }
.brand-copy h1 em { color: var(--lime); font-style: normal; }
.brand-deadline { margin: 4px 0 0; color: #e2f4ff; font-size: 14px; font-weight: 600; }

.app-shell {
  width: min(1500px, 80vw);
  position: relative;
  z-index: 2;
  margin: -28px auto 0;
  padding-bottom: 136px;
}
.site-record {
  position: relative;
  z-index: 1;
  padding: 4px 20px 32px;
  color: #6d7d91;
  font-size: 12px;
  text-align: center;
}
.site-record a { color: inherit; text-decoration: none; }
.site-record a:hover { color: var(--blue); text-decoration: underline; }
.loading-entry {
  width: min(720px, 100%);
  min-height: 160px;
  margin: 0 auto;
  display: grid;
  place-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  text-align: center;
}
.loading-entry strong { color: var(--navy); font-size: 23px; }
.loading-entry span { color: var(--muted); font-size: 13px; }

.identity-gate {
  width: min(720px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.gate-intro {
  padding: 34px;
  color: #fff;
  background: var(--navy);
}
.gate-intro h1 { margin: 0; font-size: 20px; line-height: 1.8; }
.gate-intro h1 span { display: block; color: inherit; font-size: inherit; font-weight: inherit; }
.gate-intro p { margin: 0; color: #d9ebff; line-height: 1.8; }
.gate-form { padding: 34px; display: grid; gap: 18px; align-content: center; }
.gate-form label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.gate-form input {
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}
.primary-button {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 6px;
  color: #073163;
  background: var(--lime);
  font-weight: 800;
}
.primary-button:disabled { color: #7d8795; background: #dce4e9; cursor: not-allowed; }
.gate-error { min-height: 20px; margin: -7px 0 0; color: #b3261e; font-size: 13px; }

body:has(.glm-intro) .app-shell { margin-top: -40px; }
.glm-intro {
  margin: 0;
  background: #fff;
  border-left: 5px solid #9be15d;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 16px 22px;
  position: relative;
  display: flex;
  gap: 28px;
  align-items: center;
}
.glm-l { flex: 1; min-width: 0; font-size: 14px; line-height: 1.8; }
.glm-l .glm-k { color: #0b4aa8; font-weight: bold; white-space: nowrap; }
.glm-l .glm-m { font-size: 12px; color: #7a8696; }
.glm-steps { flex: 1.6; min-width: 0; display: flex; align-items: flex-start; }
.glm-s { flex: 1; min-width: 0; text-align: center; position: relative; font-size: 12px; color: #6b7785; line-height: 1.5; }
.glm-s:not(:last-child)::after { content: ""; position: absolute; top: 15px; left: calc(50% + 15px); width: calc(100% - 30px); height: 2px; background: #cfd8e3; }
.glm-s.glm-done:not(:last-child)::after { background: #0b62d6; }
.glm-dot { width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 6px; line-height: 30px; font-weight: bold; background: #e3e9f1; color: #8a96a6; position: relative; z-index: 1; }
.glm-done .glm-dot { background: #0b62d6; color: #fff; }
.glm-cur .glm-dot { background: #9be15d; color: #0a3d8f; box-shadow: 0 0 0 5px rgba(155, 225, 93, 0.3); }
.glm-s b { display: block; min-height: 18px; color: #1f2d3d; font-size: 13px; line-height: 18px; padding: 0 4px; overflow-wrap: anywhere; }
.glm-cur b { color: #0b62d6; }
.glm-tag { display: inline-block; margin-top: 4px; background: #0b62d6; color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 11px; white-space: nowrap; }
.glm-who { text-align: right; font-size: 11px; color: #888; min-width: 70px; }
.glm-who b { display: block; color: #222; font-size: 14px; }

@media (min-width: 1101px) {
  .glm-steps { margin-right: 64px; }
}

@media (max-width: 1100px) {
  .glm-intro { flex-wrap: wrap; gap: 16px 22px; }
  .glm-l { flex: 1 1 calc(100% - 100px); }
  .glm-steps { order: 3; flex: 1 1 100%; }
  .glm-s b { min-height: 36px; }
}

.track-tabs {
  position: sticky;
  z-index: 5;
  top: 0;
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(7, 65, 122, 0.09);
  backdrop-filter: blur(12px);
}
.track-tabs button {
  min-height: 56px;
  padding: 6px 8px;
  display: grid;
  place-content: center;
  gap: 3px;
  border: 0;
  border-right: 1px solid var(--line);
  color: #37506c;
  background: transparent;
}
.track-tabs button:last-child { border-right: 0; }
.track-tabs strong { font-size: 16px; }
.track-tabs span { color: var(--muted); font-size: 11px; }
.track-tabs button.is-active { color: #fff; background: var(--blue); }
.track-tabs button:disabled { cursor: default; opacity: 0.45; }
.track-tabs button.is-active span { color: #d8eeff; }

.story-workspace {
  min-width: 0;
  max-width: 100%;
  margin-top: 12px;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.story-nav, .focused-story {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(5, 67, 125, 0.08);
}
.story-nav { position: sticky; top: 88px; padding: 10px; }
.story-nav-heading { padding: 2px 3px 8px; display: grid; gap: 2px; }
.story-nav-heading span { color: var(--blue); font-size: 12px; font-weight: 800; }
.story-nav-heading strong { font-size: 18px; }
.story-nav-list {
  max-height: calc(100vh - 190px);
  padding-right: 3px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.story-nav-list button {
  min-width: 0;
  min-height: 44px;
  padding: 4px 2px;
  display: grid;
  place-items: center;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  text-align: center;
}
.story-nav-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; }
.story-nav-list i { color: var(--muted); font-size: 9px; font-style: normal; }
.story-nav-list button.is-active { border-color: var(--blue); background: #edf7ff; }
.story-nav-list button.is-selected { border-color: #74b62b; background: var(--selected); }
.story-nav-list button.is-selected i { color: #397900; font-size: 13px; font-weight: 900; }
.focused-story { min-width: 0; padding: 8px; }
.story-identity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding: 8px 20px 12px; color: #103f75; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.story-identity strong { color: #0065c8; }
.story-author { padding: 8px 20px; color: #54789d; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
#story-dialog .story-identity { padding: 24px 64px 16px 20px; font-size: 17px; }
#story-dialog .story-identity strong { font-size: 18px; }
.vote-button:disabled { opacity: 0.55; cursor: not-allowed; }
.focused-heading { margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.focused-heading div { min-width: 0; display: grid; gap: 4px; }
.focused-heading span { color: var(--blue); font-size: 12px; font-weight: 800; }
.focused-heading h2 { margin: 0; font-size: 21px; }
.focused-heading .focused-actions { display: flex; align-items: center; gap: 6px; }
.story-step-button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid #9bb9ce;
  border-radius: 6px;
  color: var(--blue);
  background: #fff;
  font-size: 28px;
  line-height: 1;
}
.story-step-button:hover { border-color: var(--blue); background: #edf7ff; }
.received-count {
  display: inline-block;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  vertical-align: middle;
}
.focused-media {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 16px;
  gap: 4px;
  align-items: center;
}
.focused-reading-frame { position: relative; min-width: 0; }
.story-side-step { width: 42px; height: 64px; place-self: center; color: #fff; border: 0; background: #285f9e; box-shadow: 0 4px 14px rgba(0, 31, 74, 0.18); }
.story-side-step:hover { color: #fff; border-color: transparent; background: #0d4f9b; }
.story-reading-card {
  min-height: 0;
  max-height: calc(100dvh - 295px);
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, var(--background-share, 34%)) minmax(0, 1fr);
  grid-template-areas: "background action" "result result";
  gap: 8px;
  align-content: stretch;
  border: 1px solid #a8dfe4;
  background: #dff8f7;
  overflow-y: auto;
}
.story-section { min-width: 0; padding: 12px 16px; border-radius: 6px; text-align: left; }
.story-section h3 {
  width: max-content;
  margin: 0 0 8px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1;
}
.story-section p { margin: 0; color: #344356; font-size: var(--reading-font-size, 16px); line-height: 1.48; white-space: pre-line; }
.story-section.is-background { grid-area: background; background: #edffd6; }
.story-section.is-background h3 { color: #3a6d00; background: #9ce05b; }
.story-section.is-action { grid-area: action; background: #e1f0ff; }
.story-section.is-action h3 { color: #07539b; background: #8fc5ff; }
.story-section.is-result { grid-area: result; background: #fff9d9; }
.story-section.is-result h3 { color: #925700; background: #ffc34e; }
.reading-hint {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 7px 12px;
  border: 2px solid #0755aa;
  border-radius: 6px;
  color: #0755aa;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 31, 74, 0.18);
}
.reading-hint:hover { color: #fff; background: #0755aa; }
.vote-button {
  min-width: 160px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #9bb9ce;
  border-radius: 6px;
  color: var(--blue);
  background: #fff;
  font-weight: 800;
}
.vote-button.is-selected { border-color: #5d9f17; color: #234c00; background: var(--lime); }

.submit-bar {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 8px;
  width: min(1100px, calc(100% - 30px));
  min-height: 70px;
  padding: 8px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  transform: translateX(-50%);
  border: 1px solid rgba(23, 64, 104, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 44px rgba(3, 47, 98, 0.2);
  backdrop-filter: blur(16px);
}
.vote-progress { display: grid; gap: 7px; }
.progress-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.progress-copy strong { font-size: 18px; }
.progress-copy span { color: var(--muted); font-size: 12px; }
.progress-copy .submission-pending { color: #b3261e; font-weight: 700; }
.progress-track { height: 7px; overflow: hidden; background: #dce8ee; }
.progress-track i { height: 100%; display: block; background: linear-gradient(90deg, var(--blue), var(--lime)); transition: width 180ms ease; }

dialog {
  width: min(920px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 31, 77, 0.34);
}
#story-dialog {
  width: min(1700px, 96vw);
  height: calc(100dvh - 20px);
  max-height: none;
  overflow: hidden;
}
#story-dialog-content { height: 100%; }
#story-dialog .dialog-close { position: absolute; top: 12px; right: 68px; float: none; margin: 0; }
.story-dialog-frame {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  gap: 4px;
  align-items: stretch;
}
.dialog-side-step {
  width: 42px;
  height: 64px;
  place-self: center;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #285f9e;
  font-size: 40px;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(0, 31, 74, 0.18);
}
.dialog-side-step:hover { background: #0d4f9b; }
.dialog-side-step:disabled { opacity: 0.35; cursor: not-allowed; }
.mobile-dialog-step { display: none; }
#story-dialog .story-dialog-body {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
dialog::backdrop { background: rgba(0, 26, 70, 0.72); backdrop-filter: blur(3px); }
.dialog-close {
  position: sticky;
  z-index: 2;
  top: 12px;
  float: right;
  width: 42px;
  height: 42px;
  margin: 12px 12px -54px 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(10, 31, 58, 0.78);
  font-size: 28px;
  line-height: 1;
}
.dialog-reading-shell { min-height: 0; max-height: none; padding: 14px; border: 0; overflow-y: auto; }
.dialog-reading-shell .story-section { padding: 16px 20px; }
.dialog-reading-shell .story-section p { font-size: var(--reading-font-size, 17px); line-height: 1.55; }
.dialog-meta { min-height: 76px; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dialog-meta > div:first-child { display: grid; gap: 4px; }
.dialog-meta .dialog-meta-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; }
.dialog-meta span { color: var(--blue); font-size: 16px; font-weight: 800; }
.dialog-vote-count { color: #234c00; font-size: 16px; white-space: nowrap; }
.dialog-meta .received-count { font-size: 12px; }
.dialog-actions { display: flex; align-items: center; gap: 10px; }
.dialog-actions button { min-height: 40px; white-space: nowrap; }
.dialog-actions button:disabled { opacity: 0.45; cursor: not-allowed; }

.review-body { padding: 34px; }
.review-body > span { color: var(--blue); font-size: 13px; font-weight: 800; }
.review-body h2 { margin: 6px 0 6px; font-size: 28px; }
.review-body > p { margin: 0 0 22px; color: var(--muted); }
.review-body .review-error { min-height: 18px; margin: -12px 0 16px; color: #b3261e; font-size: 13px; font-weight: 700; }
.review-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.review-group { padding: 14px; border: 1px solid var(--line); border-radius: 6px; }
.review-group h3 { margin: 0 0 9px; font-size: 15px; }
.review-group p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.review-group ul { margin: 0; padding-left: 18px; color: var(--ink); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.review-actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 10px; }
.secondary-button { min-height: 46px; padding: 0 18px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff; font-weight: 700; }

.success-state {
  width: min(720px, 100%);
  margin: 50px auto;
  padding: 44px;
  border-top: 6px solid var(--lime);
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}
.success-mark { width: 62px; height: 62px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; color: #174b00; background: var(--lime); font-size: 34px; font-weight: 900; }
.success-state h1 { margin: 0 0 10px; font-size: 30px; }
.success-state p { color: var(--muted); line-height: 1.7; }
.success-state .secondary-button { margin-top: 12px; }

@media (min-width: 1025px) {
  .story-reading-card.is-wide-action {
    grid-template-columns: minmax(0, var(--aside-share)) minmax(0, 1fr);
    grid-template-areas: "background action" "result action";
  }
  .dialog-reading-shell.is-stacked {
    grid-template-columns: 1fr;
    grid-template-areas: "background" "action" "result";
    grid-template-rows: max-content max-content max-content;
    align-content: start;
  }
  .dialog-reading-shell.is-stacked .story-section { padding: 10px 16px; }
  .dialog-reading-shell.is-stacked .story-section p { line-height: 1.45; }
}

@media (max-width: 920px) {
  .story-workspace { grid-template-columns: 180px minmax(0, 1fr); }
  .story-nav-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .track-tabs { grid-template-columns: repeat(3, 1fr); }
  .track-tabs button:nth-child(3) { border-right: 0; }
  .track-tabs button:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}

@media (min-width: 761px) and (max-width: 1500px) {
  .brand-watermark { right: 8vw; top: 28px; font-size: 88px; }
}

@media (min-width: 761px) and (max-width: 1200px) {
  .app-shell { width: calc(100% - 48px); }
  .brand-copy { left: 24px; }
  .story-workspace { grid-template-columns: 190px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  #story-dialog { width: calc(100% - 20px); height: auto; max-height: calc(100dvh - 20px); overflow-y: auto; }
  #story-dialog-content { height: auto; }
  #story-dialog .dialog-close { right: 12px; }
  .story-dialog-frame { display: block; height: auto; }
  .dialog-side-step { display: none; }
  .mobile-dialog-step { display: inline-flex; align-items: center; justify-content: center; }
  #story-dialog .story-dialog-body { height: auto; display: block; }
  .brand-header { min-height: 130px; }
  .brand-watermark { display: none; }
  .brand-header::before { background: rgba(0, 53, 139, 0.76); }
  .brand-header::after { height: 54px; }
  .brand-copy { top: 20px; right: 18px; left: 18px; max-width: none; }
  .brand-copy h1 { font-size: 24px; white-space: nowrap; }
  .brand-deadline { font-size: 14px; }
  .app-shell { width: calc(100% - 20px); margin-top: -20px; padding-bottom: 176px; }
  .identity-gate { grid-template-columns: 1fr; }
  .gate-intro, .gate-form { padding: 24px 20px; }
  .gate-intro h1 { font-size: 20px; }
  body:has(.glm-intro) .app-shell { margin-top: -20px; }
  .glm-intro { padding: 16px; gap: 14px; }
  .glm-l { flex-basis: 100%; }
  .glm-who { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; flex: 1 1 100%; }
  .track-tabs {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .track-tabs button { min-width: 112px; flex: 0 0 112px; border-bottom: 0 !important; scroll-snap-align: start; }
  .story-workspace { grid-template-columns: 1fr; }
  .story-nav { position: static; padding: 12px; }
  .story-nav-heading { display: flex; align-items: baseline; justify-content: space-between; }
  .story-nav-list { display: flex; overflow-x: auto; }
  .story-nav-list { max-height: none; }
  .story-nav-list button { min-width: 82px; flex: 0 0 82px; }
  .focused-story { padding: 12px; }
  .focused-heading { align-items: stretch; flex-direction: column; }
  .focused-heading h2 { font-size: 21px; }
  .focused-heading .vote-button { min-width: 0; width: auto; flex: 1; }
  .focused-media { grid-template-columns: 10px minmax(0, 1fr) 10px; gap: 2px; }
  .story-side-step { width: 32px; height: 54px; font-size: 25px; }
  .story-reading-card { min-height: 0; max-height: none; padding: 10px; grid-template-columns: 1fr; grid-template-areas: "background" "action" "result"; }
  .story-section { padding: 18px 16px; }
  .story-section h3 { margin-bottom: 11px; font-size: 15px; }
  .story-section p { font-size: 16px; line-height: 1.78; }
  .dialog-reading-shell { padding: 14px; }
  .dialog-reading-shell .story-section { padding: 20px 17px; }
  .dialog-reading-shell .story-section p { font-size: 17px; line-height: 1.82; }
  .submit-bar { bottom: 8px; grid-template-columns: 1fr; gap: 12px; }
  .submit-bar .primary-button { width: 100%; }
  .review-body { padding: 28px 18px 20px; }
  .review-groups { grid-template-columns: 1fr; }
  .review-actions { flex-direction: column-reverse; }
  .review-actions button { width: 100%; }
  .dialog-meta { align-items: stretch; flex-direction: column; }
  .dialog-actions { align-items: stretch; flex-direction: column; }
  .dialog-actions button { width: 100%; }
}

@media (max-width: 360px) {
  .brand-copy h1 { font-size: 22px; }
}

@media (orientation: landscape) and (max-width: 1024px) and (max-height: 560px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body:has(.story-workspace) .brand-header { display: none; }
  body:has(.story-workspace) .app-shell { margin-top: 0; }
  body:has(.story-workspace) .glm-intro { display: none; }

  .brand-header { min-height: 120px; }
  .brand-watermark { top: 0; right: 18px; font-size: 86px; }
  .brand-header::after { height: 34px; }
  .brand-copy { top: 14px; right: 18px; left: 18px; gap: 2px; }
  .brand-copy span { font-size: 10px; }
  .brand-copy h1 { font-size: 28px; }
  .brand-deadline { font-size: 12px; }

  .app-shell {
    width: calc(100% - 16px);
    margin-top: -16px;
    padding-bottom: 82px;
  }
  .identity-gate { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .gate-intro, .gate-form { padding: 18px; }
  .gate-intro h1 { margin: 5px 0 8px; font-size: 21px; }
  .gate-intro p { font-size: 13px; line-height: 1.55; }
  .gate-form { gap: 10px; }
  .gate-form input { min-height: 42px; }

  .track-tabs {
    margin-top: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: visible;
  }
  .track-tabs button {
    min-width: 0;
    min-height: 50px;
    padding: 5px 3px;
    border-right: 1px solid var(--line);
    border-bottom: 0 !important;
  }
  .track-tabs button:nth-child(3) { border-right: 1px solid var(--line); }
  .track-tabs button:last-child { border-right: 0; }
  .track-tabs strong { font-size: 14px; }
  .track-tabs span { font-size: 9px; }

  .story-workspace {
    margin-top: 8px;
    grid-template-columns: minmax(190px, 25vw) minmax(0, 1fr);
    gap: 8px;
  }
  .story-nav {
    top: 58px;
    max-height: calc(100dvh - 127px);
    padding: 8px;
    overflow: hidden;
  }
  .story-nav-heading { padding: 1px 2px 7px; }
  .story-nav-heading strong { font-size: 17px; }
  .story-nav-list {
    max-height: calc(100dvh - 175px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .story-nav-list button {
    min-width: 0;
    min-height: 44px;
    padding: 4px 2px;
  }
  .story-nav-list span { font-size: 11px; }

  .focused-story { padding: 8px; }
  .focused-heading {
    margin-bottom: 7px;
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }
  .focused-heading h2 { font-size: 18px; }
  .focused-heading .vote-button { width: auto; }
  .vote-button { min-width: 132px; min-height: 34px; }
  .story-reading-card {
    min-height: 0;
    max-height: calc(100dvh - 187px);
    padding: 8px;
    grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.45fr);
    grid-template-areas: "background action" "result result";
    gap: 8px;
    overflow-y: auto;
  }
  .story-section { padding: 12px 22px; }
  .story-section h3 { margin-bottom: 8px; padding: 5px 10px; font-size: 13px; }
  .story-section p { font-size: 15px; line-height: 1.62; }
  .reading-hint { top: 8px; right: 8px; padding: 6px 9px; font-size: 11px; }

  .submit-bar {
    bottom: max(5px, env(safe-area-inset-bottom));
    width: calc(100% - 16px);
    min-height: 62px;
    padding: 8px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  .vote-progress { gap: 4px; }
  .progress-copy strong { font-size: 15px; }
  .progress-copy span { font-size: 10px; }
  .progress-track { height: 4px; }
  .submit-bar .primary-button { width: auto; min-height: 40px; padding: 0 16px; }

  #story-dialog {
    width: calc(100vw - 8px);
    max-width: none;
    height: calc(100dvh - 8px);
    max-height: none;
    overflow: hidden;
  }
  #story-dialog-content {
    height: 100%;
  }
  #story-dialog .story-dialog-body {
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }
  .dialog-reading-shell {
    min-height: 0;
    max-height: none;
    padding: 10px;
    overflow-y: auto;
    align-content: start;
  }
  .dialog-reading-shell .story-section { padding: 14px 16px; }
  .dialog-reading-shell .story-section p { font-size: 15px; line-height: 1.68; }
  .dialog-meta { min-height: 64px; padding: 8px 14px; align-items: center; flex-direction: row; }
  .dialog-actions { align-items: center; flex-direction: row; }
  .dialog-actions button { width: auto; }
}
