/* 心画·关系空间构图 — 演示样式 */

.xh-page {
  background: linear-gradient(180deg, var(--color-bg-top), var(--color-bg-bottom));
  min-height: 100%;
}

.xh-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px var(--space-page) 4px;
}

.xh-nav a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--color-text);
  text-decoration: none;
  font-size: 26px;
  line-height: 1;
}

.xh-nav h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.xh-card {
  margin: 12px var(--space-page) 16px;
  padding: 20px 18px;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.xh-card h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.xh-card p,
.xh-guide {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

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

.xh-field {
  margin-top: 16px;
}

.xh-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.xh-field input {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: var(--radius-pill);
  background: #f5f5f5;
  padding: 0 18px;
  font: inherit;
  font-size: 15px;
}

.xh-footer {
  padding: 12px var(--space-page) 28px;
}

.xh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: var(--radius-btn);
  background: var(--color-primary-strong);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.xh-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.xh-btn--ghost {
  background: #fff;
  color: var(--color-primary-strong);
  border: 1.5px solid #f0c7b8;
}

/* Canvas */
.xh-canvas-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0 var(--space-page) 12px;
}

.xh-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.xh-toolbar button,
.xh-tool {
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--color-text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.xh-toolbar .xh-tool--male {
  border-left: 3px solid #5b8def;
}

.xh-toolbar .xh-tool--female {
  border-left: 3px solid #e85a8c;
}

.xh-board {
  position: relative;
  flex: 1;
  min-height: 320px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  touch-action: none;
}

.xh-board--living {
  position: relative;
  z-index: 1;
  margin: 48px 18px 24px;
  min-height: 240px;
  height: 240px;
  border-radius: 14px;
  background: #ffffff;
  border: 2px solid rgba(0, 0, 0, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 24px rgba(60, 40, 20, 0.12);
}

.xh-figure {
  position: absolute;
  display: grid;
  place-items: center;
  cursor: grab;
  user-select: none;
  border: 2.5px solid #5b8def;
  background: transparent;
  color: #5b8def;
  font-weight: 800;
  font-size: 18px;
  box-shadow: none;
}

.xh-figure--outline {
  background: transparent !important;
}

.xh-figure.is-selected {
  border-width: 3.5px;
  outline: 2px solid rgba(255, 122, 69, 0.45);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.xh-figure--male {
  border-radius: 8px;
}

.xh-figure--female {
  border-radius: 999px;
}

.xh-board--preview {
  flex: none;
  width: 100%;
  height: 220px;
  min-height: 220px;
  margin: 0;
  pointer-events: none;
  background: #ffffff;
  border: 2px solid rgba(0, 0, 0, 0.08);
}

.xh-inspector {
  margin-top: 10px;
  padding: 12px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  display: none;
}

.xh-inspector.is-open {
  display: block;
}

.xh-inspector .row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.xh-inspector .row:last-child {
  margin-bottom: 0;
}

.xh-inspector input[type="range"] {
  flex: 1;
}

.xh-inspector input[type="color"] {
  width: 42px;
  height: 32px;
  border: 0;
  background: transparent;
  padding: 0;
}

.xh-symbol-group {
  display: flex;
  gap: 6px;
}

.xh-symbol-group button {
  min-width: 36px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e8ddd8;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.xh-symbol-group button.is-on {
  background: var(--color-option-active-bg);
  border-color: var(--color-primary);
  color: var(--color-primary-strong);
}

/* Result */
.xh-demo-bar {
  margin: 8px var(--space-page) 0;
  padding: 10px 12px;
  background: #f3f4f6;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  font-size: 12px;
  color: #475569;
}

.xh-demo-bar strong {
  color: #0f172a;
}

.xh-demo-bar select {
  width: 100%;
  margin-top: 6px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font: inherit;
  font-size: 13px;
  padding: 0 8px;
}

.xh-demo-bar .note {
  margin-top: 6px;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.45;
}

.xh-result-block {
  margin: 12px var(--space-page);
  padding: 16px;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.xh-result-block h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.xh-result-block .tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--color-option-active-bg);
  color: var(--color-primary-strong);
  font-size: 12px;
  font-weight: 700;
}

.xh-result-block p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.xh-result-block p:last-child {
  margin-bottom: 0;
}

.xh-child-note {
  margin: 0 var(--space-page) 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff8e8;
  color: #9a6b1f;
  font-size: 12px;
  line-height: 1.5;
}

.xh-course-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #f3ebe6;
  text-decoration: none;
  color: inherit;
}

.xh-course-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.xh-course-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #ffb089, #ff7a45);
}

.xh-course-item b {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.xh-course-item small {
  color: var(--color-text-muted);
  font-size: 12px;
}

.xh-course-item em {
  display: block;
  margin-top: 6px;
  color: var(--color-primary-strong);
  font-style: normal;
  font-weight: 700;
  font-size: 14px;
}

.xh-cta {
  display: block;
  margin-top: 4px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff1eb, #ffe4d6);
  text-decoration: none;
  color: var(--color-text);
}

.xh-cta strong {
  display: block;
  margin-bottom: 4px;
  color: var(--color-primary-strong);
}

.xh-cta span {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.xh-board-tip {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ——— v1.0.3 客厅关系地图 ——— */
.xh-living-page {
  background: linear-gradient(180deg, #f3ebe3 0%, #efe6dc 40%, #e8dccf 100%);
  min-height: 100%;
}

.xh-toolbar--living {
  margin: 0 16px 8px;
}

.xh-living {
  position: relative;
  margin: 0 16px;
  border-radius: 22px;
  overflow: hidden;
  min-height: 340px;
  box-shadow: 0 14px 36px rgba(60, 40, 30, 0.14);
  background: linear-gradient(180deg, #d9c4a8, #b8956e);
}

.xh-living__art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.72;
  pointer-events: none;
}

/* v1.0.4：交互板与结果回放均为纯白底；□○ 仅描边 */
.xh-board--living {
  position: relative;
  z-index: 1;
  margin: 48px 18px 24px;
  min-height: 240px;
  height: 240px;
  border-radius: 14px;
  background: #ffffff;
  border: 2px solid rgba(0, 0, 0, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 24px rgba(60, 40, 20, 0.12);
}

.xh-board--preview {
  flex: none;
  width: 100%;
  height: 220px;
  min-height: 220px;
  margin: 0;
  pointer-events: none;
  background: #ffffff;
  border: 2px solid rgba(0, 0, 0, 0.08);
}

.xh-board--preview.is-empty {
  display: grid;
  place-items: center;
}

.xh-figure.is-readonly {
  cursor: default;
  box-shadow: none;
  background: transparent !important;
}

.xh-pattern-headline {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: #c2410c;
  text-align: center;
  padding: 14px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff6ee, #ffebda);
  border: 1.5px solid #fb923c;
  box-shadow: 0 8px 20px rgba(255, 122, 69, 0.16);
}

.jh-result-compose .xh-pattern-headline {
  margin: 12px 12px 0;
}

.jh-result-compose .xh-hint {
  color: var(--color-text-muted);
}

.xh-board-preview-block .xh-btn {
  text-decoration: none;
}

.xh-living__hint {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.xh-compose-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.xh-compose-card h3 {
  margin: 8px 0 0;
  font-size: 16px;
}

.xh-result-page--home {
  background:
    linear-gradient(180deg, rgba(120, 90, 70, 0.1), transparent 28%),
    linear-gradient(180deg, #f3ebe3, #fff8f4 42%, #ffede5);
  min-height: 100%;
}

.xh-result-hero {
  margin: 8px 16px 12px;
  border-radius: 18px;
  overflow: hidden;
  min-height: 110px;
  position: relative;
  background: #8b7355 center / cover no-repeat;
  box-shadow: 0 10px 28px rgba(60, 40, 30, 0.12);
}

.xh-result-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(40, 28, 18, 0.2), rgba(40, 28, 18, 0.55));
}

.xh-result-hero__copy {
  position: relative;
  z-index: 1;
  padding: 18px 16px;
  color: #fff;
}

.xh-result-hero__copy strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.xh-result-hero__copy span {
  font-size: 12px;
  opacity: 0.92;
  line-height: 1.5;
}

.xh-compose-desc {
  margin: 0 16px 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-card);
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}
