* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #eef2f0;
  color: #2f2824;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

a {
  color: inherit;
}

.phone-shell {
  position: relative;
  overflow: hidden;
  width: min(430px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  background: #fffaf6;
  box-shadow: 0 0 80px rgba(58, 42, 36, 0.2);
}

.page {
  min-height: 100vh;
  padding: 18px 16px 98px;
  background:
    linear-gradient(180deg, rgba(255, 250, 246, 0.92), rgba(255, 250, 246, 0.96)),
    radial-gradient(circle at 18% 0%, rgba(177, 75, 95, 0.12), transparent 34%),
    url("./assets/login-hero-bg.jpg?v=20260701a") center top / cover no-repeat,
    #fffaf6;
}

.login-page {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  padding: 34px 18px;
  isolation: isolate;
  overflow: hidden;
  background: #221918;
}

.login-page::before {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: -2;
  background-image: url("./assets/login-hero-bg.jpg?v=20260701a");
  background-size: cover;
  background-position: center;
  filter: saturate(0.96) contrast(1.04);
  transform: scale(1.04);
  animation: loginBgDrift 16s ease-in-out infinite alternate;
}

.login-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(36, 25, 23, 0.18), rgba(36, 25, 23, 0.72) 58%, rgba(36, 25, 23, 0.88)),
    linear-gradient(135deg, rgba(126, 52, 63, 0.38), rgba(226, 164, 105, 0.15));
}

.brand {
  position: relative;
  margin-bottom: 26px;
  text-align: center;
  color: #fff;
  animation: riseIn 640ms ease both;
}

.brand-mark {
  display: inline-flex;
  width: 72px;
  height: 72px;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  color: #fff;
  font-size: 34px;
  font-weight: 900;
  background: linear-gradient(135deg, #76313e, #b84d5d 58%, #d5a15f);
  box-shadow: 0 18px 40px rgba(39, 21, 18, 0.34);
}

.brand h1 {
  margin: 14px 0 6px;
  font-size: 32px;
  letter-spacing: 0;
}

.brand .muted {
  color: rgba(255, 255, 255, 0.78);
}

.muted {
  color: #8f7e75;
}

.card {
  border: 1px solid rgba(92, 68, 58, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(78, 48, 38, 0.1);
}

.login-card,
.panel-card {
  padding: 20px;
}

.login-card {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 54px rgba(25, 18, 16, 0.3);
  animation: riseIn 760ms 90ms ease both;
}

.login-card-head {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(80, 51, 43, 0.08);
}

.login-card-head span {
  color: #8f7e75;
  font-size: 13px;
}

.login-card-head b {
  font-size: 21px;
  letter-spacing: 0;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.field-label.spaced {
  margin-top: 14px;
}

.phone-input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(80, 51, 43, 0.14);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.94);
  font-size: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.phone-input:focus,
.admin-input:focus {
  border-color: rgba(159, 62, 76, 0.58);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(177, 75, 95, 0.1);
}

.primary-btn,
.ghost-btn,
.danger-btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, #883847, #bd5361);
  box-shadow: 0 12px 24px rgba(136, 56, 71, 0.18);
}

.ghost-btn {
  color: #823947;
  border: 1px solid rgba(177, 75, 95, 0.24);
  background: #fff8f4;
}

.danger-btn {
  color: #9f2f42;
  border: 1px solid rgba(159, 47, 66, 0.24);
  background: #fff2f1;
}

.full {
  width: 100%;
  margin-top: 14px;
}

.message {
  min-height: 22px;
  margin-top: 12px;
  color: #8f7e75;
  font-size: 13px;
  line-height: 1.45;
}

.message.error {
  color: #b43a4c;
}

.admin-link {
  display: inline-flex;
  justify-content: center;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  text-decoration: none;
  animation: riseIn 780ms 150ms ease both;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 22px 18px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(135deg, #663a3b 0%, #a33f50 54%, #d69b5d 100%);
  box-shadow: 0 16px 32px rgba(143, 64, 82, 0.18);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.14) 42%, transparent 72%);
  transform: translateX(-110%);
  animation: sheen 5.8s ease-in-out infinite;
}

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

.hero small {
  color: rgba(255, 255, 255, 0.78);
}

.hero h2 {
  margin: 8px 0;
  font-size: 29px;
  line-height: 1.15;
}

.hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.stat {
  padding: 14px 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.88);
}

.stat b {
  display: block;
  color: #9f3e4c;
  font-size: 21px;
}

.stat span {
  color: #8f7e75;
  font-size: 12px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 2px 12px;
}

.section-head h3 {
  margin: 0;
  font-size: 20px;
}

.chips {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.chip {
  min-height: 34px;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0 13px;
  color: #725f57;
  background: #fff;
  border: 1px solid rgba(80, 51, 43, 0.1);
}

.chip.active {
  color: #fff;
  border-color: #9f3e4c;
  background: #9f3e4c;
}

.profile-card,
.event-card,
.user-card,
.request-card {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.profile-card {
  border-color: rgba(101, 72, 61, 0.08);
  animation: cardIn 420ms ease both;
}

.profile-card:hover,
.event-card:hover,
.request-card:hover {
  transform: translateY(-2px);
  border-color: rgba(177, 75, 95, 0.18);
  box-shadow: 0 18px 38px rgba(78, 48, 38, 0.14);
}

.profile-photo,
.large-photo,
.gallery-photo,
.member-photo-avatar,
.member-photo,
.portrait-preview,
.portrait-mini {
  background-image: url("./assets/profile-contact-sheet.jpg?v=20260701a");
  background-repeat: no-repeat;
  background-size: 300% 200%;
}

.profile-photo {
  width: 104px;
  height: 132px;
  flex: 0 0 104px;
  border-radius: 14px;
  box-shadow: inset 0 -42px 42px rgba(0, 0, 0, 0.08), 0 10px 20px rgba(70, 42, 34, 0.1);
}

.cell-1 {
  background-position: 0% 0%;
}

.cell-2 {
  background-position: 50% 0%;
}

.cell-3 {
  background-position: 100% 0%;
}

.cell-4 {
  background-position: 0% 100%;
}

.cell-5 {
  background-position: 50% 100%;
}

.cell-6 {
  background-position: 100% 100%;
}

.grow {
  min-width: 0;
  flex: 1;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.name {
  font-size: 18px;
  font-weight: 900;
}

.large-name {
  font-size: 24px;
  font-weight: 900;
}

.meta {
  display: block;
  margin-top: 5px;
  color: #6c5d56;
  font-size: 13px;
  line-height: 1.35;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.match {
  color: #9f3e4c;
  font-weight: 900;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  color: #8f4052;
  background: #fff0e8;
  font-size: 12px;
  white-space: nowrap;
}

.pill.light {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.mini-btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 5;
  display: grid;
  width: min(430px, 100vw);
  height: 66px;
  grid-template-columns: repeat(5, 1fr);
  transform: translateX(-50%);
  border-top: 1px solid rgba(80, 51, 43, 0.08);
  background: rgba(255, 250, 246, 0.96);
  backdrop-filter: blur(12px);
}

.tabbar button {
  color: #87766e;
  background: transparent;
  font-size: 13px;
}

.tabbar button.active {
  color: #9f3e4c;
  font-weight: 900;
}

.profile-hero-card {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  padding: 0;
}

.large-photo {
  width: 100%;
  height: 360px;
  border-radius: 16px;
  transform: scale(1.001);
}

.profile-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
}

.gallery-item {
  min-width: 0;
}

.gallery-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
}

.gallery-item span {
  display: block;
  margin-top: 5px;
  color: #8f7e75;
  font-size: 11px;
  text-align: center;
}

.profile-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 18px;
  color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(30, 24, 20, 0.72));
}

.profile-overlay span {
  display: block;
  margin-top: 6px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.info {
  padding: 14px;
}

.info span {
  display: block;
  color: #8f7e75;
  font-size: 12px;
}

.info b {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.intro,
.tag-block,
.timeline,
.empty {
  padding: 16px;
}

.intro {
  line-height: 1.65;
  color: #574a44;
}

.sticky-actions {
  position: sticky;
  bottom: 78px;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin-top: 16px;
}

.step {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(80, 51, 43, 0.08);
}

.step:last-child {
  border-bottom: 0;
}

.dot,
.date {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: #9f3e4c;
  font-size: 13px;
  font-weight: 900;
}

.step b {
  display: block;
}

.step span {
  display: block;
  margin-top: 4px;
  color: #7b6b63;
  font-size: 13px;
  line-height: 1.45;
}

.date {
  width: 54px;
  height: 64px;
  flex-direction: column;
  border-radius: 14px;
  color: #fff;
  background: #2f2824;
}

.date b {
  font-size: 21px;
}

.date span {
  font-size: 12px;
}

.member-card {
  display: flex;
  gap: 14px;
  padding: 18px;
}

.member-mark {
  display: flex;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, #5c7b73, #9f3e4c);
}

.member-photo-avatar {
  display: block;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 18px;
  background-color: #f3e4dd;
}

.menu-card {
  margin-top: 14px;
  padding: 0 16px;
}

.menu-row {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(80, 51, 43, 0.08);
}

.menu-row:first-child {
  border-top: 0;
}

.menu-row span:last-child {
  color: #7b6b63;
  text-align: right;
  font-size: 13px;
}

.back-btn {
  margin-bottom: 12px;
}

.admin-body {
  background:
    linear-gradient(135deg, rgba(119, 59, 66, 0.08), rgba(92, 123, 115, 0.08)),
    #eef2f0;
}

.admin-app {
  min-height: 100vh;
}

.admin-login {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  isolation: isolate;
  overflow: hidden;
}

.admin-login::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("./assets/login-hero-bg.jpg?v=20260701a");
  background-size: cover;
  background-position: center;
  filter: saturate(0.9) contrast(1.02);
}

.admin-login::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, rgba(36, 25, 23, 0.72), rgba(36, 25, 23, 0.3) 52%, rgba(239, 232, 224, 0.88));
}

.admin-login-card {
  width: min(420px, 100%);
  padding: 26px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  animation: riseIn 680ms ease both;
}

.admin-login .admin-link {
  color: #823947;
}

.admin-login-card h1 {
  margin: 0 0 8px;
}

.admin-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 244px 1fr;
}

.admin-side {
  padding: 26px 18px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 220px),
    #282322;
  box-shadow: 16px 0 38px rgba(43, 34, 30, 0.08);
}

.admin-side h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.admin-nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.admin-nav button {
  min-height: 42px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  text-align: left;
  padding: 0 12px;
}

.admin-nav button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.admin-main {
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(238, 242, 240, 0.9), rgba(238, 242, 240, 0.96)),
    url("./assets/login-hero-bg.jpg?v=20260701a") right top / 760px auto no-repeat;
}

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

.admin-top h2 {
  margin: 0;
  font-size: 26px;
}

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

.metric {
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 246, 0.92));
}

.metric span {
  color: #66756f;
  font-size: 13px;
}

.metric b {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.admin-section {
  margin-top: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
}

.admin-section h3 {
  margin: 0;
}

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

.admin-section-head p {
  margin: 6px 0 0;
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.admin-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(80, 51, 43, 0.12);
  border-radius: 10px;
  padding: 0 12px;
  outline: none;
  background: #fff;
  color: #2f2824;
}

.member-editor {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(177, 75, 95, 0.18);
  border-radius: 16px;
  background: #fff8f3;
}

.editor-title,
.editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.editor-title h4 {
  margin: 0;
  font-size: 18px;
}

.member-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.member-form-grid label,
.avatar-editor label {
  display: grid;
  gap: 6px;
  color: #66756f;
  font-size: 13px;
}

.member-form-grid label span,
.avatar-editor label span {
  font-weight: 800;
}

.avatar-editor,
.album-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.portrait-preview {
  width: 96px;
  height: 116px;
  border-radius: 14px;
  box-shadow: inset 0 -28px 28px rgba(0, 0, 0, 0.08);
}

.album-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.album-head h4 {
  margin: 0;
}

.member-photo-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(86px, 1fr));
  gap: 10px;
}

.member-photo-card {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(80, 51, 43, 0.1);
  border-radius: 12px;
  background: #fff;
}

.member-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
}

.member-photo-card > span {
  display: block;
  margin-top: 6px;
  color: #66756f;
  font-size: 12px;
}

.photo-actions {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}

.photo-actions button {
  min-height: 26px;
  border-radius: 8px;
  color: #8f4052;
  background: #fff0e8;
  font-size: 12px;
}

.compact {
  min-height: 38px;
}

.wide-field {
  grid-column: span 2;
}

.admin-textarea {
  min-height: 86px;
  padding-top: 10px;
  resize: vertical;
}

.file-line {
  margin-top: 10px;
}

.editor-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(80, 51, 43, 0.08);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: #66756f;
  font-weight: 800;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table .primary-btn,
.admin-table .danger-btn,
.admin-table .ghost-btn {
  min-height: 34px;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
}

.portrait-mini {
  width: 48px;
  height: 58px;
  border-radius: 10px;
}

@keyframes loginBgDrift {
  from {
    transform: scale(1.04) translate3d(-8px, -6px, 0);
  }

  to {
    transform: scale(1.1) translate3d(10px, 8px, 0);
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sheen {
  0%,
  42% {
    transform: translateX(-110%);
  }

  72%,
  100% {
    transform: translateX(110%);
  }
}

@media (max-width: 820px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-side {
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .admin-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-filters,
  .member-form-grid {
    grid-template-columns: 1fr;
  }

  .album-editor {
    grid-template-columns: 1fr;
  }

  .member-photo-grid {
    grid-template-columns: repeat(3, minmax(72px, 1fr));
  }

  .wide-field {
    grid-column: auto;
  }

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

  .admin-main {
    padding: 18px;
  }
}
