:root {
  --bg: #f3f3f2;
  --paper: #ffffff;
  --ink: #262626;
  --muted: #707070;
  --line: #ece7df;
  --gold: #a8793a;
  --gold-dark: #8b642f;
  --gold-soft: #fbf4e9;
  --green: #5d8f76;
  --red: #b66a60;
  --blue: #5f7fa0;
  --shadow: 0 12px 32px rgba(33, 28, 22, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: #e9e7e3;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(168, 121, 58, 0.12), transparent 26%),
    linear-gradient(180deg, #f8f6f1 0%, #e6e8e5 100%);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

button {
  font: inherit;
}

.mini-app {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 96px;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(38, 38, 38, 0.04), var(--shadow);
  overflow: hidden;
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 22px;
  color: #202020;
  font-size: 17px;
  font-weight: 750;
}

.phone-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.signal {
  width: 20px;
  height: 14px;
  border: 3px solid #202020;
  border-top: 0;
  border-left: 0;
  transform: skew(-8deg);
}

.battery {
  min-width: 30px;
  padding: 2px 5px;
  border-radius: 7px;
  background: #343434;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  text-align: center;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 58px 1fr 108px;
  align-items: center;
  height: 70px;
  padding: 0 16px;
  border-bottom: 1px solid #eeeeee;
  background: rgba(250, 250, 249, 0.96);
  backdrop-filter: blur(18px);
}

h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 760;
  text-align: center;
  letter-spacing: 0;
}

.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
}

.icon-button::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 3px solid #111;
  border-radius: 50%;
}

.icon-button::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 3px;
  right: 5px;
  bottom: 8px;
  border-radius: 2px;
  background: #111;
  transform: rotate(45deg);
}

.menu-pill {
  justify-self: end;
  display: grid;
  grid-template-columns: 1fr 1px 38px;
  align-items: center;
  width: 106px;
  height: 40px;
  border: 1px solid #e6e2db;
  border-radius: 22px;
  background: #fff;
  color: #111;
}

.menu-pill span {
  text-align: center;
  font-size: 20px;
  letter-spacing: 2px;
}

.menu-pill i {
  width: 20px;
  height: 20px;
  margin: 0 auto;
  border: 4px solid #111;
  border-radius: 50%;
}

.menu-pill::before {
  content: "";
  width: 1px;
  height: 24px;
  background: #eeeae4;
  grid-column: 2;
  grid-row: 1;
}

.view[hidden] {
  display: none;
}

.home-view {
  padding: 18px 22px 22px;
}

.home-hero {
  display: grid;
  gap: 12px;
  padding: 24px 20px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(37, 48, 41, 0.90), rgba(88, 75, 52, 0.86)),
    #263027;
  color: #fff;
}

.home-hero span {
  color: #ead7ad;
  font-size: 12px;
  font-weight: 800;
}

.home-hero h2 {
  margin: 0;
  font-size: 29px;
  line-height: 1.18;
  letter-spacing: 0;
}

.home-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.80);
  font-size: 15px;
  line-height: 1.65;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.home-stats div {
  display: grid;
  gap: 4px;
  min-height: 76px;
  align-content: center;
  padding: 12px 8px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  background: #fffaf2;
  text-align: center;
}

.home-stats strong {
  color: var(--gold-dark);
  font-size: 24px;
}

.home-stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.home-tags {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.home-tags button {
  min-height: 48px;
  border: 1px solid #dfc8a9;
  border-radius: 8px;
  background: #fff;
  color: var(--gold-dark);
  font-weight: 760;
}

.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.primary-link,
.secondary-link {
  display: grid;
  min-height: 48px;
  place-items: center;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.primary-link {
  background: var(--gold);
  color: #fff;
}

.secondary-link {
  border: 1px solid #d6bea0;
  background: #fff;
  color: var(--gold-dark);
}

.featured-cases {
  margin-top: 22px;
}

.featured-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.featured-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 820;
}

.featured-head a {
  color: var(--gold-dark);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

#featuredFeed {
  display: grid;
  gap: 12px;
}

.featured-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #eee7dd;
  border-radius: 8px;
  background: #fff;
}

.featured-image {
  width: 92px;
  height: 92px;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: #f5f1ea;
  overflow: hidden;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.featured-card div {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.featured-card span {
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 800;
}

.featured-card strong {
  font-size: 16px;
  line-height: 1.45;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 18px 26px 8px;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.tabs {
  display: flex;
  gap: 22px;
}

.tab {
  position: relative;
  border: 0;
  padding: 8px 0 10px;
  background: transparent;
  color: #777;
  font-size: 18px;
  font-weight: 760;
}

.tab.active {
  color: #222;
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 24px;
  height: 3px;
  border-radius: 999px;
  background: var(--gold);
  transform: translateX(-50%);
}

.category-strip {
  display: flex;
  gap: 10px;
  padding: 8px 22px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.category {
  flex: 0 0 auto;
  height: 34px;
  border: 1px solid #d7bea1;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--gold-dark);
  font-size: 14px;
  font-weight: 700;
}

.category.active {
  background: var(--gold);
  color: #fff;
}

.feed {
  border-top: 1px solid #eeeeee;
}

.case-card {
  position: relative;
  padding: 28px 26px 18px;
  border-bottom: 1px solid #eeeeee;
  background: #fff;
}

.case-profile {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(168, 121, 58, 0.18), rgba(93, 143, 118, 0.16)),
    #f4f0eb;
  display: grid;
  place-items: center;
  color: var(--gold-dark);
  font-size: 18px;
  font-weight: 800;
}

.case-profile strong {
  display: block;
  margin-bottom: 2px;
  font-size: 18px;
  font-weight: 760;
}

.case-profile span {
  color: var(--muted);
  font-size: 15px;
}

.case-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 760;
  line-height: 1.55;
}

.elite {
  display: inline-flex;
  align-items: center;
  height: 28px;
  margin-right: 8px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  vertical-align: 2px;
}

.case-summary {
  margin: 0 0 14px;
  color: #636363;
  font-size: 17px;
  line-height: 1.7;
  text-decoration: underline;
  text-decoration-color: rgba(168, 121, 58, 0.62);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.screenshot-button {
  position: relative;
  display: block;
  width: 100%;
  height: 260px;
  margin: 0 0 12px;
  border: 1px solid #efe9e1;
  border-radius: 8px;
  padding: 0;
  background: #f7f5f2;
  overflow: hidden;
  cursor: zoom-in;
}

.screenshot-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.screenshot-button::after {
  content: "查看完整截图";
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 760;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tag-row {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tag-row::-webkit-scrollbar {
  display: none;
}

.tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 34px;
  border: 1px solid #c9a16f;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--gold-dark);
  font-size: 14px;
  font-weight: 760;
}

.tag::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.tag[data-kind="身心归位"]::before {
  background: var(--green);
}

.tag[data-kind="关系和谐"]::before {
  background: var(--red);
}

.tag[data-kind="觉醒喜乐"]::before {
  background: var(--gold);
}

.tag[data-kind="心力恢复"]::before {
  background: var(--blue);
}

.metrics {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 13px;
  color: #555;
  font-size: 16px;
}

.metrics span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 430px);
  height: 74px;
  border-top: 1px solid #eeeeee;
  background: rgba(255, 255, 255, 0.96);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.bottom-nav a {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: #555;
  text-decoration: none;
}

.bottom-nav a.active {
  color: var(--gold);
}

.bottom-nav em {
  font-style: normal;
  font-size: 13px;
}

.home-icon,
.case-icon,
.assessment-icon {
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
}

.home-icon {
  border-radius: 5px;
  transform: rotate(45deg) scale(0.82);
}

.case-icon {
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-35deg);
}

.assessment-icon {
  border-radius: 6px;
  position: relative;
}

.assessment-icon::before,
.assessment-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.assessment-icon::before {
  top: 7px;
}

.assessment-icon::after {
  top: 14px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.82);
}

.lightbox.open {
  display: grid;
}

.lightbox img {
  max-width: min(92vw, 520px);
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.36);
}

.close-button {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 30px;
  line-height: 1;
}

@media (max-width: 430px) {
  body {
    background: #fff;
  }

  .mini-app {
    box-shadow: none;
  }

  .app-header {
    grid-template-columns: 48px 1fr 100px;
    padding: 0 12px;
  }

  h1 {
    font-size: 18px;
  }

  .case-card {
    padding-left: 22px;
    padding-right: 22px;
  }

  .home-view {
    padding-left: 16px;
    padding-right: 16px;
  }

  .home-hero h2 {
    font-size: 26px;
  }
}
