/* ============================================================================
   组件层：头图、人物卡、点赞按钮、领奖台、榜单行、底部条、抽屉、表单。
   ========================================================================= */

/* ------------------------------------------------------------------ 活动头图 */

.hero {
  position: relative;
  overflow: hidden;
  padding: 18px 16px 24px;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  background: linear-gradient(140deg, var(--hero-from) 0%, var(--hero-mid) 50%, var(--hero-to) 100%);
  color: var(--ink-invert);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 8% -10%, rgba(255, 255, 255, 0.3), transparent 55%),
    radial-gradient(70% 60% at 100% 0%, rgba(255, 255, 255, 0.22), transparent 60%);
  pointer-events: none;
}

.hero--cover {
  background-size: cover;
  background-position: center;
}

.hero--cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 8, 24, 0.35) 0%, rgba(15, 8, 24, 0.72) 100%);
}

.hero__inner {
  position: relative;
  z-index: 1;
}

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

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: rgba(16, 10, 26, 0.34);
  font-size: 12px;
  font-weight: 500;
  backdrop-filter: blur(6px);
}

.hero__title {
  margin-top: 14px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(20, 8, 30, 0.28);
}

.hero__sub {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.94);
}

.hero__stats {
  display: flex;
  gap: 22px;
  margin-top: 18px;
}

.hero__stat b {
  display: block;
  font-family: var(--font-num);
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.hero__stat span {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.93);
}

.hero__clock {
  font-family: var(--font-num);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.95);
}

/* ------------------------------------------------------------------ 人物卡 */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-1) var(--ease);
}

.card:active {
  transform: scale(0.985);
}

.card__photo {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--surface-3);
  overflow: hidden;
}

.card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__shade {
  position: absolute;
  inset: auto 0 0 0;
  height: 72%;
  /* 姓名/单位压在照片上，压暗层要足够深，照片再亮也读得清 */
  background: linear-gradient(transparent 0%, rgba(8, 7, 14, 0.5) 38%, rgba(8, 7, 14, 0.86) 100%);
  pointer-events: none;
}

.card__no {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: rgba(18, 16, 26, 0.68);
  color: #fff;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}

.card__crown {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 700;
  color: rgba(24, 16, 4, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(20, 18, 28, 0.28);
}

.card__crown--1 {
  background: linear-gradient(180deg, #f2b944, var(--gold));
}

.card__crown--2 {
  background: linear-gradient(180deg, #b3bbc6, var(--silver));
}

.card__crown--3 {
  background: linear-gradient(180deg, #d09261, var(--bronze));
}

.card__caption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 9px;
  color: #fff;
}

.card__name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 8px rgba(10, 9, 18, 0.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__org {
  display: block;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.82);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 10px 10px;
}

.card__count {
  display: flex;
  align-items: baseline;
  gap: 3px;
  min-width: 0;
}

.card__count b {
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.card__count span {
  font-size: 11px;
  color: var(--ink-3);
}

/* ------------------------------------------------------------------ 头像 */

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar__initial {
  font-size: 2.1em;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.avatar--round {
  border-radius: 50%;
}

/* 头像尺寸随容器变化，避免每个调用点各写一套尺寸 */
.card__photo .avatar {
  font-size: 22px;
}

.detail-photo .avatar {
  font-size: 34px;
}

.podium__avatar .avatar {
  font-size: 17px;
}

.podium__item--1 .podium__avatar .avatar {
  font-size: 21px;
}

.rank-row__avatar .avatar,
.thumb .avatar {
  font-size: 13px;
}

.upload__preview .avatar {
  font-size: 15px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: dotPulse 1.8s var(--ease) infinite;
}

@keyframes dotPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

/* ------------------------------------------------------------------ 点赞按钮 */

.heart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--like-soft);
  color: var(--like-ink);
  font-size: 12.5px;
  font-weight: 600;
  flex: none;
  transition: transform var(--dur-1) var(--ease), background var(--dur-2) var(--ease),
    color var(--dur-2) var(--ease);
}

.heart:active:not([disabled]) {
  transform: scale(0.92);
}

.heart svg {
  transition: transform var(--dur-2) var(--ease);
}

.heart.is-pop svg {
  animation: heartPop var(--dur-3) var(--ease);
}

.heart--done,
.heart[disabled] {
  background: var(--surface-3);
  color: var(--ink-3);
  cursor: default;
}

.heart--big {
  gap: 8px;
  /* 和左侧额度提示同一行，必须可伸缩，否则会顶出屏幕 */
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: 50px;
  font-size: 16px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #ff5c86 0%, var(--like) 100%);
  color: #fff;
  box-shadow: var(--shadow-like);
}

.heart--big.is-pop {
  animation: buttonPulse var(--dur-3) var(--ease);
}

.heart__burst {
  position: absolute;
  left: 50%;
  bottom: 60%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.heart__burst i {
  position: absolute;
  display: block;
  animation: floatUp var(--dur-3) var(--ease) forwards;
}

@keyframes heartPop {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.5);
  }
  60% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes buttonPulse {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(0.965);
  }
  60% {
    transform: scale(1.015);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes floatUp {
  0% {
    transform: translate(-50%, 0) scale(0.5);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx, -50%), -74px) scale(1.25);
    opacity: 0;
  }
}

/* ------------------------------------------------------------------ 领奖台 */

.podium {
  display: grid;
  grid-template-columns: 1fr 1.16fr 1fr;
  gap: 8px;
  align-items: end;
  padding: 20px 16px 0;
}

.podium__item {
  text-align: center;
}

.podium__rank {
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
}

.podium__avatar {
  position: relative;
  width: 66px;
  height: 66px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--silver), var(--shadow-2);
}

.podium__item--1 .podium__avatar {
  width: 82px;
  height: 82px;
  box-shadow: 0 0 0 4px var(--gold), var(--shadow-2);
}

.podium__item--3 .podium__avatar {
  box-shadow: 0 0 0 3px var(--bronze), var(--shadow-2);
}

.podium__name {
  margin-top: 10px;
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium__block {
  margin-top: 10px;
  padding: 12px 4px 14px;
  border-radius: var(--r-md) var(--r-md) 0 0;
}

.podium__item--1 .podium__block {
  background: linear-gradient(180deg, var(--gold-soft), rgba(253, 243, 224, 0.35));
  border-top: 3px solid var(--gold);
}

.podium__item--2 .podium__block {
  background: linear-gradient(180deg, var(--silver-soft), rgba(240, 242, 245, 0.35));
  border-top: 3px solid var(--silver);
}

.podium__item--3 .podium__block {
  background: linear-gradient(180deg, var(--bronze-soft), rgba(249, 239, 230, 0.35));
  border-top: 3px solid var(--bronze);
}

.podium__likes {
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.podium__likes span {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 3px;
}

/* ------------------------------------------------------------------ 榜单行 */

.rank-list {
  background: var(--surface);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  margin: 0 16px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.rank-row:last-child {
  border-bottom: 0;
}

.rank-row__no {
  flex: none;
  width: 24px;
  text-align: center;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.rank-row__no--1 {
  color: #9a6a12;
}

.rank-row__no--2 {
  color: #6b7480;
}

.rank-row__no--3 {
  color: #8a5326;
}

.rank-row__avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-3);
}

.rank-row__body {
  flex: 1;
  min-width: 0;
}

.rank-row__name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 600;
}

.rank-row__org {
  font-size: 11.5px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.rank-row__likes {
  text-align: right;
}

.rank-row__likes b {
  display: block;
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rank-row__likes span {
  font-size: 10.5px;
  color: var(--ink-3);
}

/* ------------------------------------------------------------------ 通用 */

.section {
  margin-top: 22px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px 10px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
}

.section-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.panel {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}

.panel--pad {
  padding: 16px;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 0 16px;
}

.tab {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-1);
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}

.tab.is-active {
  background: var(--ink);
  color: #fff;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  margin: 0 16px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: var(--ink-3);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--ink);
}

.search input::placeholder {
  color: var(--ink-3);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 600;
}

.pill--like {
  background: var(--like-soft);
  color: var(--like-ink);
}

.pill--muted {
  background: var(--surface-3);
  color: var(--ink-2);
  font-weight: 500;
}

.pill--warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill--ok {
  background: var(--ok-soft);
  color: var(--ok);
}

/* ------------------------------------------------------------------ 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: transform var(--dur-1) var(--ease), background var(--dur-1) var(--ease),
    opacity var(--dur-1) var(--ease);
}

.btn:active:not([disabled]) {
  transform: scale(0.97);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--ink);
  color: #fff;
}

.btn--like {
  background: linear-gradient(135deg, #ff5c86, var(--like));
  color: #fff;
  box-shadow: var(--shadow-like);
}

.btn--outline {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn--sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.btn--block {
  width: 100%;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
  flex: none;
}

.icon-btn--ghost {
  background: transparent;
  box-shadow: none;
}

.icon-btn--danger {
  color: var(--danger);
  box-shadow: inset 0 0 0 1px rgba(192, 57, 43, 0.24);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* ------------------------------------------------------------------ 底部条 */

.bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.bottombar__inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: var(--app-w);
  height: calc(var(--bottombar-h) + env(safe-area-inset-bottom, 0px));
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px) saturate(160%);
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow-3);
}

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

.bottombar__quota b {
  font-family: var(--font-num);
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--like-ink);
}

.bottombar__quota span {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-left: 5px;
}

.bottombar__quota em {
  display: block;
  font-size: 11px;
  font-style: normal;
  color: var(--ink-3);
}

/* ------------------------------------------------------------------ 抽屉/弹层 */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(17, 16, 24, 0.44);
  animation: fadeIn var(--dur-2) var(--ease);
}

.sheet__panel {
  width: 100%;
  max-width: var(--app-w);
  max-height: 86vh;
  overflow: auto;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 18px 16px calc(22px + env(safe-area-inset-bottom, 0px));
  animation: sheetIn var(--dur-2) var(--ease);
}

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

.sheet__title {
  font-size: 17px;
  font-weight: 600;
}

.sheet__text {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
  white-space: pre-wrap;
}

@keyframes sheetIn {
  from {
    transform: translateY(14%);
    opacity: 0.6;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

/* ------------------------------------------------------------------ 表单 */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.field__hint {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.5;
}

.field__error {
  font-size: 12px;
  color: var(--danger);
}

.input,
.textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 14px;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-3);
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--like);
  box-shadow: 0 0 0 3px var(--like-ring);
}

.textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.6;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.switch-row:last-child {
  border-bottom: 0;
}

.switch-row__title {
  font-size: 13.5px;
  font-weight: 500;
}

.switch-row__hint {
  font-size: 11.5px;
  color: var(--ink-3);
}

.switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background var(--dur-2) var(--ease);
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-2) var(--ease);
}

.switch[aria-checked="true"] {
  background: var(--like);
  box-shadow: none;
}

.switch[aria-checked="true"]::after {
  transform: translateX(18px);
}

/* ------------------------------------------------------------------ 提示 */

.toasts {
  position: fixed;
  z-index: 80;
  left: 0;
  right: 0;
  bottom: calc(var(--bottombar-h) + 22px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 20px;
}

.toast {
  max-width: 100%;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: rgba(23, 23, 31, 0.92);
  color: #fff;
  font-size: 13px;
  text-align: center;
  box-shadow: var(--shadow-2);
  animation: toastIn var(--dur-2) var(--ease);
}

.toast--error {
  background: rgba(184, 45, 34, 0.95);
}

.toast--success {
  background: rgba(14, 122, 81, 0.95);
}

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

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 46px 24px;
  text-align: center;
}

.empty__mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border-radius: 16px;
  background: var(--surface-3);
  color: var(--ink-3);
}

.empty__title {
  font-size: 15px;
  font-weight: 600;
}

.empty__text {
  font-size: 12.5px;
  color: var(--ink-3);
  max-width: 30ch;
}

.skeleton {
  border-radius: var(--r-md);
  background: linear-gradient(90deg, #eeedf2 25%, #f7f6f9 37%, #eeedf2 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}

@keyframes shimmer {
  from {
    background-position: 100% 50%;
  }
  to {
    background-position: 0 50%;
  }
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  line-height: 1.6;
}

.alert--info {
  background: var(--like-soft);
  color: var(--like-ink);
}

.alert--warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.alert--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.alert--ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.alert__icon {
  flex: none;
  margin-top: 1px;
}
