.home-actions {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(42px, 8vw, 120px);
}

.community-button-icon {
  color: #56a9a4;
}

.community-button:hover .community-button-icon,
.community-button:focus-visible .community-button-icon {
  border-color: #65c4bd;
  box-shadow: 0 0 0 4px rgba(101, 196, 189, .15);
}

.community-page {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(820px, calc(100% - 32px));
  max-height: min(760px, calc(100dvh - 48px));
  margin: auto;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid #e2e9e9;
  border-radius: 26px;
  color: #303737;
  background:
    radial-gradient(circle at 100% 0, rgba(126, 214, 214, .14), transparent 220px),
    #fff;
  box-shadow: 0 24px 90px rgba(24, 56, 61, .2);
  overflow: hidden;
}

.community-page[open] {
  display: flex;
  flex-direction: column;
  animation: community-page-in 220ms var(--ease-out) both;
}

.community-page::backdrop {
  background: rgba(32, 50, 54, .52);
  backdrop-filter: blur(5px);
}

.community-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e6ecec;
}

.community-kicker {
  display: block;
  margin-bottom: 7px;
  color: #43a2a7;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .14em;
}

.community-header h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: -.045em;
  line-height: 1.05;
}

.community-header p {
  max-width: 520px;
  margin: 10px 0 0;
  color: #727b7d;
  font-size: 14px;
  line-height: 1.6;
}

.community-header button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #357c82;
  background: #f1f5f5;
  font-size: 22px;
  cursor: pointer;
}

.community-header button:hover { background: #e3f3f3; }
.community-header button:focus-visible { outline: 2px solid #35aeb6; outline-offset: 3px; }

.community-content {
  min-height: 0;
  margin-top: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

.community-card {
  display: grid;
  justify-items: center;
  min-width: 0;
  padding: 22px 18px 20px;
  border: 1px solid rgba(67, 162, 167, .16);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(247, 252, 252, .96), rgba(255, 255, 255, .98));
  box-shadow: 0 8px 24px rgba(47, 92, 94, .08);
  text-align: center;
}

.community-card--qq { --community-brand: #5599e9; }
.community-card--wechat { --community-brand: #50bf75; }

.community-card-heading {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 11px;
  min-width: 0;
  text-align: left;
}

.community-platform-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: var(--community-brand);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--community-brand) 14%, transparent);
  font-size: 22px;
}

.community-platform {
  display: block;
  margin-bottom: 4px;
  color: var(--community-brand);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
}

.community-card h2 {
  margin: 0;
  overflow-wrap: anywhere;
  color: #303737;
  font-size: 18px;
  line-height: 1.25;
}

.community-qr-frame {
  display: grid;
  place-items: center;
  width: min(100%, 220px);
  aspect-ratio: 1;
  margin: 24px 0 14px;
  padding: 12px;
  border: 4px solid #fff;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 9px 25px rgba(39, 68, 70, .17), 0 0 0 1px rgba(45, 96, 99, .1);
}

.community-qr-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.community-number {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  color: #7b8586;
  font-size: 12px;
}

.community-number strong {
  color: #303737;
  font: 850 17px/1 Consolas, monospace;
  letter-spacing: .04em;
}

.community-card-hint {
  margin: 9px 0 0;
  color: #8a9394;
  font-size: 11px;
}

.community-loading,
.community-message,
.community-empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  margin: 0;
  color: #788384;
  font-size: 15px;
  text-align: center;
}

.community-loading { gap: 9px; }
.community-loading i { color: #43a2a7; font-size: 26px; animation: community-spin 900ms linear infinite; }
.community-message { color: #a4665e; }

.community-empty { gap: 8px; }
.community-empty-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 5px;
  border-radius: 50%;
  color: #43a2a7;
  background: #eaf7f7;
  font-size: 34px;
}
.community-empty strong { color: #303737; font-size: 18px; }
.community-empty p { max-width: 360px; margin: 0; color: #879091; font-size: 13px; line-height: 1.6; }

#community-retry {
  display: block;
  align-self: center;
  margin: 20px auto 0;
  padding: 10px 18px;
  border: 1px solid #d4dddd;
  border-radius: 12px;
  color: #357c82;
  background: #fff;
  font: inherit;
  cursor: pointer;
}

#community-retry[hidden] { display: none; }

@keyframes community-page-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes community-spin { to { transform: rotate(360deg); } }

@media (max-width: 620px) {
  .community-grid { grid-template-columns: 1fr; }
  .community-card { grid-template-columns: minmax(0, 1fr) minmax(150px, 42vw); align-items: center; gap: 14px 18px; padding: 18px; text-align: left; }
  .community-card-heading { grid-column: 1; grid-row: 1; }
  .community-qr-frame { grid-column: 2; grid-row: 1 / span 3; width: 100%; margin: 0; }
  .community-number,
  .community-card-hint { grid-column: 1; }
  .community-card-hint { margin-top: 0; }
}

@media (max-width: 430px) {
  .home-actions { gap: 24px; }
  .community-page { width: calc(100% - 20px); max-height: calc(100dvh - 28px); padding: 22px 16px; border-radius: 21px; }
  .community-header { gap: 12px; padding-bottom: 17px; }
  .community-kicker { font-size: 9px; }
  .community-header h1 { font-size: 27px; }
  .community-header p { font-size: 12px; }
  .community-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .community-card-heading,
  .community-number,
  .community-card-hint { grid-column: 1; }
  .community-card-heading { justify-content: center; text-align: left; }
  .community-qr-frame { grid-column: 1; grid-row: auto; width: min(62vw, 210px); margin: 4px 0 0; }
  .community-number { justify-content: center; }
  .community-card-hint { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .community-page[open] { animation: none; }
  .community-loading i { animation: none; }
}
