:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --panel-bg: #ffffff;
  --text: #1f2430;
  --sub-text: #5e6677;
  --border: #dde3ef;
  --primary: #4665f5;
  --primary-hover: #3550cd;
  --chip-bg: #eef2ff;
  --shadow: 0 8px 24px rgba(31, 36, 48, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 248, 252, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 0;
  margin: 0 auto;
  width: min(1200px, 94vw);
}

.site-logo {
  font-weight: 800;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-logo:hover {
  color: var(--primary);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.site-nav a {
  font-size: 14px;
  font-weight: 600;
  color: #3a4766;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--primary);
}

.site-nav a[aria-current="page"] {
  color: #2441cc;
}

.site-footer {
  margin-top: 40px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--border);
  background: #eef1f8;
}

.site-footer-inner {
  display: grid;
  gap: 10px;
}

.footer-brand {
  margin: 0;
  font-weight: 700;
  color: #2a3550;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.footer-nav a {
  font-size: 14px;
  color: #455374;
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--primary);
}

.footer-note {
  margin: 0;
  font-size: 13px;
  color: var(--sub-text);
  max-width: 720px;
  line-height: 1.55;
}

.page {
  width: min(1200px, 94vw);
  margin: 20px auto 36px;
}

.page > .page-header:first-child {
  margin-top: 0;
}

.breadcrumbs {
  margin: 12px auto 0;
  width: min(1200px, 94vw);
  font-size: 13px;
  color: var(--sub-text);
}

.breadcrumbs a {
  color: #4a5f9e;
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.hero {
  background: linear-gradient(135deg, #edf2ff 0%, #fff 48%, #f7f0ff 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0;
  font-size: clamp(26px, 4.5vw, 38px);
  line-height: 1.2;
}

.hero-lead {
  margin: 12px 0 0;
  font-size: 16px;
  color: #3d4a63;
  max-width: 720px;
  line-height: 1.65;
}

.hero-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: #fff;
  color: #2f3f6f;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.btn-outline:hover {
  border-color: #b9c5f3;
  background: #f8f9ff;
}

.card-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.feature-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: var(--panel-bg);
  box-shadow: 0 4px 16px rgba(31, 36, 48, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
}

.feature-card h2 {
  margin: 0;
  font-size: 17px;
  color: #1f2d52;
}

.feature-card p {
  margin: 0;
  font-size: 14px;
  color: var(--sub-text);
  line-height: 1.55;
  flex: 1;
}

.feature-card a.card-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  margin-top: 4px;
}

.feature-card a.card-link:hover {
  text-decoration: underline;
}

.section-block-title {
  margin: 32px 0 12px;
  font-size: 20px;
  color: #1f2d52;
}

.content-prose {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.intro-block {
  margin-bottom: 18px;
}

.content-prose.follows-list {
  margin-top: 22px;
}

.content-prose p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.7;
  color: #333b4f;
}

.content-prose p:last-child {
  margin-bottom: 0;
}

.prose-heading {
  margin: 0 0 10px;
  font-size: 18px;
  color: #1f2d52;
}

.article-body h2 {
  margin: 22px 0 10px;
  font-size: 18px;
  color: #1f2d52;
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body ul {
  margin: 8px 0 12px;
  padding-left: 1.25em;
  line-height: 1.65;
  color: #333b4f;
}

.article-body li {
  margin-bottom: 6px;
}

.list-page {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.list-page li {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--panel-bg);
}

.list-page a {
  font-weight: 700;
  color: #1f3ca8;
  text-decoration: none;
  font-size: 16px;
}

.list-page a:hover {
  text-decoration: underline;
}

.list-page .list-desc {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--sub-text);
  line-height: 1.55;
}

.related-inline {
  margin-top: 28px;
  padding: 16px;
  border-radius: 12px;
  border: 1px dashed #c8d2f0;
  background: #f8f9ff;
}

.inline-links {
  margin: 8px 0 0;
  padding-left: 1.2em;
  line-height: 1.7;
}

.inline-links a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.inline-links a:hover {
  text-decoration: underline;
}

.result-extra {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.result-extra h2 {
  margin: 0 0 10px;
  font-size: 17px;
  color: #1f2d52;
}

.result-extra p,
.result-extra li {
  font-size: 14px;
  line-height: 1.65;
  color: #3d4a63;
}

.result-extra ul {
  margin: 8px 0 0;
  padding-left: 1.2em;
}

.ad-slot {
  margin: 20px 0;
  min-height: 90px;
  border: 1px dashed #c5cddc;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #8b95ab;
  font-size: 13px;
  background: #fafbff;
}

.quiz-form {
  display: grid;
  gap: 14px;
}

.quiz-item {
  border: 1px solid #e3e8f4;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}

.quiz-item legend,
.quiz-q {
  font-weight: 700;
  font-size: 14px;
  color: #253257;
  margin: 0 0 8px;
}

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

.quiz-options label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: #3d4a63;
  cursor: pointer;
}

.quiz-options input {
  margin-top: 3px;
}

.quiz-result {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #c8d7ff;
  background: #f4f7ff;
  display: none;
}

.quiz-result.is-visible {
  display: block;
}

.quiz-result h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #17348f;
}

.quiz-result p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: #333b4f;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
}

.subtitle {
  margin: 8px 0 0;
  color: var(--sub-text);
}

.tabs {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab-button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tab-button:hover {
  border-color: #b9c5f3;
}

.tab-button.is-active {
  background: var(--chip-bg);
  border-color: #c6d1ff;
  color: #2441cc;
}

.tab-panel {
  margin-top: 16px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px;
}

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

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

.profile-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #fcfdff;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  --asset-accent: #2945cc;
  --asset-accent-bg: #eef2ff;
  --asset-accent-border: #c8d2f7;
  --asset-accent-bg-hover: #e1e9ff;
  --asset-chip-bg: #eef2ff;
  --asset-chip-border: #ced7fc;
  --asset-chip-text: #233fbf;
  --asset-chip-remove-bg: rgba(35, 63, 191, 0.14);
  --asset-chip-remove-bg-hover: rgba(35, 63, 191, 0.26);
}

.profile-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.profile-title {
  margin: 0;
  font-size: 18px;
}

.profile-role-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  white-space: nowrap;
}

.profile-card.role-male {
  border-color: #bcd0ff;
  background: #f3f7ff;
  --asset-accent: #2945cc;
  --asset-accent-bg: #eef2ff;
  --asset-accent-border: #c8d2f7;
  --asset-accent-bg-hover: #e1e9ff;
  --asset-chip-bg: #eef2ff;
  --asset-chip-border: #ced7fc;
  --asset-chip-text: #233fbf;
  --asset-chip-remove-bg: rgba(35, 63, 191, 0.14);
  --asset-chip-remove-bg-hover: rgba(35, 63, 191, 0.26);
}

.profile-card.role-female {
  border-color: #f0c2d8;
  background: #fff4fa;
  --asset-accent: #b03673;
  --asset-accent-bg: #ffe9f3;
  --asset-accent-border: #f0c2d8;
  --asset-accent-bg-hover: #ffdce9;
  --asset-chip-bg: #ffe9f3;
  --asset-chip-border: #f0c2d8;
  --asset-chip-text: #aa2f6d;
  --asset-chip-remove-bg: rgba(176, 54, 115, 0.16);
  --asset-chip-remove-bg-hover: rgba(176, 54, 115, 0.28);
}

.profile-card.role-single {
  border-color: #ccbdf8;
  background: #f7f4ff;
  --asset-accent: #6441c2;
  --asset-accent-bg: #efe8ff;
  --asset-accent-border: #ccbdf8;
  --asset-accent-bg-hover: #e6ddff;
  --asset-chip-bg: #efe8ff;
  --asset-chip-border: #d4c8f9;
  --asset-chip-text: #5836b5;
  --asset-chip-remove-bg: rgba(100, 65, 194, 0.16);
  --asset-chip-remove-bg-hover: rgba(100, 65, 194, 0.28);
}

.profile-card.role-male .profile-role-badge {
  color: #2047bb;
  background: #e8f0ff;
}

.profile-card.role-female .profile-role-badge {
  color: #b03673;
  background: #ffe9f3;
}

.profile-card.role-single .profile-role-badge {
  color: #6441c2;
  background: #efe8ff;
}

.profile-card.is-editing {
  transform: translateY(-1px);
}

.profile-card.role-male.is-editing {
  border-color: #7fa3ff;
  box-shadow: 0 10px 24px rgba(38, 85, 208, 0.2);
}

.profile-card.role-female.is-editing {
  border-color: #e38fba;
  box-shadow: 0 10px 24px rgba(194, 74, 131, 0.2);
}

.profile-card.role-single.is-editing {
  border-color: #a98ce8;
  box-shadow: 0 10px 24px rgba(106, 71, 186, 0.2);
}

.section-block {
  border: 1px solid #e9edf7;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
}

.section-block:last-child {
  margin-bottom: 0;
}

.section-title {
  margin: 0 0 10px;
  font-size: 15px;
  color: #253257;
}

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

.field.full {
  grid-column: 1 / -1;
}

.field.break-before {
  grid-column: 1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field[hidden] {
  display: none !important;
}

.field label {
  font-size: 13px;
  color: #3d475f;
}

.required-label::after {
  content: " *";
  color: #d83b3b;
  font-weight: 700;
}

.education-field {
  border: 1px dashed #cfd8ff;
  border-radius: 10px;
  padding: 10px;
  background: #f8faff;
}

.education-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cascade-main-label {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #243157;
}

.cascade-helper {
  margin: 0;
  font-size: 12px;
  color: #617099;
}

.education-cascade {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.cascade-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cascade-item label {
  font-size: 13px;
  color: #2f3f6f;
  font-weight: 600;
}

.field input,
.field select,
.cascade-item input,
.cascade-item select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
  outline: none;
  background: #fff;
}

.field input:focus,
.field select:focus,
.cascade-item input:focus,
.cascade-item select:focus {
  border-color: #89a0ff;
  box-shadow: 0 0 0 3px rgba(70, 101, 245, 0.14);
}

.single-role {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.single-role label {
  font-weight: 600;
}

.single-role select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 120px;
}

.house-assets-main-label {
  font-size: 13px;
  color: #3d475f;
}

.house-assets-panel {
  border: 1px dashed #d3daf2;
  border-radius: 10px;
  padding: 10px;
  background: #fafcff;
}

.house-assets-add-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

.house-assets-add-row select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
  outline: none;
  background: #fff;
}

.house-assets-add-row select:focus {
  border-color: #89a0ff;
  box-shadow: 0 0 0 3px rgba(70, 101, 245, 0.14);
}

.secondary-btn {
  border: 1px solid var(--asset-accent-border);
  background: var(--asset-accent-bg);
  color: var(--asset-accent);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.secondary-btn:hover {
  background: var(--asset-accent-bg-hover);
}

.house-assets-summary-label {
  margin: 0;
  font-size: 12px;
  color: #5d6782;
}

.asset-summary-header {
  margin: 10px 0 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.asset-count {
  margin: 0;
  font-size: 12px;
  color: #2f3f6f;
  font-weight: 600;
}

.house-assets-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.house-assets-empty {
  color: #8791aa;
  font-size: 13px;
}

.house-assets-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--asset-chip-border);
  background: var(--asset-chip-bg);
  color: var(--asset-chip-text);
  border-radius: 999px;
  padding: 4px 8px 4px 10px;
  font-size: 13px;
}

.chip-remove-btn {
  border: none;
  background: var(--asset-chip-remove-bg);
  color: var(--asset-chip-text);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  line-height: 18px;
  cursor: pointer;
  padding: 0;
}

.chip-remove-btn:hover {
  background: var(--asset-chip-remove-bg-hover);
}

.action-row {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.action-row.is-split {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.result-board {
  margin-top: 14px;
  border: 1px solid #d9e1f3;
  border-radius: 12px;
  background: #f9fbff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.result-title {
  margin: 0;
  font-size: 15px;
  color: #20305f;
}

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

.result-item {
  border: 1px solid #dce4fa;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.result-item h4 {
  margin: 0;
  font-size: 13px;
  color: #455374;
}

.result-score {
  margin: 4px 0 0;
  font-size: 26px;
  font-weight: 700;
  color: #1f3ca8;
}

.result-main-row {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.result-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: #66718f;
}

.percentile-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.percentile-ring {
  --size: 72px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: conic-gradient(#3f66dc calc(var(--p) * 1%), #e6edff 0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.percentile-ring-inner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #2445b5;
}

.percentile-text {
  margin: 0;
  font-size: 12px;
  color: #51608a;
}

.result-tip {
  margin: 0;
  font-size: 12px;
  color: #5a6583;
}

.result-conclusion {
  margin: 0;
  font-size: 14px;
  color: #20305f;
  font-weight: 700;
}

.conclusion-hero {
  border: 1px solid #c8d7ff;
  border-radius: 12px;
  background: #edf3ff;
  padding: 12px;
}

.conclusion-label {
  margin: 0;
  font-size: 12px;
  color: #4a5f9e;
  letter-spacing: 0.5px;
}

.conclusion-text {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.2;
  color: #17348f;
  font-weight: 800;
}

.conclusion-sub {
  margin: 6px 0 0;
  font-size: 12px;
  color: #52689f;
}

.result-empty {
  margin: 0;
  font-size: 14px;
  color: #5e6677;
}

.primary-btn {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 9px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

a.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary-btn:hover {
  background: var(--primary-hover);
}

@media (max-width: 900px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page {
    width: 94vw;
    margin-top: 14px;
  }

  .tab-panel {
    padding: 14px;
  }

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

  .education-cascade {
    grid-template-columns: 1fr;
  }

  .house-assets-add-row {
    grid-template-columns: 1fr;
  }

  .action-row {
    justify-content: stretch;
  }

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

  .primary-btn {
    width: 100%;
  }
}
