:root {
  --ink: #171511;
  --muted: #6f6a61;
  --paper: #f7f2e8;
  --surface: #fffaf1;
  --line: rgba(45, 36, 24, 0.16);
  --gold: #b98232;
  --green: #526b53;
  --red: #8e3f33;
  --shadow: 0 18px 48px rgba(35, 26, 15, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(185, 130, 50, 0.12), transparent 24rem),
    linear-gradient(180deg, #171511 0, #232016 460px, #efe5d3 860px, var(--paper) 1180px);
  font-family:
    "Noto Serif SC", "Songti SC", "Microsoft YaHei", "PingFang SC", serif;
}

.review-dock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  display: grid;
  gap: 6px;
  width: 148px;
  padding: 12px;
  color: var(--ink);
  background: rgba(255, 250, 241, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.review-dock strong {
  font-size: 13px;
}

.review-dock a {
  padding: 7px 8px;
  color: #4c4438;
  background: rgba(185, 130, 50, 0.1);
  border-radius: 4px;
  font-size: 13px;
}

.review-dock a:hover {
  color: #fffaf1;
  background: var(--red);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 54px);
  background: rgba(247, 242, 232, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff8e9;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 18px;
  color: #403a31;
  font-size: 14px;
}

.main-nav a {
  padding: 8px 0;
  border-bottom: 1px solid transparent;
}

.main-nav a:hover {
  border-color: var(--gold);
}

.main-nav a[aria-current="page"] {
  color: var(--red);
  border-color: var(--gold);
}

.section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 72px 0;
}

.subpage-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 72px 0 38px;
  color: #fff9ed;
}

.subpage-hero h1 {
  margin-bottom: 18px;
  color: #fff9ed;
  font-size: clamp(52px, 9vw, 104px);
}

.subpage-hero .lead {
  color: #fff9ed;
}

.subpage-hero-copy {
  max-width: 760px;
}

.subpage-hero-copy p:not(.lead) {
  max-width: 680px;
  color: rgba(255, 249, 237, 0.78);
}

.subpage-note {
  align-self: end;
  padding: 24px;
  color: var(--ink);
  background-color: rgba(255, 250, 241, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.subpage-note strong {
  display: block;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 20px;
}

.subpage-note p {
  margin: 0;
  color: var(--muted);
}

.subpage-tool {
  padding-top: 28px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 34px;
  width: 100%;
  min-height: calc(100vh - 72px);
  padding: 72px clamp(18px, 4vw, 54px);
  align-items: center;
  color: #fff9ed;
  background:
    linear-gradient(90deg, rgba(18, 16, 12, 0.78) 0%, rgba(18, 16, 12, 0.48) 36%, rgba(18, 16, 12, 0.14) 100%),
    linear-gradient(180deg, rgba(18, 16, 12, 0.32) 0%, rgba(18, 16, 12, 0.08) 48%, rgba(239, 229, 211, 0.88) 100%),
    url("../assets/hero-seasonal-bg.png") center / cover no-repeat;
  overflow: hidden;
}

.hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 18% 26%, rgba(185, 130, 50, 0.18), transparent 28rem),
    linear-gradient(135deg, rgba(23, 21, 17, 0.28), transparent 52%);
  pointer-events: none;
}

.hero::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 240px;
  content: "";
  background:
    linear-gradient(180deg, rgba(239, 229, 211, 0), rgba(239, 229, 211, 0.76) 54%, var(--paper) 100%),
    radial-gradient(ellipse at 58% 68%, rgba(255, 250, 241, 0.3), transparent 34rem);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--gold);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(58px, 11vw, 132px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.08;
}

h3 {
  margin-bottom: 10px;
  font-size: 21px;
}

p {
  color: inherit;
  line-height: 1.8;
}

.lead {
  font-size: clamp(21px, 3vw, 32px);
  line-height: 1.35;
}

.hero-copy p:not(.lead) {
  max-width: 660px;
  color: rgba(255, 249, 237, 0.78);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
}

.button.primary {
  color: #fffaf1;
  background: var(--red);
  border-color: var(--red);
}

.button.ghost {
  color: inherit;
  background: rgba(255, 250, 241, 0.08);
  border-color: rgba(255, 250, 241, 0.36);
}

.hero-panel,
.system-card,
.result-panel,
.tool-form,
.case-grid article,
.qr-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  position: relative;
  z-index: 1;
  align-self: end;
  padding: 28px;
  color: var(--ink);
  background: rgba(255, 250, 241, 0.84);
  backdrop-filter: blur(10px);
}

.hero-panel span {
  color: var(--muted);
}

.hexagram-stage {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 6px;
}

.hexagram-stage b {
  display: grid;
  width: 54px;
  height: 64px;
  place-items: center;
  color: var(--ink);
  background: rgba(185, 130, 50, 0.1);
  border: 1px solid rgba(185, 130, 50, 0.24);
  border-radius: 6px;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Microsoft YaHei", sans-serif;
  font-size: 42px;
  font-weight: 400;
  line-height: 1;
}

.hero-panel strong {
  font-size: 40px;
  line-height: 1;
}

.hero-panel small {
  display: block;
  margin-bottom: 14px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
}

.hero-panel p {
  color: var(--muted);
}

.compact,
.tool-section,
.contact-section {
  position: relative;
  color: var(--ink);
}

.compact:first-of-type {
  margin-top: -54px;
  padding-top: 110px;
}

.compact:first-of-type::before {
  position: absolute;
  top: 0;
  right: calc(50% - 50vw);
  left: calc(50% - 50vw);
  height: 180px;
  content: "";
  background:
    linear-gradient(180deg, rgba(247, 242, 232, 0), rgba(247, 242, 232, 0.72) 42%, var(--paper) 100%),
    radial-gradient(ellipse at 64% 18%, rgba(185, 130, 50, 0.11), transparent 38rem);
  pointer-events: none;
}

.compact:first-of-type > * {
  position: relative;
  z-index: 1;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading p {
  color: var(--muted);
}

.system-grid,
.case-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.system-card,
.case-grid article {
  min-height: 220px;
  padding: 24px;
  background: rgba(255, 250, 241, 0.86);
}

.system-card span,
.case-grid span {
  color: var(--gold);
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 700;
}

.system-card p,
.case-grid p {
  color: var(--muted);
}

.review-section {
  border-top: 1px solid var(--line);
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.review-grid article {
  min-height: 240px;
  padding: 22px;
  background: rgba(255, 250, 241, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.review-grid h3 {
  color: var(--red);
}

.review-grid ul {
  margin: 0;
  padding-left: 19px;
  color: var(--muted);
  line-height: 1.9;
}

.review-grid strong {
  color: var(--ink);
}

.review-command {
  background: rgba(82, 107, 83, 0.12) !important;
}

.review-command p {
  margin-bottom: 10px;
  color: #3e4e3f;
  line-height: 1.65;
}

.mvp-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.mvp-flow article,
.helper-panel,
.result-summary {
  padding: 16px;
  background: rgba(255, 250, 241, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mvp-flow strong,
.helper-panel strong {
  display: block;
  margin-bottom: 6px;
  color: #393126;
}

.mvp-flow p,
.helper-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.tool-section {
  border-top: 1px solid var(--line);
}

.tool-layout,
.community-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
}

.tool-form,
.result-panel {
  padding: 22px;
  background: rgba(255, 250, 241, 0.92);
}

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

.tool-form label {
  display: grid;
  gap: 7px;
  color: #3d382f;
  font-weight: 700;
}

.tool-form .wide,
.tool-form button {
  grid-column: 1 / -1;
}

.tool-form .quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tool-form .quick-actions button {
  grid-column: auto;
  min-height: 34px;
  padding: 0 12px;
  color: var(--green);
  background: #fffdf8;
  border: 1px solid rgba(82, 107, 83, 0.28);
  border-radius: 4px;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid rgba(45, 36, 24, 0.18);
  border-radius: 4px;
}

textarea {
  resize: vertical;
}

.result-panel {
  min-height: 300px;
}

.result-panel h3 {
  color: var(--red);
}

.result-summary {
  margin-bottom: 18px;
  background: rgba(142, 63, 51, 0.08);
  border-color: rgba(142, 63, 51, 0.18);
}

.result-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.result-summary strong {
  display: block;
  margin: 4px 0 6px;
  color: var(--red);
  font-size: 28px;
}

.result-summary p {
  margin-bottom: 0;
  color: var(--muted);
}

.result-panel ul {
  margin: 0 0 18px;
  padding-left: 20px;
  line-height: 1.8;
}

.table-wrap {
  width: 100%;
  margin-bottom: 18px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  background: #fffdf8;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: #4c4438;
  background: rgba(185, 130, 50, 0.12);
}

.contact-note {
  padding: 14px;
  color: #463f35;
  background: rgba(82, 107, 83, 0.12);
  border: 1px solid rgba(82, 107, 83, 0.2);
  border-radius: 6px;
  line-height: 1.7;
}

.empty-state {
  display: grid;
  min-height: 250px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-row button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(255, 250, 241, 0.7);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.filter-row button.active {
  color: #fffaf1;
  background: var(--green);
  border-color: var(--green);
}

.post-list {
  display: grid;
  gap: 12px;
}

.post {
  padding: 18px;
  background: rgba(255, 250, 241, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.post header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.post h3 {
  margin-bottom: 4px;
}

.post small,
.post p {
  color: var(--muted);
}

.post button {
  min-width: 76px;
  min-height: 32px;
  color: var(--green);
  background: transparent;
  border: 1px solid rgba(82, 107, 83, 0.32);
  border-radius: 4px;
  cursor: pointer;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 24px;
  align-items: center;
  border-top: 1px solid var(--line);
}

.contact-section p {
  color: var(--muted);
}

.qr-card {
  margin: 0;
  padding: 14px;
  background: #fffaf1;
  text-align: center;
}

.qr-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
}

.qr-card figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px clamp(18px, 4vw, 54px);
  color: rgba(255, 249, 237, 0.75);
  background: #171511;
}

@media (max-width: 920px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .hero,
  .subpage-hero,
  .tool-layout,
  .community-layout,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 48px;
  }

  .system-grid,
  .case-grid,
  .review-grid,
  .mvp-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .review-dock {
    display: none;
  }

  .site-header {
    gap: 10px;
    padding: 12px 18px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .main-nav {
    width: 100%;
    gap: 2px 16px;
    font-size: 13px;
  }

  .main-nav a {
    padding: 5px 0;
  }

  .section {
    width: min(100% - 24px, 1180px);
    padding: 48px 0;
  }

  .subpage-hero {
    width: min(100% - 24px, 1180px);
    padding-top: 48px;
  }

  .system-grid,
  .case-grid,
  .review-grid,
  .mvp-flow,
  .tool-form {
    grid-template-columns: 1fr;
  }

  .system-card,
  .case-grid article {
    min-height: auto;
  }

  .hero-panel strong {
    font-size: 32px;
  }

  .hexagram-stage b {
    width: 48px;
    height: 56px;
    font-size: 36px;
  }
}

/* Formal diagnosis module merge */
.diagnosis-heading {
  margin-bottom: 28px;
}

.diagnosis-module {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  gap: 20px;
  align-items: start;
}

.diagnosis-panel,
.diagnosis-result-preview,
.diagnosis-side-card {
  background: rgba(255, 252, 245, 0.88);
  border: 1px solid rgba(121, 92, 45, 0.16);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(70, 48, 25, 0.1);
}

.diagnosis-panel,
.diagnosis-result-preview {
  padding: 26px;
}

.diagnosis-side {
  display: grid;
  gap: 14px;
}

.diagnosis-side-card {
  padding: 20px;
}

.diagnosis-side-card strong {
  display: block;
  color: #2b2118;
  font-size: 18px;
  margin-bottom: 8px;
}

.diagnosis-side-card span,
.diagnosis-result-preview p,
.module-lead {
  color: #766a5e;
  line-height: 1.85;
}

.symptom-row,
.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.symptom-row button,
.mode-row button {
  border: 1px solid rgba(121, 92, 45, 0.25);
  background: #fffaf0;
  border-radius: 999px;
  color: #4a3520;
  cursor: pointer;
  font: inherit;
  padding: 9px 14px;
}

.mode-row button:first-child {
  background: #1f1b16;
  color: #fff8e8;
}

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

.diagnosis-form-preview label {
  display: grid;
  gap: 8px;
  color: #4f4338;
}

.diagnosis-form-preview input,
.diagnosis-form-preview textarea,
.diagnosis-form-preview select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(121, 92, 45, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: #2a211a;
  font: inherit;
  padding: 12px 13px;
}

.diagnosis-output-dark {
  background: #1f1b16;
  border-radius: 8px;
  color: #f8efe0;
  margin-top: 18px;
  padding: 22px;
}

.diagnosis-output-dark h3 {
  margin-top: 0;
}

.diagnosis-output .accuracy-badge,
.diagnosis-output h3,
.diagnosis-output ul,
.diagnosis-output p {
  max-width: 920px;
}

.followup-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.followup-options button {
  border: 1px solid rgba(121, 92, 45, 0.25);
  background: #fffaf0;
  border-radius: 999px;
  color: #4a3520;
  cursor: pointer;
  font: inherit;
  padding: 9px 14px;
}

.diagnosis-wechat {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(121, 92, 45, 0.16);
  border-radius: 8px;
  background: rgba(255, 252, 245, 0.78);
}

.diagnosis-wechat img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 6px;
}

.diagnosis-wechat p {
  margin: 0;
  color: #6f6257;
  line-height: 1.75;
}

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

  .diagnosis-panel,
  .diagnosis-result-preview {
    padding: 20px;
  }

  .diagnosis-wechat {
    grid-template-columns: 1fr;
  }
}
