:root {
  --bg: #f6efe4;
  --bg2: #efe3d2;
  --panel: #fffaf2;
  --card: #fff8ee;
  --line: #d8c7b2;
  --text: #3a2b22;
  --muted: #7d6758;
  --accent: #b86a4a;
  --accent-2: #7b9e78;
  --accent-3: #d39d52;
  --shadow: 0 12px 30px rgba(92,63,44,.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, Georgia, serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #fff8ee 0%, rgba(255,248,238,0) 35%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  min-height: 100vh;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.hero, .panel, .question-card, .result-card {
  background: rgba(255, 250, 242, .92);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px 24px;
  margin-bottom: 18px;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.1;
  letter-spacing: .3px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f9efdf;
  border: 1px solid #e5d5be;
  color: #8a5a3d;
  font-size: 13px;
}

.panel {
  padding: 16px 18px;
  margin-bottom: 16px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.progress-wrap {
  margin-top: 12px;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #eadcca;
  overflow: hidden;
  border: 1px solid #dcc7aa;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-3), var(--accent-2));
  transition: width .25s ease;
}

.question-card {
  padding: 22px 20px;
}

.q-kicker {
  font-size: 12px;
  letter-spacing: .12em;
  color: #9c7d67;
  text-transform: uppercase;
}

.q-title {
  margin: 6px 0 6px;
  font-size: 26px;
  line-height: 1.25;
}

.q-desc {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px;
  background: var(--card);
  cursor: pointer;
  transition: .18s ease;
  user-select: none;
}

.option:hover {
  transform: translateY(-1px);
  border-color: #c9ae92;
  background: #fff4e7;
}

.option.selected {
  border-color: var(--accent);
  background: #fdf0e5;
  box-shadow: 0 0 0 2px rgba(184,106,74,.12) inset;
}

.hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.likert-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.rank-list {
  display: grid;
  gap: 10px;
}

.rank-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.rank-actions {
  display: flex;
  gap: 8px;
}

.btns {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

button {
  border: none;
  border-radius: 16px;
  padding: 12px 18px;
  font-weight: 700;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: .18s ease;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #c98562);
  box-shadow: 0 8px 20px rgba(184,106,74,.22);
}

.primary:hover {
  transform: translateY(-1px);
}

.secondary {
  color: var(--text);
  background: #f4eadc;
  border: 1px solid var(--line);
}

.secondary:hover {
  background: #efe2d0;
}

.ghost {
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--line);
}

.result-card {
  display: none;
  padding: 22px 20px;
  margin-top: 18px;
}

.result-head {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: start;
}

.portrait {
  width: 180px;
  height: 230px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #efe2d0;
}

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

.result-name {
  margin: 4px 0 8px;
  font-size: 34px;
  line-height: 1.1;
}

.badges, .axes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f8eddc;
  border: 1px solid #e4d2b8;
  color: #8a5a3d;
  font-size: 12px;
}

.result-sub {
  margin: 0;
  color: var(--muted);
}

.section-title {
  margin: 22px 0 10px;
  font-size: 20px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.mini-card {
  padding: 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
}

.share-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f8eddc;
  border: 1px solid #e2cfb1;
}

.footer-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.footer-info {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.footer-info a {
  color: var(--accent);
  text-decoration: none;
}

.footer-info a:hover {
  text-decoration: underline;
}

.copyright {
  margin-bottom: 4px;
}

@media (max-width: 760px) {
  .result-head {
    grid-template-columns: 1fr;
  }
  
  .portrait {
    width: 100%;
    max-width: 260px;
    height: 320px;
  }
  
  .likert-row {
    grid-template-columns: 1fr;
  }
  
  .mini-grid {
    grid-template-columns: 1fr;
  }
  
  .btns {
    justify-content: flex-start;
  }
}
