:root {
  --bg: #fff4f8;
  --bg-deep: #2a101f;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --ink: #2b1422;
  --muted: #8d667a;
  --line: rgba(177, 89, 129, 0.2);
  --brand: #c22f75;
  --brand-dark: #7b1748;
  --accent: #f2a1c6;
  --shadow: 0 18px 42px rgba(126, 36, 82, 0.18);
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 185, 215, 0.95), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(170, 37, 100, 0.2), transparent 32%),
    linear-gradient(180deg, #fff1f7 0%, #ffe6f0 46%, #fff8fb 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

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

.page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 14px calc(32px + env(safe-area-inset-bottom));
}

.home-hero {
  padding: 26px 0 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

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

h1 {
  margin-bottom: 8px;
  color: #351326;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: 0;
}

.lead {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.count-pill {
  flex: 0 0 auto;
  min-width: 82px;
  padding: 9px 12px;
  border: 1px solid rgba(194, 47, 117, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 10px 26px rgba(194, 47, 117, 0.12);
}

.search-panel {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 8px -14px 18px;
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(194, 47, 117, 0.1);
  border-bottom: 1px solid rgba(194, 47, 117, 0.18);
  background: rgba(255, 244, 248, 0.86);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 13px;
  border: 1px solid rgba(194, 47, 117, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 26px rgba(126, 36, 82, 0.1);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--brand);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.search-box input::placeholder {
  color: #b7899f;
}

.clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #ffe2ee;
  color: var(--brand-dark);
  font-size: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 12px;
}

.section-title h2 {
  margin: 0;
  color: #351326;
  font-size: 18px;
}

.result-text {
  color: var(--muted);
  font-size: 13px;
}

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

.employee-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 232px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.employee-card::after {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, transparent 54%, rgba(43, 20, 34, 0.68) 100%);
  content: "";
  pointer-events: none;
}

.employee-card:active {
  transform: scale(0.99);
}

.avatar-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #f8d6e5;
}

.avatar-wrap img {
  position: absolute;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.employee-body {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.employee-name {
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -14px 18px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid rgba(194, 47, 117, 0.14);
  background: rgba(255, 244, 248, 0.88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(194, 47, 117, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--brand-dark);
  font-size: 24px;
}

.top-title {
  min-width: 0;
  margin: 0;
  color: #351326;
  font-size: 18px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-identity {
  margin-bottom: 16px;
  padding: 18px 16px;
  border: 1px solid rgba(194, 47, 117, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 34px rgba(126, 36, 82, 0.12);
}

.employee-identity p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.employee-identity h1 {
  margin: 0;
  font-size: 34px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.photo-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 7px;
  background: #f8d6e5;
  box-shadow: 0 10px 22px rgba(126, 36, 82, 0.12);
}

.photo-tile img {
  position: absolute;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-tile:active {
  opacity: 0.85;
}

.empty-state,
.error-state,
.loading-screen,
.noscript {
  margin: 28px auto;
  padding: 24px 16px;
  border: 1px solid rgba(194, 47, 117, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
  box-shadow: 0 14px 34px rgba(126, 36, 82, 0.1);
}

.empty-state h2,
.error-state h2 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 20px;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 12px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.viewer {
  position: fixed;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    radial-gradient(circle at 50% 0%, rgba(194, 47, 117, 0.26), transparent 36%),
    rgba(18, 8, 14, 0.98);
  color: #fff;
  touch-action: none;
}

.viewer[hidden] {
  display: none;
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
}

.viewer-title {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-close,
.viewer-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 26px;
}

.viewer-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 8px 0;
}

.viewer-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  -webkit-user-select: none;
  user-select: none;
}

.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.viewer-nav.prev {
  left: 10px;
}

.viewer-nav.next {
  right: 10px;
}

.viewer-caption {
  min-height: 40px;
  padding: 6px 16px calc(12px + env(safe-area-inset-bottom));
}

@media (min-width: 680px) {
  .page {
    padding-top: 26px;
  }

  h1 {
    font-size: 48px;
  }

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

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

@media (max-width: 360px) {
  .employee-grid {
    grid-template-columns: 1fr;
  }

  .title-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@supports not (aspect-ratio: 1 / 1) {
  .photo-tile::before {
    display: block;
    padding-top: 100%;
    content: "";
  }

  .avatar-wrap::before {
    display: block;
    padding-top: 133.333%;
    content: "";
  }
}
