:root {
  --bg: #f7f1e8;
  --paper: #fff;
  --ink: #202124;
  --muted: #7a7268;
  --line: #e6dccc;
  --accent: #c95745;
  --answer: #fc8197;
  --teal: #2b6f68;
  --orange: #c97935;
  --shadow: 0 12px 28px rgba(75, 58, 38, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

body.home-bg {
  background:
    linear-gradient(180deg, rgba(255, 242, 246, 0.12), rgba(255, 242, 246, 0.18)),
    url("./assets/home-bg.webp") center top / cover fixed no-repeat;
}

body.dim-bg.dim-sleep { background: #eef5ff; }
body.dim-bg.dim-housework { background: #f0f7e9; }
body.dim-bg.dim-clean { background: #eef8f5; }
body.dim-bg.dim-food { background: #fff4df; }
body.dim-bg.dim-money { background: #f5efff; }
body.dim-bg.dim-privacy { background: #fff0f3; }
body.dim-bg.dim-social { background: #edf4ff; }
body.dim-bg.dim-conflict { background: #fff1e8; }

button,
input {
  font: inherit;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

button[hidden] {
  display: none;
}

button.secondary {
  color: var(--ink);
  background: #fff;
  border: 1px solid #999999;
}

button.icon-text {
  min-height: 36px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #999999;
  font-size: 13px;
}

input {
  width: 100%;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 87, 69, 0.14);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 35px;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 25px;
  line-height: 1.18;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: 0;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 96px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero {
  padding: 42px 2px 24px;
}

.hero.compact {
  padding-top: 24px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.lead {
  max-width: 20em;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.hint {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.panel label {
  font-size: 14px;
  font-weight: 900;
}

.topbar,
.question-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  margin: -18px -16px 0;
  padding: 8px 16px;
  background: rgba(247, 241, 232, 0.94);
  border-bottom: 1px solid rgba(230, 220, 204, 0.9);
  backdrop-filter: blur(16px);
}

body.dim-bg .topbar,
body.dim-bg .question-top,
body.dim-bg .bottom-actions {
  background: rgba(255, 253, 248, 0.8);
}

body.home-bg .topbar {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
}

.topbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.question-top div {
  display: grid;
  gap: 2px;
  text-align: right;
}

.question-top strong {
  font-size: 15px;
}

.question-top span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.section-head {
  padding: 24px 2px 14px;
}

.section-head .hint {
  max-width: 22em;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.category-card {
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper);
  text-align: center;
  box-shadow: var(--shadow);
}

.category-card strong {
  display: block;
  font-size: 19px;
  line-height: 1.2;
}

.page-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 2px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.page-indicator span:last-child {
  display: inline-flex;
  gap: 5px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #d8cbbb;
}

.dot.is-active {
  width: 18px;
  background: var(--teal);
}

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

.question-card {
  padding: 16px;
  border: 1px solid #eeeeee;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.question-text {
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.45;
}

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

.answer-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  padding: 0 12px;
  border: 1px solid #dddddd;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  font-weight: 900;
}

.answer-option::after {
  content: none;
}

.answer-option.is-selected {
  color: #fff;
  border-color: transparent;
}

.answer-option.is-selected[data-value="yes"] {
  background: var(--answer);
}

.answer-option.is-selected[data-value="no"] {
  background: var(--answer);
}

.answer-option.is-selected::after {
  background: #fff;
}

.bottom-actions {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 6;
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(247, 241, 232, 0.94);
  border-top: 1px solid rgba(230, 220, 204, 0.9);
  backdrop-filter: blur(16px);
}

.bottom-actions button,
.bottom-actions a {
  width: min(100%, 488px);
  margin: 0 auto;
}

.bottom-actions.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.bottom-actions.two button {
  width: 100%;
  max-width: 239px;
}

.result-panel {
  display: grid;
  gap: 12px;
  padding: 16px 0;
}

.result-card {
  padding: 16px;
  border: 1px solid #eeeeee;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.result-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.completion-list,
.answer-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.completion-item,
.answer-item {
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #eeeeee;
}

.completion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 900;
}

.completion-item span {
  color: var(--muted);
  font-size: 12px;
}

.dimension-result + .dimension-result {
  margin-top: 16px;
}

.dimension-result h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dimension-result h3 span {
  color: var(--muted);
  font-size: 12px;
}

.answer-item p {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
}

.answer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.badge.yes {
  background: var(--answer);
}

.badge.no {
  background: #9a9a9a;
}

.badge.empty {
  color: var(--muted);
  background: #e3d8c8;
}

.image-preview {
  display: grid;
  gap: 10px;
  padding-bottom: 10px;
}

.image-preview[hidden] {
  display: none;
}

.image-preview img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 88px;
  left: 16px;
  z-index: 20;
  display: none;
  width: fit-content;
  max-width: min(360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 9px 12px;
  border: 1px solid rgba(185, 79, 69, 0.18);
  border-radius: 999px;
  color: #9b3e35;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 10px 24px rgba(75, 58, 38, 0.12);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
  backdrop-filter: blur(14px);
}

.toast.is-active {
  display: block;
}
