* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --paper: #f6efe3;
  --paper-deep: #eadfcf;
  --ink: #1f1a17;
  --ink-soft: #645b54;
  --accent: #d85a32;
  --accent-dark: #8f3118;
  --accent-pale: rgba(216, 90, 50, 0.14);
  --olive: #53624b;
  --line: rgba(31, 26, 23, 0.12);
  --card: rgba(255, 249, 241, 0.88);
  --shadow: 0 18px 40px rgba(80, 47, 25, 0.12);
}

body {
  font-family: 'STZhongsong', 'PingFang SC', 'Microsoft YaHei', serif;
  background:
    radial-gradient(circle at top left, rgba(216, 90, 50, 0.16), transparent 22%),
    radial-gradient(circle at bottom right, rgba(83, 98, 75, 0.12), transparent 26%),
    var(--paper);
  color: var(--ink);
  min-height: 100vh;
  touch-action: manipulation;
  overflow-x: hidden;
}

.home-page,
.gallery-page,
.test-page,
.result-page {
  position: relative;
}

.home-page::before,
.gallery-page::before,
.result-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(31, 26, 23, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 26, 23, 0.028) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.scene-lights {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.light-bulb {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.45;
  animation: drift 8s ease-in-out infinite;
}

.light-bulb:nth-child(1) {
  top: -30px;
  left: -40px;
  background: rgba(216, 90, 50, 0.22);
}

.light-bulb:nth-child(2) {
  top: 12%;
  right: -50px;
  background: rgba(245, 171, 84, 0.24);
  animation-delay: 2s;
}

.light-bulb:nth-child(3) {
  bottom: -40px;
  left: 15%;
  background: rgba(83, 98, 75, 0.16);
  animation-delay: 4s;
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -12px, 0) scale(1.08); }
}

.home-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px;
}

.home-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
}

.hero {
  width: min(980px, 100%);
  background: linear-gradient(145deg, rgba(255, 249, 241, 0.92), rgba(234, 223, 207, 0.72));
  border: 1px solid rgba(31, 26, 23, 0.08);
  border-radius: 36px;
  box-shadow: var(--shadow);
  padding: 52px 42px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  width: 140px;
  height: 34px;
  background: rgba(216, 90, 50, 0.18);
  border: 1px dashed rgba(31, 26, 23, 0.15);
  transform: rotate(-7deg);
  top: 16px;
}

.hero::before {
  left: 48px;
}

.hero::after {
  right: 48px;
  transform: rotate(8deg);
}

.logo {
  margin-bottom: 18px;
}

.logo img {
  height: 92px;
  width: auto;
  filter: drop-shadow(0 10px 20px rgba(216, 90, 50, 0.16));
}

.title {
  font-size: clamp(3.2rem, 9vw, 6rem);
  line-height: 0.95;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}

.title-word {
  display: inline-block;
  color: var(--ink);
  text-shadow: 3px 3px 0 rgba(216, 90, 50, 0.16);
  animation: pop 0.45s ease backwards;
}

.title-word:nth-child(1) { animation-delay: 0.08s; }
.title-word:nth-child(2) { animation-delay: 0.16s; }
.title-word:nth-child(3) { animation-delay: 0.24s; }
.title-word:nth-child(4) { animation-delay: 0.32s; }

@keyframes pop {
  from { opacity: 0; transform: translateY(12px) rotate(-4deg); }
  to { opacity: 1; transform: translateY(0) rotate(0deg); }
}

.subtitle {
  margin-bottom: 26px;
  min-height: 32px;
}

.typing-text {
  font-size: 1.06rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.work-tags {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(620px, 100%);
  margin: 0 auto 30px;
}

.work-tag {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(31, 26, 23, 0.08);
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.45;
  box-shadow: 0 8px 18px rgba(80, 47, 25, 0.06);
}

.home-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 6px;
}

.start-btn,
.gallery-btn,
.restart-btn,
.back-btn {
  font-family: inherit;
}

.start-btn,
.gallery-btn {
  min-width: 220px;
  padding: 16px 24px;
  border-radius: 18px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.start-btn {
  background: linear-gradient(135deg, var(--accent), #ef7b44);
  color: #fff;
  box-shadow: 0 14px 28px rgba(216, 90, 50, 0.22);
}

.gallery-btn {
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  border-color: rgba(31, 26, 23, 0.1);
}

.start-btn:hover,
.gallery-btn:hover,
.restart-btn:hover,
.back-btn:hover,
.gallery-item:hover,
.option:hover,
.tag:hover {
  transform: translateY(-3px);
}

.btn-icon {
  font-size: 1.1rem;
}

.bottom-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: min(920px, 100%);
  margin: 0 auto;
}

.stat {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(31, 26, 23, 0.08);
  border-radius: 22px;
  text-align: center;
  padding: 20px 16px;
  box-shadow: 0 10px 24px rgba(80, 47, 25, 0.06);
}

.stat-num {
  display: block;
  font-size: 2rem;
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-label {
  display: block;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.gallery-page {
  min-height: 100vh;
  display: none;
  padding: 32px 28px 50px;
}

.gallery-header {
  width: min(1180px, 100%);
  margin: 0 auto 24px;
  background: rgba(255, 249, 241, 0.88);
  border: 1px solid rgba(31, 26, 23, 0.08);
  border-radius: 28px;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow);
}

.gallery-heading {
  min-width: 0;
}

.back-btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(31, 26, 23, 0.1);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(80, 47, 25, 0.06);
}

.gallery-title {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  margin-bottom: 8px;
  line-height: 1.12;
}

.gallery-subtitle {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.gallery-subtitle span {
  color: var(--accent-dark);
  font-weight: 700;
}

.gallery-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}

.gallery-item {
  background: rgba(255, 249, 241, 0.88);
  border: 1px solid rgba(31, 26, 23, 0.08);
  border-radius: 24px;
  padding: 16px 14px 18px;
  text-align: center;
  position: relative;
  box-shadow: 0 12px 24px rgba(80, 47, 25, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  overflow: hidden;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(216, 90, 50, 0.72), rgba(242, 180, 94, 0.4));
  opacity: 0;
  transition: opacity 0.22s ease;
}

.gallery-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 12px;
  background: rgba(31, 26, 23, 0.06);
}

.gallery-name {
  font-size: 0.98rem;
  line-height: 1.35;
  margin-bottom: 5px;
  font-weight: 700;
}

.gallery-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(31, 26, 23, 0.08);
}

.hidden-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #ef7b44);
  color: #fff;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.gallery-item.hidden-item {
  background: linear-gradient(180deg, rgba(255, 244, 231, 0.92), rgba(255, 249, 241, 0.88));
  border-color: rgba(216, 90, 50, 0.22);
}

.gallery-item:hover {
  box-shadow: 0 18px 30px rgba(80, 47, 25, 0.1);
}

.gallery-item:hover::after {
  opacity: 1;
}

.test-page {
  min-height: 100vh;
  display: none;
  padding: 32px 16px 44px;
}

.test-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 35%);
  pointer-events: none;
}

.test-header,
.question-card,
.options,
.test-footer {
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.test-header {
  margin-bottom: 24px;
}

.progress {
  height: 12px;
  border-radius: 999px;
  background: rgba(31, 26, 23, 0.08);
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #f2b45e);
  border-radius: 999px;
  transition: width 0.28s ease;
}

.question-count {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.question-card {
  background: rgba(255, 249, 241, 0.92);
  border: 1px solid rgba(31, 26, 23, 0.08);
  border-radius: 30px;
  padding: 30px 26px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  position: relative;
}

.question-card::before {
  /* removed 'Q' decorative label as requested */
  content: '';
}

.question-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--accent-pale);
  color: var(--accent-dark);
  font-size: 1.6rem;
  margin-bottom: 16px;
}

.question-text {
  font-size: clamp(1.16rem, 2.8vw, 1.48rem);
  line-height: 1.72;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px;
  border-radius: 20px;
  background: rgba(255, 249, 241, 0.88);
  border: 1px solid rgba(31, 26, 23, 0.08);
  box-shadow: 0 10px 22px rgba(80, 47, 25, 0.05);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  line-height: 1.65;
}

.option.selected {
  border-color: rgba(216, 90, 50, 0.4);
  background: linear-gradient(135deg, rgba(255, 249, 241, 0.96), rgba(255, 237, 219, 0.92));
  box-shadow: 0 14px 28px rgba(216, 90, 50, 0.12);
}

.option-label {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--ink);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
}

.test-footer {
  margin-top: 28px;
}

.mood-indicator {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.mood-emoji {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 18px rgba(80, 47, 25, 0.05);
  animation: bounce 2.2s ease-in-out infinite;
}

.mood-emoji:nth-child(2) { animation-delay: 0.25s; }
.mood-emoji:nth-child(3) { animation-delay: 0.5s; }
.mood-emoji:nth-child(4) { animation-delay: 0.75s; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.result-page {
  min-height: 100vh;
  display: none;
  padding: 40px 16px 50px;
}

.result-badge,
.result-card {
  width: min(860px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.result-badge {
  margin-bottom: 16px;
  text-align: center;
}

.badge-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(31, 26, 23, 0.08);
  color: var(--ink-soft);
  font-size: 0.84rem;
  letter-spacing: 0.06em;
}

.result-card {
  background: rgba(255, 249, 241, 0.94);
  border: 1px solid rgba(31, 26, 23, 0.08);
  border-radius: 32px;
  box-shadow: var(--shadow);
  padding: 24px 24px 20px;
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 10px;
  background: linear-gradient(90deg, var(--accent), #f2b45e, var(--olive));
}

.result-image-wrapper {
  position: relative;
  width: 200px;
  margin: 0 auto 18px;
}

.result-image {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid rgba(31, 26, 23, 0.08);
  box-shadow: 0 16px 30px rgba(80, 47, 25, 0.14);
  background: rgba(31, 26, 23, 0.05);
}

.result-shine {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background: linear-gradient(120deg, transparent 25%, rgba(255, 255, 255, 0.35) 50%, transparent 75%);
  transform: translateX(-120%);
  animation: sweep 3.2s ease-in-out infinite;
}

@keyframes sweep {
  0% { transform: translateX(-120%); }
  50%, 100% { transform: translateX(120%); }
}

.result-type {
  text-align: center;
  color: var(--accent-dark);
  font-size: 0.86rem;
  letter-spacing: 0.18em;
  margin-bottom: 10px;
}

.result-meta {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(216, 90, 50, 0.08);
  color: var(--ink-soft);
  font-size: 0.82rem;
  margin: 0 auto 16px;
}

.result-name {
  text-align: center;
  font-size: clamp(1.8rem, 5vw, 2.9rem);
  line-height: 1.12;
  margin-bottom: 16px;
}

.result-section-label {
  /* make section labels block-level so they always sit on their own line */
  display: block;
  text-align: center;
  margin: 12px 0 10px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-section-label::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: rgba(31, 26, 23, 0.22);
  vertical-align: middle;
  margin-right: 8px;
}

.result-section-label-accent {
  color: var(--accent-dark);
}

.result-section-label-accent::before {
  background: rgba(216, 90, 50, 0.42);
}

.result-desc,
.result-insight {
  border-radius: 24px;
  padding: 18px 18px;
  line-height: 1.82;
  font-size: 0.98rem;
  text-align: left;
}

.result-desc {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(31, 26, 23, 0.08);
  color: var(--ink);
  margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.result-insight {
  background: rgba(216, 90, 50, 0.08);
  border: 1px dashed rgba(216, 90, 50, 0.26);
  color: var(--accent-dark);
  margin-bottom: 18px;
  position: relative;
}

.result-insight::before {
  content: 'NOTE';
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(143, 49, 24, 0.34);
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}

.tag,
.hidden-hint {
  font-size: 0.82rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1.5px solid rgba(31, 26, 23, 0.12);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(80, 47, 25, 0.08);
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}

.hidden-hint {
  position: relative;
  display: grid;
  place-items: center;
  width: fit-content;
  min-width: min(100%, 260px);
  max-width: 100%;
  margin: 14px auto 20px;
  padding: 16px 28px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 240, 191, 0.85), rgba(255, 211, 110, 0.18) 32%, transparent 56%),
    linear-gradient(135deg, rgba(94, 31, 0, 0.98), rgba(38, 11, 1, 0.97));
  border: 1px solid rgba(255, 224, 155, 0.42);
  color: #fff6db;
  box-shadow:
    0 18px 40px rgba(94, 34, 5, 0.24),
    inset 0 1px 0 rgba(255, 244, 208, 0.38),
    inset 0 -10px 26px rgba(255, 179, 71, 0.1);
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  animation: unlockReveal 560ms cubic-bezier(.2,.9,.3,1) both;
}

.hidden-hint::before,
.hidden-hint::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.hidden-hint::before {
  inset: 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 239, 189, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 36%, rgba(255, 214, 124, 0.08));
}

.hidden-hint::after {
  top: -26px;
  left: 50%;
  width: 132px;
  height: 72px;
  background: radial-gradient(circle, rgba(255, 236, 170, 0.7), rgba(255, 236, 170, 0));
  transform: translateX(-50%);
  opacity: 0.72;
  filter: blur(10px);
}

.hidden-hint-text,
.hidden-hint-orbit,
.hidden-hint-spark {
  position: relative;
  z-index: 1;
}

.hidden-hint-text {
  display: inline-block;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: #fff2c8;
  text-shadow:
    0 0 12px rgba(255, 217, 119, 0.32),
    0 2px 14px rgba(255, 184, 68, 0.24);
}

.hidden-hint-orbit {
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  border: 1px dashed rgba(255, 218, 116, 0.24);
  opacity: 0.8;
}

.hidden-hint-spark {
  position: absolute;
  top: 50%;
  color: #ffd36d;
  font-size: 1.05rem;
  text-shadow: 0 0 18px rgba(255, 214, 105, 0.48);
  animation: twinkle 1.8s ease-in-out infinite;
}

.hidden-hint-spark-left {
  left: 16px;
  transform: translateY(-50%);
}

.hidden-hint-spark-right {
  right: 16px;
  transform: translateY(-50%);
  animation-delay: 0.45s;
}

/* extra flashy effects when anim class is present */
.hidden-hint.anim {
  position: relative;
}

.hidden-hint.anim::after {
  content: '';
  position: absolute;
  left: -18%;
  top: -24%;
  width: 44%;
  height: 150%;
  background: linear-gradient(90deg, rgba(255,255,255,0.0), rgba(255,240,196,0.78), rgba(255,255,255,0.0));
  transform: rotate(-18deg) translateX(-140%);
  filter: blur(10px);
  opacity: 0.95;
  animation: shimmer 1500ms ease-in-out;
}

@keyframes shimmer {
  0% { transform: rotate(-18deg) translateX(-140%); opacity: 0; }
  40% { opacity: 0.95; }
  100% { transform: rotate(-18deg) translateX(300%); opacity: 0; }
}

@keyframes unlockReveal {
  0% { transform: translateY(6px) scale(0.96); opacity: 0; filter: blur(2px); }
  60% { transform: translateY(-2px) scale(1.04); opacity: 1; filter: none; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.45; transform: translateY(-50%) scale(0.84) rotate(0deg); }
  50% { opacity: 1; transform: translateY(-50%) scale(1.16) rotate(12deg); }
}

.result-btns {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.result-restart-btn,
.result-generate-btn {
  min-width: 260px;
  padding: 18px 22px;
  border-radius: 24px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.96rem;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.result-restart-btn::before,
.result-generate-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 52%);
  pointer-events: none;
}

.result-restart-btn {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(241, 232, 220, 0.9));
  border: 1.5px solid rgba(31, 26, 23, 0.12);
  box-shadow: 0 14px 28px rgba(80, 47, 25, 0.08);
}

.result-generate-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent) 56%, #ef8b52);
  border: 1.5px solid rgba(255, 239, 228, 0.3);
  box-shadow: 0 18px 34px rgba(216, 90, 50, 0.28);
}

.result-restart-btn:hover,
.result-generate-btn:hover {
  transform: translateY(-4px);
}

.result-restart-btn:hover {
  box-shadow: 0 20px 34px rgba(80, 47, 25, 0.12);
  border-color: rgba(31, 26, 23, 0.18);
}

.result-generate-btn:hover {
  box-shadow: 0 22px 40px rgba(216, 90, 50, 0.34);
}

.result-btn-icon,
.result-btn-copy {
  position: relative;
  z-index: 1;
}

.result-btn-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.result-restart-btn .result-btn-icon {
  background: rgba(31, 26, 23, 0.08);
  color: var(--ink);
}

.result-generate-btn .result-btn-icon {
  background: rgba(255, 255, 255, 0.16);
  color: #fff7f1;
}

.result-btn-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.result-btn-copy strong {
  font-size: 1rem;
  line-height: 1.2;
}

.result-btn-copy em {
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0.72;
}

.result-generate-btn .result-btn-copy em {
  opacity: 0.82;
}

/* Poster overlay buttons */
#posterOverlay button#posterCloseBtn {
  display: inline-block;
}


@media (min-width: 900px) {
  .hero {
    padding: 64px 58px 46px;
  }

  .result-card {
    padding: 42px 42px 34px;
  }

  .result-desc,
  .result-insight {
    padding: 20px 22px;
  }
}

@media (max-width: 768px) {
  .home-page,
  .gallery-page {
    padding: 18px;
  }

  .hero {
    padding: 40px 22px 28px;
    border-radius: 28px;
  }

  .hero::before,
  .hero::after {
    width: 90px;
    height: 24px;
    top: 12px;
  }

  .hero::before { left: 18px; }
  .hero::after { right: 18px; }

  .work-tags {
    grid-template-columns: 1fr;
  }

  .bottom-bar {
    grid-template-columns: 1fr;
  }

  .gallery-header {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 18px;
  }

  .back-btn {
    justify-self: start;
  }

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

  .question-card {
    padding: 24px 18px;
    border-radius: 24px;
  }

  .option {
    padding: 15px 14px;
    border-radius: 16px;
  }

  .result-card {
    padding: 28px 18px 24px;
    border-radius: 26px;
  }

  .result-btns {
    flex-direction: column;
  }

  .result-restart-btn,
  .result-generate-btn {
    width: 100%;
    min-width: 0;
  }

  .result-image-wrapper,
  .result-image {
    width: 160px;
    height: 160px;
  }

  .hidden-hint {
    min-width: min(100%, 280px);
    padding: 16px 32px;
  }

  .hidden-hint-text {
    font-size: 1rem;
  }

  .result-desc,
  .result-insight {
    font-size: 0.92rem;
  }

  .result-insight::before {
    top: 8px;
    right: 12px;
  }
}

@media (max-width: 480px) {
  .home-page,
  .gallery-page,
  .test-page,
  .result-page {
    padding-left: 12px;
    padding-right: 12px;
  }

  .logo img {
    height: 74px;
  }

  .start-btn,
  .gallery-btn,
  .restart-btn,
  .result-restart-btn,
  .result-generate-btn {
    width: 100%;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  .result-image-wrapper,
  .result-image {
    width: 142px;
    height: 142px;
  }

  .hidden-hint {
    margin-bottom: 18px;
    padding-left: 20px;
    padding-right: 20px;
    min-width: 230px;
  }

  .hidden-hint-spark-left {
    left: 12px;
  }

  .hidden-hint-spark-right {
    right: 12px;
  }

  .hidden-badge {
    font-size: 0.62rem;
    padding: 4px 8px;
  }
}

/* ============================================
   POSTER TEMPLATE - Mobile-friendly Vertical Layout
   ============================================ */
#posterTemplate {
  width: 540px;
  height: 900px;
  background: #fffcf5;
  position: fixed;
  left: -9999px;
  top: 0;
  overflow: hidden;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #1a1a1a;
}

/* 顶部装饰条 */
#posterTemplate .poster-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #ff5a36, #ff8a5c, #3d6b54);
}

/* 主内容区 */
#posterTemplate .poster-main {
  padding: 28px 24px 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 顶部Logo */
#posterTemplate .poster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

#posterTemplate.compact .poster-header {
  margin-bottom: 4px;
}

#posterTemplate .poster-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

#posterTemplate .poster-logo img {
  width: 36px;
  height: 36px;
}

#posterTemplate .poster-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: #ff5a36;
  letter-spacing: 2px;
  line-height: 34px;
}

#posterTemplate .poster-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: linear-gradient(135deg, #ff5a36, #ff8a5c);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
}

#posterTemplate .poster-badge.hidden-persona {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
}


/* 1. 人格形象 - 正方形 */
#posterTemplate .poster-avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.15);
  background: #f5f0e8;
}

/* 2. 人格名称 */
#posterTemplate .poster-name {
  margin-top: 20px;
  font-size: 42px;
  font-weight: 900;
  color: #111;
  line-height: 1.1;
  letter-spacing: -1px;
  word-break: break-word;
}

#posterTemplate.compact .poster-name {
  margin-top: 10px;
}

/* 隐藏类型 */
#posterTemplate .poster-type {
  display: none;
}

/* 3. 人格介绍 */
#posterTemplate .poster-desc {
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.65;
  color: #444;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  line-clamp: 4;
}

#posterTemplate.compact .poster-desc {
  margin-top: 8px;
}

#posterTemplate .poster-tags-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: auto; /* push to bottom of main */
  padding-bottom: 12px; /* move row down from the edge */
}

#posterTemplate .poster-tags-left {
  flex: 1;
  padding-right: 16px;
  height: 116px; /* same as QR to force bottom alignment */
  display: flex;
  align-items: center;
}

#posterTemplate .poster-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto; /* push tags down to match QR bottom */
}

#posterTemplate .poster-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  border-radius: 20px;
}

/* QR code, enlarged */
#posterTemplate .poster-qr {
  width: 116px !important;
  height: 116px !important;
  flex-shrink: 0;
  background: #fff;
  padding: 5px;
  border-radius: 8px;
  border: 1px solid #eee;
}

#posterOverlayImg {
  border-radius: 16px !important;
}
