:root {
  --ivory: #f5f8f7;
  --paper: #fffdf9;
  --ink: #24333a;
  --forest: #286474;
  --clay: #df756a;
  --sage: #72a6aa;
  --muted: #687880;
  --line: #d7e3e2;
  --violet: #796db0;
  --sun: #edb85d;
  --community-shadow: 0 24px 70px rgba(38, 83, 98, 0.2);
}

body {
  background:
    radial-gradient(circle at 8% 8%, rgba(181, 231, 232, 0.4), transparent 28rem),
    radial-gradient(circle at 95% 20%, rgba(255, 210, 196, 0.36), transparent 30rem),
    radial-gradient(circle at 55% 100%, rgba(220, 209, 245, 0.34), transparent 34rem),
    linear-gradient(145deg, #f7fbfa, #fff9f5 52%, #f7f5fc);
  background-attachment: fixed;
}

body.community-open {
  overflow: hidden;
}

.site-shell {
  isolation: isolate;
  position: relative;
}

.site-shell::before,
.site-shell::after {
  border-radius: 999px;
  content: "";
  filter: blur(4px);
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

.site-shell::before {
  background: rgba(127, 204, 210, 0.18);
  height: 240px;
  left: -90px;
  top: 28%;
  width: 240px;
}

.site-shell::after {
  background: rgba(238, 151, 134, 0.16);
  bottom: 8%;
  height: 300px;
  right: -120px;
  width: 300px;
}

.topbar {
  background: rgba(255, 253, 249, 0.68);
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 0 0 24px 24px;
  box-shadow: 0 10px 34px rgba(54, 89, 100, 0.07);
  max-width: 1440px;
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(18px);
}

.brand-mark {
  background: linear-gradient(135deg, #27687a, #695f9e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.primary-button {
  background: linear-gradient(135deg, #286f7e, #4d7d92 52%, #7768a7);
  box-shadow: 0 10px 25px rgba(56, 103, 121, 0.27);
}

.primary-button:hover {
  background: linear-gradient(135deg, #216270, #416e82 52%, #695b98);
}

.outline-button {
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(40, 100, 116, 0.55);
}

.mirror-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(239, 249, 247, 0.86)),
    var(--paper);
  border-color: rgba(106, 170, 177, 0.38);
  box-shadow: 0 20px 55px rgba(42, 92, 105, 0.14);
}

.method-card {
  overflow: hidden;
}

.method-card::before {
  border-radius: 999px;
  content: "";
  height: 90px;
  opacity: 0.36;
  position: absolute;
  right: -38px;
  top: -38px;
  width: 90px;
}

.method-card:nth-child(1) {
  background: linear-gradient(145deg, rgba(230, 248, 247, 0.9), rgba(255, 253, 249, 0.9));
  border-color: #bddeda;
}

.method-card:nth-child(1)::before {
  background: #76c5c5;
}

.method-card:nth-child(2) {
  background: linear-gradient(145deg, rgba(255, 237, 230, 0.9), rgba(255, 253, 249, 0.9));
  border-color: #f0cbbd;
}

.method-card:nth-child(2)::before {
  background: #ed957f;
}

.method-card:nth-child(3) {
  background: linear-gradient(145deg, rgba(241, 236, 255, 0.9), rgba(255, 253, 249, 0.9));
  border-color: #d6cdef;
}

.method-card:nth-child(3)::before {
  background: #9a85ca;
}

.method-card:nth-child(4) {
  background: linear-gradient(145deg, rgba(255, 247, 218, 0.9), rgba(255, 253, 249, 0.9));
  border-color: #ead69c;
}

.method-card:nth-child(4)::before {
  background: #e7ba58;
}

.quote-card {
  background: linear-gradient(145deg, rgba(219, 239, 238, 0.85), rgba(235, 229, 251, 0.78));
  border: 1px solid rgba(142, 159, 199, 0.24);
}

.auth-shell,
.admin-shell {
  background:
    radial-gradient(circle at 10% 15%, rgba(167, 225, 228, 0.55), transparent 30rem),
    radial-gradient(circle at 90% 12%, rgba(255, 198, 181, 0.46), transparent 28rem),
    linear-gradient(145deg, #f7fbfa, #fff8f4 54%, #f5f2fc);
}

.auth-card,
.admin-panel,
.admin-stats > div {
  background: rgba(255, 253, 249, 0.86);
  border-color: rgba(134, 177, 181, 0.36);
  box-shadow: 0 20px 60px rgba(48, 87, 102, 0.12);
  backdrop-filter: blur(16px);
}

.task-aside,
.report-intro,
.privacy-hero {
  background: linear-gradient(145deg, rgba(232, 248, 247, 0.56), rgba(250, 240, 250, 0.48));
  border-radius: 24px;
}

.community-nav-button {
  color: #6b5799 !important;
  font-weight: 700;
}

.community-nav-button::before {
  color: #df756a;
  content: "✦";
  margin-right: 7px;
}

.community-launcher {
  align-items: center;
  background: linear-gradient(135deg, #2e7d88, #6f63a3 62%, #d77570);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  bottom: 26px;
  box-shadow: 0 16px 38px rgba(55, 76, 111, 0.34);
  color: #fff;
  display: flex;
  font-size: 14px;
  font-weight: 750;
  gap: 9px;
  min-height: 52px;
  padding: 0 20px;
  position: fixed;
  right: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 90;
}

.community-launcher[hidden] {
  display: none;
}

.community-launcher:hover {
  box-shadow: 0 20px 42px rgba(55, 76, 111, 0.4);
  transform: translateY(-3px);
}

.community-launcher-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: inline-flex;
  font-size: 15px;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.community-overlay,
.share-overlay {
  align-items: stretch;
  background: rgba(26, 40, 48, 0.44);
  display: flex;
  inset: 0;
  justify-content: flex-end;
  opacity: 0;
  position: fixed;
  transition: opacity 0.18s ease;
  z-index: 200;
  backdrop-filter: blur(8px);
}

.community-overlay[hidden],
.share-overlay[hidden] {
  display: none;
}

.community-overlay.is-open {
  opacity: 1;
}

.community-drawer {
  background:
    radial-gradient(circle at 90% 3%, rgba(255, 210, 196, 0.46), transparent 19rem),
    radial-gradient(circle at 8% 20%, rgba(190, 232, 235, 0.5), transparent 22rem),
    #f7faf9;
  box-shadow: -20px 0 70px rgba(23, 53, 65, 0.24);
  max-width: 720px;
  overflow-y: auto;
  padding: 40px clamp(22px, 5vw, 52px) 64px;
  transform: translateX(34px);
  transition: transform 0.2s ease;
  width: min(720px, 100%);
}

.community-overlay.is-open .community-drawer {
  transform: translateX(0);
}

.community-header {
  align-items: flex-start;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.community-kicker {
  color: #d66e65;
  display: block;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.18em;
  margin-bottom: 10px;
}

.community-header h2,
.share-dialog h2 {
  color: #285d69;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(32px, 6vw, 46px);
  line-height: 1.18;
  margin: 0;
}

.community-header p,
.share-dialog > p {
  color: #64747b;
  font-size: 14px;
  line-height: 1.75;
  margin: 12px 0 0;
}

.community-close,
.share-close {
  align-items: center;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(72, 108, 118, 0.18);
  border-radius: 50%;
  color: #557078;
  display: flex;
  flex: 0 0 auto;
  font-size: 27px;
  height: 42px;
  justify-content: center;
  line-height: 1;
  width: 42px;
}

.community-guideline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
}

.community-guideline span {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(74, 130, 140, 0.18);
  border-radius: 999px;
  color: #5b747b;
  font-size: 11px;
  padding: 7px 11px;
}

.community-guideline span:first-child {
  background: #dff4f1;
  color: #2b706f;
}

.community-compose {
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(112, 163, 167, 0.3);
  border-radius: 22px;
  box-shadow: 0 15px 38px rgba(45, 87, 100, 0.1);
  padding: 22px;
}

.community-compose-title,
.community-compose-actions,
.community-feed-heading,
.community-post-top,
.community-reply-meta,
.community-reply-actions {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.community-compose-title strong {
  color: #2b5660;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 18px;
}

.community-post-counter {
  color: #87969b;
  font-size: 11px;
}

.community-moods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 17px 0 14px;
}

.community-mood {
  background: #f0f4f3;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #68777c;
  font-size: 12px;
  padding: 7px 11px;
}

.community-mood[aria-pressed="true"] {
  background: linear-gradient(135deg, #d9f1ef, #eae3f8);
  border-color: #8ebbbd;
  color: #315f6a;
  font-weight: 700;
}

.community-compose textarea,
.community-reply-form textarea {
  background: rgba(247, 250, 249, 0.86);
  border: 1px solid #d8e4e3;
  border-radius: 14px;
  color: #2c3e44;
  line-height: 1.7;
  min-height: 108px;
  padding: 14px 15px;
  resize: vertical;
  width: 100%;
}

.community-compose textarea:focus,
.community-reply-form textarea:focus,
.share-result input:focus {
  border-color: #65a3aa;
  outline: 3px solid rgba(101, 163, 170, 0.18);
}

.community-compose-actions {
  gap: 14px;
  margin-top: 14px;
}

.community-status,
.community-inline-status,
.share-status {
  color: #728187;
  font-size: 12px;
  line-height: 1.5;
}

.community-status[data-tone="success"] {
  color: #2c7a68;
}

.community-status[data-tone="error"],
.community-inline-status {
  color: #bf625c;
}

.community-submit,
.community-reply-submit,
.share-generate,
.share-copy,
.share-system {
  background: linear-gradient(135deg, #2d7480, #6b61a0);
  border: 0;
  border-radius: 12px;
  color: #fff;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 750;
  min-height: 44px;
  padding: 0 17px;
}

.community-submit:disabled,
.community-reply-submit:disabled,
.share-generate:disabled {
  cursor: wait;
  opacity: 0.54;
}

.community-feed-heading {
  margin: 36px 0 15px;
}

.community-feed-heading span {
  color: #d36f67;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.community-feed-heading h3 {
  color: #315b65;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 23px;
  margin: 3px 0 0;
}

.community-refresh {
  background: transparent;
  border-bottom: 1px solid #83a9ad;
  color: #5c7d83;
  font-size: 12px;
  padding: 5px 1px;
}

.community-feed {
  display: grid;
  gap: 14px;
  scroll-margin-top: 20px;
}

.community-post {
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid rgba(113, 159, 165, 0.24);
  border-radius: 19px;
  box-shadow: 0 10px 30px rgba(53, 85, 96, 0.07);
  padding: 19px;
}

.community-identity {
  align-items: center;
  color: #385b63;
  display: flex;
  font-size: 13px;
  gap: 9px;
}

.community-avatar {
  align-items: center;
  background: linear-gradient(145deg, #d9f0ee, #e9e2f7);
  border-radius: 50%;
  color: #4f7281;
  display: flex;
  font-family: "Noto Serif SC", "Songti SC", serif;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.community-post-meta {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.community-mood-label {
  color: #b76061;
  font-size: 11px;
}

.community-post time {
  color: #97a1a5;
  font-size: 10px;
}

.community-post-body {
  color: #34464d;
  font-size: 14px;
  line-height: 1.85;
  margin: 17px 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.community-replies {
  display: grid;
  gap: 8px;
}

.community-reply {
  background: linear-gradient(135deg, rgba(229, 243, 241, 0.67), rgba(245, 239, 250, 0.66));
  border-left: 3px solid #8dbabd;
  border-radius: 4px 12px 12px 4px;
  padding: 11px 13px;
}

.community-reply-meta span {
  color: #638086;
  font-size: 10px;
  font-weight: 700;
}

.community-reply-meta span.is-author {
  color: #bd6b62;
}

.community-reply p {
  color: #45595f;
  font-size: 12px;
  line-height: 1.7;
  margin: 5px 0 0;
  white-space: pre-wrap;
}

.community-reply-toggle {
  background: transparent;
  color: #557f86;
  font-size: 12px;
  margin-top: 13px;
  padding: 5px 0;
}

.community-reply-form {
  border-top: 1px solid #e0e9e7;
  margin-top: 10px;
  padding-top: 12px;
}

.community-reply-form[hidden] {
  display: none;
}

.community-reply-form textarea {
  min-height: 74px;
}

.community-reply-actions {
  gap: 10px;
  margin-top: 9px;
}

.community-reply-submit {
  font-size: 11px;
  min-height: 36px;
  padding: 0 13px;
}

.community-empty,
.community-loading {
  align-items: center;
  background: rgba(255, 255, 255, 0.48);
  border: 1px dashed #bdd0d0;
  border-radius: 18px;
  color: #718288;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.community-empty > span {
  color: #a187c4;
  font-size: 24px;
  margin-bottom: 8px;
}

.community-empty strong {
  color: #48656d;
}

.community-empty p,
.community-loading p {
  font-size: 12px;
  margin: 7px 0 0;
}

.community-loading > span {
  animation: community-pulse 0.9s ease-in-out infinite alternate;
  background: linear-gradient(135deg, #78b6b8, #a38dce);
  border-radius: 50%;
  height: 18px;
  width: 18px;
}

.share-report-button {
  background: linear-gradient(135deg, #e9f6f3, #eee7fa);
  border: 1px solid #9abfc1;
  border-radius: 10px;
  color: #476c77;
  min-height: 38px;
  padding: 0 14px;
}

.share-overlay {
  align-items: center;
  justify-content: center;
  opacity: 1;
  padding: 20px;
}

.share-dialog {
  background:
    radial-gradient(circle at 90% 0, rgba(255, 214, 201, 0.5), transparent 15rem),
    radial-gradient(circle at 0 100%, rgba(198, 234, 235, 0.55), transparent 18rem),
    #fffdf9;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  box-shadow: var(--community-shadow);
  max-width: 590px;
  padding: clamp(26px, 5vw, 44px);
  position: relative;
  width: 100%;
}

.share-close {
  position: absolute;
  right: 20px;
  top: 20px;
}

.share-dialog h2 {
  font-size: clamp(28px, 5vw, 40px);
  padding-right: 46px;
}

.share-preview {
  background: linear-gradient(135deg, rgba(224, 243, 241, 0.72), rgba(240, 232, 249, 0.72));
  border-radius: 15px;
  display: grid;
  gap: 5px;
  margin: 22px 0 15px;
  padding: 16px;
}

.share-preview strong {
  color: #3f6670;
  font-size: 13px;
}

.share-preview span {
  color: #6e7f85;
  font-size: 12px;
  line-height: 1.6;
}

.share-result label {
  color: #61747b;
  display: grid;
  font-size: 11px;
  gap: 7px;
}

.share-result input {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid #cbdddc;
  border-radius: 11px;
  color: #365d68;
  padding: 12px;
  width: 100%;
}

.share-status {
  min-height: 20px;
  margin: 11px 0;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
}

.share-cancel {
  background: transparent;
  color: #687980;
  padding: 0 10px;
}

.share-copy {
  background: linear-gradient(135deg, #2d7480, #4c8090);
}

.share-system {
  background: linear-gradient(135deg, #7869a8, #d17672);
}

@keyframes community-pulse {
  from {
    opacity: 0.45;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1.06);
  }
}

@media (max-width: 920px) {
  .topbar {
    border-radius: 0;
  }

  .community-nav-button {
    display: none;
  }

  .community-launcher {
    bottom: 18px;
    right: 18px;
  }

  .share-report-button {
    order: 3;
  }
}

@media (max-width: 640px) {
  .community-drawer {
    padding: 25px 16px 48px;
  }

  .community-header h2 {
    font-size: 34px;
  }

  .community-guideline {
    margin: 18px 0;
  }

  .community-compose {
    border-radius: 18px;
    padding: 17px;
  }

  .community-compose-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .community-submit {
    width: 100%;
  }

  .community-launcher {
    min-height: 48px;
    padding: 0 15px;
  }

  .community-post {
    padding: 16px;
  }

  .community-post-top {
    align-items: flex-start;
  }

  .share-overlay {
    padding: 12px;
  }

  .share-dialog {
    border-radius: 21px;
    padding: 28px 20px 22px;
  }

  .share-actions > button:not(.share-cancel) {
    flex: 1 1 140px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
