:root {
  --stage: #050505;
  --ink: #272717;
  --paper: #f7f4e8;
  --muted: #e2dfd2;
  --line: rgba(39, 39, 23, .16);
  --green: #78936f;
  --coral: #e5684f;
  --blue: #739bff;
  --gold: #d6ae52;
  --shadow: 0 24px 80px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  background: var(--stage);
  font-family: "Trebuchet MS", "Microsoft YaHei", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 20; background: var(--paper); color: var(--ink); padding: 10px 12px; }
.skip-link:focus { top: 12px; }
.scene-canvas, .cursor-trail {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.scene-canvas { z-index: -2; background: radial-gradient(circle at 70% 20%, rgba(115, 155, 255, .16), transparent 32%), #050505; }
.cursor-trail { z-index: 18; }
.cursor-aura {
  position: fixed;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(214, 174, 82, .32);
  border-radius: 999px;
  pointer-events: none;
  z-index: 17;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity .2s ease;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 62px;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(247, 244, 232, .14);
  background: rgba(5, 5, 5, .78);
  backdrop-filter: blur(20px);
}
.brand { color: var(--paper); text-decoration: none; display: flex; align-items: center; gap: 10px; min-width: 190px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(247,244,232,.25);
  background: var(--paper);
  color: var(--ink);
  font-size: 21px;
  font-weight: 800;
}
.brand small { display: block; color: rgba(247,244,232,.62); margin-top: 2px; }
.top-nav { display: flex; gap: 6px; flex: 1; justify-content: center; flex-wrap: wrap; }
.top-nav button, .segmented button, .icon-button, .secondary, .primary {
  border: 1px solid rgba(247,244,232,.22);
  border-radius: 6px;
  min-height: 36px;
  padding: 8px 12px;
  color: var(--paper);
  background: rgba(247,244,232,.05);
}
.top-nav button.active, .segmented button.active, .primary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.secondary { background: rgba(115,155,255,.18); }
.session-box { display: flex; align-items: center; gap: 10px; color: rgba(247,244,232,.72); }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.mobile-menu-button,
.mobile-nav-close,
.mobile-nav-backdrop { display: none; }
.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid rgba(36, 36, 21, .18);
  background: var(--ink);
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  text-transform: uppercase;
}
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-session {
  width: 34px;
  border-color: rgba(248, 245, 232, .34);
  border-radius: 4px;
  background: var(--acid);
  color: var(--ink);
}
.avatar-editor {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--paper-line);
}
.avatar-profile {
  width: 112px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--ink), #4c5141);
  color: var(--acid);
  font-size: 40px;
}
.avatar-editor-copy p {
  margin: 5px 0 12px;
  color: rgba(36, 36, 21, .62);
}
.avatar-upload-button {
  color: var(--ink);
  border-color: rgba(36, 36, 21, .22);
}
.avatar-status {
  margin-left: 10px;
  color: rgba(36, 36, 21, .64);
  font-size: 13px;
}
.match-identity {
  display: flex;
  gap: 14px;
  align-items: center;
}
.match-identity h3,
.match-identity p { margin-bottom: 0; }
.avatar-match {
  width: 68px;
  border-radius: 4px;
  background: var(--signal);
  font-size: 24px;
}
.avatar-chat {
  width: 42px;
  border-radius: 4px;
  background: var(--violet);
  font-size: 16px;
}
.app-shell {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 28px;
  width: min(1480px, calc(100% - 40px));
  margin: 30px auto 80px;
}
.side-rail {
  position: sticky;
  top: 92px;
  align-self: start;
  min-height: calc(100vh - 130px);
  padding: 30px 26px;
  border: 1px solid rgba(247,244,232,.14);
  background: linear-gradient(180deg, rgba(247,244,232,.09), rgba(247,244,232,.025));
}
.rail-eyebrow, .eyebrow { color: var(--gold); text-transform: uppercase; font-size: 12px; letter-spacing: 0; }
.side-rail h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 4vw, 62px); line-height: .98; margin: 16px 0; }
.side-rail p { color: rgba(247,244,232,.72); line-height: 1.75; }
.rail-stat { margin-top: 28px; display: flex; justify-content: space-between; border-top: 1px solid rgba(247,244,232,.14); padding-top: 18px; }
.workspace { min-width: 0; }
.auth-panel, .view, .form-band {
  border: 1px solid var(--line);
  background: rgba(247,244,232,.95);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.auth-panel { padding: 24px; margin-bottom: 18px; }
.auth-intro {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}
.auth-switch {
  display: inline-flex;
  border: 1px solid rgba(36, 36, 21, .16);
  background: rgba(255, 255, 255, .54);
  padding: 4px;
}
.auth-switch button {
  border: 0;
  background: transparent;
  color: var(--ink);
  min-height: 34px;
  padding: 7px 14px;
}
.auth-switch button.active {
  background: #050505;
  color: var(--paper);
}
.auth-mode { display: none; }
.auth-mode.active { display: block; }
.auth-grid-login {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.password-input-wrap,
.verification-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0;
}
.password-input-wrap input,
.verification-input-row input {
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.password-toggle,
.verification-input-row button {
  min-height: 40px;
  border: 1px solid rgba(39, 39, 23, .18);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  padding: 8px 10px;
  color: var(--ink);
  background: rgba(39, 39, 23, .08);
  white-space: nowrap;
}
.verification-field { min-width: 0; }
.verification-input-row { gap: 8px; }
.verification-input-row input { border-radius: 6px; }
.verification-input-row button {
  border-left: 1px solid rgba(247, 244, 232, .22);
  color: var(--paper);
  background: rgba(115, 155, 255, .72);
}
.verification-input-row button:disabled {
  cursor: wait;
  opacity: .65;
}
.view { display: none; padding: 24px; }
.view.active { display: block; }
.view-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
h2, h3, p { margin-top: 0; }
h2 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 3vw, 44px); margin-bottom: 6px; }
.form-band { padding: 20px; margin: 16px 0; box-shadow: none; background: rgba(255,255,255,.5); }
.form-grid, .auth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.form-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 6px; font-size: 13px; color: rgba(39,39,23,.72); }
.required-field {
  position: relative;
}
.required-field::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--signal);
  box-shadow: 0 0 0 3px rgba(255, 91, 63, .12);
}
.field-error input,
.field-error select,
.field-error textarea {
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(255, 91, 63, .12);
}
input, select, textarea {
  width: 100%;
  border: 1px solid rgba(39,39,23,.18);
  border-radius: 6px;
  background: rgba(255,255,255,.78);
  color: var(--ink);
  min-height: 40px;
  padding: 9px 10px;
}
textarea { resize: vertical; }
select[multiple] { min-height: 116px; }
.wide { grid-column: 1 / -1; }
.picker-panel {
  border: 1px solid rgba(36, 36, 21, .13);
  background: rgba(255, 255, 255, .54);
  padding: 14px;
  display: grid;
  gap: 12px;
}
.picker-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.check-line {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  color: rgba(36, 36, 21, .76);
}
.check-line input {
  width: 16px;
  min-height: 16px;
}
.picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.picker-row:has(label:nth-child(1):last-of-type) {
  grid-template-columns: minmax(0, 1fr) auto;
}
.add-button {
  min-height: 40px;
  color: var(--ink);
  border-color: rgba(36, 36, 21, .18);
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}
.tag-chip,
.empty-chip {
  border: 1px solid rgba(36, 36, 21, .16);
  background: #fffef8;
  color: var(--ink);
  border-radius: 4px;
  min-height: 32px;
  padding: 6px 9px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tag-chip span {
  color: var(--signal);
  font-weight: 800;
}
.empty-chip {
  color: rgba(36, 36, 21, .55);
  border-style: dashed;
}
.actions { display: flex; gap: 10px; margin-top: 16px; }
.segmented { display: inline-flex; background: rgba(39,39,23,.08); padding: 4px; border-radius: 8px; }
.segmented button { color: var(--ink); border-color: transparent; background: transparent; }
.match-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.match-card, .item, .chat-list button, .chat-contact-card {
  border: 1px solid rgba(39,39,23,.14);
  background: #fffdf5;
  border-radius: 8px;
  padding: 16px;
}
.match-card { min-height: 230px; transform-style: preserve-3d; transition: transform .18s ease, box-shadow .18s ease; }
.match-card:hover { transform: translateY(-3px) rotateX(1deg) rotateY(-1deg); box-shadow: 0 16px 42px rgba(39,39,23,.15); }
.score-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.score-pill { background: #111; color: var(--paper); border-radius: 999px; padding: 6px 10px; font-size: 13px; }
.match-note {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-left: 2px solid rgba(39,39,23,.28);
  background: rgba(39,39,23,.04);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.match-note-label {
  display: block;
  font-size: 11px;
  letter-spacing: .08em;
  opacity: .62;
  margin-bottom: 2px;
}
/* 匹配卡「查看详情」展开区 */
.match-detail { margin: 12px 0; border-top: 1px solid rgba(39,39,23,.14); padding-top: 10px; }
.match-detail-toggle { margin: 10px 0 0; }
.detail-group-title { font-size: 12px; letter-spacing: .08em; color: var(--gold); margin: 10px 0 6px; }
.detail-row { display: flex; gap: 10px; padding: 4px 0; font-size: 13px; line-height: 1.5; }
.detail-label { flex: 0 0 84px; color: rgba(39,39,23,.62); }
.detail-value { flex: 1; overflow-wrap: anywhere; }
.detail-empty { font-size: 12px; opacity: .6; margin: 4px 0; }
.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 14px; min-height: 520px; }
.chat-sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}
.chat-sidebar-head {
  border: 1px solid rgba(39,39,23,.14);
  background: rgba(255,255,255,.56);
  padding: 12px;
}
.chat-sidebar-head strong,
.chat-sidebar-head small {
  display: block;
}
.chat-sidebar-head small {
  margin-top: 4px;
  color: rgba(39,39,23,.58);
}
.contact-search {
  margin-top: 10px;
  min-height: 36px;
  background: rgba(255,255,255,.82);
}
.email-push-setting {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(36, 36, 21, .13);
  background: rgba(255, 255, 255, .54);
}
.setting-label { display: grid; gap: 3px; }
.setting-label small { color: rgba(36, 36, 21, .58); }
.field-hint { display: block; color: rgba(36, 36, 21, .58); font-size: 12px; line-height: 1.45; margin: 2px 0 4px; }
.switch-line { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.switch-line input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(36, 36, 21, .25);
  transition: background .18s ease;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fffef8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
  transition: transform .18s ease;
}
.switch-line input:checked + .switch-track { background: var(--green); }
.switch-line input:checked + .switch-track::after { transform: translateX(18px); }
.switch-line:focus-within .switch-track { outline: 2px solid var(--signal); outline-offset: 2px; }
.blocked-drawer { border-top: 1px solid rgba(36, 36, 21, .12); border-bottom: 1px solid rgba(36, 36, 21, .12); }
.blocked-drawer-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 12px;
  font-weight: 700;
}
.blocked-drawer-toggle span:first-of-type { margin-left: auto; margin-right: 8px; color: var(--coral); }
.blocked-contacts-list { display: grid; gap: 7px; padding: 0 0 10px; }
.blocked-contact-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 4px; background: rgba(255, 255, 255, .55); }
.blocked-contact-row .avatar-chat { width: 32px; }
.blocked-contact-row span { display: grid; min-width: 0; gap: 2px; }
.blocked-contact-row strong, .blocked-contact-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blocked-contact-row small, .blocked-empty { color: rgba(36, 36, 21, .55); font-size: 11px; }
.chat-status-warning { display: block; margin-top: 5px; color: #b24634; font-size: 11px; line-height: 1.4; white-space: normal !important; }
.chat-list { display: grid; gap: 8px; align-content: start; }
.chat-contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}
.chat-contact-card.active { border-color: var(--coral); }
.chat-contact-card.search-result { border-style: dashed; }
.chat-open {
  width: 100%;
  min-width: 0;
  padding: 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  color: var(--ink);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.chat-open-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.chat-open strong,
.chat-open small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-open small { color: rgba(39,39,23,.58); }
.chat-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 4px;
  justify-content: center;
  font-size: 13px;
}
.danger-soft { color: var(--coral); border-color: rgba(255, 83, 64, .35); }
.primary-mini { background: var(--ink); color: var(--paper); }
.chat-room { border: 1px solid rgba(39,39,23,.14); background: #fffdf5; border-radius: 8px; display: grid; grid-template-rows: 1fr auto; overflow: hidden; }
.messages { padding: 14px; overflow: auto; max-height: 460px; display: grid; gap: 8px; align-content: start; }
.empty-chat {
  place-self: center;
  color: rgba(39,39,23,.58);
  border: 1px dashed rgba(39,39,23,.18);
  padding: 18px;
  background: rgba(255,255,255,.45);
}
.message { max-width: 76%; padding: 10px 12px; border-radius: 8px; background: var(--muted); }
.message.mine { margin-left: auto; background: #111; color: var(--paper); }
.chat-input { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; border-top: 1px solid rgba(39,39,23,.12); }
.item-list { display: grid; gap: 10px; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.admin-lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.admin-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  margin: 0 -24px;
  padding: 0 24px;
  border-bottom: 1px solid var(--paper-line);
  scrollbar-width: thin;
}
.admin-tabs button {
  flex: 0 0 auto;
  min-width: 92px;
  min-height: 44px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: rgba(36, 36, 21, .58);
  font-weight: 700;
}
.admin-tabs button.active {
  border-bottom-color: var(--signal);
  color: var(--ink);
}
.admin-console { padding-top: 20px; }
.admin-panel[hidden] { display: none; }
.admin-panel.active { display: block; }
.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--paper-line);
  background: rgba(255, 255, 255, .38);
}
.admin-metrics article {
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 126px;
  padding: 17px;
  border-right: 1px solid var(--paper-line);
}
.admin-metrics article:last-child { border-right: 0; }
.admin-metrics span,
.admin-metrics small,
.admin-section-head small,
.admin-list-head small {
  color: rgba(36, 36, 21, .5);
  font-size: 11px;
  text-transform: uppercase;
}
.admin-metrics strong {
  align-self: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  line-height: 1;
}
.admin-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .75fr);
  gap: 20px;
  margin-top: 20px;
}
.admin-overview-section,
.admin-editor,
.admin-records {
  min-width: 0;
  border-top: 3px solid var(--ink);
  padding-top: 14px;
}
.admin-section-head,
.admin-list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.admin-section-head h3,
.admin-list-head h3 { margin: 3px 0 0; font-size: 20px; }
.admin-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.admin-quick-actions button {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--paper-line);
  border-radius: 4px;
  background: #fffef8;
  color: var(--ink);
  font-weight: 700;
}
.admin-quick-actions button:hover { border-color: var(--signal); color: var(--signal); }
.admin-work-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.admin-editor {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 84px;
}
/* 编辑用户表单不 sticky，自然堆叠在创建表单下方 */
.admin-editor-plain { position: static; }
.admin-field-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.admin-checks { display: flex; flex-wrap: wrap; gap: 16px; }
.admin-submit { width: 100%; margin-top: 4px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.admin-list-head { align-items: center; }
.admin-search { display: flex; gap: 7px; width: min(100%, 330px); }
.admin-search input { min-width: 0; min-height: 36px; }
.admin-search button { min-height: 36px; color: var(--ink); border-color: var(--paper-line); }
.admin-record-list,
.admin-log-list,
.admin-activity-list { display: grid; gap: 0; border-top: 1px solid var(--paper-line); }
.admin-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 14px 2px;
  border-bottom: 1px solid var(--paper-line);
}
.admin-record-main { min-width: 0; }
.admin-record-main p { margin: 7px 0 4px; color: rgba(36, 36, 21, .74); overflow-wrap: anywhere; }
.admin-record-main small { color: rgba(36, 36, 21, .5); overflow-wrap: anywhere; }
.admin-record-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.admin-record-title strong { min-width: 0; font-size: 16px; overflow-wrap: anywhere; }
.admin-record-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 230px; }
.admin-record-actions button {
  min-width: 58px;
  border: 1px solid var(--paper-line);
  background: #fffef8;
  color: var(--ink);
}
.admin-record-actions .danger-soft { color: var(--signal); border-color: rgba(255, 91, 63, .4); }
.admin-record-actions button:disabled { cursor: not-allowed; opacity: .46; }
.admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 6px;
  border: 1px solid rgba(36, 36, 21, .16);
  border-radius: 3px;
  background: rgba(36, 36, 21, .05);
  color: rgba(36, 36, 21, .7);
  font-size: 11px;
  line-height: 1;
}
.admin-badge.is-active { border-color: rgba(84, 137, 83, .38); background: rgba(84, 137, 83, .1); color: #3c733c; }
.admin-badge.is-disabled { border-color: rgba(255, 91, 63, .3); color: #b33d2b; }
.admin-badge.is-admin { border-color: rgba(74, 114, 218, .34); background: rgba(74, 114, 218, .1); color: #365fb6; }
.admin-badge.is-pinned { border-color: rgba(185, 132, 24, .34); background: rgba(214, 174, 82, .12); color: #8b650f; }
.admin-log-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--paper-line);
}
.admin-log-entry p { margin: 5px 0 0; color: rgba(36, 36, 21, .58); }
.admin-log-entry time { color: rgba(36, 36, 21, .48); font-size: 12px; white-space: nowrap; }
.admin-activity-list article {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--paper-line);
}
.admin-activity-list article > span { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--signal); }
.admin-activity-list strong,
.admin-activity-list small { display: block; }
.admin-activity-list small { margin-top: 3px; color: rgba(36, 36, 21, .52); overflow-wrap: anywhere; }
.admin-empty { padding: 20px 2px; color: rgba(36, 36, 21, .5); }
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 14px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(12px);
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .side-rail { position: relative; top: 0; min-height: 0; }
  .form-grid, .auth-grid, .admin-grid, .admin-lists, .match-grid, .chat-layout { grid-template-columns: 1fr; }
  .picker-row { grid-template-columns: 1fr; }
  .site-header { align-items: center; flex-wrap: nowrap; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-metrics article:nth-child(2) { border-right: 0; }
  .admin-metrics article:nth-child(-n+2) { border-bottom: 1px solid var(--paper-line); }
  .admin-overview-grid,
  .admin-work-grid { grid-template-columns: 1fr; }
  .admin-editor { position: static; }
  .mobile-menu-button {
    display: grid;
    place-items: center;
    order: 2;
    width: 40px;
    height: 40px;
    margin-left: auto;
    border: 1px solid rgba(248, 245, 232, .24);
    border-radius: 4px;
    background: rgba(248, 245, 232, .07);
    color: var(--paper);
    font-size: 23px;
  }
  .top-nav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 24;
    width: min(86vw, 390px);
    padding: 74px 22px 28px;
    display: none;
    align-content: start;
    justify-content: stretch;
    gap: 8px;
    background: rgba(3, 3, 3, .97);
    border-left: 1px solid rgba(248, 245, 232, .18);
  }
  .top-nav button:not(.mobile-nav-close) {
    width: 100%;
    min-height: 48px;
    padding-inline: 14px;
    text-align: left;
  }
  .mobile-nav-close {
    display: grid;
    place-items: center;
    position: absolute;
    right: 20px;
    top: 18px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(248, 245, 232, .24);
    border-radius: 4px;
    background: transparent;
    color: var(--paper);
    font-size: 26px;
  }
  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0, 0, 0, .68);
  }
  body.mobile-nav-open { overflow: hidden; }
  body.mobile-nav-open .top-nav {
    display: grid;
    animation: mobile-nav-in .22s ease both;
  }
  body.mobile-nav-open .mobile-nav-backdrop { display: block; }
  .nav-cta { display: none; }
  .session-box { order: 3; }
}

@keyframes mobile-nav-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor-trail, .cursor-aura { display: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Editions front-end polish */
:root {
  --stage: #030303;
  --paper: #f8f5e8;
  --paper-2: #e4e0d1;
  --ink: #242415;
  --acid: #b9ff66;
  --signal: #ff5b3f;
  --violet: #8a7dff;
  --cyan: #78e7ff;
  --grid-line: rgba(248, 245, 232, .105);
  --paper-line: rgba(36, 36, 21, .14);
}

body {
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(248, 245, 232, .045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(248, 245, 232, .04) 1px, transparent 1px),
    radial-gradient(circle at 74% 18%, rgba(120, 231, 255, .14), transparent 28%),
    radial-gradient(circle at 22% 70%, rgba(255, 91, 63, .09), transparent 30%),
    #030303;
  background-size: 72px 72px, 72px 72px, auto, auto, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(248, 245, 232, .08) 42.2% 42.7%, transparent 43%),
    radial-gradient(circle at var(--cursor-x, 50%) var(--cursor-y, 50%), rgba(185, 255, 102, .08), transparent 18rem);
  mix-blend-mode: screen;
}

.scene-canvas {
  opacity: .92;
  filter: saturate(1.18) contrast(1.08);
}

.cursor-trail {
  mix-blend-mode: screen;
}

.cursor-aura {
  width: 190px;
  height: 190px;
  border: 1px solid rgba(185, 255, 102, .5);
  box-shadow:
    0 0 0 1px rgba(120, 231, 255, .16) inset,
    0 0 44px rgba(185, 255, 102, .24),
    0 0 120px rgba(120, 231, 255, .12);
}

.cursor-aura::before,
.cursor-aura::after {
  content: "";
  position: absolute;
  inset: 50%;
  width: 36px;
  height: 1px;
  background: rgba(248, 245, 232, .65);
  transform: translate(-50%, -50%);
}

.cursor-aura::after {
  width: 1px;
  height: 36px;
}

.edition-hud {
  position: fixed;
  left: 22px;
  right: 22px;
  bottom: 18px;
  z-index: 9;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  pointer-events: none;
  color: rgba(248, 245, 232, .66);
  font-size: 11px;
  text-transform: uppercase;
}

.edition-hud strong {
  color: var(--paper);
  border: 1px solid rgba(248, 245, 232, .24);
  background: rgba(3, 3, 3, .64);
  padding: 7px 12px;
  border-radius: 4px;
  box-shadow: 0 0 28px rgba(120, 231, 255, .11);
}

.edition-hud span:last-child {
  text-align: right;
}

.site-header {
  position: fixed;
  left: 18px;
  right: 18px;
  top: 14px;
  min-height: 58px;
  border: 1px solid rgba(248, 245, 232, .16);
  background: rgba(3, 3, 3, .66);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .3);
}

.brand-mark {
  border-radius: 4px;
  background: var(--acid);
  color: #101108;
  box-shadow: 0 0 34px rgba(185, 255, 102, .38);
}

.top-nav button,
.nav-cta,
.icon-button,
.secondary,
.primary,
.segmented button {
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.top-nav button {
  position: relative;
  overflow: hidden;
}

.top-nav button::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 5px;
  height: 1px;
  background: var(--acid);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease;
}

.top-nav button:hover::after,
.top-nav button.active::after {
  transform: scaleX(1);
}

.nav-cta {
  background: var(--signal);
  color: #fff8ed;
  border-color: var(--signal);
  min-width: 92px;
}

.app-shell {
  width: min(1560px, calc(100% - 48px));
  margin-top: 104px;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
}

.side-rail {
  top: 104px;
  min-height: calc(100vh - 146px);
  border-color: rgba(248, 245, 232, .18);
  background:
    linear-gradient(180deg, rgba(248, 245, 232, .13), rgba(248, 245, 232, .035)),
    linear-gradient(135deg, rgba(185, 255, 102, .08), transparent 42%);
}

.side-rail::before {
  content: "";
  position: absolute;
  inset: 14px;
  pointer-events: none;
  border: 1px solid rgba(248, 245, 232, .09);
}

.side-rail h1 {
  font-size: clamp(42px, 4.8vw, 78px);
}

.rail-stat {
  border-color: rgba(248, 245, 232, .2);
}

.chapter-index {
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
  display: grid;
  gap: 6px;
}

.chapter-index button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  border: 0;
  border-top: 1px solid rgba(248, 245, 232, .16);
  background: transparent;
  color: rgba(248, 245, 232, .78);
  padding: 12px 0;
  text-align: left;
}

.chapter-index span {
  color: var(--acid);
}

.workspace {
  display: grid;
  gap: 18px;
}

.auth-panel,
.view {
  border-radius: 0;
  border-color: rgba(248, 245, 232, .2);
}

.view {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 146px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(248, 245, 232, .92)),
    var(--paper);
}

.view::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(36, 36, 21, .055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(36, 36, 21, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000, transparent 72%);
}

.view > * {
  position: relative;
  z-index: 1;
}

.view-head {
  min-height: 88px;
  border-bottom: 1px solid var(--paper-line);
  padding-bottom: 18px;
}

.view-head h2 {
  font-size: clamp(34px, 4vw, 64px);
  line-height: .95;
}

.form-band {
  border-radius: 0;
  border-color: var(--paper-line);
  background: rgba(255, 255, 255, .62);
}

.form-band h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-band h3::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--signal);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.match-card,
.item,
.chat-list button,
.chat-contact-card {
  border-radius: 4px;
  background:
    linear-gradient(180deg, #fffef8, #eeeada);
  box-shadow: 0 18px 40px rgba(36, 36, 21, .09);
}

.chat-open {
  background: transparent;
  box-shadow: none;
}
.chat-contact-card .primary-mini {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.chat-contact-card .danger-soft {
  color: var(--coral);
  border-color: rgba(255, 83, 64, .35);
}

.match-card {
  min-height: 260px;
  border-color: rgba(36, 36, 21, .2);
}

.match-card h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  margin-bottom: 6px;
}

.score-pill {
  border-radius: 4px;
  background: #060606;
  box-shadow: 0 0 24px rgba(120, 231, 255, .14);
}

.match-card .primary {
  background: var(--signal);
  color: #fff;
  border-color: var(--signal);
}

.chat-room {
  border-radius: 4px;
  background:
    linear-gradient(180deg, #fffef8, #efead7);
}

.message {
  border-radius: 4px;
}

.message.mine {
  background: #050505;
  box-shadow: 0 0 24px rgba(185, 255, 102, .12);
}

.toast {
  border-radius: 4px;
  border: 1px solid rgba(248, 245, 232, .22);
  background: rgba(3, 3, 3, .9);
}

@media (max-width: 980px) {
  .site-header {
    position: sticky;
    inset: auto;
    top: 0;
    border-left: 0;
    border-right: 0;
    backdrop-filter: none;
  }

  .top-nav .mobile-nav-close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 40px;
    padding: 0;
    text-align: center;
  }

  .top-nav .mobile-nav-close::after { display: none; }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(calc(100% - 24px), 760px);
    margin: 20px auto 64px;
  }

  .side-rail {
    top: 0;
    min-height: 0;
  }

  .edition-hud {
    display: none;
  }

  .view {
    min-height: auto;
    padding: 18px;
  }
}

@media (max-width: 560px) {
  .top-nav button,
  .nav-cta {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .brand {
    min-width: 0;
  }

  .session-box {
    width: auto;
    max-width: 44%;
    justify-content: flex-end;
  }
  #sessionText { display: none; }
  .site-header { gap: 9px; padding-inline: 12px; }
  .brand strong { font-size: 14px; }
  .brand small { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .view-head,
  .auth-intro {
    align-items: flex-start;
    flex-direction: column;
  }
  .view-head .primary { align-self: stretch; }
  .avatar-editor {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
  }
  .avatar-profile { width: 84px; font-size: 30px; }
  .avatar-status { display: block; margin: 8px 0 0; }
  .match-identity { align-items: flex-start; }
  .avatar-match { width: 56px; }
  .chat-input { grid-template-columns: minmax(0, 1fr) auto; }

  .scene-canvas {
    opacity: .74;
  }

  .side-rail {
    background:
      linear-gradient(180deg, rgba(10, 12, 9, .92), rgba(9, 10, 8, .86)),
      linear-gradient(135deg, rgba(185, 255, 102, .12), transparent 42%);
  }
}

/* WebGL scene pass */
.scene-canvas {
  opacity: .96;
  filter: saturate(1.36) contrast(1.16);
}

.cursor-aura {
  width: 210px;
  height: 210px;
  border-color: rgba(185, 255, 102, .56);
  box-shadow:
    0 0 0 1px rgba(120, 231, 255, .2) inset,
    0 0 48px rgba(185, 255, 102, .34),
    0 0 130px rgba(120, 231, 255, .2);
}

.cursor-aura::before {
  box-shadow: 0 0 18px rgba(185, 255, 102, .42);
}

.side-rail {
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, .32),
    0 36px 90px rgba(0, 0, 0, .42);
}

body[data-view="match"] .match-card:hover {
  box-shadow:
    0 20px 48px rgba(36, 36, 21, .18),
    0 0 0 1px rgba(255, 91, 63, .18),
    0 0 52px rgba(255, 91, 63, .12);
}

body[data-view="chat"] .chat-room {
  box-shadow:
    0 22px 54px rgba(36, 36, 21, .13),
    0 0 52px rgba(120, 231, 255, .1);
}

/* Matching and chat interaction layer */
.match-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-only,
.composer-tool {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid rgba(36, 36, 21, .2);
  border-radius: 4px;
  background: rgba(255, 255, 255, .68);
  color: var(--ink);
  font-size: 23px;
  line-height: 1;
}

.icon-only.is-refreshing span {
  animation: refresh-spin .55s linear infinite;
}

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

.chat-layout {
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
}

.chat-room {
  position: relative;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.chat-room-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(36, 36, 21, .12);
  background: rgba(255, 255, 255, .62);
}

.chat-room-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.chat-room-head strong,
.chat-room-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-room-head small {
  color: rgba(36, 36, 21, .55);
  font-size: 12px;
}

.chat-back {
  display: none;
  font-size: 32px;
}

.chat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.chat-line time {
  flex: 0 0 auto;
  color: rgba(36, 36, 21, .42);
  font-size: 11px;
}

.chat-preview-line small {
  min-width: 0;
}

.unread-badge,
.bottom-nav-badge {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--signal);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.message {
  display: grid;
  gap: 6px;
  overflow-wrap: anywhere;
}

.message small {
  display: block;
  color: rgba(36, 36, 21, .5);
  font-size: 10px;
}

.message.mine small {
  color: rgba(248, 245, 232, .58);
}

.message.emoji-message {
  width: fit-content;
  padding: 5px 8px;
  background: transparent;
  font-size: 34px;
}

.message.emoji-message.mine {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.message.emoji-message.mine small {
  color: rgba(36, 36, 21, .5);
}

.message.image-message {
  width: min(72%, 360px);
  max-width: 360px;
  padding: 5px;
  background: rgba(255, 255, 255, .7);
}

.message.image-message.mine {
  background: #050505;
}

.chat-image-link,
.chat-image-link img {
  display: block;
  width: 100%;
}

.chat-image-link img {
  max-height: 340px;
  object-fit: contain;
  border-radius: 2px;
}

.chat-input {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.chat-tools {
  display: flex;
  gap: 6px;
}

.composer-tool {
  width: 38px;
  height: 38px;
  min-height: 38px;
  background: transparent;
  font-size: 21px;
}

.emoji-picker {
  grid-template-columns: repeat(8, minmax(34px, 1fr));
  gap: 5px;
  padding: 10px 12px;
  border-top: 1px solid rgba(36, 36, 21, .12);
  background: #fffef8;
}

.emoji-picker:not(.hidden) {
  display: grid;
}

.emoji-picker button {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 23px;
}

.emoji-picker button:hover {
  background: var(--paper-2);
}

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 760px) {
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .site-header {
    min-height: 58px;
  }

  .mobile-menu-button,
  .top-nav,
  .mobile-nav-backdrop {
    display: none !important;
  }

  .app-shell {
    width: min(100% - 16px, 680px);
    margin: 12px auto 20px;
  }

  .side-rail {
    display: none;
  }

  .view {
    padding: 14px;
  }

  .admin-tabs { margin-inline: -14px; padding-inline: 14px; }
  .admin-tabs button { min-width: 78px; padding-inline: 10px; }
  .admin-console { padding-top: 16px; }
  .admin-list-head { align-items: stretch; flex-direction: column; }
  .admin-search { width: 100%; }
  .admin-record { grid-template-columns: 1fr; }
  .admin-record-actions { justify-content: flex-start; max-width: none; }
  .admin-log-entry { grid-template-columns: 1fr; gap: 5px; }
  .admin-log-entry time { white-space: normal; }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 22;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(64px + env(safe-area-inset-bottom));
    padding: 5px 5px env(safe-area-inset-bottom);
    border-top: 1px solid rgba(248, 245, 232, .18);
    background: rgba(3, 3, 3, .94);
    backdrop-filter: blur(16px);
  }

  body.admin-session .mobile-bottom-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .mobile-bottom-nav button {
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 54px;
    padding: 3px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: rgba(248, 245, 232, .58);
  }

  .mobile-bottom-nav button > span {
    font-size: 23px;
    line-height: 1;
  }

  .mobile-bottom-nav button > small {
    font-size: 11px;
  }

  .mobile-bottom-nav button.active {
    color: var(--acid);
    background: rgba(185, 255, 102, .08);
  }

  .bottom-nav-badge {
    position: absolute;
    top: 2px;
    left: calc(50% + 8px);
  }

  .toast {
    right: 10px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    max-width: calc(100% - 20px);
  }

  #view-chat {
    min-height: calc(100svh - 150px);
    padding: 0;
  }

  #view-chat > .view-head {
    margin: 0;
    min-height: 76px;
    padding: 14px;
  }

  #view-chat > .view-head h2 {
    font-size: 32px;
  }

  #exportChatBtn {
    display: none;
  }

  .chat-layout {
    display: block;
    min-height: calc(100svh - 226px);
  }

  .chat-sidebar {
    grid-template-rows: auto 1fr;
    min-height: calc(100svh - 226px);
  }

  .chat-sidebar-head {
    border-width: 0 0 1px;
    padding: 12px 14px;
  }

  .chat-sidebar-head small {
    display: none;
  }

  .contact-search {
    margin-top: 8px;
  }

  .chat-list {
    gap: 0;
  }

  .chat-contact-card {
    border-width: 0 0 1px;
    border-radius: 0;
    padding: 10px 12px;
    background: rgba(255, 254, 248, .86);
    box-shadow: none;
  }

  .chat-contact-card.active {
    border-color: rgba(36, 36, 21, .14);
  }

  .chat-open {
    grid-template-columns: 50px minmax(0, 1fr);
    min-height: 54px;
    padding: 2px;
  }

  .avatar-chat {
    width: 50px;
  }

  .chat-open strong {
    font-size: 16px;
  }

  .chat-actions {
    grid-template-columns: repeat(2, minmax(0, 92px));
    justify-content: end;
  }

  .chat-room {
    display: none;
    min-height: calc(100svh - 134px - env(safe-area-inset-bottom));
    height: calc(100svh - 134px - env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #view-chat.chat-detail-open > .view-head,
  #view-chat.chat-detail-open .chat-sidebar {
    display: none;
  }

  #view-chat.chat-detail-open .chat-layout,
  #view-chat.chat-detail-open .chat-room {
    display: grid;
  }

  .chat-back {
    display: inline-grid;
  }

  .messages {
    min-height: 0;
    max-height: none;
    padding: 12px;
  }

  .message {
    max-width: 82%;
  }

  .message.image-message {
    width: min(82%, 320px);
  }

  .chat-input {
    gap: 6px;
    padding: 9px;
    background: #fffef8;
  }

  .chat-input input {
    min-width: 0;
  }

  .composer-tool {
    width: 34px;
    height: 38px;
    min-height: 38px;
  }

  .emoji-picker {
    grid-template-columns: repeat(6, minmax(34px, 1fr));
    max-height: 166px;
    overflow-y: auto;
  }
}

@media (max-width: 420px) {
  .chat-input {
    grid-template-columns: auto minmax(0, 1fr) 52px;
  }

  .chat-tools {
    gap: 2px;
  }

  .composer-tool {
    width: 31px;
  }

  #sendMessageBtn {
    padding-inline: 7px;
  }
}

/* 保存资料按钮：荧光绿高亮 + 未保存状态脉冲 */
#saveProfileBtn {
  background: var(--acid);
  color: var(--ink);
  border: 1px solid var(--acid);
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(185, 255, 102, .35), 0 0 18px rgba(185, 255, 102, .28);
}

#saveProfileBtn:hover {
  box-shadow: 0 0 0 1px rgba(185, 255, 102, .6), 0 0 26px rgba(185, 255, 102, .45);
}

#saveProfileBtn.has-unsaved {
  animation: save-pulse 1.1s ease-in-out infinite;
}

@keyframes save-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(185, 255, 102, .35), 0 0 18px rgba(185, 255, 102, .28); }
  50% { box-shadow: 0 0 0 1px rgba(185, 255, 102, .75), 0 0 30px rgba(185, 255, 102, .6); }
}

/* 未保存徽标 */
#saveProfileBtn.has-unsaved::after {
  content: " · 未保存";
  font-size: .72em;
  opacity: .85;
}
