:root {
  --ink: #172328;
  --muted: #51636b;
  --paper: #fffaf0;
  --line: rgba(23, 35, 40, 0.14);
  --teal: #0c8f90;
  --coral: #f26b52;
  --gold: #f4c83c;
  --mint: #a7ddc6;
  --blue: #2f77c8;
  --shadow: 0 24px 80px rgba(23, 35, 40, 0.18);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(12, 143, 144, 0.11), transparent 30%),
    linear-gradient(315deg, rgba(242, 107, 82, 0.12), transparent 27%),
    var(--paper);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button,
.link-button {
  border: 0;
  cursor: pointer;
}

.paper-sweep {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.55;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 78px, rgba(23, 35, 40, 0.035) 78px 79px),
    repeating-linear-gradient(0deg, transparent 0 78px, rgba(23, 35, 40, 0.035) 78px 79px);
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  animation: drift-grid 18s linear infinite;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  line-height: 1.05;
}

.gate {
  width: min(1280px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 460px);
  align-items: center;
  gap: clamp(24px, 5vw, 84px);
  padding: 48px 0;
}

.gate-copy {
  position: relative;
  min-height: 620px;
  padding: clamp(28px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(255, 250, 240, 0.96), rgba(255, 250, 240, 0.58)),
    url("/static/contact-board.svg") center / cover;
  box-shadow: var(--shadow);
}

.gate-copy::after {
  position: absolute;
  right: -12%;
  bottom: 9%;
  width: 46%;
  height: 12px;
  content: "";
  background: var(--gold);
  transform: rotate(-4deg);
  animation: underline-swing 4.8s ease-in-out infinite;
}

.gate h1 {
  max-width: 680px;
  margin-bottom: 18px;
  font-size: clamp(2.7rem, 6vw, 6.6rem);
}

.lede {
  max-width: 520px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.7;
}

.guardrail-strip,
.statline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.guardrail-strip span,
.statline span,
.meter {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.pulse-board {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pulse-board span {
  position: absolute;
  width: 17px;
  height: 17px;
  border: 4px solid var(--coral);
  animation: ping 3.2s ease-out infinite;
}

.pulse-board span:nth-child(1) {
  top: 18%;
  right: 24%;
}

.pulse-board span:nth-child(2) {
  top: 35%;
  right: 9%;
  border-color: var(--blue);
  animation-delay: 0.7s;
}

.pulse-board span:nth-child(3) {
  right: 32%;
  bottom: 26%;
  border-color: var(--teal);
  animation-delay: 1.4s;
}

.pulse-board span:nth-child(4) {
  right: 14%;
  bottom: 16%;
  border-color: var(--gold);
  animation-delay: 2.1s;
}

.auth-shell,
.editor-panel,
.directory-panel,
.message-page section {
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.auth-shell {
  width: 100%;
  padding: clamp(20px, 3vw, 30px);
  animation: rise-in 700ms both;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.tab,
.ghost {
  min-height: 46px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  font-weight: 900;
}

.tab.is-active {
  background: var(--ink);
  color: white;
  transform: translateY(-2px);
}

.auth-panel {
  display: none;
  gap: 15px;
}

.auth-panel.is-active,
.profile-form {
  display: grid;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 900;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(23, 35, 40, 0.2);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  outline: 0;
  padding: 14px 15px;
  transition: border 180ms, box-shadow 180ms, transform 180ms;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(12, 143, 144, 0.16);
  transform: translateY(-1px);
}

.primary {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 950;
  transition: transform 180ms, background 180ms, box-shadow 180ms;
}

.primary:hover {
  background: var(--teal);
  box-shadow: 8px 8px 0 var(--gold);
  transform: translate(-3px, -3px);
}

.flash,
.status {
  border-left: 6px solid;
  margin-bottom: 16px;
  padding: 13px 14px;
  line-height: 1.55;
}

.flash.success,
.status.approved {
  border-color: var(--teal);
  background: rgba(167, 221, 198, 0.32);
}

.flash.warn,
.status.neutral {
  border-color: var(--gold);
  background: rgba(244, 200, 60, 0.2);
}

.flash.error,
.status.rejected {
  border-color: var(--coral);
  background: rgba(242, 107, 82, 0.14);
}

.trap {
  position: absolute;
  left: -9999px;
}

.topbar {
  width: min(1440px, calc(100% - 36px));
  margin: 20px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 950;
}

.brand span {
  width: 28px;
  height: 28px;
  background:
    linear-gradient(90deg, var(--coral) 0 50%, transparent 50%),
    linear-gradient(var(--teal) 0 50%, var(--gold) 50%);
  animation: tile-turn 5s steps(4) infinite;
}

.ghost {
  padding: 0 16px;
}

.workspace {
  width: min(1440px, calc(100% - 36px));
  margin: 18px auto 36px;
  display: grid;
  grid-template-columns: minmax(340px, 470px) minmax(0, 1fr);
  gap: 18px;
}

.editor-panel,
.directory-panel {
  padding: clamp(18px, 3vw, 28px);
}

.editor-panel {
  align-self: start;
  position: sticky;
  top: 18px;
}

.panel-head,
.directory-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.panel-head h1 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 3vw, 3.1rem);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.profile-form {
  gap: 14px;
}

.form-rule {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.directory-head h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.4vw, 2.6rem);
}

.search {
  width: min(100%, 330px);
}

.search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.statline {
  margin: 22px 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 14px;
}

.contact-card {
  min-height: 240px;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
  padding: 20px;
  animation: card-in 560ms both;
  transition: transform 180ms, box-shadow 180ms, border 180ms;
}

.contact-card:nth-child(3n + 1)::before,
.contact-card:nth-child(3n + 2)::before,
.contact-card:nth-child(3n + 3)::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 7px;
  content: "";
}

.contact-card:nth-child(3n + 1)::before {
  background: var(--teal);
}

.contact-card:nth-child(3n + 2)::before {
  background: var(--coral);
}

.contact-card:nth-child(3n + 3)::before {
  background: var(--gold);
}

.contact-card:hover {
  border-color: rgba(23, 35, 40, 0.42);
  box-shadow: 9px 9px 0 rgba(23, 35, 40, 0.12);
  transform: translate(-4px, -4px) rotate(-0.35deg);
}

.contact-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.contact-card h3 {
  margin-bottom: 14px;
  font-size: 1.5rem;
}

.contact-card em {
  border: 1px solid var(--line);
  background: var(--mint);
  padding: 5px 7px;
  color: var(--ink);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 950;
}

.contact-card ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-card li {
  display: grid;
  gap: 4px;
  word-break: break-word;
}

.contact-card li span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
}

.contact-card li b {
  font-weight: 800;
  line-height: 1.45;
}

.empty {
  border: 1px dashed var(--line);
  margin: 0;
  padding: 28px;
  color: var(--muted);
}

.message-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.message-page section {
  width: min(560px, 100%);
  padding: clamp(24px, 5vw, 52px);
}

.message-page h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(24px) rotate(0.8deg);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
}

@keyframes drift-grid {
  to {
    transform: translate3d(79px, 79px, 0);
  }
}

@keyframes ping {
  0% {
    opacity: 0;
    transform: scale(0.25) rotate(8deg);
  }

  20% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(2.3) rotate(24deg);
  }
}

@keyframes tile-turn {
  50% {
    transform: rotate(180deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes underline-swing {
  50% {
    transform: rotate(3deg) translateX(-18px);
  }
}

@media (max-width: 960px) {
  .gate,
  .workspace {
    grid-template-columns: 1fr;
  }

  .gate {
    width: min(100% - 24px, 740px);
    padding: 12px 0 28px;
  }

  .gate-copy {
    min-height: 560px;
  }

  .editor-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .gate-copy {
    min-height: 510px;
    padding: 24px;
    background-position: 58% center;
  }

  .gate h1 {
    font-size: 2.7rem;
  }

  .topbar,
  .workspace {
    width: calc(100% - 20px);
  }

  .field-grid,
  .panel-head,
  .directory-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .search {
    width: 100%;
  }
}

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

