@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=Noto+Serif+SC:wght@600;700&display=swap");

:root {
  --c-forest: #14532d;
  --c-green: #16803d;
  --c-green-soft: #dcfce7;
  --c-accent: #ea580c;
  --c-accent-soft: #ffedd5;
  --c-teal: #0f766e;
  --c-teal-soft: #ccfbf1;
  --c-ink: #14231a;
  --c-text: #1f2d24;
  --c-muted: #5c6b61;
  --c-bg: #e8f0ea;
  --c-surface: #ffffff;
  --c-line: #d3e0d6;
  --c-danger: #b91c1c;
  --c-danger-soft: #fef2f2;
  --shadow: 0 8px 28px rgba(20, 83, 45, 0.08);
  --shadow-sm: 0 2px 10px rgba(20, 83, 45, 0.06);
  --radius: 16px;
  --radius-sm: 12px;
  --wrap: 1080px;
  --font: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Noto Serif SC", "Songti SC", "STSong", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--c-text);
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(22, 128, 61, 0.14), transparent 55%),
    radial-gradient(700px 380px at 96% 8%, rgba(234, 88, 12, 0.1), transparent 50%),
    linear-gradient(180deg, #f4faf5 0%, var(--c-bg) 42%, #eef4ef 100%);
  background-attachment: fixed;
}

a { color: inherit; }

/* —— 顶栏 —— */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(211, 224, 214, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.top__brand {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--c-forest);
  line-height: 1.2;
}

.top__brand small {
  font-family: var(--font);
  font-weight: 500;
  color: var(--c-muted);
  font-size: 12px;
  letter-spacing: 0;
}

.top__nav {
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 13px;
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 1px;
}

.top__nav::-webkit-scrollbar { display: none; }

.top__nav a {
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--c-muted);
  padding: 7px 11px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.top__nav a:hover {
  color: var(--c-forest);
  background: rgba(22, 128, 61, 0.08);
}

.top__nav a.is-active {
  color: #fff;
  background: var(--c-green);
  font-weight: 600;
}

#who, .who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--c-muted);
  flex: 0 0 auto;
  margin-left: 4px;
}

.who__name {
  max-width: 7.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--c-text);
}

.who__logout {
  margin: 0;
  padding: 5px 11px;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 999px;
  background: #fff;
  color: var(--c-text);
  border: 1px solid var(--c-line);
  cursor: pointer;
}

.who__logout:hover { background: var(--c-green-soft); border-color: #bbf7d0; }

.login-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--c-muted);
  line-height: 1.5;
}

/* —— 版心 —— */
.wrap {
  width: min(100% - 28px, var(--wrap));
  margin: 0 auto;
  padding: 22px 0 64px;
}

.page-hero {
  margin-bottom: 20px;
}

.page-hero h1,
.wrap > h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  color: var(--c-ink);
  letter-spacing: 0.01em;
}

.page-hero .sub,
.wrap > .sub {
  margin: 0;
  max-width: 52em;
  color: var(--c-muted);
  font-size: 14px;
  line-height: 1.65;
}

/* —— 汇总条 —— */
.summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 20px;
}

.summary__item {
  position: relative;
  overflow: hidden;
  background: var(--c-surface);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
  border: 1px solid rgba(211, 224, 214, 0.9);
  box-shadow: var(--shadow-sm);
}

.summary__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--c-green), var(--c-teal));
}

.summary__value {
  display: block;
  font-size: clamp(18px, 3.2vw, 22px);
  font-weight: 700;
  color: var(--c-forest);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.summary__label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--c-muted);
}

@media (min-width: 720px) {
  .summary { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
}

/* —— 分段筛选 —— */
.seg, #filters.tools {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  margin: 0 0 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.seg__btn,
#filters button {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
  font-weight: 500;
  background: transparent !important;
  color: var(--c-muted) !important;
  cursor: pointer;
}

.seg__btn.on,
#filters button.on,
.presets button.on {
  background: var(--c-green) !important;
  color: #fff !important;
}

/* —— 卡片 —— */
.card {
  display: block;
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(211, 224, 214, 0.95);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.18s;
}

a.card:hover {
  border-color: #86efac;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.35;
}

.card-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
}

.card-row .card {
  margin-bottom: 0;
  min-width: 0;
}

.card-row__del {
  flex: 0 0 auto;
  align-self: stretch;
  min-width: 64px;
  margin: 0 !important;
  background: var(--c-surface) !important;
  color: var(--c-danger) !important;
  border: 1px solid #fecaca !important;
  box-shadow: none !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer;
}

.card-row__del:hover { background: var(--c-danger-soft) !important; }

.card-row__del:disabled { opacity: 0.55; cursor: wait; }

@media (max-width: 560px) {
  .card-row {
    grid-template-columns: 1fr;
    gap: 0;
    background: var(--c-surface);
    border: 1px solid rgba(211, 224, 214, 0.95);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
  }
  .card-row .card {
    border: 0;
    box-shadow: none;
    border-radius: 0;
  }
  .card-row .card:hover {
    transform: none;
    box-shadow: none;
  }
  .card-row__del {
    border: 0 !important;
    border-top: 1px solid #fecaca !important;
    border-radius: 0 !important;
    width: 100%;
    min-height: 44px;
    background: var(--c-danger-soft) !important;
  }
}

.meta {
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.65;
}

.meta-bits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  margin-top: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f3f7f4;
  color: var(--c-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.tag {
  display: inline-block;
  margin-right: 0;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--c-teal-soft);
  color: var(--c-teal);
  font-size: 12px;
  font-weight: 600;
}

.tag--rest {
  background: var(--c-accent-soft);
  color: #c2410c;
}

.login, .empty, .err {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 20px 18px;
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-sm);
  line-height: 1.55;
}

.err { border-color: #fecaca; color: #991b1b; background: var(--c-danger-soft); }

label { display: block; font-size: 14px; margin-bottom: 8px; color: var(--c-muted); line-height: 1.5; }

input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--c-line);
  border-radius: 11px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: var(--c-text);
}

input:focus {
  outline: none;
  border-color: #86efac;
  box-shadow: 0 0 0 3px rgba(22, 128, 61, 0.15);
}

button, .btn {
  margin-top: 12px;
  border: 0;
  border-radius: 11px;
  background: var(--c-accent);
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: filter 0.15s, transform 0.15s;
}

/* display:inline-block 会盖掉原生 [hidden]，必须显式藏掉 */
button[hidden], .btn[hidden] {
  display: none !important;
}

button:hover, .btn:hover { filter: brightness(1.05); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: wait; }

button.ghost, .btn.ghost {
  background: #fff;
  color: var(--c-forest);
  border: 1px solid var(--c-line);
}

button.danger, .btn.danger {
  background: #fff;
  color: var(--c-danger);
  border: 1px solid #fecaca;
}

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

.btn--soft {
  background: var(--c-green-soft);
  color: var(--c-forest);
}

/* —— 我的轨迹列表：尽量铺满视口，宽屏自适应 —— */
.wrap--mine {
  width: min(100% - 20px, 1480px);
  max-width: 100%;
  padding-top: 12px;
  padding-bottom: 48px;
  box-sizing: border-box;
}

.page-hero--mine {
  margin-bottom: 12px;
}

.page-hero--mine h1 {
  font-size: clamp(22px, 3.2vw, 28px);
  margin-bottom: 4px;
}

.page-hero--mine .sub {
  font-size: 13px;
  line-height: 1.5;
  max-width: 48em;
}

.summary--mine {
  gap: 8px;
  margin-bottom: 12px;
}

.summary--mine .summary__item {
  padding: 10px 12px 10px 14px;
  border-radius: 12px;
  box-shadow: none;
}

.summary--mine .summary__value {
  font-size: clamp(16px, 2.4vw, 20px);
}

.summary--mine .summary__label {
  margin-top: 2px;
  font-size: 11px;
}

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

.mine-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  background: var(--c-surface);
  border: 1px solid rgba(211, 224, 214, 0.95);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.mine-card:hover {
  border-color: #86efac;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

/* 对齐 App「毅步运动」列表：标题 / 元信息 / 2:1 地图轨迹 / 照片方块 */
.mine-card--stack .mine-card__body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  padding: 12px 12px 12px;
  text-decoration: none;
  color: inherit;
}

.mine-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--c-ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 对齐 App：左滑露出删除底，默认不显示角上删除按钮 */
.mine-card--swipe {
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.mine-card__swipe-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 22px;
  background: #dc2626;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  pointer-events: none;
}

.mine-card__swipe-panel {
  position: relative;
  z-index: 1;
  background: var(--c-surface);
  will-change: transform;
}

.mine-card__line {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--c-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mine-card__map {
  position: relative;
  margin-top: 10px;
  aspect-ratio: 2 / 1;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #e2e8f0;
}

.mine-card__map .leaflet-container {
  width: 100%;
  height: 100%;
  background: #e2e8f0;
}

.trail-preview--empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.trail-preview__tip {
  position: absolute;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  background: rgba(226, 232, 240, 0.55);
}

.mine-card__photos {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.mine-card__photo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e2e8f0;
  display: block;
}

.mine-card__cover {
  position: relative;
  width: 88px;
  min-height: 88px;
  background: linear-gradient(155deg, #bbf7d0 0%, #d1fae5 40%, #e7e5e4 100%);
  overflow: hidden;
}

.mine-card__cover img {
  width: 100%;
  height: 100%;
  min-height: 88px;
  object-fit: cover;
  display: block;
}

.mine-card__cover-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  text-align: center;
}

.mine-card__cover-ph span {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-forest);
  opacity: 0.7;
}

.mine-card__info {
  min-width: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.mine-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.mine-card__head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mine-card__head time {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}

.mine-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 8px;
}

.mine-card__metric {
  min-width: 0;
}

.mine-card__metric strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--c-forest);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mine-card__metric span {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  color: var(--c-muted);
  letter-spacing: 0.02em;
}

.mine-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
}

.mine-card__meta .tag,
.mine-card__meta .chip {
  font-size: 11px;
  padding: 2px 7px;
}

.mine-card__author {
  margin: 0;
  font-size: 12px;
  color: var(--c-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mine-card--world {
  grid-template-columns: 1fr;
}

.world-card__side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid rgba(211, 224, 214, 0.75);
  background: #fbfdfb;
}

.world-card__side .btn,
.world-card__side button {
  margin: 0 !important;
  border-radius: 999px !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
  line-height: 1.2;
  box-shadow: none !important;
}

.world-card__side .btn {
  background: var(--c-accent) !important;
  color: #fff !important;
  border: 0 !important;
}

.world-card__side .btn--soft {
  background: var(--c-green-soft) !important;
  color: var(--c-forest) !important;
}

.world-card__side .btn.ghost,
.world-card__side button.ghost {
  background: #fff !important;
  color: var(--c-forest) !important;
  border: 1px solid var(--c-line) !important;
}

.world-card__side button.ghost:hover {
  background: var(--c-green-soft) !important;
  border-color: #bbf7d0 !important;
}

.mine-card__del {
  align-self: stretch;
  width: 52px;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid #fecaca;
  background: #fffafa;
  color: var(--c-danger);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  writing-mode: horizontal-tb;
}

.mine-card__del--corner {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: auto;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #fecaca;
  border-left: 1px solid #fecaca;
  border-radius: 8px;
  background: rgba(255, 250, 250, 0.96);
  line-height: 1.2;
}

.mine-card__del:hover {
  background: var(--c-danger-soft);
}

.mine-card__del:disabled {
  opacity: 0.55;
  cursor: wait;
}

@media (max-width: 560px) {
  .wrap--mine {
    width: min(100% - 12px, 100%);
    padding-top: 10px;
    padding-bottom: 40px;
  }
  .page-hero--mine {
    margin-bottom: 10px;
  }
  .page-hero--mine h1 {
    font-size: 22px;
  }
  .summary--mine {
    gap: 6px;
    margin-bottom: 10px;
  }
  .summary--mine .summary__item {
    padding: 9px 10px 9px 12px;
  }
  .mine-list { gap: 8px; }
  .mine-card {
    border-radius: 12px;
    grid-template-columns: 1fr;
  }
  .mine-card:hover { transform: none; }
  .mine-card--stack .mine-card__body {
    padding: 10px;
  }
  .mine-card__title { font-size: 14px; }
  .mine-card__photo { width: 52px; height: 52px; }
  .mine-card__cover {
    width: 72px;
    min-height: 72px;
  }
  .mine-card__cover img { min-height: 72px; }
  .mine-card__info {
    padding: 9px 10px;
    gap: 5px;
  }
  .mine-card__head h2 { font-size: 14px; }
  .mine-card__metric strong { font-size: 14px; }
  .world-card__side {
    padding: 8px 10px;
    gap: 6px;
  }
  .world-card__side .btn,
  .world-card__side button {
    flex: 1 1 auto;
    text-align: center;
    min-height: 36px;
  }
}

@media (min-width: 720px) {
  .wrap--mine {
    width: min(100% - 24px, 1480px);
    padding-top: 14px;
  }
  .mine-card--stack .mine-card__body {
    padding: 14px;
  }
  .mine-card__title { font-size: 16px; }
  .mine-card__cover {
    width: 104px;
    min-height: 104px;
  }
  .mine-card__cover img { min-height: 104px; }
  .mine-card__info {
    padding: 12px 14px;
    gap: 8px;
  }
  .mine-card__head h2 { font-size: 16px; }
  .mine-card__metric strong { font-size: 17px; }
  .mine-card__del--corner { font-size: 13px; }

  .mine-card--world {
    grid-template-columns: 1fr auto;
  }
  .world-card__side {
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    min-width: 104px;
    padding: 10px 10px;
    border-top: 0;
    border-left: 1px solid rgba(211, 224, 214, 0.75);
    background: #fff;
  }
}

/* 宽屏：我的轨迹双列，更好利用横向空间 */
@media (min-width: 1100px) {
  .wrap--mine {
    width: min(100% - 28px, 1560px);
  }
  .mine-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .summary--mine {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 720px) {
  .world-card__side .btn,
  .world-card__side button {
    width: 100%;
    text-align: center;
  }
}

/* —— 缤纷世界卡片 —— */
.world-list {
  display: grid;
  gap: 14px;
}

.world-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  margin-bottom: 0;
}

.world-card:hover {
  border-color: #86efac;
  box-shadow: var(--shadow);
}

.world-card__main {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: stretch;
  min-height: 112px;
}

.world-card__cover {
  position: relative;
  width: 112px;
  min-height: 112px;
  background: linear-gradient(155deg, #bbf7d0 0%, #d1fae5 40%, #e7e5e4 100%);
  overflow: hidden;
}

.world-card__cover img {
  width: 100%;
  height: 100%;
  min-height: 112px;
  object-fit: cover;
  display: block;
}

.world-card__cover-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
}

.world-card__cover-ph span {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-forest);
  opacity: 0.75;
  letter-spacing: 0.04em;
}

.world-card__content {
  padding: 12px 14px 10px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.world-card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.world-card__author {
  margin: 0;
  font-size: 12px;
  color: var(--c-muted);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.world-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 6px;
  align-items: center;
}

.world-card__stats .chip {
  font-size: 11px;
  padding: 2px 8px;
}

.world-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(211, 224, 214, 0.7);
}

.world-card__actions .btn,
.world-card__actions button {
  margin-top: 0;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
}

.world-card__actions .btn {
  background: var(--c-accent);
}

.world-card__actions .btn--soft {
  background: var(--c-green-soft);
  color: var(--c-forest);
}

.world-card__actions .btn.ghost,
.world-card__actions button.ghost {
  background: #fff;
  color: var(--c-forest);
  border: 1px solid var(--c-line);
}

.world-card__actions button.ghost:hover {
  background: var(--c-green-soft);
  border-color: #bbf7d0;
}

@media (max-width: 560px) {
  .world-card__main {
    grid-template-columns: 76px 1fr;
    min-height: 76px;
  }
  .world-card__cover {
    width: 76px;
    min-height: 76px;
  }
  .world-card__cover img { min-height: 76px; }
  .world-card__content { padding: 10px 10px 8px; gap: 4px; }
  .world-card__title { font-size: 15px; }
  .world-card__author { font-size: 11px; }
  .world-card__actions {
    padding: 8px 10px 10px;
    gap: 6px;
  }
  .world-card__actions .btn,
  .world-card__actions button {
    padding: 6px 11px;
    font-size: 12px;
  }
}

@media (min-width: 900px) {
  .world-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .world-card__main {
    grid-template-columns: 128px 1fr;
    min-height: 128px;
  }
  .world-card__cover {
    width: 128px;
    min-height: 128px;
  }
  .world-card__cover img { min-height: 128px; }
}

/* —— 照片 / 灯箱 —— */
.photos {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 12px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.photos .photo-thumb--video {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 12px;
  overflow: hidden;
  background: #111827;
  flex: 0 0 auto;
  cursor: pointer;
  outline: 2px solid transparent;
}
.photos .photo-thumb--video.on { outline-color: var(--c-green); }
.photos .photo-thumb--video video,
.photos .photo-thumb--video .photo-thumb__poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #1f2937;
}
.photos .photo-thumb__play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  padding-left: 2px;
  box-sizing: border-box;
  pointer-events: none;
}
.photos .photo-thumb__badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.photos img {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 12px;
  background: #e8eeea;
  cursor: pointer;
  flex: 0 0 auto;
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.photos img.on { outline-color: var(--c-green); }

.leaflet-popup.photo-pop .leaflet-popup-content { margin: 8px; }

.photo-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 20, 14, 0.9);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.photo-lightbox.on { display: flex; }

.photo-lightbox__img {
  max-width: min(96vw, 920px);
  max-height: 86vh;
  object-fit: contain;
  border-radius: 10px;
  background: #111;
}

.photo-lightbox__bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.photo-lightbox__cap {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

.photo-lightbox__del { margin: 0; flex: 0 0 auto; }
.photo-lightbox__del[hidden] { display: none !important; }

.photo-lightbox__close {
  position: absolute;
  top: 12px;
  right: 16px;
  margin: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.photo-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  margin: 0;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.photo-lightbox__nav:hover,
.photo-lightbox__nav:focus-visible {
  background: rgba(255, 255, 255, 0.28);
}

.photo-lightbox__nav--prev { left: 12px; }
.photo-lightbox__nav--next { right: 12px; }

@media (max-width: 640px) {
  .photo-lightbox__nav {
    width: 40px;
    height: 40px;
    font-size: 28px;
  }
  .photo-lightbox__nav--prev { left: 6px; }
  .photo-lightbox__nav--next { right: 6px; }
}

/* —— 感谢 / 积分 —— */
.tip-pay { margin-bottom: 18px; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

.presets button {
  margin-top: 0;
  background: #fff;
  color: var(--c-text);
  border: 1px solid var(--c-line);
}

.tip-qr { margin-top: 12px; }
.tip-qr img { width: 220px; height: 220px; background: #fff; border-radius: 12px; }
.tip-open {
  display: inline-block;
  margin: 0 0 12px;
  text-align: center;
  text-decoration: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
}

@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
}

.stat {
  background: var(--c-surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-sm);
}

.stat b {
  display: block;
  font-size: 20px;
  color: var(--c-forest);
  font-variant-numeric: tabular-nums;
}

.stat span { color: var(--c-muted); font-size: 12px; }

.map {
  width: 100%;
  height: min(62vh, 520px);
  min-height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #d7e3dc;
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-sm);
}

/* 轨迹回放：前进距离跑马 + 媒体快照（对齐小程序） */
.yibu-replay-pill {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 1200;
  padding: 10px 12px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.55);
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(6px);
}
.yibu-replay-pill__label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.2px;
  color: rgba(31, 41, 55, 0.72);
}
.yibu-replay-pill__num {
  margin-top: 2px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  color: #145c3e;
}
.yibu-replay-snap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1210;
  width: min(220px, 56vw);
  height: min(220px, 56vw);
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  background: #111;
}
.yibu-replay-snap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.yibu-replay-snap__badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}


.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tools button { margin-top: 0; }

.points {
  background: linear-gradient(145deg, #166534 0%, #14532d 55%, #0f3d24 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 0;
}

.points b {
  display: block;
  font-size: clamp(36px, 8vw, 48px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.points span { color: rgba(255, 255, 255, 0.78); }

.rules {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--c-text);
}

.rules li { margin: 6px 0; }

.ledger {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: var(--c-surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--c-line);
}

.ledger em { font-style: normal; color: var(--c-teal); font-weight: 700; }
.ledger em.cost { color: var(--c-danger); }

/* —— 详情页动作区 —— */
.wrap .btn + .btn,
.wrap button + button { margin-left: 0; }

@media (min-width: 720px) {
  .top {
    padding: 14px 28px;
  }
  .wrap {
    width: min(100% - 48px, var(--wrap));
    padding-top: 28px;
  }
}

@media (max-width: 420px) {
  .top { padding: 10px 12px; }
  .top__brand { font-size: 16px; }
  .wrap { width: min(100% - 20px, var(--wrap)); padding-top: 16px; }
}

/* —— 缤纷世界：全屏照片地图（对齐 App） —— */
.world-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0f172a;
}

.world-page .top {
  flex-shrink: 0;
}

.world-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0b1220;
}

.world-map-pane {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 2 / 1;
  min-height: 180px;
  max-height: 46vh;
  background: #1e293b;
}

.world-layout.is-map-full .world-map-pane {
  flex: 1 1 auto;
  aspect-ratio: auto;
  max-height: none;
  min-height: 0;
}

.world-layout.is-map-full .world-sheet,
.world-layout.is-map-full .world-list-pane {
  display: none;
}

.world-toolbar {
  position: absolute;
  z-index: 500;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 14px;
  pointer-events: none;
}

.world-toolbar__text,
.world-seg {
  pointer-events: auto;
}

.world-toolbar__text {
  max-width: min(100%, 420px);
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.world-toolbar__text h1 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}

.world-toolbar__text p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(248, 250, 252, 0.78);
}

.world-seg {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.world-login {
  margin: 0 12px 8px;
  max-width: none;
}

.world-login__box {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.world-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #1e293b;
}

.world-map.leaflet-container,
.world-map .leaflet-container {
  width: 100%;
  height: 100%;
  font: inherit;
  background: #1e293b;
}

.world-busy {
  position: absolute;
  z-index: 520;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(24, 89, 62, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.world-map-tools {
  position: absolute;
  z-index: 520;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.world-tool {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.96);
  color: #18593e;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.world-sheet {
  flex: 0 0 auto;
  z-index: 530;
  padding: 10px 14px;
  background: rgba(20, 27, 45, 0.98);
  color: #fff;
  border-top: 1px solid rgba(71, 85, 105, 0.55);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.28);
}

.world-list-pane {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #0b1220;
  padding: 10px 12px 24px;
}

.world-search {
  display: block;
  margin: 0 0 10px;
}

.world-search input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #334155;
  border-radius: 12px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
}

.world-search input::placeholder {
  color: #64748b;
}

.world-search input:focus {
  border-color: #4ade80;
}

.world-list-status {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.world-list-status.is-empty {
  color: #e2e8f0;
}

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

.world-card {
  padding: 12px;
  border-radius: 14px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.world-card:hover {
  border-color: #4ade80;
}

.world-card.is-selected {
  background: #1e3a2f;
  border-color: #4ade80;
}

.world-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.world-card__line {
  margin: 4px 0 0;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.world-card__map {
  position: relative;
  margin-top: 10px;
  aspect-ratio: 2 / 1;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #334155;
}

.world-card__map .leaflet-container {
  width: 100%;
  height: 100%;
  background: #334155;
}

.world-card__photos {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.world-card__photo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #334155;
  display: block;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.world-sheet__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.world-sheet__titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.world-sheet__titles strong {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
}

.world-sheet__titles span {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

.world-sheet__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.world-sheet__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.world-sheet__actions .btn,
.world-sheet__actions a.btn {
  flex: 1 1 120px;
  text-align: center;
  text-decoration: none;
  justify-content: center;
}

.world-sheet__actions .btn:not(.ghost):not(.btn--soft) {
  background: #ea580c;
  border-color: #ea580c;
}

.world-pin-wrap {
  background: transparent !important;
  border: 0 !important;
}

.world-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  user-select: none;
}

.world-pin__photo {
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid #18593e;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  background: linear-gradient(135deg, #bbf7d0, #d1fae5, #e7e5e4);
  flex-shrink: 0;
}

.world-pin.is-selected .world-pin__photo {
  border-width: 2.6px;
  border-color: #ea580c;
}

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

.world-pin__ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 10px;
  font-weight: 700;
  color: #14532d;
  text-align: center;
  padding: 2px;
}

.world-pin__bubble {
  max-width: 110px;
  padding: 3px 6px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.world-pin__bubble.is-selected {
  background: rgba(234, 88, 12, 0.94);
}

.world-pin.level-2 .world-pin__bubble {
  max-width: 132px;
}

.world-pin__title {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.world-pin__stats {
  margin-top: 2px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .world-toolbar {
    top: 8px;
    left: 8px;
    right: 8px;
  }
  .world-toolbar__text {
    max-width: 100%;
  }
  .world-toolbar__text p {
    display: none;
  }
  .world-map-pane {
    max-height: 38vh;
  }
  .world-card__photo {
    width: 52px;
    height: 52px;
  }
}

@media (min-width: 1100px) {
  .world-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

/* 缤纷世界列表 → 展开预览（对齐 App WorldTrailExpandScreen） */
.expand-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  color: #f8fafc;
}

.expand-page .top {
  flex-shrink: 0;
}

.expand-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.expand-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #18593e;
  color: #fff;
}

.expand-back,
.expand-full {
  flex-shrink: 0;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.expand-full {
  padding: 4px 2px;
}

.expand-bar__title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.expand-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 28px;
}

.expand-map {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #1e293b;
}

.expand-map .leaflet-container {
  width: 100%;
  height: 100%;
  background: #1e293b;
}

.expand-info {
  padding: 14px 16px 8px;
}

.expand-info h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}

.expand-meta {
  margin: 6px 0 0;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.4;
}

.expand-photos {
  padding: 8px 16px 0;
}

.expand-photos h2 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.expand-photo-stage {
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: #1e293b;
}

.expand-photo-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.expand-photo-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.expand-photo-dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #64748b;
  cursor: pointer;
}

.expand-photo-dots button.on {
  width: 8px;
  height: 8px;
  background: #4ade80;
}

.expand-actions {
  display: flex;
  gap: 8px;
  padding: 20px 16px 0;
}

.expand-actions .btn {
  flex: 2;
  text-align: center;
  justify-content: center;
  background: #ea580c !important;
  border-color: #ea580c !important;
  color: #fff !important;
}

.expand-actions .btn.ghost {
  flex: 1;
  background: transparent !important;
  border: 1px solid #4ade80 !important;
  color: #4ade80 !important;
}

.expand-actions .btn:disabled {
  background: #7c2d12 !important;
  border-color: #7c2d12 !important;
  opacity: 0.85;
}
