:root {
  --bg: #f4efe6;
  --panel: #fffdf8;
  --ink: #2a2622;
  --muted: #7a7268;
  --grout: #c9bfb0;
  --accent: #c45c3e;
  --accent-soft: #e8a090;
  --line: #d8cfc2;
  --shadow: rgba(42, 38, 34, 0.12);
  --radius: 25px;
  --font: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

.app-header {
  padding: 1rem 1.25rem 0.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff9f0 0%, var(--bg) 100%);
}

.app-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.app-header-lead {
  min-width: 0;
}

.app-header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.profile-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ebe4d9;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 6px var(--shadow);
}

.profile-pill:hover {
  filter: brightness(1.04);
}

button.profile-pill {
  font: inherit;
  font-family: inherit;
  cursor: pointer;
  color: inherit;
}

.profile-pill--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

.profile-pill-icon {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
}

.profile-pill-icon::before,
.profile-pill-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
}

.profile-pill-icon::before {
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.profile-pill-icon::after {
  bottom: 0;
  width: 14px;
  height: 8px;
  border-radius: 8px 8px 3px 3px;
}

.trophy-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
}

/* 单色奖杯（与排名柱状、个人剪影同一套墨色），替代彩色 emoji */
.trophy-pill-icon::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background-color: var(--ink);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94.63 1.5 1.98 2.63 3.61 2.96V19H7v2h10v-2h-4v-3.1c1.63-.33 2.98-1.46 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2zM5 8V7h2v3.82C5.84 10.4 5 9.3 5 8zm14 0c0 1.3-.84 2.4-2 2.82V7h2v1z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94.63 1.5 1.98 2.63 3.61 2.96V19H7v2h10v-2h-4v-3.1c1.63-.33 2.98-1.46 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2zM5 8V7h2v3.82C5.84 10.4 5 9.3 5 8zm14 0c0 1.3-.84 2.4-2 2.82V7h2v1z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.home-pill-icon {
  font-size: 14px;
  line-height: 1;
}

.home-pill-icon::before {
  content: "⌂";
}

.app-header-desc {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 52rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(340px, 420px);
  gap: 1rem;
  padding: 1rem 1.25rem 1.5rem;
  min-height: calc(100% - 5.5rem);
  align-items: stretch;
}

@media (min-width: 901px) {
  body.index-page {
    display: grid;
    grid-template-columns: 39px 1fr;
    min-height: 100vh;
  }

  body.index-page .app-header {
    border-bottom: none;
    border-right: 1px solid var(--line);
    padding: 0.8rem 0.35rem;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  body.index-page .app-header-bar {
    width: 100%;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
  }

  body.index-page .app-header h1 {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.1;
    transform: translateX(-10px);
  }

  body.index-page .badge {
    display: none;
  }

  body.index-page .header-actions {
    flex-direction: column;
    gap: 0.4rem;
  }

  body.index-page .profile-pill--icon {
    width: 24px;
    height: 24px;
  }

  body.index-page .app-header-desc {
    display: none;
  }

  body.index-page .layout {
    padding: 1rem 1rem 1.25rem;
    min-height: 100vh;
  }
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.discovery {
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.panel-head {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.discovery-head {
  position: relative;
  overflow: visible;
}

.discover-search-wrap {
  position: relative;
  width: min(56%, 320px);
  flex: 0 1 320px;
}

.discover-search {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0.28rem 0.5rem 0.28rem 0.65rem;
}

.discover-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.82rem;
  background: transparent;
  color: var(--ink);
}

.discover-search input::placeholder {
  color: #989089;
}

.discover-search-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.86rem;
  color: #6f665d;
  background: #f4eee7;
}

.discover-search-wrap .discover-search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 100%;
  max-height: 44vh;
  min-height: 0;
  display: none;
  z-index: 8;
  box-shadow: 0 10px 26px rgba(42, 38, 34, 0.16);
}

.discover-search-wrap.is-open .discover-search-results {
  display: block;
}

.panel-head span.hint {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
}

.panel-head--board {
  position: relative;
  justify-content: center;
  font-weight: 400;
}

.board-head-center {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
}

.board-title {
  font-weight: 400;
}

.board-collected {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 400;
}

.board-help-wrap {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}

.board-help-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #ece9e3;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.board-help-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 150px;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
  box-shadow: 0 8px 18px var(--shadow);
  display: none;
  z-index: 3;
}

.board-help-wrap:hover .board-help-pop,
.board-help-btn:focus + .board-help-pop {
  display: block;
}

.board-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  min-height: 280px;
}

.board-scroll--dragging {
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
}

.tile-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  max-width: 720px;
  margin: 0 auto;
}

.cell {
  aspect-ratio: 1;
  border: 3px solid var(--grout);
  border-radius: 4px;
  background: #ebe4d9;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  -webkit-user-drag: none;
}

.cell:not(.empty) {
  cursor: grab;
}

.tile-board--dragging {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.tile-board--dragging .cell:not(.empty) {
  cursor: grabbing;
}

.app--dragging-board,
.app--dragging-board * {
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-user-drag: none !important;
  -webkit-touch-callout: none;
}

.cell--drag-source {
  opacity: 0.55;
  z-index: 2;
  box-shadow: 0 4px 16px rgba(42, 38, 34, 0.25);
}

.cell--drop-target {
  outline: 3px solid var(--accent);
  outline-offset: -2px;
  background: rgba(232, 160, 144, 0.2);
}


.cell.empty {
  background: repeating-linear-gradient(
    -45deg,
    #e8e1d6,
    #e8e1d6 6px,
    #e2dbd0 6px,
    #e2dbd0 12px
  );
}

.cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.cell .remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: rgba(42, 38, 34, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 0;
}

.cell:not(.empty):hover .remove {
  opacity: 1;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.65rem 0.5rem;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs button.active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.tab-panel {
  flex: 1;
  padding: 0.85rem 1rem 1rem;
  display: none;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
}

.tab-panel.active {
  display: flex;
}

.search-row {
  display: flex;
  gap: 0.5rem;
}

.search-row input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
}

.search-row input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.results {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 120px;
}

.decor-list {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 140px;
  padding: 0.65rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  align-content: start;
}

.decor-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.35rem;
  cursor: pointer;
}

.decor-item:hover {
  border-color: var(--accent-soft);
  background: #fff9f6;
}

.decor-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.decor-item-name {
  margin: 0.3rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem 0.95rem;
  align-items: start;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.12s;
}

.result-item:last-child {
  border-bottom: none;
}

.result-item:hover {
  background: #fff7f2;
}

.result-item img {
  width: 72px;
  height: 72px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--grout);
}

.result-meta {
  display: flex;
  flex-direction: column;
  min-height: 6.25rem;
  padding-bottom: 0.25rem;
}

.result-copy-stack {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.result-question {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
  color: var(--ink);
}

.result-question-empty {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.92rem;
}

.result-collectible {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
  color: #a8a29d;
}

.result-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0;
  flex-shrink: 0;
  padding-top: 0.2rem;
}

.empty-hint {
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 760px) {
  .discovery-head {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .discover-search-wrap {
    width: 100%;
    flex-basis: 100%;
  }

  .discover-search-wrap .discover-search-results {
    right: auto;
    left: 0;
  }
}

.explore-filters-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-top: 0.15rem;
}

.explore-undo-top {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #e3e3e3;
  color: #222;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.explore-undo-top:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.explore-filters-title {
  margin: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  transform: translateY(2px);
}

.explore-filters-wrap {
  min-width: 0;
  flex: 1;
}

.explore-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.55rem;
  justify-content: flex-start;
  padding: 0.35rem 0 0.1rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.explore-filters::-webkit-scrollbar {
  display: none;
}

.explore-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--ink);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  min-height: 2rem;
  padding: 0 0.85rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-transform: lowercase;
  flex: 0 0 auto;
  white-space: nowrap;
}

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

.explore-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  position: relative;
  min-height: 320px;
  touch-action: none;
}

.card-stack {
  position: relative;
  width: min(100%, 280px);
  min-height: 320px;
  perspective: 900px;
  overflow: visible;
}

.swipe-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.swipe-guide {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 1px solid transparent;
  opacity: 0;
  transform: translate(0, 0) rotate(0deg) scale(0.96);
  transition: opacity 0.14s ease, transform 0.14s ease;
  box-shadow: 0 14px 28px rgba(20, 20, 20, 0.14);
}

.swipe-guide::before {
  content: "";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.82;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.swipe-guide--add {
  border-color: rgba(63, 168, 95, 0.55);
  background: linear-gradient(140deg, rgba(96, 196, 126, 0.42) 0%, rgba(75, 171, 103, 0.18) 100%);
}

.swipe-guide--add::before {
  content: "✓";
  color: rgba(45, 150, 78, 0.95);
}

.swipe-guide--skip {
  border-color: rgba(210, 86, 86, 0.55);
  background: linear-gradient(220deg, rgba(223, 108, 108, 0.42) 0%, rgba(208, 86, 86, 0.18) 100%);
}

.swipe-guide--skip::before {
  content: "✕";
  color: rgba(193, 63, 63, 0.95);
}

.swipe-card {
  position: relative;
  width: 100%;
  border-radius: 16px;
  border: 2px solid #c4b8a8;
  background: #fff;
  box-shadow: 0 18px 40px var(--shadow);
  overflow: hidden;
  cursor: grab;
  user-select: none;
  transform-origin: 50% 50%;
  will-change: transform;
  z-index: 1;
}

.swipe-card:active {
  cursor: grabbing;
}

.swipe-card-front,
.swipe-card-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.32s ease, opacity 0.32s ease;
}

.swipe-card-front {
  transform: rotateY(0);
  opacity: 1;
}

.swipe-card-back {
  position: absolute;
  inset: 0;
  transform: rotateY(-180deg);
  opacity: 0;
  pointer-events: none;
  background: #fff;
}

.swipe-card.card--flipped .swipe-card-front {
  transform: rotateY(180deg);
  opacity: 0;
}

.swipe-card.card--flipped .swipe-card-back {
  transform: rotateY(0);
  opacity: 1;
}

.swipe-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #e8f0e8;
  overflow: hidden;
}

.swipe-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.swipe-card .card-body {
  position: relative;
  padding: 1.2rem 1.05rem 1.85rem;
  text-align: left;
  min-height: 8.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.7rem;
}

.swipe-card .card-question {
  font-size: 1.42rem;
  font-weight: 700;
  line-height: 1.42;
  margin: 0;
  color: var(--ink);
}

.swipe-card .card-collectible-line {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
  color: #a8a29d;
}

.swipe-card .card-question-empty {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--muted);
}

.swipe-card .card-back-body {
  height: 100%;
  padding: 1.05rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: linear-gradient(180deg, #fff 0%, #fcfaf6 100%);
}

.swipe-card .card-back-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.swipe-card .card-back-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.swipe-card .card-explain {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink);
  overflow-y: auto;
  flex: 1;
  padding-right: 0.2rem;
}

.swipe-card .card-explain-empty {
  color: var(--muted);
}

.swipe-card .card-back-divider {
  height: 1px;
  background: #2f2f2f;
  opacity: 0.9;
  flex-shrink: 0;
}

.swipe-card .card-back-footer {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-shrink: 0;
  padding-bottom: 0.1rem;
}

.swipe-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  width: 100%;
  max-width: 280px;
}

.swipe-actions button {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  background: #fff;
}

.swipe-actions button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.swipe-actions button.undo {
  background: #e3e3e3;
  color: #222;
  border-color: #d3d3d3;
  font-weight: 700;
}

.swipe-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.swipe-actions button.ghost:hover {
  background: #f5f0ea;
}

.explore-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: #fff;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 50;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #efe6dc;
  color: var(--muted);
  margin-left: 0.35rem;
  vertical-align: middle;
}

.achievement-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.achievement-modal.is-open {
  display: flex;
}

.achievement-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 38, 34, 0.38);
}

.achievement-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  max-height: min(90vh, 560px);
  overflow: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.achievement-modal-dialog::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.achievement-modal-inner {
  background: #f3f8f3;
  border-radius: 18px;
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: 0 24px 60px rgba(42, 38, 34, 0.22);
  position: relative;
  border: 1px solid #c5d4c5;
}

.achievement-modal-hero {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 1rem;
  align-items: start;
}

.achievement-modal-media {
  position: relative;
  width: 108px;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #f0a8b8;
  border: 2px solid #b8c9b8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.achievement-modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.achievement-modal-text {
  min-width: 0;
  padding-top: 0.15rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}

.achievement-modal-text > * {
  margin: 0;
  padding: 0;
  text-align: start;
  align-self: stretch;
}

.achievement-modal-reward {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  /* 粗体全角「」等标点常比正文略“缩进”，与下方副标题左缘对齐 */
  margin-left: -0.52em;
}

.achievement-modal-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.achievement-modal-unlock-line {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.achievement-modal-sound-btn {
  margin-top: 0rem;
  margin-left: -0.14rem;
  align-self: flex-start;
  border: none;
  border-radius: 50%;
  width: 21px;
  height: 21px;
  padding: 0;
  background: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background 0.15s ease;
}

.achievement-modal-sound-btn:hover {
  opacity: 0.9;
}

.achievement-modal-sound-btn.is-playing {
  background: #d1e8d1;
}

.achievement-modal-sound-btn img {
  width: 15px;
  height: 15px;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.achievement-modal-sound-btn[hidden] {
  display: none !important;
}

.achievement-modal-unlock-line[hidden] {
  display: none !important;
}

.achievement-modal-food-vote {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem 1rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 14px rgba(42, 38, 34, 0.06);
}

.achievement-modal-food-vote[hidden] {
  display: none !important;
}

.food-vote-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.food-vote-bar {
  display: flex;
  gap: 5px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef2ee;
}

.food-vote-bar-seg {
  min-width: 4px;
  border-radius: 999px;
  transition: flex 0.2s ease;
}

.food-vote-bar-seg--good {
  background: #b8e0b8;
}

.food-vote-bar-seg--bad {
  background: #c5dcc5;
}

.food-vote-counts {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.food-vote-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.food-vote-btn {
  padding: 0.65rem 0.75rem;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.food-vote-btn--good {
  background: #c8e6c8;
  color: var(--ink);
}

.food-vote-btn--bad {
  background: #c8dcc8;
  color: var(--ink);
}

.food-vote-btn:hover {
  filter: brightness(1.04);
}

.food-vote-btn--selected {
  box-shadow: 0 0 0 2px rgba(42, 38, 34, 0.35), 0 2px 0 rgba(0, 0, 0, 0.08);
  filter: brightness(0.97);
}

.achievement-modal-t071-poll {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem 1rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 14px rgba(42, 38, 34, 0.06);
}

.achievement-modal-t071-poll[hidden] {
  display: none !important;
}

.t071-poll-title {
  margin: 0 0 0.25rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}

.t071-poll-hint {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.35;
}

.t071-poll-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: min(48vh, 320px);
  overflow-y: auto;
  padding-right: 0.15rem;
  -webkit-overflow-scrolling: touch;
}

.t071-poll-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.65rem 0.55rem 0.55rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  background: #eef0ee;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.t071-poll-option:hover {
  filter: brightness(1.02);
}

.t071-poll-option--selected {
  background: #d4edd4;
  border-color: #9bc99b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.t071-poll-line-swatch {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-sizing: border-box;
}

.t071-poll-line-swatch--light {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.t071-poll-line-swatch--dark {
  border-color: #555;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.t071-poll-name {
  flex: 1;
  min-width: 0;
  text-align: start;
}

.achievement-modal-times-wrap {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem 1rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 14px rgba(42, 38, 34, 0.06);
}

.achievement-modal-times-wrap[hidden] {
  display: none !important;
}

.times-wrap-heading {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.times-wrap-heading--rank {
  margin-top: 1rem;
  margin-bottom: 0.45rem;
}

.times-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.times-stepper-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #d4dad4;
  background: #e8ece8;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.times-stepper-btn:hover:not(:disabled) {
  filter: brightness(1.04);
}

.times-stepper-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.times-stepper-value {
  min-width: 2.5rem;
  height: 44px;
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f2f5f2;
  border: 1px solid #d8ded8;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: #e8e8e8;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rank-row--secondary {
  background: #f1f1f1;
  font-size: 0.82rem;
}

.rank-row-left {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.rank-name {
  font-weight: 600;
  color: var(--ink);
}

.rank-row-right {
  color: var(--muted);
  font-weight: 600;
}

.achievement-modal-upgrade-wrap {
  margin-top: 1.1rem;
}

.achievement-modal-child-question {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}

.achievement-modal-upgrade-ask {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.achievement-modal-upgrade-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 10px;
  background: #c8cfc8;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 0 #a8b0a8;
}

.achievement-modal-upgrade-btn:hover {
  filter: brightness(1.03);
}

.achievement-modal-no-upgrade {
  margin: 1rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  line-height: 1.45;
}

.achievement-modal-close-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
  padding-top: 0.35rem;
}

.achievement-modal-close-fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: #aeb8ae;
  color: #141210;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(42, 38, 34, 0.14);
}

.achievement-modal-close-fab:hover {
  filter: brightness(1.06);
}

.dashboard-main {
  display: grid;
  gap: 1rem;
  padding: 1rem 1.25rem 1.5rem;
}

.dashboard-tasks {
  padding: 0.9rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.dashboard-rewards {
  padding: 1rem 1.1rem 1.15rem;
}

.dashboard-reward-chip {
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  align-items: start;
  text-align: center;
  gap: 0.4rem;
  flex: 0 0 6.35rem;
  width: 6.35rem;
  max-width: 6.35rem;
}

.dashboard-reward-img {
  display: block;
  width: 100%;
  max-width: 5.75rem;
  height: 5.75rem;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 10px;
}

.dashboard-reward-img--transport {
  max-width: 6.15rem;
  height: 6.15rem;
}

.dashboard-reward-caption {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 400;
  color: #9ca3af;
  line-height: 1.35;
  letter-spacing: 0.01em;
  width: 100%;
  min-height: 2.75em;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.dashboard-rewards-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 1.1rem 1.35rem;
}

.dashboard-task {
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f2f2f2;
  font-size: 0.85rem;
  font-weight: 600;
}

.dashboard-task.is-done {
  background: #dce9dc;
  border-color: #c9dcc9;
}

.dashboard-data {
  padding: 0.95rem;
}

.dashboard-data-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.65rem;
}

.dashboard-stat-slot {
  /* 用 flex 代替 grid：收起时展开区不占主布局宽度，三张色块才能始终挨在一起 */
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 0 0 auto;
  min-width: 0;
}

.dashboard-stat-slot > .dashboard-stat-card {
  flex: 0 0 auto;
  align-self: flex-start;
}

.dashboard-stat-slot > .dashboard-expand-panel {
  flex: 0 1 0;
  min-width: 0;
  max-width: 0;
  overflow: hidden;
}

.dashboard-stat-slot.is-open > .dashboard-expand-panel {
  flex: 0 1 auto;
  max-width: 280px;
  opacity: 1;
  padding-left: 0.45rem;
  pointer-events: auto;
}

.dashboard-stat-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  height: fit-content;
  width: auto;
  aspect-ratio: 1 / 1;
  align-self: start;
  border-radius: 27px;
  padding: 1.125rem 0.9rem;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.dashboard-stat-card--orange {
  background: #f3b87c;
}

.dashboard-stat-card--mint {
  background: #b8e490;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* 与橙色参考块同边长（由 JS 写入 --dashboard-stat-face）；文案多时可滚动 */
.dashboard-stat-card.dashboard-stat-card--mint {
  aspect-ratio: unset;
  width: var(--dashboard-stat-face, 10.125rem);
  height: var(--dashboard-stat-face, 10.125rem);
  max-width: var(--dashboard-stat-face, 10.125rem);
  flex-shrink: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.dashboard-stat-card--mint:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dashboard-stat-card--mint:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dashboard-stat-card--mint:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.dashboard-stat-num {
  font-size: clamp(1.3125rem, 3vw, 1.7625rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.dashboard-stat-desc {
  margin: 0.3375rem 0 0;
  width: 100%;
  max-width: 100%;
  font-size: 0.54rem;
  line-height: 1.35;
  color: rgba(0, 0, 0, 0.72);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dashboard-stat-card--orange .dashboard-stat-desc {
  color: rgba(0, 0, 0, 0.78);
}

.dashboard-expand-panel {
  flex: 0 0 auto;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  padding-left: 0;
  transition: max-width 0.35s ease, opacity 0.28s ease, padding-left 0.35s ease;
  pointer-events: none;
}

.dashboard-expand-surface {
  height: 100%;
  min-height: 100%;
  border-radius: 18px;
  padding: 0.5rem;
  background: rgba(184, 228, 144, 0.45);
  border: 1px solid rgba(184, 228, 144, 0.85);
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
}

.dashboard-mini-rank-list {
  flex: 1;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.dashboard-mini-rank-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.5rem;
  align-items: center;
  font-size: 0.78rem;
}

.dashboard-mini-rank-label {
  font-weight: 600;
  color: #222;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-mini-rank-label.is-me {
  color: var(--accent);
}

.dashboard-mini-rank-bar-wrap {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.dashboard-mini-rank-bar-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #ececec;
  overflow: hidden;
}

.dashboard-mini-rank-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #b8e490;
  min-width: 4px;
  transition: width 0.35s ease;
}

.dashboard-mini-rank-count {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.dashboard-mini-rank-empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  padding: 0.35rem 0;
}

.tile-rank-pill-icon {
  display: inline-block;
  width: 14px;
  height: 12px;
  position: relative;
  vertical-align: middle;
}

.tile-rank-pill-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--ink), var(--ink)) 0 100% / 3px 45% no-repeat,
    linear-gradient(to top, var(--ink), var(--ink)) 5.5px 100% / 3px 100% no-repeat,
    linear-gradient(to top, var(--ink), var(--ink)) 11px 100% / 3px 65% no-repeat;
}

body.index-page .tile-rank-pill-icon {
  transform: scale(0.88);
}

.tile-rank-modal {
  position: fixed;
  inset: 0;
  z-index: 205;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.tile-rank-modal.is-open {
  display: flex;
}

.tile-rank-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 38, 34, 0.38);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.tile-rank-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(96vw, 520px);
  max-height: 92vh;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tile-rank-modal-dialog::-webkit-scrollbar {
  display: none;
}

.tile-rank-modal-inner {
  position: relative;
  background: #faf8f4;
  border-radius: 22px;
  padding: 1.35rem 1.25rem 1.5rem;
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(42, 38, 34, 0.14);
}

.tile-rank-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}

.tile-rank-modal-close:hover {
  filter: brightness(1.03);
}

.tile-rank-modal-title {
  margin: 0 2rem 0.35rem 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

.tile-rank-modal-sub {
  margin: 0 0 1.1rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.tile-rank-podium {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  gap: 0.65rem;
  min-height: 200px;
  margin-bottom: 1.25rem;
}

.tile-rank-podium-col {
  flex: 1 1 0;
  max-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tile-rank-podium-visual {
  position: relative;
  width: 56px;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}

.tile-rank-podium-visual .tile-rank-podium-img-wrap {
  margin-bottom: 0;
}

.tile-rank-podium-crown {
  position: absolute;
  left: 50%;
  top: 0;
  width: clamp(30px, 9vw, 42px);
  height: auto;
  z-index: 2;
  pointer-events: none;
  transform: translate(-50%, -72%) rotate(10deg);
  filter: drop-shadow(0 2px 3px rgba(42, 38, 34, 0.18));
}

.tile-rank-podium-img-wrap {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #eee;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}

.tile-rank-podium-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile-rank-podium-pill {
  display: inline-block;
  max-width: 100%;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-rank-podium-pill--third {
  background: #7bc67b;
  color: #fff;
}

.tile-rank-podium-pill--first {
  background: #e8954c;
  color: #fff;
}

.tile-rank-podium-pill--second {
  background: #5a9fd4;
  color: #fff;
}

.tile-rank-podium-bar {
  width: 100%;
  border-radius: 12px 12px 6px 6px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tile-rank-podium-bar--third {
  height: 72px;
  background: #d4edc4;
}

.tile-rank-podium-bar--second {
  height: 100px;
  background: #c8e3f5;
}

.tile-rank-podium-bar--first {
  height: 128px;
  background: #f5d4b0;
}

.tile-rank-podium-bar-num {
  font-size: 2.6rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1;
  user-select: none;
}

.tile-rank-podium-col--empty .tile-rank-podium-img-wrap {
  opacity: 0.35;
}

.tile-rank-podium-col--empty .tile-rank-podium-pill {
  background: #ddd;
  color: #888;
}

.tile-rank-podium-col--empty .tile-rank-podium-bar {
  background: #e8e4dc !important;
}

.tile-rank-total-heading {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.tile-rank-total-list {
  background: #ece8e0;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.tile-rank-total-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: #f5f2eb;
}

.tile-rank-total-row:last-child {
  border-bottom: none;
}

.tile-rank-total-rank {
  font-weight: 800;
  font-size: 0.95rem;
  min-width: 1.5rem;
  color: var(--ink);
}

.tile-rank-total-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ddd;
}

.tile-rank-total-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-rank-total-count {
  font-size: 0.78rem;
  color: var(--muted);
  flex-shrink: 0;
}

.tile-rank-total-empty {
  margin: 0;
  padding: 1rem 0.75rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.animal-video-modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2.09rem 1.67rem;
}

.animal-video-modal.is-open {
  display: flex;
}

/* 美食弹窗叠在动物弹窗之上（同屏极少同时出现） */
#food-five-video-modal.animal-video-modal {
  z-index: 211;
}

#food-video-modal.animal-video-modal {
  z-index: 212;
}

#transport-video-modal.animal-video-modal {
  z-index: 213;
}

.animal-video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 38, 34, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.animal-video-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(92vw, 1200px);
  max-height: 92vh;
}

.animal-video-modal-inner {
  position: relative;
  background: #fff;
  border-radius: 33px;
  padding: 4.9rem 2.25rem 2.81rem;
  box-shadow: 0 20px 50px rgba(42, 38, 34, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.animal-video-modal-kicker {
  margin: 0 0 0.74rem;
  font-size: 1.2rem;
  font-weight: 400;
  color: #9ca3af;
  letter-spacing: 0.02em;
  text-align: center;
}

.animal-video-modal-headline {
  margin: 0 0 2.09rem;
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1.35;
}

.animal-video-tap-hint {
  margin: 0 0 1.04rem;
  font-size: 1.25rem;
  color: #9ca3af;
  text-align: center;
}

/* 竖屏视频不按满宽拉伸，避免左右大块黑边；留白与弹窗同为白底 */
.animal-video-modal-video-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
}

.animal-video-modal-video {
  display: block;
  max-width: 100%;
  max-height: min(calc(62vh * 2 / 3 * 1.25 * 0.75), 300px);
  width: auto;
  height: auto;
  border-radius: 15px;
  background: #fff;
  cursor: pointer;
  object-fit: contain;
}

.animal-video-modal-close {
  position: absolute;
  top: 1.08rem;
  right: 1.08rem;
  width: 3.33rem;
  height: 3.33rem;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: #111827;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.animal-video-modal-close:hover {
  background: #e5e7eb;
}
