: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: 224px;
  overflow: hidden;
  color: #fff;
  background-color: #0463c5;
  background-image: url("./assets/glm-header.png");
  background-position: center;
  background-size: cover;
}
.brand-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 42, 110, 0.94) 0%, rgba(0, 75, 165, 0.9) 52%, rgba(0, 48, 125, 0.78) 100%);
  pointer-events: none;
}
.brand-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 72px;
  background: linear-gradient(180deg, rgba(238, 247, 251, 0), #eef7fb);
  pointer-events: none;
}
.brand-copy {
  position: absolute;
  z-index: 1;
  left: max(24px, calc((100vw - 1420px) / 2));
  top: 32px;
  display: grid;
  gap: 6px;
}
.brand-copy span { color: var(--lime); font-size: 13px; font-weight: 800; }
.brand-copy h1 { margin: 0; font-size: 48px; line-height: 1.12; }
.brand-copy h1 em { color: var(--lime); font-style: normal; }
.brand-copy p { margin: 0; color: #d9efff; font-size: 18px; font-weight: 700; }

.app-shell {
  width: min(1420px, calc(100% - 40px));
  position: relative;
  z-index: 2;
  margin: -28px auto 0;
  padding-bottom: 136px;
}
.site-record {
  position: relative;
  z-index: 2;
  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 span { color: var(--lime); font-size: 13px; font-weight: 800; }
.gate-intro h1 { margin: 8px 0 14px; font-size: 30px; line-height: 1.22; }
.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; }

.topline {
  min-height: 64px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border: 1px solid #b6d7eb;
  border-left: 5px solid var(--lime);
  background: #fff;
}
.topline div { display: grid; gap: 4px; }
.topline span { color: var(--muted); font-size: 12px; }
.topline strong { font-size: 16px; }
.identity-chip { text-align: right; }

.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: 68px;
  padding: 10px 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.is-active span { color: #d8eeff; }

.story-workspace {
  min-width: 0;
  max-width: 100%;
  margin-top: 20px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  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: 14px; }
.story-nav-heading { padding: 3px 4px 12px; display: grid; gap: 3px; }
.story-nav-heading span { color: var(--blue); font-size: 12px; font-weight: 800; }
.story-nav-heading strong { font-size: 21px; }
.story-nav-list {
  max-height: calc(100vh - 190px);
  padding-right: 3px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.story-nav-list button {
  min-width: 0;
  min-height: 52px;
  padding: 6px 4px;
  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: 12px; 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: 16px; }
.focused-heading { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.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: 24px; }
.focused-media { position: relative; }
.story-reading-card {
  min-height: 430px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(0, 1.5fr);
  grid-template-areas: "background action" "result result";
  gap: 12px;
  align-content: stretch;
  border: 1px solid #a8dfe4;
  background: #dff8f7;
}
.story-reading-card.is-long { grid-template-columns: 1fr; grid-template-areas: "background" "action" "result"; }
.story-section { min-width: 0; padding: 22px 24px; border-radius: 6px; text-align: left; }
.story-section h3 {
  width: max-content;
  margin: 0 0 16px;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 17px;
  line-height: 1;
}
.story-section p { margin: 0; color: #344356; font-size: 18px; line-height: 1.85; }
.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 11px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: rgba(3, 45, 98, 0.82);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 31, 74, 0.2);
}
.media-nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 52px;
  height: 64px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  color: #fff;
  background: rgba(4, 60, 132, 0.82);
  box-shadow: 0 7px 22px rgba(0, 30, 70, 0.26);
  font-size: 42px;
  line-height: 1;
}
.media-nav.is-prev { left: -24px; }
.media-nav.is-next { right: -24px; }
.media-nav:hover { background: var(--blue); }
.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: 14px;
  width: min(1100px, calc(100% - 30px));
  min-height: 88px;
  padding: 14px 18px;
  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-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);
}
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: 560px; padding: 28px; border: 0; }
.dialog-reading-shell .story-section { padding: 28px 30px; }
.dialog-reading-shell .story-section p { font-size: 20px; line-height: 1.95; }
.dialog-meta { padding: 18px 22px; display: flex; justify-content: space-between; gap: 18px; }
.dialog-meta > div:first-child { display: grid; gap: 4px; }
.dialog-meta span { color: var(--blue); font-size: 12px; font-weight: 800; }
.dialog-meta h2 { margin: 0; font-size: 22px; }
.dialog-actions { display: flex; align-items: center; gap: 10px; }

.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-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 (max-width: 920px) {
  .story-workspace { grid-template-columns: 260px 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 (max-width: 760px) {
  .brand-header { min-height: 190px; background-position: 42% center; }
  .brand-header::before { background: rgba(0, 53, 139, 0.76); }
  .brand-header::after { height: 54px; }
  .brand-copy { top: 24px; right: 18px; left: 18px; }
  .brand-copy h1 { font-size: 32px; }
  .brand-copy p { font-size: 15px; }
  .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: 25px; }
  .topline { align-items: flex-start; flex-direction: column; gap: 9px; }
  .identity-chip { text-align: left; }
  .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 { width: 100%; }
  .story-reading-card { min-height: 0; 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; }
  .media-nav { width: 42px; height: 54px; font-size: 34px; }
  .media-nav.is-prev { left: -10px; }
  .media-nav.is-next { right: -10px; }
  .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%; }
}
