:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #65736d;
  --line: #dbe3de;
  --paper: #fbfcf8;
  --panel: #ffffff;
  --mint: #dff2e6;
  --green: #21634c;
  --gold: #c18a12;
  --coral: #d76b55;
  --blue: #3c6f93;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(216, 237, 214, 0.9), transparent 28rem),
    linear-gradient(135deg, #fbfcf8 0%, #eef5f0 42%, #f9f4ea 100%);
}

a {
  color: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
}

#siteTitle {
  cursor: default;
  user-select: none;
}

.ghost-link,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.ghost-link[hidden],
.primary-link[hidden] {
  display: none !important;
}

.primary-link {
  width: 100%;
  border-color: transparent;
  background: var(--green);
  color: white;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 18px;
}

.search-box {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 40px rgba(33, 99, 76, 0.08);
}

.search-box span {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.result-meta {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  min-width: 132px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
}

.result-meta strong {
  font-size: 24px;
}

.result-meta span {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

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

.stats-grid div {
  min-height: 70px;
  border: 1px solid rgba(33, 99, 76, 0.14);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.stats-grid strong {
  display: block;
  margin-bottom: 3px;
  color: var(--green);
  font-size: 26px;
  line-height: 1.05;
}

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

.member-grid {
  column-count: 3;
  column-gap: 16px;
}

.member-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  break-inside: avoid;
  margin-bottom: 16px;
  border: 1px solid rgba(33, 99, 76, 0.12);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(23, 33, 29, 0.06);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--green), var(--blue));
  color: white;
  font-size: 20px;
  font-weight: 800;
}

.avatar-large {
  width: 78px;
  height: 78px;
  font-size: 34px;
}

.card-head h2 {
  margin-bottom: 3px;
  font-size: 18px;
  line-height: 1.2;
}

.card-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.skill-line {
  margin-bottom: 0;
  color: #31413a;
  font-size: 15px;
  line-height: 1.55;
}

.mini-facts {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr 1fr;
  gap: 8px;
}

.mini-facts div {
  min-width: 0;
  border-radius: 8px;
  padding: 10px;
  background: #f4f7f2;
}

dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.stars {
  color: #b9c2bc;
  white-space: nowrap;
}

.stars .is-active {
  color: var(--gold);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  text-align: center;
}

.load-row,
.load-status {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.load-status {
  min-height: 42px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.load-row .ghost-link {
  min-width: 160px;
  cursor: pointer;
}

.load-row .ghost-link:disabled {
  cursor: wait;
  opacity: 0.62;
}

.detail-shell {
  max-width: 960px;
}

.detail-card {
  border: 1px solid rgba(33, 99, 76, 0.14);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 45px rgba(23, 33, 29, 0.08);
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.detail-hero h2 {
  margin-bottom: 10px;
  font-size: 30px;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-badges span {
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--mint);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.feature-block {
  margin: 22px 0;
  border-left: 4px solid var(--coral);
  padding: 2px 0 2px 16px;
}

.feature-block h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.feature-block p {
  margin-bottom: 0;
  color: #31413a;
  line-height: 1.7;
}

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

.field-item {
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcf8;
}

.field-item dd {
  font-weight: 600;
  line-height: 1.55;
}

.field-item.is-locked {
  width: 100%;
  margin: 0;
  border: 1px dashed #c9c3b4;
  background: #f3f1ea;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.field-item.is-locked dd {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.field-item.is-locked small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.lock-mask {
  letter-spacing: 2px;
  color: #8a8374;
}

.lock-hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.unlock-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin: 0 0 16px;
  border: 1px dashed var(--gold);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff8e8;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.unlock-banner strong {
  display: block;
  margin-bottom: 4px;
}

.unlock-banner small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.lock-icon {
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1;
}

.unlock-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 33, 29, 0.42);
}

.unlock-mask[hidden] {
  display: none;
}

.unlock-card {
  width: min(440px, 100%);
}

.unlock-card h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.unlock-card > p {
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.6;
}

.form-shell {
  max-width: 980px;
}

.form-card {
  border: 1px solid rgba(33, 99, 76, 0.14);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 45px rgba(23, 33, 29, 0.08);
}

.form-section + .form-section,
.notice-box,
.form-message {
  margin-top: 24px;
}

.form-section h2,
.notice-box h2 {
  margin-bottom: 14px;
  font-size: 20px;
}

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

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

.field-control {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field-control span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.field-control b,
.check-row b {
  color: var(--coral);
}

.field-control small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-control input,
.field-control select,
.field-control textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fbfcf8;
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
  outline: 0;
}

.field-control textarea {
  resize: vertical;
}

.field-control input:focus,
.field-control select:focus,
.field-control textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(33, 99, 76, 0.12);
}

.field-control.is-invalid input,
.field-control.is-invalid select,
.field-control.is-invalid textarea,
.check-row.is-invalid {
  border-color: var(--coral);
}

.notice-box {
  border: 1px solid rgba(215, 107, 85, 0.32);
  border-radius: 8px;
  padding: 18px;
  background: #fff8f2;
}

.notice-box p {
  margin-bottom: 14px;
  color: #4f4d44;
  line-height: 1.75;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: 800;
}

.check-row input {
  margin-top: 2px;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-message {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.form-message.is-error {
  color: #a33d2d;
}

.form-message.is-success {
  color: var(--green);
  font-weight: 800;
}

.form-submit {
  margin-top: 12px;
  border: 0;
  cursor: pointer;
}

.form-submit:disabled {
  cursor: wait;
  opacity: 0.66;
}

.tabs {
  display: flex;
  gap: 10px;
  margin: 20px 0;
}

.tabs .ghost-link.is-active {
  border-color: var(--green);
  background: var(--mint);
  color: var(--green);
}

.status-filter {
  min-width: 140px;
}

.admin-list {
  display: grid;
  gap: 14px;
}

.admin-item-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.admin-item-head h2 {
  margin-bottom: 6px;
  font-size: 20px;
}

.admin-item-head p {
  margin: 0;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-actions .primary-link,
.admin-actions .ghost-link {
  width: auto;
  border: 1px solid var(--line);
  cursor: pointer;
}

.admin-actions .primary-link {
  border-color: transparent;
}

.invite-box {
  margin-top: 16px;
}

.invite-box .form-submit {
  width: auto;
}

.invite-code-line {
  margin: 12px 0 8px;
  font-size: 15px;
}

.invite-code-line strong {
  color: var(--green);
  font-size: 28px;
  letter-spacing: 2px;
}

.invite-list p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1024px) {
  .member-grid {
    column-count: 2;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .topbar,
  .toolbar,
  .detail-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions .ghost-link {
    flex: 1;
  }

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

  .result-meta {
    min-height: 52px;
  }

  .form-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
  }

  .stats-grid div {
    min-height: 58px;
    padding: 10px 12px;
  }

  .stats-grid strong {
    margin-bottom: 2px;
    font-size: 22px;
  }

  .stats-grid span {
    font-size: 12px;
  }

  .member-grid {
    column-count: 1;
  }

  .mini-facts {
    grid-template-columns: 1fr 1fr;
  }

  .detail-card {
    padding: 18px;
  }

  .form-card {
    padding: 18px;
  }

  .admin-item-head {
    flex-direction: column;
  }
}
