:root {
  --paper: #f5f1e8;
  --paper-deep: #ebe3d5;
  --ink: #20231f;
  --muted: #6e7068;
  --line: rgba(42, 47, 41, 0.15);
  --red: #a84438;
  --red-dark: #843328;
  --green: #49735c;
  --amber: #b38338;
  --white: #fffdf8;
  --shadow: 0 18px 48px rgba(45, 38, 27, 0.11);
  --radius: 24px;
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(168, 68, 56, 0.25);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.paper-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.45;
  background-image:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.8), transparent 30%),
    linear-gradient(90deg, rgba(50, 45, 35, 0.018) 1px, transparent 1px),
    linear-gradient(rgba(50, 45, 35, 0.018) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px;
}

.screen {
  min-height: 100vh;
}

.eyebrow {
  display: inline-block;
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.welcome-screen {
  display: grid;
  place-items: center;
  padding: 54px 24px;
}

.welcome-shell {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(480px, 1.1fr);
  gap: 72px;
  align-items: center;
}

.brand-block h1 {
  margin: 18px 0 20px;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(3.2rem, 7vw, 6.7rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.brand-block p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.9;
}

.entry-card {
  padding: 38px;
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid rgba(72, 61, 44, 0.12);
  border-radius: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.field-label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.nickname-input {
  width: 100%;
  height: 54px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.nickname-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(168, 68, 56, 0.08);
}

.group-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin: 32px 0 16px;
}

.group-heading .field-label {
  margin-bottom: 4px;
}

.group-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.group-hint {
  flex: 0 0 auto;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 700;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.group-card {
  position: relative;
  min-height: 88px;
  padding: 13px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  text-align: center;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.group-card::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(32, 35, 31, 0.24);
  border-radius: 50%;
  color: #fff;
  font-size: 0.65rem;
  line-height: 1;
}

.group-card:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 68, 56, 0.45);
}

.group-card.is-selected {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.group-card.is-selected::after {
  content: "✓";
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.2);
}

.group-card strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 1.65rem;
}

.group-card span {
  display: block;
  margin-top: 3px;
  font-size: 0.72rem;
  opacity: 0.76;
}

.primary-button,
.ghost-button {
  min-height: 46px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 150ms ease, opacity 150ms ease, background 150ms ease;
}

.primary-button {
  padding: 0 25px;
  border: 0;
  background: var(--red);
  color: #fff;
  box-shadow: 0 10px 24px rgba(168, 68, 56, 0.18);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--red-dark);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  box-shadow: none;
}

.start-button {
  width: 100%;
  margin-top: 24px;
}

.ghost-button {
  padding: 0 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink);
}

.ghost-button:hover {
  background: #fff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  padding: 13px clamp(18px, 4vw, 54px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 241, 232, 0.9);
  backdrop-filter: blur(18px);
}

.topbar-brand,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

.topbar-brand div {
  display: grid;
  gap: 2px;
}

.topbar-brand strong {
  font-size: 0.95rem;
}

.topbar-brand span:not(.mini-mark) {
  color: var(--muted);
  font-size: 0.76rem;
}

.mini-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: "STSong", serif;
  font-size: 1.05rem;
}

.save-state {
  color: var(--green);
  font-size: 0.76rem;
}

.progress-strip {
  position: sticky;
  top: 76px;
  z-index: 19;
  height: 3px;
  background: rgba(32, 35, 31, 0.08);
}

.progress-strip__bar {
  width: 0;
  height: 100%;
  background: var(--red);
  transition: width 250ms ease;
}

.survey-layout {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 34px clamp(18px, 4vw, 54px) 80px;
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(520px, 1.08fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.artwork-panel {
  position: sticky;
  top: 112px;
}

.artwork-meta {
  min-height: 65px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 14px;
}

.artwork-meta h2 {
  margin: 4px 0 0;
  font-family: Georgia, "STSong", serif;
  font-size: 2.25rem;
  line-height: 1;
}

.counter-pill,
.section-status {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(32, 35, 31, 0.07);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.image-stage {
  position: relative;
  min-height: 460px;
  height: min(67vh, 720px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(52, 47, 38, 0.13);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  touch-action: pan-y;
  user-select: none;
}

.image-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: opacity 130ms ease, transform 180ms ease;
}

.image-stage.is-changing img {
  opacity: 0.2;
  transform: scale(0.985);
}

.image-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: rgba(32, 35, 31, 0.82);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 2rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 150ms ease, background 150ms ease;
}

.image-stage:hover .image-nav,
.image-nav:focus-visible {
  opacity: 1;
}

.image-nav:disabled {
  cursor: default;
  opacity: 0 !important;
}

.image-nav--prev {
  left: 14px;
}

.image-nav--next {
  right: 14px;
}

.zoom-button {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 9px 13px;
  border: 0;
  border-radius: 999px;
  background: rgba(32, 35, 31, 0.8);
  color: #fff;
  font-size: 0.75rem;
}

.swipe-note {
  margin: 12px 4px 0;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.score-panel {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.section-heading > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.section-heading h3 {
  margin: 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 1.75rem;
  font-weight: 600;
}

.section-heading--second {
  margin-top: 42px;
}

.section-index {
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 0.8rem;
  font-weight: 800;
}

.section-intro {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.question-list {
  display: grid;
  gap: 12px;
}

.question-card {
  padding: 18px 19px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 253, 248, 0.7);
  transition: border-color 150ms ease, background 150ms ease;
}

.question-card.is-answered {
  border-color: rgba(73, 115, 92, 0.3);
  background: rgba(255, 253, 248, 0.95);
}

.question-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.question-title span {
  flex: 0 0 auto;
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 0.76rem;
  font-weight: 800;
}

.question-title h4 {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.5;
}

.option-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.option-row--five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.score-option {
  min-height: 44px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.score-option:hover {
  border-color: rgba(168, 68, 56, 0.5);
}

.score-option.is-selected {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.score-option small {
  font-weight: 500;
  opacity: 0.68;
}

.criteria-details {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.75rem;
}

.criteria-details summary {
  cursor: pointer;
  color: var(--red-dark);
  font-weight: 700;
}

.criteria-details ul {
  margin: 9px 0 0;
  padding-left: 20px;
  line-height: 1.65;
}

.completion-notice {
  position: sticky;
  bottom: 20px;
  margin-top: 24px;
  padding: 14px 18px;
  border-radius: 13px;
  background: var(--green);
  color: #fff;
  text-align: center;
  box-shadow: 0 12px 28px rgba(73, 115, 92, 0.25);
}

.directory-shell {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 50px clamp(18px, 4vw, 54px) 88px;
}

.directory-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 32px;
}

.directory-hero h2 {
  margin: 9px 0 8px;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  font-weight: 500;
}

.directory-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.completion-card {
  min-width: 150px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.8);
  text-align: right;
}

.completion-card strong,
.completion-card span {
  display: block;
}

.completion-card strong {
  font-family: Georgia, serif;
  font-size: 2rem;
  color: var(--red);
}

.completion-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.thumbnail-card {
  position: relative;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 1 / 0.83;
  border: 2px solid transparent;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(46, 39, 29, 0.07);
  text-align: left;
}

.thumbnail-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.thumbnail-card span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(32, 35, 31, 0.78);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.thumbnail-card::after {
  content: "未评分";
  position: absolute;
  right: 8px;
  top: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.thumbnail-card.is-partial {
  border-color: var(--amber);
}

.thumbnail-card.is-partial::after {
  content: "部分完成";
  color: #7a551b;
}

.thumbnail-card.is-complete {
  border-color: var(--green);
}

.thumbnail-card.is-complete::after {
  content: "已完成";
  color: var(--green);
}

.submit-panel {
  margin-top: 34px;
  padding: 25px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: 22px;
  background: var(--ink);
  color: #fff;
}

.submit-panel h3,
.submit-panel p {
  margin: 0;
}

.submit-panel h3 {
  font-family: "STSong", serif;
  font-size: 1.35rem;
}

.submit-panel p {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.82rem;
}

.zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(18, 19, 17, 0.94);
}

.zoom-modal img {
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  background: #fff;
}

.zoom-close {
  position: absolute;
  right: 24px;
  top: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 1.8rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 120;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 17px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.82rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1050px) {
  .welcome-shell {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .brand-block {
    text-align: center;
  }

  .brand-block p {
    margin-inline: auto;
  }

  .survey-layout {
    grid-template-columns: 1fr;
  }

  .artwork-panel {
    position: static;
  }

  .image-stage {
    height: min(66vh, 640px);
  }

  .thumbnail-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .welcome-screen {
    padding: 28px 16px;
  }

  .brand-block h1 {
    font-size: 3.4rem;
  }

  .entry-card {
    padding: 24px 19px;
  }

  .group-grid {
    grid-template-columns: repeat(5, minmax(54px, 1fr));
    gap: 6px;
  }

  .group-card {
    min-height: 76px;
    border-radius: 13px;
  }

  .group-card strong {
    font-size: 1.35rem;
  }

  .group-card span {
    font-size: 0.62rem;
  }

  .save-state {
    display: none;
  }

  .topbar {
    min-height: 68px;
    padding: 10px 14px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions .ghost-button {
    min-height: 42px;
    padding-inline: 14px;
  }

  .progress-strip {
    top: 68px;
  }

  .survey-layout {
    padding: 20px 14px 64px;
    gap: 30px;
  }

  .image-stage {
    min-height: 360px;
    height: 55vh;
    border-radius: 18px;
  }

  .image-stage .image-nav {
    opacity: 0.75;
  }

  .image-nav {
    width: 38px;
    height: 38px;
  }

  .option-row,
  .option-row--five {
    grid-template-columns: 1fr;
  }

  .score-option {
    justify-content: flex-start;
    padding-left: 14px;
  }

  .section-heading h3 {
    font-size: 1.45rem;
  }

  .directory-shell {
    padding: 32px 14px 70px;
  }

  .directory-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .completion-card {
    text-align: left;
  }

  .thumbnail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }

  .submit-panel {
    position: sticky;
    bottom: 12px;
    z-index: 10;
    padding: 18px;
    align-items: stretch;
    flex-direction: column;
  }

  .submit-panel .primary-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
