:root {
  color-scheme: light;
  --ink: #182321;
  --muted: #66736f;
  --subtle: #8a7770;
  --paper: #fffdf8;
  --surface: #ffffff;
  --surface-warm: #f5efe6;
  --surface-cool: #eaf4f1;
  --line: #ded6ca;
  --line-strong: #c9b9aa;
  --teal: #168a7a;
  --teal-dark: #0d5f58;
  --coral: #e8664f;
  --coral-soft: #ffe5dc;
  --gold: #b7832f;
  --blue-gray: #4e6875;
  --danger: #b94a3b;
  --success: #2d8b57;
  --shadow: 0 18px 44px rgba(40, 30, 20, 0.12);
  --page-pad: 32px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(234, 244, 241, 0.72), rgba(255, 253, 248, 0) 260px),
    var(--paper);
  font-family:
    "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui,
    sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

img {
  display: block;
  max-width: 100%;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px var(--page-pad);
  background: rgba(255, 253, 248, 0.9);
  border-bottom: 1px solid rgba(222, 214, 202, 0.82);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--coral));
  border-radius: 8px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  white-space: nowrap;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 13px;
  color: var(--muted);
  border-radius: 8px;
  white-space: nowrap;
}

.nav-tabs a.active,
.nav-tabs a:hover {
  color: var(--teal-dark);
  background: var(--surface-cool);
}

.nav-tabs svg,
button svg,
.trust-row svg,
.payment-tags svg,
.insight-list svg,
.status-pill svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
  flex: 0 0 auto;
}

.header-actions,
.hero-actions,
.payment-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.primary-button {
  padding: 0 16px;
  color: #fff;
  background: var(--teal);
  box-shadow: 0 10px 22px rgba(22, 138, 122, 0.2);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.secondary-button {
  padding: 0 15px;
  color: var(--teal-dark);
  background: var(--surface-cool);
  border-color: rgba(22, 138, 122, 0.18);
}

.ghost-button {
  padding: 0 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.8);
}

.icon-button {
  width: 42px;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.hero {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  display: grid;
  align-items: end;
  padding: 92px var(--page-pad) 38px;
}

.hero-bg,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-bg {
  object-fit: cover;
  object-position: center;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(255, 253, 248, 0.96), rgba(255, 253, 248, 0.78) 34%, rgba(255, 253, 248, 0.18) 72%),
    linear-gradient(0deg, rgba(24, 35, 33, 0.2), rgba(24, 35, 33, 0));
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(300px, 600px) minmax(300px, 410px);
  gap: 28px;
  align-items: end;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 0.84rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
}

h1 {
  font-size: 4rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.15rem;
}

.hero-lede {
  max-width: 560px;
  margin: 18px 0 0;
  color: #45514d;
  font-size: 1.08rem;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0;
}

.trust-row span,
.payment-tags span,
.status-pill,
.insight-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 11px;
  color: var(--teal-dark);
  background: rgba(234, 244, 241, 0.9);
  border: 1px solid rgba(22, 138, 122, 0.16);
  border-radius: 8px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.quick-search,
.match-panel,
.topic-panel,
.event-panel,
.gift-panel,
.ops-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(222, 214, 202, 0.92);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.quick-search {
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.panel-title strong {
  color: var(--coral);
  font-size: 1.4rem;
}

.filter-grid,
.advanced-search {
  display: grid;
  gap: 14px;
}

label,
fieldset {
  min-width: 0;
}

label > span,
legend {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

select,
input[type="range"] {
  width: 100%;
}

select {
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

input[type="range"] {
  accent-color: var(--teal);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-ui {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  margin: 0;
  background: #cfc7bc;
  border-radius: 999px;
  transition: background 0.16s ease;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  transition: transform 0.16s ease;
}

.switch-row input:checked + .switch-ui {
  background: var(--teal);
}

.switch-row input:checked + .switch-ui::after {
  transform: translateX(18px);
}

.quick-search .secondary-button {
  width: 100%;
  margin-top: 16px;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  max-width: 1180px;
  margin: -22px auto 0;
  padding: 0 var(--page-pad);
  position: relative;
  z-index: 2;
}

.metrics-strip div {
  min-height: 106px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.metrics-strip div:first-child {
  border-radius: 8px 0 0 8px;
}

.metrics-strip div:last-child {
  border-radius: 0 8px 8px 0;
}

.metrics-strip strong {
  display: block;
  color: var(--teal-dark);
  font-size: 1.8rem;
}

.metrics-strip span {
  color: var(--muted);
  font-weight: 700;
}

.section-block {
  max-width: 1180px;
  margin: 0 auto;
  padding: 70px var(--page-pad) 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segmented button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
}

.segmented button.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 5px rgba(40, 30, 20, 0.1);
}

.profile-grid,
.membership-grid,
.ops-grid {
  display: grid;
  gap: 18px;
}

.profile-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(40, 30, 20, 0.08);
}

.profile-photo {
  position: relative;
  min-height: 272px;
  background-image: url("./assets/profile-grid.png");
  background-repeat: no-repeat;
  background-size: 300% 200%;
  background-position: var(--pos);
}

.profile-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(24, 35, 33, 0.46), rgba(24, 35, 33, 0) 58%);
}

.score-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  color: #fff;
  background: rgba(22, 138, 122, 0.88);
  border-radius: 8px;
  font-weight: 800;
}

.profile-body {
  padding: 16px;
}

.profile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-top h3 {
  margin-bottom: 4px;
}

.profile-meta,
.profile-school,
.profile-bio {
  color: var(--muted);
}

.profile-meta {
  margin: 0;
  font-size: 0.92rem;
}

.profile-school {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0;
  font-weight: 700;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 14px;
}

.tag-row span,
.verified-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 9px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--subtle);
  font-size: 0.82rem;
  font-weight: 700;
}

.verified-badge {
  color: var(--teal-dark);
  background: var(--surface-cool);
  border-color: rgba(22, 138, 122, 0.18);
}

.profile-actions {
  display: grid;
  grid-template-columns: 42px 42px 1fr;
  gap: 9px;
}

.profile-actions .secondary-button {
  min-width: 0;
}

.profile-actions .liked {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

.search-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 18px;
}

.search-layout .section-heading {
  grid-column: 1 / -1;
}

.advanced-search {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.advanced-search fieldset {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.advanced-search .primary-button {
  width: fit-content;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 700;
}

.check-pill input {
  accent-color: var(--teal);
}

.match-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  padding: 22px;
  text-align: center;
}

.match-ring {
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 58%, transparent 59%),
    conic-gradient(var(--teal) calc(var(--score) * 1%), #eadfd2 0);
}

.match-ring span {
  color: var(--teal-dark);
  font-size: 1.9rem;
  font-weight: 900;
}

.insight-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.membership-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.member-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.member-card.featured {
  border-color: rgba(184, 131, 47, 0.5);
  box-shadow: 0 14px 30px rgba(184, 131, 47, 0.16);
}

.member-card h3 {
  padding-right: 48px;
}

.member-card .price {
  color: var(--teal-dark);
  font-size: 1.55rem;
  font-weight: 900;
}

.member-card .price small {
  color: var(--muted);
  font-size: 0.82rem;
}

.benefit-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.benefit-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.benefit-list svg {
  width: 16px;
  height: 16px;
  color: var(--teal);
  margin-top: 3px;
  flex: 0 0 auto;
}

.recommend-label {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  color: #fff;
  background: var(--gold);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.community-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr 0.85fr;
  gap: 18px;
}

.community-heading {
  grid-column: 1 / -1;
}

.topic-panel,
.event-panel,
.gift-panel {
  padding: 18px;
}

.topic-list,
.gift-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topic-list button,
.gift-row button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.event-list,
.audit-list,
.risk-list {
  display: grid;
  gap: 10px;
}

.event-list div,
.audit-item,
.risk-list span {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.event-list div:last-child,
.audit-item:last-child,
.risk-list span:last-child {
  border-bottom: 0;
}

time {
  color: var(--coral);
  font-weight: 900;
}

.event-list b {
  color: var(--teal-dark);
  font-size: 0.86rem;
}

.operations {
  padding-bottom: 76px;
}

.status-pill.good {
  color: var(--success);
  background: rgba(45, 139, 87, 0.1);
  border-color: rgba(45, 139, 87, 0.18);
}

.ops-grid {
  grid-template-columns: 1.1fr 1fr 1fr;
}

.ops-panel {
  padding: 18px;
  box-shadow: none;
}

.audit-item {
  grid-template-columns: 1fr auto;
}

.audit-item span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.audit-actions {
  display: flex;
  gap: 7px;
}

.mini-button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.mini-button.approve {
  color: var(--success);
}

.mini-button.reject {
  color: var(--danger);
}

.data-bars {
  display: grid;
  gap: 17px;
}

.data-bars div {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 10px;
}

.data-bars span,
.risk-list em {
  color: var(--muted);
  font-style: normal;
}

.data-bars b {
  height: 10px;
  overflow: hidden;
  background: #eee4d8;
  border-radius: 999px;
}

.data-bars b::after {
  content: "";
  display: block;
  width: var(--bar);
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--coral));
  border-radius: inherit;
}

.risk-list span {
  grid-template-columns: 1fr auto;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(24, 35, 33, 0.45);
}

.modal.hidden {
  display: none;
}

.modal-panel {
  position: relative;
  width: min(920px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  background: var(--paper);
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.modal-close {
  position: sticky;
  top: 12px;
  left: calc(100% - 54px);
  z-index: 1;
}

.profile-detail {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) 1fr;
  gap: 22px;
  padding: 22px;
}

.detail-photo {
  min-height: 430px;
  border-radius: 8px;
  background-image: url("./assets/profile-grid.png");
  background-repeat: no-repeat;
  background-size: 300% 200%;
  background-position: var(--pos);
}

.detail-info {
  display: grid;
  align-content: start;
  gap: 16px;
}

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

.detail-facts span {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-facts b {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.gift-picker button {
  min-height: 72px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  min-width: 220px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  color: #fff;
  background: rgba(24, 35, 33, 0.92);
  border-radius: 8px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1080px) {
  :root {
    --page-pad: 22px;
  }

  .app-header {
    grid-template-columns: 1fr auto;
  }

  .nav-tabs {
    grid-column: 1 / -1;
    justify-content: flex-start;
    order: 3;
  }

  .hero-content,
  .search-layout,
  .profile-detail {
    grid-template-columns: 1fr;
  }

  .profile-grid,
  .ops-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .membership-grid,
  .community-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gift-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  :root {
    --page-pad: 16px;
  }

  .app-header {
    gap: 12px;
  }

  .header-actions .primary-button {
    display: none;
  }

  .brand small {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-top: 84px;
    padding-bottom: 32px;
  }

  .hero-shade {
    background:
      linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 253, 248, 0.82) 44%, rgba(255, 253, 248, 0.22)),
      linear-gradient(0deg, rgba(24, 35, 33, 0.22), rgba(24, 35, 33, 0));
  }

  h1 {
    font-size: 2.7rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .hero-lede {
    font-size: 1rem;
  }

  .hero-actions,
  .section-heading,
  .community-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .primary-button,
  .hero-actions .ghost-button,
  .section-heading .segmented,
  .section-heading .payment-tags {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .metrics-strip,
  .profile-grid,
  .membership-grid,
  .community-grid,
  .ops-grid,
  .advanced-search,
  .detail-facts,
  .gift-picker {
    grid-template-columns: 1fr;
  }

  .metrics-strip div,
  .metrics-strip div:first-child,
  .metrics-strip div:last-child {
    border-radius: 8px;
  }

  .metrics-strip {
    gap: 10px;
  }

  .profile-photo {
    min-height: 310px;
  }

  .section-block {
    padding-top: 54px;
  }

  .event-list div,
  .data-bars div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .modal {
    padding: 12px;
  }

  .detail-photo {
    min-height: 360px;
  }
}
