/* miaomiao-bar site — one theme only: cream paper, caramel ink, 2px outlines, hard shadows. */

:root {
  --paper: #fff7e8;
  --paper-deep: #f7ead1;
  --card: #fffdf6;
  --ink: #3a2e23;
  --ink-soft: #7a6a57;
  --line: #3a2e23;
  --amber: #ffb020;
  --amber-soft: #ffe3a3;
  --coral: #ff6b6b;
  --mint: #7bc47f;
  --sky: #5ab0ff;
  --shadow: rgba(58, 46, 35, 0.18);

  --radius: 16px;
  --radius-sm: 12px;
  --drop: 4px 4px 0 var(--shadow);
  --drop-lg: 6px 6px 0 var(--shadow);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  /* Faint paper grid, so the cream reads as paper instead of a flat fill. */
  background-image: radial-gradient(rgba(58, 46, 35, 0.07) 1px, transparent 1px);
  background-size: 18px 18px;
  color: var(--ink);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

code {
  padding: 1px 6px;
  border: 1.5px solid rgba(58, 46, 35, 0.35);
  border-radius: 6px;
  background: var(--paper-deep);
  font: 13px/1.5 ui-monospace, 'SF Mono', Menlo, monospace;
  white-space: nowrap;
}

::selection {
  background: var(--amber-soft);
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 24px;
  background: rgba(255, 247, 232, 0.88);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand img,
.brand__icon {
  border-radius: 7px;
  box-shadow: 2px 2px 0 var(--shadow);
}

.brand__name {
  font-weight: 750;
}

/* the stats page reuses the same header markup with its own class names */
.topbar__link {
  color: var(--ink-soft);
  font-weight: 600;
  text-decoration: none;
}

.topbar__link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13.5px;
  font-weight: 600;
}

.nav-link {
  color: var(--ink-soft);
  text-decoration: none;
}

.nav-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.lang-toggle {
  min-width: 38px;
  padding: 4px 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--shadow);
}

.lang-toggle:hover {
  background: var(--amber-soft);
}

.lang-toggle:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--shadow);
}

/* ---------- hero ---------- */

.hero {
  max-width: 740px;
  margin: 0 auto;
  padding: 44px 24px 28px;
  text-align: center;
}

.hero__icon {
  border-radius: 24px;
  transform: rotate(-3deg);
  box-shadow: var(--drop-lg);
}

.hero__title {
  margin: 22px 0 8px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.hero__tagline {
  margin: 0 auto 12px;
  max-width: 560px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 620;
}

.hero__desc {
  margin: 0 auto 26px;
  max-width: 600px;
  color: var(--ink-soft);
  font-size: 14px;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.btn {
  padding: 11px 20px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--drop);
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}

.btn:hover:not(:disabled) {
  background: #fff2d4;
}

.btn:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--shadow);
}

.btn--primary {
  background: var(--amber);
}

.btn--primary:hover:not(:disabled) {
  background: #ffbe3d;
}

.btn--ghost {
  background: var(--card);
}

.btn:disabled {
  opacity: 0.55;
  cursor: progress;
  box-shadow: 2px 2px 0 var(--shadow);
}

.download-progress {
  max-width: 340px;
  margin: 16px auto 0;
}

.download-progress__bar {
  height: 10px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 99px;
  background: var(--paper-deep);
}

.download-progress__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: var(--amber);
  transition: width 0.12s linear;
}

.download-progress__text {
  display: block;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.hero__meta {
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

/* ---------- screenshots ---------- */

.shots {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  justify-content: center;
  max-width: 1000px;
  margin: 30px auto 0;
  padding: 0 24px;
}

.shots figure {
  margin: 0;
  width: 310px;
  max-width: 100%;
}

.shots img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--drop-lg);
  transition: transform 0.12s;
}

.shots figure:nth-child(odd) img {
  transform: rotate(-1.2deg);
}

.shots figure:nth-child(even) img {
  transform: rotate(1.2deg);
}

.shots img:hover {
  transform: rotate(0) translateY(-3px);
}

.shots figcaption {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 620;
  text-align: center;
}

/* ---------- blocks ---------- */

.block {
  max-width: 1000px;
  margin: 0 auto;
  padding: 60px 24px 0;
}

.block h2 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 780;
  letter-spacing: 0.01em;
}

.block__lead {
  margin: 0 0 24px;
  max-width: 660px;
  color: var(--ink-soft);
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  padding: 16px 18px 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--drop);
}

.card h3 {
  display: inline-block;
  margin: 0 0 10px;
  padding: 2px 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0.03em;
}

/* One accent per group: the cards read as a set of stickers, not a list. */
.grid .card:nth-child(2) h3 {
  background: #d9f0d7;
}

.grid .card:nth-child(3) h3 {
  background: #d6ecff;
}

.grid .card:nth-child(4) h3 {
  background: #ffdede;
}

.grid .card:nth-child(5) h3 {
  background: #fff0c2;
}

.grid .card:nth-child(6) h3 {
  background: #e8e2ff;
}

.card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.8;
}

.card li::marker {
  color: var(--amber);
}

/* ---------- table ---------- */

.table {
  overflow-x: auto;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--drop);
}

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

.table th,
.table td {
  padding: 11px 14px;
  border-bottom: 1.5px solid rgba(58, 46, 35, 0.22);
  text-align: left;
  vertical-align: top;
}

.table th {
  background: var(--paper-deep);
  color: var(--ink);
  font-weight: 750;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.table td:first-child {
  font-weight: 650;
  white-space: nowrap;
}

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

.note {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 12.5px;
}

/* ---------- faq ---------- */

details {
  margin-bottom: 10px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: var(--drop);
}

summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
}

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

summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  color: var(--amber);
  transition: transform 0.12s;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details p {
  margin: 10px 0 2px;
  color: var(--ink-soft);
  font-size: 13px;
}

/* ---------- footer ---------- */

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  max-width: 1000px;
  margin: 70px auto 0;
  padding: 22px 24px 44px;
  border-top: 2px dashed rgba(58, 46, 35, 0.28);
  color: var(--ink-soft);
  font-size: 12px;
}

.footer__left {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__left a {
  color: var(--ink-soft);
  font-weight: 600;
  text-decoration: none;
}

.footer__left a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  max-width: 380px;
  padding: 12px 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 620;
  line-height: 1.45;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: var(--drop-lg);
  animation: toast-in 0.16s ease-out;
  pointer-events: none;
  z-index: 20;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}


/* ---------- stats page ---------- */

.stats-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

.stats-title {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.stats-sub {
  margin: 0 0 28px;
  color: var(--ink-soft);
  font-size: 14px;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 34px;
}

.stat-card {
  padding: 18px 20px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--drop);
}

.stat-card b {
  display: block;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.stat-card span {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 620;
}

.stats-block {
  margin-bottom: 32px;
}

.stats-block h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 780;
}

.map-wrap {
  position: relative;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--drop);
}

#world-map {
  display: block;
  width: 100%;
  height: auto;
}

#world-map .country {
  stroke: var(--card);
  stroke-width: 0.6;
  transition: fill 0.12s;
}

#world-map .country.has-data:hover {
  stroke: var(--line);
  stroke-width: 1;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 11.5px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-item i {
  width: 12px;
  height: 12px;
  border: 1.5px solid rgba(58, 46, 35, 0.35);
  border-radius: 3px;
}

.legend-item em {
  font-style: normal;
}

.map-tooltip {
  position: absolute;
  z-index: 5;
  max-width: 220px;
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-size: 11.5px;
  line-height: 1.5;
  box-shadow: var(--drop);
  pointer-events: none;
}

.city-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.city-row {
  display: grid;
  grid-template-columns: minmax(84px, 150px) 1fr 34px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.city-name {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-bar {
  height: 10px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 99px;
  background: var(--paper-deep, #f7ead1);
}

.city-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--amber);
}

.city-count {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.daily-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 160px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--drop);
}

.day-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
}

.day-col i {
  width: 100%;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--amber);
}

.day-col span {
  color: var(--ink-soft);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.stats-empty {
  color: var(--ink-soft);
  font-size: 12.5px;
}

.stats-foot {
  margin-top: 24px;
  color: var(--ink-soft);
  font-size: 12px;
}

@media (max-width: 720px) {
  .hero {
    padding-top: 30px;
  }

  .hero__title {
    font-size: 32px;
  }

  .hero__tagline {
    font-size: 16px;
  }

  .topbar__nav {
    gap: 12px;
    font-size: 12.5px;
  }

  /* Keep GitHub reachable on a phone; the in-page anchors are not worth it. */
  .nav-link:not(.nav-link--keep) {
    display: none;
  }

  .shots figure {
    width: 280px;
  }
}
