:root {
  --bg: #f4f7f2;
  --surface: #ffffff;
  --text: #1f2a24;
  --muted: #5f6f66;
  --accent: #2f6b4f;
  --accent-soft: #d9eadf;
  --danger: #b44a3a;
  --shadow: 0 18px 50px rgba(31, 42, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, #e7f1ea 0%, transparent 35%),
    var(--bg);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 32px 20px 48px;
  gap: 28px;
}

.hero {
  text-align: center;
  max-width: 520px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 44px);
  line-height: 1.15;
}

.subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.streak-badge {
  display: inline-block;
  margin: 16px 0 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
}

.daily-quote {
  margin: 14px auto 0;
  max-width: 420px;
  padding: 0;
  border: none;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  font-style: normal;
}

.daily-quote::before {
  content: "「";
}

.daily-quote::after {
  content: "」";
}

.primary-btn {
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #357a59, var(--accent));
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(47, 107, 79, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(47, 107, 79, 0.28);
}

.primary-btn:active {
  transform: translateY(0);
}

.animal-card {
  width: min(100%, 560px);
  background: var(--surface);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: fadeUp 0.35s ease;
}

.animal-card.hidden {
  display: none;
}

.image-wrap {
  aspect-ratio: 4 / 3;
  background-color: var(--accent-soft);
  background-image: url("../assets/images/placeholder.svg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

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

.image-wrap img.is-error {
  opacity: 0;
}

.card-body {
  padding: 20px 22px 24px;
}

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

.card-meta h2 {
  margin: 0;
  font-size: 24px;
}

.title-group {
  min-width: 0;
}

.scientific-name {
  margin: 4px 0 0;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
}

.status-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--danger);
  background: #fdecea;
}

.detail-pager {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.detail-pages {
  flex: 1;
  min-width: 0;
  min-height: 180px;
}

.detail-page {
  margin: 0;
}

.page-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
}

.fun-fact {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: #f0f7f3;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.action-tip {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef6f1, #f7fbf8);
  border: 1px solid #d5e6db;
}

.action-tip-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.action-tip-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

.nav-btn {
  flex-shrink: 0;
  align-self: center;
  width: 40px;
  height: 40px;
  border: 1px solid #d4e4da;
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  color: var(--accent);
  background: var(--surface);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(31, 42, 36, 0.08);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.nav-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: scale(1.05);
}

.nav-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.detail-pages.is-slide-next {
  animation: slideNext 0.28s ease;
}

.detail-pages.is-slide-prev {
  animation: slidePrev 0.28s ease;
}

.detail-list {
  margin: 0;
}

.detail-item {
  margin-bottom: 14px;
}

.detail-item:last-child {
  margin-bottom: 0;
}

.detail-item dt {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.detail-item dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
}

.threat-list {
  margin: 0;
  padding-left: 18px;
}

.threat-list li {
  margin-bottom: 4px;
}

.threat-list li:last-child {
  margin-bottom: 0;
}

.learn-more {
  margin: 0;
}

.learn-more-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.learn-more-links a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
  transition: background 0.18s ease;
}

.learn-more-links a:hover {
  background: #c8dfd0;
}

.image-credit {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.image-credit a {
  color: var(--accent);
  text-decoration: none;
}

.image-credit a:hover {
  text-decoration: underline;
}

.page-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e8efe9;
}

.page-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.page-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.footer-note {
  margin: 16px 0 0;
  font-size: 13px;
  text-align: center;
  color: var(--accent);
}

.collection {
  width: min(100%, 560px);
  padding: 4px 0 8px;
}

.collection-header {
  text-align: center;
  margin-bottom: 16px;
}

.collection-progress {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.collection-hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.collection-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-chip {
  border: 1px solid #d4e4da;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-chip.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.collection-empty {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

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

.collection-item {
  appearance: none;
  border: 1px solid #e2ebe4;
  border-radius: 16px;
  padding: 8px 6px 10px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.collection-item.is-met:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 22px rgba(47, 107, 79, 0.12);
}

.collection-item.is-locked {
  cursor: default;
  background: #f3f7f4;
}

.collection-item.is-today.is-met {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.collection-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--accent-soft);
}

.collection-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.collection-lock {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 22px;
  font-weight: 700;
  color: #9bb3a5;
}

.collection-name {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collection-item.is-locked .collection-name {
  color: var(--muted);
  font-weight: 500;
}

.collection-item.is-shake {
  animation: collectionShake 0.35s ease;
}

@keyframes collectionShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

@media (max-width: 520px) {
  .collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

.share-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.share-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.share-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.ghost-btn {
  border: 1.5px solid #c5d5cb;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.ghost-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

body.share-modal-open {
  overflow: hidden;
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(31, 42, 36, 0.52);
}

.share-modal.hidden {
  display: none;
}

.share-dialog {
  width: min(100%, 420px);
  max-height: min(92vh, 860px);
  overflow: auto;
  padding: 20px 20px 22px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: fadeUp 0.28s ease;
}

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

.share-dialog-header h2 {
  margin: 0;
  font-size: 20px;
}

.share-close-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  background: var(--accent-soft);
  cursor: pointer;
}

.share-hint {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.share-preview {
  display: block;
  width: 100%;
  border-radius: 18px;
  background: var(--accent-soft);
  box-shadow: 0 10px 28px rgba(31, 42, 36, 0.12);
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.share-action-btn {
  flex: 1 1 140px;
  text-align: center;
  box-shadow: none;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

@keyframes slideNext {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

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

@keyframes slidePrev {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

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

@media (max-width: 520px) {
  .detail-pager {
    gap: 6px;
  }

  .nav-btn {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  .detail-pages {
    min-height: 200px;
  }
}

/* --- Guess-before-reveal mini interaction --- */
.guess-panel {
  width: min(100%, 460px);
  padding: 22px 24px 24px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.guess-panel.hidden {
  display: none;
}

.guess-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.guess-sub {
  margin: 6px 0 16px;
  font-size: 12px;
  color: var(--muted);
}

.guess-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.guess-chip {
  border: 1px solid #d4e4da;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: #fff;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.guess-chip:hover:not(:disabled) {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.guess-chip:disabled {
  cursor: default;
  opacity: 0.6;
}

.guess-chip.is-answer {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  opacity: 1;
}

.guess-chip.is-miss {
  color: var(--danger);
  background: #f3ddd8;
  border-color: #e6bfb6;
  opacity: 1;
}

.guess-feedback {
  margin: 16px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}

.guess-feedback.is-correct {
  color: var(--accent);
}

.guess-feedback.is-wrong {
  color: var(--danger);
}

/* --- IUCN / national legend --- */
.status-legend {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.status-legend abbr {
  text-decoration: none;
  border-bottom: 1px dotted var(--muted);
  cursor: help;
}

/* --- Collection theme achievement --- */
.collection-achievement {
  margin: 0 0 14px;
  padding: 10px 16px;
  border-radius: 999px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  background: linear-gradient(135deg, #eaf6ef, #dcefe3);
  border: 1px solid #cfe6d7;
}

.collection-achievement[hidden] {
  display: none;
}

/* --- About / sources / disclaimer --- */
.site-about {
  width: min(100%, 560px);
  margin-top: 8px;
}

.about-details {
  border: 1px solid #e2ebe4;
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}

.about-summary {
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.about-summary::-webkit-details-marker {
  display: none;
}

.about-summary::before {
  content: "＋ ";
  color: var(--muted);
}

.about-details[open] .about-summary::before {
  content: "－ ";
}

.about-body {
  padding: 4px 20px 22px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}

.about-body h3 {
  margin: 18px 0 8px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text);
}

.about-body a {
  color: var(--accent);
  text-decoration: none;
}

.about-body a:hover {
  text-decoration: underline;
}

.about-sources,
.about-orgs {
  margin: 0;
  padding-left: 18px;
}

.about-sources li,
.about-orgs li {
  margin-bottom: 6px;
}

.about-updated {
  margin: 18px 0 0;
  padding-top: 12px;
  border-top: 1px solid #eef3ef;
  font-size: 12px;
  color: var(--muted);
}

.about-disclaimer {
  margin-top: 12px;
  font-size: 12px;
}

/* --- 本月图鉴 (calendar) --- */
.monthly {
  width: min(100%, 560px);
}

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

.monthly-title {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.month-nav {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid #d4e4da;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  color: var(--accent);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.month-nav:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.month-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.monthly-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.monthly-weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.monthly-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.day-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  background: #eef3ef;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

.day-cell.is-blank {
  background: transparent;
}

.day-cell .day-num {
  position: relative;
  z-index: 1;
  font-weight: 600;
}

.day-cell.is-future {
  background: #f3f6f3;
  color: #b6c3bb;
}

.day-cell.is-missed {
  background: #eef3ef;
  color: #c3ccc5;
}

.day-cell.is-today {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
  font-weight: 700;
}

.day-cell.is-met {
  cursor: pointer;
  background: var(--accent-soft);
}

.day-cell.is-met img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.day-cell.is-met .day-num {
  position: absolute;
  left: 4px;
  top: 3px;
  z-index: 2;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.day-cell.is-met::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, transparent 38%);
  z-index: 1;
}

.day-cell.is-met:hover {
  transform: scale(1.04);
  transition: transform 0.15s ease;
}

.monthly-hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 520px) {
  .monthly-grid,
  .monthly-weekdays {
    gap: 5px;
  }

  .day-cell {
    border-radius: 9px;
    font-size: 12px;
  }
}
