:root {
  --paper: #f3eee4;
  --paper-2: #fbf8f1;
  --paper-3: #ebe3d4;
  --ink: #3a3129;
  --muted: #8c8072;
  --brown: #a0703f;
  --brown-2: #c08a52;
  --line: #e3d9c8;
  --danger: #b23a3a;
  --locked: #cfc5b4;
  --shadow: 0 6px 24px rgba(80, 55, 25, .14);
  --hand: "ZCOOL KuaiLe", "Hannotate SC", "Kaiti SC", cursive;
  --type: "Special Elite", "Courier New", "PingFang SC", monospace;
  --topbar-h: 64px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .38  0 0 0 0 .28  0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1f1b17;
    --paper-2: #29241e;
    --paper-3: #332c25;
    --ink: #ece4d6;
    --muted: #a89c8c;
    --brown: #d39d62;
    --brown-2: #e0b07a;
    --line: #3b342c;
    --locked: #4a4239;
    --shadow: 0 6px 24px rgba(0, 0, 0, .4);
  }
  .stamp { filter: brightness(1.8) saturate(.85); }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper) var(--grain);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-user-select: none; user-select: none; }

svg { stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg, .tab svg, .tab-add svg, .fab-locate svg, .photo-empty svg, .search svg {
  fill: none; stroke: currentColor; stroke-width: 1.6;
}
.fab-locate svg .fill { fill: currentColor; }

/* 双语：中文在前，英文小字在后 */
.bi small { margin-left: .35em; font-size: .78em; opacity: .7; font-weight: 400; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--paper) var(--grain);
  z-index: 1000;
}
.topbar h1 {
  margin: 0; max-width: calc(100% - 120px); text-align: center; font-family: var(--hand); font-weight: 400;
  font-size: 28px; line-height: 1.05; color: var(--brown); letter-spacing: 2px;
}
.topbar h1 .bi small { font-family: var(--type); font-size: 13px; letter-spacing: 1px; color: var(--muted); opacity: 1; }
.subline { font-family: var(--type); font-size: 11.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; }

/* ---------- 浮动底栏 ---------- */
.tabbar {
  position: fixed; z-index: 1000;
  left: 12px; right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  height: 64px; padding: 0 6px;
  display: flex; align-items: center;
  background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 32px;
  box-shadow: var(--shadow);
}
.tab {
  flex: 1; height: 100%; border: 0; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--muted); cursor: pointer; line-height: 1.1;
}
.tab svg { width: 23px; height: 23px; }
.tab .bi { display: flex; flex-direction: column; align-items: center; }
.tab .bi small { margin: 0; font-size: 9px; font-family: var(--type); }
.tab.active { color: var(--brown); font-weight: 600; }
.tab-add {
  flex: none; width: 58px; height: 58px; margin: -26px 4px 0; border-radius: 50%;
  border: 4px solid var(--paper); background: var(--brown); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 6px 16px rgba(160, 112, 63, .45);
}
.tab-add svg { width: 27px; height: 27px; stroke-width: 1.8; }
.tab-add:active { transform: scale(.94); }

main {
  position: fixed;
  top: calc(var(--topbar-h) + env(safe-area-inset-top));
  bottom: 0; left: 0; right: 0;
}
.view { position: absolute; inset: 0; }
.view.scroll { overflow-y: auto; padding-bottom: calc(100px + env(safe-area-inset-bottom)); }

/* ---------- 通用 ---------- */
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--paper-2); color: var(--ink);
  cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { transform: scale(.94); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--paper-2);
  cursor: pointer; font-size: 15px; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn.big { padding: 13px 26px; font-size: 16px; }
.btn.primary { background: var(--brown); color: #fff; border-color: var(--brown); box-shadow: 0 4px 12px rgba(160, 112, 63, .3); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: none; }
.pill-btn {
  border: 0; border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer;
  background: rgba(20, 15, 10, .6); color: #fff;
}
.link-btn { border: 0; background: none; color: var(--brown); font-size: 12.5px; cursor: pointer; padding: 0; }
.muted { color: var(--muted); font-size: 14px; }
.spacer { flex: 1; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper-2);
  font-size: 13px; cursor: pointer; color: var(--muted);
}
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(92px + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--paper);
  padding: 10px 18px; border-radius: 20px; font-size: 14px;
  z-index: 3000; max-width: calc(100% - 32px); text-align: center;
  box-shadow: var(--shadow); animation: pop .25s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- 印章 ---------- */
.stamp { width: 100%; height: auto; display: block; transform: rotate(var(--r, 0deg)); overflow: visible; }
.stamp.inked {
  -webkit-mask-image: var(--speckle); mask-image: var(--speckle);
  -webkit-mask-size: 110px; mask-size: 110px;
}
.st-arc { font-family: var(--type); font-size: 15px; letter-spacing: 2.5px; }
.st-arc.zh { font-family: var(--hand); font-size: 20px; letter-spacing: 5px; }
.st-date { font-family: var(--type); font-size: 25px; letter-spacing: 1px; }
.st-year { font-family: var(--type); font-size: 15px; letter-spacing: 3px; }
.st-star { font-size: 12px; }

.stamp-grid {
  display: grid; gap: 16px 14px; padding: 6px 20px 20px;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}
.stamp-grid.dense { grid-template-columns: repeat(3, 1fr); gap: 14px 10px; padding: 4px 14px 20px; }
.stamp-tile {
  position: relative; border: 0; background: none; padding: 0; cursor: pointer; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.stamp-tile:active .stamp { transform: rotate(var(--r, 0deg)) scale(.94); }
.stamp-tile .cap { font-size: 12px; color: var(--ink); text-align: center; line-height: 1.2; max-width: 100%; }
.stamp-tile .cap small { display: block; font-family: var(--type); font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stamp-tile.locked .cap { color: var(--muted); }
.stamp-tile .badge {
  position: absolute; top: 0; right: 2px;
  font-family: var(--type); font-size: 11px; color: #fff; background: var(--brown);
  border-radius: 10px; padding: 1px 7px; box-shadow: 0 2px 5px rgba(0,0,0,.15);
}
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 26px 0; grid-column: 1 / -1; }

/* ---------- 地图 ---------- */
#map { position: absolute; inset: 0; background: var(--paper); }
.leaflet-bottom { bottom: calc(84px + env(safe-area-inset-bottom)); }
.leaflet-control-zoom { border: 1px solid var(--line) !important; border-radius: 12px !important; overflow: hidden; box-shadow: var(--shadow); }
.leaflet-control-zoom a { background: var(--paper-2) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.map-hint {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  background: color-mix(in srgb, var(--paper-2) 92%, transparent); color: var(--ink);
  padding: 6px 14px; border-radius: 16px; font-size: 12.5px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  z-index: 500; pointer-events: none; white-space: nowrap;
}
.fab-locate {
  position: absolute; right: 14px; bottom: calc(94px + env(safe-area-inset-bottom)); z-index: 500;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper-2); color: var(--brown);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); cursor: pointer;
}
.fab-locate svg { width: 22px; height: 22px; }
.spot {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--c) center / cover no-repeat; border: 3px solid #fff;
  box-shadow: 0 3px 8px rgba(40,30,20,.4);
  display: flex; align-items: center; justify-content: center; position: relative;
  color: #fff; font-family: var(--type); font-size: 14px;
}
.spot svg { width: 22px; height: 14px; }
.spot .n {
  position: absolute; top: -7px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--c); border: 2px solid #fff; font-size: 11px; line-height: 16px; text-align: center;
}
.pin {
  width: 26px; height: 26px; border-radius: 50% 50% 50% 0;
  background: var(--brown); border: 3px solid #fff; transform: rotate(-45deg);
  box-shadow: 0 2px 5px rgba(0,0,0,.35);
}
.leaflet-popup-content-wrapper { background: var(--paper-2); color: var(--ink); border-radius: 16px; }
.leaflet-popup-tip { background: var(--paper-2); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.popup-place { font-family: var(--hand); font-size: 18px; color: var(--brown); margin-bottom: 6px; }
.popup-list { margin: 0; padding: 0; list-style: none; min-width: 190px; font-size: 13px; }
.popup-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.popup-list li:last-child { border: 0; }
.popup-list img, .popup-list .noimg { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; flex: none; background: var(--paper-3); display: flex; align-items: center; justify-content: center; }
.popup-list .noimg svg { width: 22px; height: 14px; }
.popup-list .d { font-family: var(--type); color: var(--muted); font-size: 11px; display: block; }
.popup-add { margin-top: 8px; width: 100%; }

/* ---------- 图鉴 ---------- */
.dex-head {
  position: sticky; top: 0; z-index: 2;
  padding: 6px 16px 12px;
  background: var(--paper) var(--grain);
  display: flex; flex-direction: column; gap: 12px;
}
.progress {
  display: flex; align-items: center; gap: 14px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 18px; padding: 12px 16px;
}
.progress-num { font-family: var(--type); color: var(--muted); font-size: 15px; white-space: nowrap; }
.progress-num b { font-size: 30px; color: var(--brown); font-weight: 400; }
.progress-body { flex: 1; }
.progress-label { font-size: 13px; margin-bottom: 7px; }
.bar { height: 8px; background: var(--paper-3); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brown), var(--brown-2)); width: 0; transition: width .6s; border-radius: 4px; }

/* ---------- 日历 ---------- */
.cal-card {
  margin: 4px 14px 0; padding: 8px 8px 12px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 20px;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px; }
.cal-title { font-family: var(--type); font-size: 18px; letter-spacing: 2px; cursor: pointer; text-align: center; }
.cal-title small { display: block; font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-week span { text-align: center; font-size: 10.5px; color: var(--muted); padding: 4px 0; line-height: 1.2; }
.cal-week small { display: block; font-family: var(--type); font-size: 8.5px; }
.cal-grid { gap: 3px; }
.cal-day {
  aspect-ratio: 1 / 1; min-height: 40px; border-radius: 12px; border: 0; background: none;
  display: flex; align-items: center; justify-content: center; padding: 0;
  cursor: pointer; font-family: var(--type); font-size: 14px; position: relative; overflow: hidden;
}
.cal-day.other { color: var(--muted); opacity: .4; }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--brown); }
.cal-day.selected { background: var(--paper-3); }
.cal-day.photo { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); background: center / cover no-repeat; }
.cal-day.photo.selected { box-shadow: inset 0 0 0 3px var(--brown); }
.cal-day .ring {
  width: 76%; height: 76%; border-radius: 50%;
  border: 2px solid var(--c); outline: 1px solid var(--c); outline-offset: 2px;
  color: var(--c); display: flex; align-items: center; justify-content: center;
  transform: rotate(var(--r)); font-weight: 700;
}
.cal-day .n {
  position: absolute; bottom: 2px; right: 4px; font-size: 9px;
}

.day-panel { padding: 16px 0 10px; }
.day-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 0 18px 4px; gap: 10px; }
.day-panel h2 { font-size: 15px; font-weight: 600; margin: 6px 0; }
.day-panel h2 small { display: block; font-family: var(--type); font-weight: 400; font-size: 11.5px; color: var(--muted); }

/* ---------- 我的 / 钓鱼证 ---------- */
.me-wrap { padding: 4px 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.license {
  background: var(--paper-2) var(--grain); border: 1px solid var(--line); border-radius: 20px;
  padding: 18px 16px 14px; position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.license .lic-top { min-height: 128px; padding-right: 120px; }
.license .lbl { font-family: var(--type); font-size: 11px; color: var(--muted); }
.license .val { font-family: var(--type); font-size: 18px; margin-bottom: 12px; }
.license input.val {
  border: 0; border-bottom: 1px dashed var(--line); background: none; padding: 2px 0; width: 100%; outline: none;
}
.license .issued { position: absolute; top: 12px; right: 10px; width: 116px; }
.stats { display: flex; justify-content: space-around; margin: 8px 0 12px; }
.stats div { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--muted); gap: 2px; text-align: center; }
.stats b { font-family: var(--type); font-size: 22px; color: var(--ink); font-weight: 400; }
.stats small { font-family: var(--type); font-size: 9.5px; }
.mrz { font-family: "Courier New", monospace; font-size: 11px; color: var(--muted); letter-spacing: .5px; line-height: 1.4; white-space: nowrap; overflow: hidden; }
.card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 20px; padding: 16px;
}
.card h3 { margin: 0 0 4px; font-size: 15px; }
.card p { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.card .row { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: flex; background: var(--paper-3); border-radius: 999px; padding: 3px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 999px; padding: 8px 0; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--paper-2); color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.recent { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.recent img { width: 88px; height: 88px; object-fit: cover; border-radius: 14px; flex: none; cursor: pointer; }

/* ---------- 底部弹出面板 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(40,30,20,.45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .2s;
}
.overlay .sheet {
  width: 100%; max-width: 560px; max-height: 92%;
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 24px 24px 0 0;
  background: var(--paper) var(--grain); color: var(--ink);
  box-shadow: 0 -10px 40px rgba(40,25,10,.3);
  animation: slideUp .28s cubic-bezier(.2,.8,.3,1);
}
@keyframes slideUp { from { transform: translateY(100%); } }
@media (min-width: 600px) {
  .overlay { align-items: center; }
  .overlay .sheet { border-radius: 24px; max-height: 88%; }
}
.sheet-body { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

#catchForm { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 8px; position: relative;
}
.sheet-head::before {
  content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 4px; border-radius: 2px; background: var(--line);
}
.sheet-head h2 { margin: 0; font-family: var(--hand); font-weight: 400; font-size: 24px; color: var(--brown); letter-spacing: 1px; }
.sheet-head h2 .bi small { font-family: var(--type); font-size: 12px; color: var(--muted); letter-spacing: 0; opacity: 1; }
.sheet-body { overflow-y: auto; padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }
.sheet-foot {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--paper-2);
}

.photo-box {
  position: relative; border-radius: 20px; overflow: hidden;
  background: var(--paper-2); border: 2px dashed var(--line);
  aspect-ratio: 4 / 3; flex: none;
}
.photo-box.has { border: 0; }
.photo-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted); padding: 12px;
}
.photo-empty > svg { width: 44px; height: 44px; color: var(--brown); stroke-width: 1.3; }
.photo-hint { font-size: 14px; text-align: center; }
.photo-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
#fPhotoPreview { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tools { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.flabel { font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.input, .unit-input, .search {
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--paper-2); font-size: 16px; width: 100%; color: var(--ink); outline: none; min-width: 0;
}
.input:focus, .unit-input:focus-within, .search:focus-within { border-color: var(--brown); }
textarea.input { resize: vertical; }
input[type=date].input, input[type=time].input { -webkit-appearance: none; appearance: none; min-height: 43px; height: 43px; min-width: 0; width: 100%; text-align: left; }
input[type=date].input::-webkit-date-and-time-value, input[type=time].input::-webkit-date-and-time-value { text-align: left; }
.row2 > .field { min-width: 0; }
.unit-input, .search { display: flex; align-items: center; gap: 6px; }
.unit-input input, .search input { border: 0; background: none; outline: none; flex: 1; min-width: 0; padding: 0; font-size: 16px; }
.unit-input span { font-family: var(--type); color: var(--muted); font-size: 13px; }
.search { padding: 8px 12px; }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }

.sp-grid {
  display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: 96px;
  gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none;
}
.sp-grid::-webkit-scrollbar { display: none; }
.sp-chip {
  border: 1.5px solid var(--line); background: var(--paper-2); border-radius: 14px;
  padding: 8px 4px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 0;
}
.sp-chip svg { width: 36px; height: 22px; }
.sp-chip b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.sp-chip small { font-family: var(--type); font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sp-chip.on { border-color: var(--brown); background: color-mix(in srgb, var(--brown) 12%, var(--paper-2)); }
.sp-chip.on b { color: var(--brown); }
.sp-chip .plus { font-size: 20px; color: var(--brown); line-height: 22px; }

#miniMap { height: 150px; border-radius: 14px; border: 1px solid var(--line); z-index: 0; }

/* ---------- 详情页通用：顶部大图 + 叠上来的卡片 ---------- */
.species-detail, #catchViewBody { overflow-y: auto; min-height: 0; flex: 1; }
.hero {
  position: relative; height: 240px; flex: none;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--sc) 30%, var(--paper-2)), color-mix(in srgb, var(--sc) 62%, var(--paper-3)));
}
.hero.tall { height: 310px; }
.hero-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-art { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.hero-art svg { width: 55%; height: auto; filter: drop-shadow(0 10px 12px rgba(0,0,0,.22)); animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-2deg); } }
.hero-no {
  position: absolute; left: 14px; top: 14px; font-family: var(--type); font-size: 13px;
  background: rgba(255,255,255,.88); color: #3a3129; padding: 3px 10px; border-radius: 999px;
}
.hero-close { position: absolute; top: 12px; right: 12px; }
.hero .corner-stamp { position: absolute; right: 14px; bottom: -36px; width: 100px; z-index: 3; }
.hero .corner-stamp .stamp { filter: drop-shadow(0 2px 3px rgba(0,0,0,.18)); }

.sheet-card {
  position: relative; z-index: 1; margin-top: -24px;
  background: var(--paper) var(--grain); border-radius: 24px 24px 0 0;
  padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
}
.big-name { margin: 0; font-family: var(--hand); font-weight: 400; font-size: 32px; letter-spacing: 2px; line-height: 1.15; }
.title-row { display: flex; align-items: center; gap: 10px; padding-right: 100px; }
.sub-name { font-family: var(--type); color: var(--muted); font-size: 13px; margin-top: 2px; }
.type-pill {
  display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px; font-size: 12.5px;
  background: color-mix(in srgb, var(--sc) 22%, var(--paper-2));
}
.stat3 {
  display: grid; grid-template-columns: repeat(3, 1fr); margin: 16px 0 6px; padding: 12px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat3 > div { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.stat3 > div + div { border-left: 1px solid var(--line); }
.stat3 b { font-family: var(--type); font-weight: 400; font-size: 20px; }
.stat3 b small { font-size: 12px; margin-left: 2px; color: var(--muted); }
.stat3 b .bi small { display: block; margin: 0; font-size: 10px; }
.stat3 > div > span { font-size: 11.5px; color: var(--muted); }
.stat3 > div > span .bi small { display: block; margin: 0; }

.size-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 28px;
  padding: 2px 7px; border-radius: 8px; background: var(--sc); color: #fff;
  font-family: var(--type); font-size: 11px; font-weight: 700; letter-spacing: 1px; vertical-align: middle; line-height: 1.3;
}
.title-row .size-badge { font-size: 15px; padding: 3px 10px; }
.pb-banner, .gotcha-new {
  margin-top: 10px; background: linear-gradient(90deg, #f6d77a, #e9b949); color: #5a3e0a;
  border-radius: 12px; padding: 8px 12px; font-size: 13px; font-weight: 600;
}

.ruler { margin: 30px 6px 4px; }
.ruler-track { position: relative; height: 10px; border-radius: 5px; background: var(--paper-3); }
.ruler-zone { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: color-mix(in srgb, var(--brown) 35%, var(--paper-3)); }
.ruler-mark {
  position: absolute; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  background: var(--sc); border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.3);
}
.ruler-mark i {
  position: absolute; bottom: 21px; left: 50%; transform: translateX(-50%);
  font-style: normal; font-family: var(--type); font-size: 12px; white-space: nowrap;
}
.ruler-labels { position: relative; height: 16px; margin-top: 5px; }
.ruler-labels span { position: absolute; transform: translateX(-50%); font-family: var(--type); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.ruler-cap { text-align: center; font-size: 11px; color: var(--muted); }

.caught-line { text-align: center; font-size: 13px; color: var(--muted); margin: 14px 0; }
.cv-note { background: var(--paper-2); border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.desc { font-size: 14px; line-height: 1.6; margin: 14px 0 4px; }
.en-line { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.sec { font-size: 14px; margin: 20px 0 8px; }
.sec .bi small { font-weight: 400; }
.photo-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-wall img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; cursor: pointer; }
.rows { display: flex; flex-direction: column; gap: 8px; }
.catch-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-2);
}
.row-img {
  width: 46px; height: 46px; border-radius: 10px; overflow: hidden; flex: none;
  display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--sc) 25%, var(--paper-3));
}
.row-img img { width: 100%; height: 100%; object-fit: cover; }
.row-img svg { width: 34px; height: 20px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-main b { font-size: 14px; font-weight: 600; }
.row-main small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-size { font-family: var(--type); font-size: 13px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.actions .btn { flex: 1; }
.center { text-align: center; }
.small { font-size: 12px; }

/* ---------- 鱼篓 ---------- */
.dex-head .seg { margin-bottom: 2px; }
#dexOnly, .bag-head { display: flex; flex-direction: column; gap: 12px; }
.bag-count { font-family: var(--hand); font-size: 24px; color: var(--brown); padding-left: 2px; }
.bag-count small { font-family: var(--type); font-size: 12px; color: var(--muted); margin-left: 6px; }
.bag-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 14px 20px; }
.bag-card {
  border: 1px solid var(--line); background: var(--paper-2); border-radius: 18px; padding: 8px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; min-width: 0;
  box-shadow: 0 2px 8px rgba(80,55,25,.07);
}
.bag-card:active { transform: scale(.97); }
.bag-top { position: relative; width: 100%; display: flex; align-items: baseline; justify-content: center; gap: 2px; font-family: var(--type); }
.bag-top b { font-size: 17px; font-weight: 400; }
.bag-top small { font-size: 11px; color: var(--muted); }
.pb-dot { position: absolute; right: 0; top: -2px; font-size: 13px; }
.bag-img {
  width: 88%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--sc) 22%, var(--paper-2)), color-mix(in srgb, var(--sc) 48%, var(--paper-3)));
}
.bag-img img { width: 100%; height: 100%; object-fit: cover; }
.bag-img svg { width: 72%; height: auto; }
.bag-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bag-foot { display: flex; align-items: center; gap: 6px; font-family: var(--type); font-size: 10.5px; color: var(--muted); }
.bag-foot .size-badge { font-size: 10px; padding: 1px 6px; min-width: 0; }

/* ---------- 抓到了！ ---------- */
.gotcha {
  position: fixed; inset: 0; z-index: 4000; padding: 20px;
  background: rgba(30, 22, 14, .62); display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0; } }
.gotcha-card {
  position: relative; width: min(340px, 100%); overflow: hidden; text-align: center;
  background: var(--paper) var(--grain); border-radius: 28px; padding: 30px 20px 20px;
  animation: popIn .45s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes popIn { from { transform: scale(.6); opacity: 0; } }
.gotcha-rays {
  position: absolute; left: 50%; top: 110px; width: 560px; height: 560px; margin: -280px 0 0 -280px; pointer-events: none;
  background: repeating-conic-gradient(color-mix(in srgb, var(--sc) 20%, transparent) 0 10deg, transparent 10deg 20deg);
  animation: spin 16s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gotcha-orb {
  position: relative; width: 160px; height: 160px; margin: 0 auto; border-radius: 50%; overflow: hidden;
  border: 5px solid #fff; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  background: radial-gradient(circle, color-mix(in srgb, var(--sc) 22%, #fff), color-mix(in srgb, var(--sc) 55%, #fff));
  display: flex; align-items: center; justify-content: center;
  animation: wiggle .9s .4s ease-in-out 2;
}
@keyframes wiggle { 20% { transform: rotate(-10deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(3deg); } }
.gotcha-orb img { width: 100%; height: 100%; object-fit: cover; }
.gotcha-orb svg { width: 72%; height: auto; }
.gotcha-title { position: relative; margin-top: 18px; font-family: var(--hand); font-size: 38px; color: var(--brown); letter-spacing: 3px; line-height: 1.1; }
.gotcha-title .bi small { display: block; margin: 2px 0 0; font-family: var(--type); font-size: 14px; letter-spacing: 1px; }
.gotcha-name { position: relative; font-size: 18px; font-weight: 600; margin-top: 8px; }
.gotcha-size { position: relative; font-family: var(--type); color: var(--muted); margin-top: 2px; }
.gotcha-new { position: relative; }
.gotcha-new b { display: block; font-family: var(--type); font-size: 15px; margin-top: 2px; }
.gotcha-actions { position: relative; display: flex; gap: 10px; margin-top: 18px; }
.gotcha-actions .btn { flex: 1; }

/* ---------- 顶栏左上角：训练师 / 钓鱼证 ---------- */
.trainer-btn {
  position: absolute; left: 14px; top: calc(env(safe-area-inset-top) + 12px);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--brown); background: var(--paper-2); color: var(--brown);
  font-family: var(--hand); font-size: 19px; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}

/* ---------- 背包 ---------- */
#view-bag .dex-head { gap: 10px; }
.fav-dot { position: absolute; left: 2px; top: -1px; color: #e9b949; font-size: 14px; }

/* ---------- 全屏页面（每条鱼 / 图鉴条目） ---------- */
.page {
  position: fixed; inset: 0; z-index: 1500; overflow-y: auto;
  background: var(--paper) var(--grain);
  animation: pageIn .25s cubic-bezier(.2, .8, .3, 1);
}
@keyframes pageIn { from { transform: translateX(30%); opacity: 0; } }
body.page-open .tabbar, body.page-open .topbar { visibility: hidden; }
.page .sheet-card { padding-bottom: calc(40px + env(safe-area-inset-bottom)); min-height: 50vh; }
.page-bar {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4;
  padding: calc(env(safe-area-inset-top) + 12px) 14px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.bar-gap { width: 38px; }
.fp-no {
  font-family: var(--type); font-size: 13px;
  background: rgba(255,255,255,.88); color: #3a3129; padding: 4px 12px; border-radius: 999px;
}
.hero .page-bar ~ * { z-index: 1; }

.fp-top {
  position: relative; height: calc(400px + env(safe-area-inset-top)); overflow: hidden;
  padding-top: env(safe-area-inset-top);
  background:
    radial-gradient(ellipse at 50% 115%, color-mix(in srgb, var(--sc) 55%, #5a7a4a) 0 32%, transparent 33%),
    linear-gradient(180deg, color-mix(in srgb, var(--sc) 18%, #cfe3ea), color-mix(in srgb, var(--sc) 35%, var(--paper-2)));
}
@media (prefers-color-scheme: dark) {
  .fp-top {
    background:
      radial-gradient(ellipse at 50% 115%, color-mix(in srgb, var(--sc) 45%, #22301c) 0 32%, transparent 33%),
      linear-gradient(180deg, color-mix(in srgb, var(--sc) 25%, #1d2a30), color-mix(in srgb, var(--sc) 30%, var(--paper-2)));
  }
}
.fp-cp {
  position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 58px);
  display: flex; align-items: baseline; justify-content: center; gap: 4px; color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,.35);
}
.fp-cp span { font-size: 12px; margin-right: 4px; letter-spacing: 1px; }
.fp-cp span .bi small { opacity: .85; }
.fp-cp b { font-family: var(--type); font-weight: 400; font-size: 42px; line-height: 1; }
.fp-cp small { font-family: var(--type); font-size: 16px; }
.fp-stage { position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 108px); width: 300px; margin-left: -150px; height: 300px; }
.arc { position: absolute; left: 0; top: 0; width: 300px; height: 160px; overflow: visible; }
.arc-bg { fill: none; stroke: rgba(255,255,255,.35); stroke-width: 4; stroke-linecap: round; }
.arc-fg { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; }
.arc-dot { fill: #fff; filter: drop-shadow(0 0 4px rgba(255,255,255,.9)); }
.fp-model {
  position: absolute; left: 50%; top: 42px; width: 210px; height: 210px; margin-left: -105px;
  border-radius: 50%; overflow: hidden; border: 5px solid rgba(255,255,255,.95);
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
  background: radial-gradient(circle, color-mix(in srgb, var(--sc) 20%, #fff), color-mix(in srgb, var(--sc) 50%, #fff));
  display: flex; align-items: center; justify-content: center;
}
.fp-model img { width: 100%; height: 100%; object-fit: cover; }
.fp-model svg { width: 70%; height: auto; animation: bob 3.2s ease-in-out infinite; }
.fp-nav {
  position: absolute; top: calc(env(safe-area-inset-top) + 190px); z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.75); color: #3a3129; font-size: 26px; line-height: 34px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.fp-nav.prev { left: 10px; }
.fp-nav.next { right: 10px; }
.fav-btn { font-size: 20px; color: var(--muted); }
.fav-btn.on { color: #e9b949; border-color: #e9b949; }
.fp-card { margin-top: -26px; }
.fp-card .corner-stamp { position: absolute; right: 12px; top: -46px; width: 96px; z-index: 3; }
.fp-card .corner-stamp .stamp { filter: drop-shadow(0 2px 3px rgba(0,0,0,.18)); }
.rename { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 2px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.chip-static { padding: 5px 12px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); font-size: 12.5px; }
.fp-pos { text-align: center; font-family: var(--type); font-size: 11px; color: var(--muted); margin-top: 14px; }
.gotcha-bag { position: relative; font-size: 13px; color: var(--muted); margin-top: 8px; }
#fFate button.on { background: var(--paper-2); color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.1); }

/* 地图上的临时大头针 */
.draft-pop .btn { white-space: nowrap; }
.leaflet-popup-content:has(.draft-pop) { margin: 10px 12px; }

/* ---------- 云端同步 ---------- */
.trainer-btn { overflow: visible; }
.sync-dot {
  position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--paper); display: none;
}
.sync-dot.ok { display: block; background: #4caf50; }
.sync-dot.pending { display: block; background: #e9a23b; }
.sync-dot.busy { display: block; background: #4a8fd8; animation: pulse 1s ease-in-out infinite; }
.sync-dot.err { display: block; background: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }
.auth-form { display: flex; flex-direction: column; gap: 8px; }
.auth-msg { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.err-text { color: var(--danger); }

/* ---------- 登录 / 注册页 ---------- */
.auth {
  position: fixed; inset: 0; z-index: 3500; overflow-y: auto;
  background: var(--paper) var(--grain);
  display: flex; justify-content: center;
  animation: fadeIn .25s;
}
body.auth-open .tabbar, body.auth-open .topbar, body.auth-open main { visibility: hidden; }
.auth-inner {
  width: 100%; max-width: 420px; min-height: 100%;
  padding: calc(env(safe-area-inset-top) + 28px) 24px calc(env(safe-area-inset-bottom) + 28px);
  display: flex; flex-direction: column; gap: 14px; position: relative;
}
.auth-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 340px; }
.auth-logo { width: 180px; margin-bottom: 10px; animation: stampIn .6s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes stampIn { from { transform: scale(1.6); opacity: 0; } }
.auth-title { margin: 6px 0 0; font-family: var(--hand); font-weight: 400; font-size: 44px; color: var(--brown); letter-spacing: 6px; }
.auth-sub { font-family: var(--type); font-size: 16px; letter-spacing: 4px; color: var(--muted); }
.auth-tag { margin: 16px 0 0; font-size: 15px; line-height: 1.6; color: var(--ink); }
.auth-actions { display: flex; flex-direction: column; gap: 12px; }
.auth-actions .btn, .auth-inner > .btn { width: 100%; }
.btn.social { background: #fff; color: #1f1f1f; border-color: #dadce0; gap: 10px; }
.btn.social.dark { background: #000; color: #fff; border-color: #000; }
.btn .brand { width: 20px; height: 20px; flex: none; }
.auth-skip { align-self: center; padding: 8px; color: var(--muted); font-size: 13px; }
.auth-back { position: absolute; left: 16px; top: calc(env(safe-area-inset-top) + 16px); }
.auth-h { margin: 56px 0 0; font-family: var(--hand); font-weight: 400; font-size: 30px; color: var(--brown); letter-spacing: 2px; }
.auth-h .bi small { display: block; margin: 2px 0 0; font-family: var(--type); font-size: 13px; color: var(--muted); }
.auth-p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.code-input { font-family: var(--type); font-size: 30px !important; letter-spacing: 12px; text-align: center; padding: 14px 10px !important; }
.auth-inner .link-btn { align-self: center; padding: 6px; font-size: 14px; }
.auth-inner .link-btn:disabled { color: var(--muted); }
.auth-msg:empty { display: none; }
.auth-inner .auth-msg { text-align: center; color: var(--danger); }
.auth-inner .auth-msg.ok { color: var(--muted); }

/* ---------- 大鱼种库 ---------- */
.dex-count:empty, .sp-hint:empty { display: none; }
.dex-count { padding: 0 18px 6px; font-size: 12px; color: var(--muted); }
.dex-more { display: block; margin: 0 auto 24px; }
.sp-hint { font-size: 11.5px; color: var(--muted); }
.sci { font-style: italic; font-size: 13px; color: var(--muted); margin-top: 6px; }
.credit { font-size: 11px; color: var(--muted); margin: 4px 0 0; }

/* 登录 / 注册切换 */
.auth-seg { margin: 2px 0 2px; }
.auth-seg button { font-size: 15px; padding: 10px 0; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 18px; opacity: .45; cursor: pointer; padding: 8px; }
.pw-eye.on { opacity: 1; }
.auth-inner .small-link { font-size: 12.5px; color: var(--muted); }
.switch-mode { margin-top: 6px; font-weight: 600; }

/* ---------- 奖牌 ---------- */
.medal { width: 100%; height: auto; display: block; }
.medal.locked { filter: grayscale(1); }
.medals-card h3 { display: flex; align-items: baseline; gap: 8px; }
.medal-count { font-family: var(--type); font-size: 12px; color: var(--muted); font-weight: 400; }
.medal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; margin-top: 8px; }
.medal-tile { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; min-width: 0; }
.medal-tile .medal { width: 58px; }
.medal-tile:active .medal { transform: scale(.94); }
.medal-name { font-size: 11px; text-align: center; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.medal-bar { width: 80%; height: 4px; border-radius: 2px; background: var(--paper-3); overflow: hidden; }
.medal-bar i { display: block; height: 100%; background: var(--brown); border-radius: 2px; }
.medal-num { font-family: var(--type); font-size: 9.5px; color: var(--muted); }
.medal-detail .medal-big { width: 120px; margin: 0 auto; position: relative; }
.gotcha-title.small { font-size: 28px; margin-top: 8px; }
.medal-tier { font-weight: 600; margin-top: 2px; }
.medal-what { font-size: 13.5px; color: var(--muted); margin: 10px 0; line-height: 1.5; }
.medal-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.medal-step { display: flex; flex-direction: column; align-items: center; opacity: .55; }
.medal-step.done { opacity: 1; }
.medal-step .medal { width: 44px; }
.medal-step b { font-family: var(--type); font-weight: 400; font-size: 15px; }
.medal-step small { font-size: 10.5px; color: var(--muted); }
.medal-have { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.gotcha-medals { position: relative; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.gotcha-medal { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; font-size: 12.5px; }
.gotcha-medal .medal { width: 36px; flex: none; }
.gotcha-medal b { display: block; font-size: 14px; }
.gotcha-card { max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; }

/* ---------- 钓手等级 ---------- */
.lv-chip {
  position: absolute; right: -8px; top: -6px; min-width: 22px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--brown); color: #fff; font-style: normal; font-family: var(--type); font-size: 11px; line-height: 18px; text-align: center;
  border: 2px solid var(--paper);
}
.lv-badge {
  display: inline-flex; align-items: baseline; justify-content: center; gap: 1px;
  font-family: var(--type); color: var(--brown); font-size: 18px; line-height: 1;
}
.lv-badge small { font-size: .5em; }
.lv-badge.big { font-size: 30px; }
.lv-badge.huge { font-size: 56px; margin-top: 6px; }
.level-card { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.level-ring {
  flex: none; width: 82px; height: 82px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(closest-side, var(--paper-2) 78%, transparent 80% 100%),
    conic-gradient(var(--brown) calc(var(--p) * 1%), var(--paper-3) 0);
}
.level-info { flex: 1; min-width: 0; }
.level-title { font-family: var(--hand); font-size: 22px; color: var(--brown); line-height: 1.2; }
.level-title .bi small { font-family: var(--type); font-size: 12px; color: var(--muted); }
.level-bar { height: 8px; border-radius: 4px; background: var(--paper-3); overflow: hidden; margin: 8px 0 4px; }
.level-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--brown), var(--brown-2)); }
.level-nums { font-family: var(--type); font-size: 12px; }
.level-next { font-size: 12px; color: var(--muted); margin-top: 2px; }
.level-total { font-family: var(--type); color: var(--muted); }
.xp-table { text-align: left; background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px; }
.xp-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.xp-row:last-child { border: 0; }
.xp-row b { font-family: var(--type); font-weight: 400; white-space: nowrap; }
.level-detail .sec { text-align: left; }
.gotcha-xp { position: relative; margin-top: 10px; }
.gotcha-xp b { display: block; font-family: var(--type); font-size: 22px; color: var(--brown); font-weight: 400; animation: popIn .5s .3s both cubic-bezier(.2, 1.6, .4, 1); }
.gotcha-xp span { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 4px; }
.gotcha-xp i { font-style: normal; font-size: 11px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; color: var(--muted); }
.gotcha-levelup {
  position: relative; display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 14px; border-radius: 14px; text-align: left;
  background: linear-gradient(90deg, #a0703f, #d09a5a); color: #fff; font-size: 13px;
}
.gotcha-levelup .lv-badge { color: #fff; font-size: 30px; }
.gotcha-levelup b { display: block; font-size: 16px; }
.gotcha-levelup .bi small { opacity: .85; }

/* ---------- 潮汐 · 咬口 ---------- */
:root { --tide: #2f6f8f; --tide-2: #9cc3d5; --bite: #c08a52; --night: rgba(60, 70, 110, .09); }
@media (prefers-color-scheme: dark) { :root { --tide: #7ab8d6; --tide-2: #36566a; --night: rgba(150, 170, 230, .08); } }
.fab-tide {
  position: absolute; right: 14px; bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 500;
  width: 46px; height: 46px; border-radius: 50%; font-size: 22px; line-height: 1;
  border: 1px solid var(--line); background: var(--paper-2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); cursor: pointer;
}
.tide-entry {
  display: flex; align-items: center; gap: 12px; width: calc(100% - 28px); margin: 4px 14px 10px;
  padding: 12px 14px; border-radius: 18px; border: 1px solid var(--line); cursor: pointer; text-align: left;
  background: linear-gradient(120deg, color-mix(in srgb, var(--tide) 14%, var(--paper-2)), var(--paper-2)); color: var(--ink); font: inherit;
}
.tide-entry .te-icon { font-size: 26px; }
.tide-entry .te-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tide-entry b { font-size: 14.5px; }
.tide-entry small { font-size: 11.5px; color: var(--muted); }
.tide-entry .bi small { display: inline; margin-left: 6px; }
.tide-entry .te-go { font-size: 24px; color: var(--muted); }

#tidePage { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
.tp-bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  background: color-mix(in srgb, var(--paper) 94%, transparent); border-bottom: 1px solid var(--line);
}
.tp-bar h2 { margin: 0; font-size: 16px; text-align: center; }
.tp-bar h2 .bi small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.tp-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; max-width: 560px; margin: 0 auto; }
.tp-spot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tp-where { font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-spot .link-btn { flex: none; font-size: 13px; }
.tp-spot .link-btn .bi small { display: none; }
.tp-date { display: flex; align-items: center; justify-content: space-between; }
.tp-date .icon-btn:disabled { opacity: .3; }
.tp-date-label { border: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-align: center; }
.tp-date-label small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); font-family: var(--type); }

.dc-card { padding: 10px 8px 10px; }
.dc-wait { padding: 46px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.day-chart { width: 100%; height: auto; display: block; }
.day-chart .dc-night { fill: var(--night); }
.day-chart .dc-hist { fill: var(--bite); opacity: .38; }
.day-chart .dc-cur { fill: var(--tide-2); opacity: .7; }
.day-chart .dc-cur.ebb { fill: #e0a458; opacity: .45; }
.day-chart .dc-band { fill: var(--paper); stroke: var(--line); stroke-width: .8; }
.day-chart .dc-zero { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 3; opacity: .55; }
.day-chart .dc-curline { fill: none; stroke: var(--tide); stroke-width: 1.3; opacity: .8; }
.day-chart .dc-clbl { font-size: 8.5px; fill: var(--muted); font-family: var(--type); }
.dc-curhow { text-align: left; line-height: 1.45; padding: 0 6px; font-family: inherit; }
.day-chart .dc-tide { fill: none; stroke: var(--tide); stroke-width: 2.4; stroke-linejoin: round; }
.day-chart .dc-pres { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 4; }
.day-chart .dc-ext { fill: var(--paper-2); stroke: var(--tide); stroke-width: 2; }
.day-chart .dc-lbl { font-size: 10px; fill: var(--ink); font-family: var(--type); }
.day-chart .dc-lbl.now { fill: var(--danger); }
.day-chart .dc-axis { font-size: 9.5px; fill: var(--muted); font-family: var(--type); }
.day-chart .dc-mark { stroke: var(--brown); stroke-width: 1.2; stroke-dasharray: 3 3; }
.day-chart .dc-fish { fill: var(--brown); stroke: var(--paper-2); stroke-width: 2; }
.day-chart .dc-now { stroke: var(--danger); stroke-width: 1.4; }
.dc-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; font-size: 11px; color: var(--muted); margin-top: 4px; }
.dc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dc-legend .bi small { display: none; }
.dc-legend i { width: 14px; height: 8px; border-radius: 2px; display: inline-block; }
.lg-tide { background: var(--tide); height: 3px !important; }
.lg-pres { border-top: 2px dashed var(--muted); height: 0 !important; }
.lg-cur { background: var(--tide-2); }
.lg-ebb { background: #e0a458; opacity: .6; }
.lg-hist { background: var(--bite); opacity: .5; }
.lg-night { background: var(--night); border: 1px solid var(--line); }
.dc-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 6px; }
.hl-row { display: flex; justify-content: space-around; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.hl { display: flex; flex-direction: column; align-items: center; font-size: 12px; }
.hl b { font-family: var(--type); font-weight: 400; font-size: 14px; }
.hl small { color: var(--muted); font-size: 10.5px; }
.hl small .bi small { display: none; }

.cond-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 6px 0 10px; }
.cpill {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-width: 0;
}
.cpill i { font-style: normal; font-size: 18px; line-height: 1.1; }
.cpill b { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.cpill b small { font-weight: 400; font-size: 10.5px; color: var(--muted); }
.cpill b .bi small { display: block; color: var(--muted); font-size: 10px; }
.cpill > small { font-size: 10.5px; color: var(--muted); }
.cpill > small .bi small { display: block; font-size: 9.5px; }

.bites h4 { margin: 16px 0 8px; font-size: 13px; }
.bites h4 .bi small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.bite-sum { text-align: center; display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.bite-sum b { font-size: 15px; }
.bite-sum b .bi small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.bite-sum > small { font-size: 11.5px; color: var(--muted); }
.bite-sum > small .bi small { display: block; }
.period-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pg { display: flex; flex-direction: column; align-items: center; padding: 8px 2px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.pg.best { border-color: var(--brown); background: color-mix(in srgb, var(--brown) 12%, var(--paper)); }
.pg i { font-style: normal; font-size: 18px; }
.pg b { font-family: var(--type); font-weight: 400; font-size: 17px; }
.pg small { font-size: 10.5px; color: var(--muted); text-align: center; }
.pg small .bi small { display: block; font-size: 9.5px; }
.hour-bars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 80px; align-items: end; }
.hb { height: 100%; display: flex; align-items: flex-end; background: var(--paper-3); border-radius: 3px; }
.hb i { width: 100%; border-radius: 3px; background: var(--brown-2); min-height: 0; }
.hb i.dawn, .hb i.dusk { background: var(--brown); }
.hb i.night { background: color-mix(in srgb, var(--tide) 70%, var(--brown-2)); }
.hour-axis { display: flex; justify-content: space-between; font-family: var(--type); font-size: 10px; color: var(--muted); margin-top: 3px; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 58px; align-items: center; gap: 8px; font-size: 12.5px; }
.bar-row .bl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bl .bi small { display: none; }
.bar-row .bt { height: 10px; background: var(--paper-3); border-radius: 5px; overflow: hidden; }
.bar-row .bt i { display: block; height: 100%; background: var(--tide); border-radius: 5px; }
.bar-row.top .bt i { background: var(--brown); }
.bar-row .bn { text-align: right; font-family: var(--type); }
.bar-row .bn small { color: var(--muted); font-size: 10.5px; }
.dc-src { text-align: center; font-size: 10.5px; color: var(--muted); margin-top: 4px; font-family: var(--type); }
.dc-src .bi small { display: none; }
.dc-wait .btn { margin-top: 10px; }

/* ---------- 饵 / 沿用上一条 ---------- */
.bait-chips { flex-wrap: nowrap; }
.bait-chips .chip { flex: none; }
.bait-chips .chip .bi small { font-size: .78em; }
.carry-note {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12.5px; color: var(--muted); padding: 8px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--brown) 10%, var(--paper-2)); border: 1px dashed color-mix(in srgb, var(--brown) 40%, transparent);
}
.carry-note .bi small { display: block; margin-left: 0; }
.carry-note .link-btn { flex: none; }
/* 没照片时把拍照框压扁，鱼种和饵一屏就能看到 */
.photo-box:not(.has) { aspect-ratio: auto; height: 150px; }
.photo-box:not(.has) .photo-empty { gap: 8px; }
.photo-box:not(.has) .photo-empty > svg { display: none; }

/* ---------- 好友 ---------- */
.fab-friends {
  position: absolute; right: 14px; bottom: calc(206px + env(safe-area-inset-bottom)); z-index: 500;
  width: 46px; height: 46px; border-radius: 50%; font-size: 21px; line-height: 1;
  border: 1px solid var(--line); background: var(--paper-2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); cursor: pointer; filter: grayscale(1); opacity: .75;
}
.fab-friends.on { filter: none; opacity: 1; border-color: var(--brown); box-shadow: 0 0 0 2px var(--brown), var(--shadow); }
.bag-mode { margin-bottom: 2px; }
.bag-mode button { font-size: 14px; }
.share-seg button { font-size: 12.5px; padding: 8px 2px; }
.share-seg button .bi small { display: none; }
.share-hint { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.share-chip { color: var(--muted); }
.share-chip .bi small { display: none; }

.fr-code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 12px; }
.fr-code-row .lbl { font-family: var(--type); font-size: 11px; color: var(--muted); }
.fr-code { font-family: var(--type); font-size: 28px; letter-spacing: 5px; color: var(--brown); line-height: 1.2; }
.fr-add { display: flex; gap: 8px; margin-bottom: 12px; }
.fr-add .input { flex: 1; font-family: var(--type); letter-spacing: 2px; text-transform: uppercase; }
.fr-add .input::placeholder { letter-spacing: 0; text-transform: none; }
.fr-list { display: flex; flex-direction: column; gap: 6px; }
.fr-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px dashed var(--line); }
.fr-row:last-child { border: 0; }
.fr-row b { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-av, .fr-who {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--brown); color: var(--brown); background: var(--paper-2); font-family: var(--hand); font-size: 15px;
}
.fr-n { font-family: var(--type); font-size: 12px; color: var(--muted); }
.fr-rm { width: 30px; height: 30px; font-size: 13px; color: var(--muted); }

.friend-card .bag-top { justify-content: flex-end; gap: 2px; padding-left: 26px; }
.friend-card .fr-who { position: absolute; left: 0; top: -3px; width: 24px; height: 24px; font-size: 12px; border-width: 1.5px; }
.friend-card .bag-foot { width: 100%; justify-content: space-between; padding: 0 4px; }
.fr-by { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fr-like { white-space: nowrap; }
.fr-like.on { color: #d23c3c; }

.fr-owner { font-size: 13px; color: var(--muted); margin-top: 6px; }
.fr-owner .bi small { margin-left: 6px; }
.like-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.like-btn { flex: none; }
.like-btn.on { color: #d23c3c; border-color: color-mix(in srgb, #d23c3c 45%, var(--line)); background: color-mix(in srgb, #d23c3c 8%, var(--paper-2)); }
.likers { font-size: 12.5px; color: var(--muted); min-width: 0; }
.likes-line { text-align: center; font-size: 12.5px; color: #d23c3c; margin-top: 10px; }

.spot.friend { border-style: dashed; }
.spot.friend .who {
  position: absolute; left: -7px; bottom: -6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper-2); color: var(--brown); border: 1.5px solid var(--brown);
  font-family: var(--hand); font-size: 11px; line-height: 15px; text-align: center;
}
.spot.fuzzy { opacity: .9; }
.popup-by { font-size: 12px; color: var(--muted); margin: -2px 0 6px; }

/* ---------- 分享卡片 ---------- */
.share-card { padding: 16px 16px 14px; }
.share-img { display: block; width: 100%; border-radius: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.share-wait { padding: 80px 0; text-align: center; color: var(--muted); }
.share-card .gotcha-actions { flex-wrap: wrap; }
.share-card a.btn { text-decoration: none; color: inherit; }
.share-card a.btn.primary { color: #fff; }

/* ---------- 地区图鉴册 ---------- */
.books { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.books::-webkit-scrollbar { display: none; }
.book {
  flex: none; width: 128px; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 9px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px;
}
.book.on { border-color: var(--brown); box-shadow: 0 0 0 1.5px var(--brown); }
.book.done { background: linear-gradient(135deg, #fff4cf, #f6d77a); border-color: #e9b949; }
.book-flag { font-size: 16px; line-height: 1; }
.book-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-name .bi small { display: block; margin: 0; font-weight: 400; font-size: 10px; }
.book-num { font-family: var(--type); font-size: 11px; color: var(--muted); }
.book-num b { font-size: 15px; color: var(--brown); font-weight: 400; }
.book-bar { position: relative; height: 6px; border-radius: 3px; background: var(--paper-3); overflow: hidden; }
.book-bar i { display: block; height: 100%; background: var(--brown); border-radius: 3px; }
.book-bar em { position: absolute; top: 0; bottom: 0; width: 1.5px; background: var(--paper-2); }

/* ---------- 季节活动 ---------- */
.event-box { position: absolute; top: 42px; left: 50%; transform: translateX(-50%); z-index: 500; }
.event-banner {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; cursor: pointer; font: inherit; color: var(--ink);
  background: color-mix(in srgb, var(--paper-2) 94%, transparent); border: 1.5px solid var(--brown); border-radius: 18px;
  box-shadow: var(--shadow); text-align: left; white-space: nowrap;
}
.eb-icon { font-size: 22px; }
.eb-text { display: flex; flex-direction: column; }
.eb-text b { font-family: var(--hand); font-weight: 400; font-size: 15px; color: var(--brown); line-height: 1.2; }
.eb-text b .bi small { font-family: var(--type); font-size: 10px; color: var(--muted); }
.eb-text small { font-size: 10.5px; color: var(--muted); }
.event-card { padding: 10px; }
.event-card .event-banner { width: 100%; box-shadow: none; border-width: 1px; white-space: normal; }
.event-stamps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.event-stamp { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.event-stamp small { font-family: var(--type); font-size: 10px; color: var(--muted); }
.event-detail .medal-big { width: 130px; }
.gotcha-event, .gotcha-crown, .gotcha-buddy { position: relative; margin-top: 8px; font-size: 13px; border-radius: 12px; padding: 7px 12px; }
.gotcha-event { background: color-mix(in srgb, var(--brown) 12%, var(--paper-2)); color: var(--brown); }
.gotcha-crown { background: linear-gradient(90deg, #f6d77a, #e9b949); color: #5a3e0a; font-weight: 600; }
.gotcha-buddy { background: color-mix(in srgb, #d23c3c 8%, var(--paper-2)); color: #b3403a; }
.gotcha-buddy b { display: block; font-size: 14px; }

/* ---------- 钓伴 ---------- */
.buddy-card { padding: 12px 14px; }
.buddy-row { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; padding: 0; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.buddy-row.empty { cursor: default; font-size: 13px; color: var(--muted); }
.buddy-av {
  flex: none; width: 58px; height: 58px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.15);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: radial-gradient(circle, color-mix(in srgb, var(--sc, #ccc) 20%, #fff), color-mix(in srgb, var(--sc, #ccc) 50%, #fff));
}
.buddy-av img { width: 100%; height: 100%; object-fit: cover; }
.buddy-av svg { width: 70%; }
.buddy-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.buddy-main small { font-size: 11px; color: var(--muted); }
.buddy-main b { font-family: var(--hand); font-weight: 400; font-size: 19px; color: var(--brown); }
.buddy-lv { font-size: 12px; }
.buddy-lv i, .fr-lv i, .fr-bond i, .buddy-banner i { font-style: normal; color: #d23c3c; letter-spacing: 1px; }
.buddy-next { font-size: 11px; color: var(--muted); }
.buddy-banner { margin-top: 10px; border-radius: 12px; padding: 7px 12px; font-size: 13px; background: color-mix(in srgb, #d23c3c 7%, var(--paper-2)); }
.btn.on-buddy { border-color: #d23c3c; color: #b3403a; }

/* ---------- 好友等级 / 水域霸主 ---------- */
.fr-who-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fr-who-main b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-lv { font-size: 11px; color: var(--muted); }
.fr-lv .bi small { display: none; }
.fr-bond { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.crown-line { font-size: 12.5px; margin: -4px 0 10px; color: #8a5a00; }
.crown {
  position: relative; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35));
}
.crown b {
  position: absolute; bottom: 0; right: -2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper-2); border: 1.5px solid #e9b949; color: #8a5a00; font-family: var(--hand); font-weight: 400; font-size: 11px; line-height: 15px; text-align: center;
}
.crown.mine b { background: #e9b949; color: #fff; }
.crown-list .rank { width: 26px; text-align: center; font-family: var(--type); flex: none; }
#view-map.popup-open .map-hint, #view-map.popup-open .event-box { display: none; }

/* 像 App 一样：双击不放大（地图照样可以两指缩放） */
html, body { touch-action: manipulation; }
/* 头像上的等级：写成「Lv1」的小标签，不再像未读消息的红点 */
.lv-chip {
  top: -7px; right: -14px; min-width: 0; height: 18px; padding: 0 6px 0 5px; border-radius: 6px;
  background: var(--paper-2); color: var(--brown); border: 1.5px solid var(--brown);
  font-size: 11px; line-height: 15px; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.lv-chip::before { content: 'Lv'; font-size: 9px; margin-right: 1px; }

/* ---------- 头像 ---------- */
.av {
  --ring: var(--brown);
  position: relative; display: inline-flex; flex: none; width: 40px; height: 40px; border-radius: 50%;
  padding: 2.5px; background: var(--ring); box-sizing: border-box; vertical-align: middle;
}
.av-in {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--avbg, var(--paper-2)); border: 1.5px solid var(--paper-2); box-sizing: border-box;
}
.av-in img { width: 100%; height: 100%; object-fit: cover; }
.av-letter { font-family: var(--hand); color: var(--brown); font-size: 1.15em; line-height: 1; }
.av[style*="--avbg:#"] .av-in.letter .av-letter { color: #fff; }
.av-emoji { font-size: 1.3em; line-height: 1; }
.av.frame-ocean { --ring: linear-gradient(135deg, #2f6f8f, #7ab8d6); }
.av.frame-silver { --ring: linear-gradient(135deg, #eef1f4, #8f98a3 45%, #eef1f4 55%, #8f98a3); }
.av.frame-gold { --ring: linear-gradient(135deg, #f7dc7d, #b8862b 45%, #f7dc7d 55%, #b8862b); }
.av.frame-rainbow { --ring: conic-gradient(#e0574f, #e9b949, #7fb069, #4a8fd8, #8d6cab, #e0574f); }
.av.frame-crown { --ring: linear-gradient(135deg, #f7dc7d, #b8862b); }
.av.frame-crown::after { content: '👑'; position: absolute; top: -0.55em; right: -0.2em; font-size: .75em; transform: rotate(18deg); }
.av.frame-puzzle { --ring: conic-gradient(#2f6f8f 0 25%, #5f8a3a 0 50%, #c27a3a 0 75%, #8b6d3f 0); }
.av.frame-event { --ring: repeating-conic-gradient(#b5562b 0 12deg, #e9b949 12deg 24deg); }
.av.tiny { width: 100%; height: 100%; padding: 1.5px; font-size: 11px; }
.av.tiny .av-in { border-width: 1px; }
.av.row { width: 36px; height: 36px; font-size: 15px; }
.av.mini { width: 46px; height: 46px; font-size: 18px; }
.av.big { width: 96px; height: 96px; padding: 4px; font-size: 38px; }
.av.big .av-in { border-width: 2.5px; }

/* 顶栏左上角的头像按钮 */
.trainer-btn { border: 0; background: none; padding: 0; box-shadow: none; }
.trainer-btn #meInitial { display: flex; width: 100%; height: 100%; }
.trainer-btn .av { width: 100%; height: 100%; font-size: 17px; box-shadow: var(--shadow); }

/* 钓鱼证上的大头像 */
.license .lic-top { display: flex; align-items: flex-start; gap: 12px; }
.lic-fields { flex: 1; min-width: 0; }
.lic-av { position: relative; flex: none; margin-top: 2px; border: 0; background: none; padding: 0; cursor: pointer; }
.lic-av .av.big { width: 76px; height: 76px; font-size: 30px; }
.lic-av i {
  position: absolute; right: -2px; bottom: 0; width: 24px; height: 24px; border-radius: 50%; font-style: normal; font-size: 12px; line-height: 22px;
  background: var(--paper-2); border: 1px solid var(--line); color: var(--brown); box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

/* 头像编辑 */
.av-editor { text-align: center; }
.av-preview { margin: 4px 0 14px; }
.av-preview .av.big { width: 112px; height: 112px; font-size: 46px; }
.av-tabs { margin-bottom: 12px; }
.av-tabs button { font-size: 13px; }
.av-tabs .bi small { display: none; }
.av-photo-actions { display: flex; gap: 8px; justify-content: center; margin-bottom: 6px; }
.av-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-bottom: 10px; }
.av-emoji-grid button { border: 1.5px solid transparent; background: var(--paper-2); border-radius: 10px; font-size: 20px; padding: 4px 0; cursor: pointer; }
.av-emoji-grid button.on { border-color: var(--brown); background: color-mix(in srgb, var(--brown) 12%, var(--paper-2)); }
.av-colors { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; justify-items: center; }
.av-colors button { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid var(--paper-2); background: var(--c); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.av-colors button.on { box-shadow: 0 0 0 2.5px var(--brown); }
.frame-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 4px; }
.frame-opt { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 1.5px solid transparent; border-radius: 12px; background: none; padding: 6px 2px; cursor: pointer; font: inherit; color: var(--ink); min-width: 0; }
.frame-opt.on { border-color: var(--brown); background: color-mix(in srgb, var(--brown) 10%, var(--paper-2)); }
.frame-opt.locked { opacity: .45; cursor: default; }
.frame-opt b { font-size: 11.5px; font-weight: 600; }
.frame-opt b .bi small { display: none; }
.frame-opt small { font-size: 9.5px; color: var(--muted); line-height: 1.25; }
.frame-opt small .bi small { display: none; }

/* 好友处的头像 */
.fr-row .av.row { margin-right: 2px; }
.friend-card .fr-who { border: 0; background: none; padding: 0; }
.spot.friend .who { border: 0; background: none; padding: 0; }
.crown b { border: 0; background: none; padding: 0; }
.fr-chip { display: inline-flex; align-items: center; gap: 6px; }
.fr-chip .av.tiny { width: 22px; height: 22px; }

/* ---------- 本周钓鱼（两种外观都有） ---------- */
.week-card h3 { margin-bottom: 8px; }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; }
.wb { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wb b { font-family: var(--type); font-weight: 400; font-size: 13px; min-height: 16px; color: var(--brown); }
.wb-track { position: relative; width: 70%; height: 90px; border-radius: 6px; background: var(--paper-3); overflow: hidden; display: flex; align-items: flex-end; }
.wb-track i { display: block; width: 100%; background: var(--brown); border-radius: 6px 6px 0 0; }
.wb small { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.3; font-family: var(--type); }
.wb.today small { color: var(--brown); font-weight: 700; }
.week-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 13px; }
.theme-h { margin-top: 14px !important; }
#themeSeg button { font-size: 12.5px; }

/* 这些是 Pokémon Sleep 外观才用的 */
.hdr-xp, .scene-banner, .scene-title, .bag-bar { display: none; }

/* =====================================================================
   🌿 Pokémon Sleep 外观（html[data-theme="sleep"]）
   亮绿草地 + 树叶花纹、白色圆角卡片、珊瑚色标题条、圆润粗体字、有厚度的按钮
   ===================================================================== */
html[data-theme="sleep"] {
  --paper: #f3f7f4;
  --paper-2: #ffffff;
  --paper-3: #e9f0eb;
  --ink: #34403a;
  --muted: #8d9892;
  --brown: #2dbf63;        /* 主色：Sleep 的绿 */
  --brown-2: #86e28a;
  --coral: #ff7a5a;
  --coral-dk: #e5603f;
  --sun: #ffcf3a;
  --sky: #3aa8ff;
  --line: #e1e9e3;
  --locked: #c9d3cd;
  --shadow: 0 4px 14px rgba(40, 80, 55, .12);
  --hand: "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --type: "Nunito", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --grain: none;
  --tide: #2a93d5; --tide-2: #a9dcf7; --bite: #ffb13b;
  --topbar-h: 82px;
  --leaf: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='%2399f094'%3E%3Cpath d='M14 34c2-12 12-19 24-18-2 12-12 19-24 18z'/%3E%3Cpath d='M58 84c2-12 12-19 24-18-2 12-12 19-24 18z'/%3E%3Cpath d='M62 22c8-8 20-8 26 0-8 8-20 8-26 0z'/%3E%3Cpath d='M10 74c8-8 20-8 26 0-8 8-20 8-26 0z'/%3E%3C/g%3E%3Cg stroke='%236ad86a' stroke-width='1.6' fill='none' stroke-linecap='round'%3E%3Cpath d='M16 32l20-14M60 82l20-14M64 22h22M12 74h22'/%3E%3C/g%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  html[data-theme="sleep"] {
    --paper: #13201a; --paper-2: #1d2c24; --paper-3: #26382e; --ink: #eaf3ec; --muted: #9db0a4;
    --line: #2d4136; --locked: #3c5044; --shadow: 0 4px 14px rgba(0,0,0,.45);
  }
}
html[data-theme="sleep"] body { background: var(--paper); font-family: var(--type); }
html[data-theme="sleep"] .bi small { font-weight: 700; }

/* 顶栏：白色圆角长条 + 左边奖牌头像 + 黄色经验条 */
html[data-theme="sleep"] .topbar { background: transparent; align-items: flex-start; justify-content: flex-start; padding-left: 82px; padding-top: calc(env(safe-area-inset-top) + 16px); }
html[data-theme="sleep"] .topbar::before {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; top: calc(env(safe-area-inset-top) + 8px);
  background: var(--paper-2); border-radius: 22px; box-shadow: var(--shadow); z-index: -1;
}
html[data-theme="sleep"] .topbar h1 {
  text-align: left; font-family: var(--hand); font-weight: 900; font-size: 21px; letter-spacing: 0; color: var(--ink); margin-top: 0;
}
html[data-theme="sleep"] .topbar h1 .bi small { font-family: var(--type); font-weight: 800; font-size: 12px; letter-spacing: 0; color: var(--muted); }
html[data-theme="sleep"] .subline { font-family: var(--type); font-weight: 800; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
html[data-theme="sleep"] .hdr-xp {
  display: block; position: absolute; left: 82px; right: 28px; bottom: 17px; height: 9px; border-radius: 5px;
  background: #d9f5df; overflow: hidden; box-shadow: inset 0 0 0 1.5px #bfeccb;
}
html[data-theme="sleep"] .hdr-xp i { display: block; height: 100%; background: linear-gradient(90deg, #ffd84d, #ffbf1f); border-radius: 4px; transition: width .6s; }
html[data-theme="sleep"] .trainer-btn {
  left: 10px; top: calc(env(safe-area-inset-top) + 9px); width: 64px; height: 64px; padding: 5px;
  background: linear-gradient(145deg, #ffe27a, #f2b31d); border: 0; border-radius: 50%; box-shadow: 0 4px 10px rgba(180, 120, 0, .3);
}
html[data-theme="sleep"] .trainer-btn #meInitial { display: flex; width: 100%; height: 100%; }
html[data-theme="sleep"] .trainer-btn .av { width: 100%; height: 100%; }
html[data-theme="sleep"] .lv-chip {
  top: auto; bottom: -2px; right: -4px; background: var(--paper-2); color: var(--brown); border: 2px solid var(--brown);
  font-family: var(--type); font-weight: 900; border-radius: 9px;
}
html[data-theme="sleep"] .sync-dot { right: auto; left: 2px; bottom: 2px; border-color: #fff; }

/* 底栏：白色，上面一条绿线；中间珊瑚色相机 */
html[data-theme="sleep"] .tabbar {
  left: 0; right: 0; bottom: 0; height: calc(62px + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
  border: 0; border-top: 4px solid var(--brown); border-radius: 0; background: var(--paper-2); box-shadow: 0 -4px 14px rgba(40, 80, 55, .08);
}
html[data-theme="sleep"] .tab { font-weight: 800; color: #9aa59f; }
html[data-theme="sleep"] .tab .bi small { font-family: var(--type); font-weight: 700; }
html[data-theme="sleep"] .tab.active { color: var(--coral); }
html[data-theme="sleep"] .tab.active svg { stroke-width: 2.2; }
html[data-theme="sleep"] .tab-add {
  margin-top: -30px; width: 62px; height: 62px; border: 5px solid var(--paper-2); background: var(--coral);
  box-shadow: 0 5px 0 var(--coral-dk), 0 8px 18px rgba(229, 96, 63, .35);
}

/* 按钮：胶囊形，底下一层“厚度” */
html[data-theme="sleep"] .btn {
  border: 0; background: var(--paper-2); color: var(--ink); font-weight: 800; font-family: var(--type);
  box-shadow: 0 3px 0 #d3ddd6, 0 4px 12px rgba(40, 80, 55, .08);
}
html[data-theme="sleep"] .btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #d3ddd6; }
html[data-theme="sleep"] .btn.primary { background: var(--brown); color: #fff; box-shadow: 0 4px 0 #1f9a4c, 0 6px 14px rgba(45, 191, 99, .3); }
html[data-theme="sleep"] .btn.danger { background: #fff1ed; color: var(--coral-dk); box-shadow: 0 3px 0 #f3cfc5; }
html[data-theme="sleep"] .icon-btn { border: 0; background: var(--paper-2); box-shadow: 0 3px 0 #d3ddd6, 0 3px 10px rgba(40, 80, 55, .1); }
html[data-theme="sleep"] .chip { border: 0; background: var(--paper-2); color: var(--ink); font-weight: 800; box-shadow: 0 2px 0 #d3ddd6; }
html[data-theme="sleep"] .chip.active { background: var(--brown); color: #fff; box-shadow: 0 2px 0 #1f9a4c; }
html[data-theme="sleep"] .seg { background: var(--paper-3); }
html[data-theme="sleep"] .seg button { font-weight: 800; }
html[data-theme="sleep"] .seg button.on { background: var(--paper-2); color: var(--brown); box-shadow: 0 2px 0 #d3ddd6; }
html[data-theme="sleep"] .link-btn { color: var(--brown); font-weight: 800; }
html[data-theme="sleep"] .input, html[data-theme="sleep"] .unit-input, html[data-theme="sleep"] .search {
  border: 2px solid var(--line); border-radius: 14px; background: var(--paper-2);
}
html[data-theme="sleep"] .toast { background: #34403a; color: #fff; border-radius: 16px; font-weight: 700; }

/* 卡片：白底 + 彩色描边（像主选单那一格一格） */
html[data-theme="sleep"] .card { background: var(--paper-2); border: 2px solid #bfe9cc; border-radius: 18px; box-shadow: 0 3px 0 #e2efe6; }
html[data-theme="sleep"] .me-pane > .card:nth-of-type(3n+1) { border-color: #ffc59f; box-shadow: 0 3px 0 #ffe3d0; }
html[data-theme="sleep"] .me-pane > .card:nth-of-type(3n+2) { border-color: #a9d6ff; box-shadow: 0 3px 0 #d8ecff; }
html[data-theme="sleep"] .card h3 { font-weight: 900; font-size: 16px; }
html[data-theme="sleep"] .card p { color: var(--muted); }
html[data-theme="sleep"] .sec { border-left: 6px solid var(--brown); padding-left: 10px; font-weight: 900; }
html[data-theme="sleep"] .sec .bi small { font-weight: 700; }

/* 背包 / 图鉴顶上：绿色树叶横幅 + 标题 + 数量胶囊 */
html[data-theme="sleep"] .scene-banner {
  display: flex; align-items: center; justify-content: center; height: 150px; margin-top: 6px;
  background: #7ce87a var(--leaf); background-size: 96px 96px;
}
html[data-theme="sleep"] .scene-icon {
  width: 96px; height: 96px; border-radius: 28px; background: var(--paper-2); display: flex; align-items: center; justify-content: center;
  font-size: 54px; box-shadow: 0 6px 0 #4fc85a, 0 10px 20px rgba(0,0,0,.12); transform: rotate(-4deg);
}
html[data-theme="sleep"] .scene-title { display: flex; align-items: center; gap: 12px; padding: 16px 20px 4px; }
html[data-theme="sleep"] .scene-title > b { font-weight: 900; font-size: 26px; }
html[data-theme="sleep"] .scene-title > b .bi small { font-size: 13px; color: var(--muted); }
html[data-theme="sleep"] .scene-pill {
  background: var(--coral); color: #fff; font-weight: 900; font-size: 15px; padding: 3px 16px; border-radius: 999px;
  box-shadow: 0 3px 0 var(--coral-dk);
}
html[data-theme="sleep"] .dex-head { background: var(--paper); }
html[data-theme="sleep"] .progress { border: 2px solid #bfe9cc; border-radius: 18px; }
html[data-theme="sleep"] .progress-num { font-family: var(--type); font-weight: 800; }
html[data-theme="sleep"] .progress-num b { color: var(--brown); font-weight: 900; }
html[data-theme="sleep"] .bar { background: #d9f5df; }
html[data-theme="sleep"] .bar-fill { background: linear-gradient(90deg, #ffd84d, #ffbf1f); }
html[data-theme="sleep"] .book { border: 2px solid var(--line); box-shadow: 0 3px 0 #e2efe6; }
html[data-theme="sleep"] .book.on { border-color: var(--brown); box-shadow: 0 3px 0 #1f9a4c; }
html[data-theme="sleep"] .book-num b { color: var(--brown); font-weight: 900; }
html[data-theme="sleep"] .book-bar i { background: var(--brown); }

/* 背包卡片：像宝可梦盒，上面写尺寸（Lv. 的位置），下面一条小能量条 */
html[data-theme="sleep"] .bag-grid { grid-template-columns: repeat(3, 1fr); gap: 0; padding: 4px 10px 20px; }
html[data-theme="sleep"] .bag-card {
  border: 0; border-bottom: 2px solid var(--line); border-radius: 0; background: none; box-shadow: none; padding: 12px 4px 14px;
}
html[data-theme="sleep"] .bag-top { font-family: var(--type); }
html[data-theme="sleep"] .bag-top b { font-weight: 900; font-size: 22px; color: var(--ink); }
html[data-theme="sleep"] .bag-top small { color: var(--brown); font-weight: 900; font-size: 12px; }
html[data-theme="sleep"] .bag-img { background: radial-gradient(circle, #ffffff, #e8f7ec); box-shadow: 0 3px 0 #d3ddd6; }
html[data-theme="sleep"] .bag-name { font-weight: 800; }
html[data-theme="sleep"] .bag-foot { font-family: var(--type); font-weight: 700; }
html[data-theme="sleep"] .bag-bar { display: flex; align-items: center; gap: 4px; width: 80%; }
html[data-theme="sleep"] .bag-bar span { color: var(--brown); font-size: 13px; line-height: 1; }
html[data-theme="sleep"] .bag-bar::after { content: ""; }
html[data-theme="sleep"] .bag-bar i { display: block; height: 6px; border-radius: 3px; background: var(--bc, var(--brown)); box-shadow: 0 0 0 0 transparent; }
html[data-theme="sleep"] .bag-bar.empty i { width: 100%; background: var(--paper-3); }
html[data-theme="sleep"] .fav-dot { color: var(--sun); }

/* 图鉴印章：放在白色圆底上 */
html[data-theme="sleep"] .stamp-tile .cap { font-weight: 800; }
html[data-theme="sleep"] .stamp-tile .badge { background: var(--coral); font-family: var(--type); font-weight: 900; box-shadow: 0 2px 0 var(--coral-dk); }

/* 地图上的提示 / 按钮 */
html[data-theme="sleep"] .map-hint { background: var(--paper-2); border: 0; font-weight: 800; box-shadow: var(--shadow); }
html[data-theme="sleep"] .fab-locate, html[data-theme="sleep"] .fab-tide, html[data-theme="sleep"] .fab-friends {
  border: 0; background: var(--paper-2); box-shadow: 0 4px 0 #d3ddd6, 0 6px 14px rgba(40, 80, 55, .15);
}
html[data-theme="sleep"] .event-banner { border: 2px solid var(--coral); border-radius: 18px; box-shadow: 0 3px 0 #ffd6c9, var(--shadow); }
html[data-theme="sleep"] .eb-text b { font-family: var(--hand); font-weight: 900; color: var(--coral-dk); }
html[data-theme="sleep"] .pin { background: var(--coral); }
html[data-theme="sleep"] .popup-place { font-family: var(--hand); font-weight: 900; color: var(--ink); }
html[data-theme="sleep"] .leaflet-popup-content-wrapper { border-radius: 18px; }

/* 日历 */
html[data-theme="sleep"] .cal-card { border: 2px solid #a9d6ff; border-radius: 20px; box-shadow: 0 3px 0 #d8ecff; }
html[data-theme="sleep"] .cal-title { font-family: var(--type); font-weight: 900; letter-spacing: 0; }
html[data-theme="sleep"] .cal-day { font-family: var(--type); font-weight: 800; }
html[data-theme="sleep"] .cal-day.today { box-shadow: inset 0 0 0 2px var(--coral); }
html[data-theme="sleep"] .cal-day.selected { background: #dff7e6; }
html[data-theme="sleep"] .day-panel h2 { font-weight: 900; }
html[data-theme="sleep"] .tide-entry { border: 2px solid #a9d6ff; box-shadow: 0 3px 0 #d8ecff; }

/* 钓鱼证 */
html[data-theme="sleep"] .license { background: var(--paper-2); border: 2px solid #ffd27a; box-shadow: 0 4px 0 #ffe9b8, var(--shadow); }
html[data-theme="sleep"] .license .lbl { font-family: var(--type); font-weight: 800; }
html[data-theme="sleep"] .license .val { font-family: var(--type); font-weight: 900; }
html[data-theme="sleep"] .stats b { font-family: var(--type); font-weight: 900; color: var(--ink); }
html[data-theme="sleep"] .mrz { display: none; }
html[data-theme="sleep"] .level-title, html[data-theme="sleep"] .buddy-main b { font-family: var(--hand); font-weight: 900; color: var(--ink); }
html[data-theme="sleep"] .lv-badge { font-family: var(--type); font-weight: 900; color: var(--brown); }
html[data-theme="sleep"] .level-ring { background: radial-gradient(closest-side, var(--paper-2) 78%, transparent 80% 100%), conic-gradient(var(--sun) calc(var(--p) * 1%), #d9f5df 0); }
html[data-theme="sleep"] .level-bar { background: #d9f5df; }
html[data-theme="sleep"] .level-bar i { background: linear-gradient(90deg, #ffd84d, #ffbf1f); }
html[data-theme="sleep"] .level-nums, html[data-theme="sleep"] .medal-num, html[data-theme="sleep"] .medal-count { font-family: var(--type); font-weight: 800; }
html[data-theme="sleep"] .fr-code { font-family: var(--type); font-weight: 900; color: var(--coral); }

/* 本周钓鱼：蓝色大卡片 + 青色柱子（像睡眠柱状图） */
html[data-theme="sleep"] .week-card { background: linear-gradient(160deg, #46b4ff, #2f8cff); border: 0; box-shadow: 0 5px 0 #2173d9, var(--shadow); color: #fff; }
html[data-theme="sleep"] .week-card h3 { color: #fff; }
html[data-theme="sleep"] .week-card h3 .bi small { color: #d8f0ff; }
html[data-theme="sleep"] .wb b { color: #b9f7ff; font-weight: 900; font-family: var(--type); font-size: 14px; }
html[data-theme="sleep"] .wb-track { background: rgba(255,255,255,.12); height: 110px; }
html[data-theme="sleep"] .wb-track i { background: #7af6ff; }
html[data-theme="sleep"] .wb small { color: #fff; font-weight: 900; }
html[data-theme="sleep"] .wb.today small { color: #fffb9e; }
html[data-theme="sleep"] .week-foot { color: #fff; font-weight: 800; }
html[data-theme="sleep"] .week-foot .bi small { color: #d8f0ff; }
html[data-theme="sleep"] .week-card .btn.primary { background: #fff; color: #2f8cff; box-shadow: 0 3px 0 #1f6fd0; }

/* 每条鱼的页面：绿色树叶背景 */
html[data-theme="sleep"] .page { background: var(--paper); }
html[data-theme="sleep"] .fp-top { background: #7ce87a var(--leaf); background-size: 96px 96px; }
html[data-theme="sleep"] .hero { background: #7ce87a var(--leaf); background-size: 96px 96px; }
html[data-theme="sleep"] .fp-cp { text-shadow: 0 2px 0 rgba(0,0,0,.18); }
html[data-theme="sleep"] .fp-cp b { font-family: var(--type); font-weight: 900; }
html[data-theme="sleep"] .fp-cp small, html[data-theme="sleep"] .fp-cp span { font-family: var(--type); font-weight: 800; }
html[data-theme="sleep"] .arc-bg { stroke: rgba(255,255,255,.45); }
html[data-theme="sleep"] .fp-model { border-color: #fff; box-shadow: 0 8px 0 #4fc85a, 0 14px 26px rgba(0,0,0,.18); background: #fff; }
html[data-theme="sleep"] .fp-no { font-family: var(--type); font-weight: 900; background: #fff; box-shadow: 0 2px 0 #d3ddd6; }
html[data-theme="sleep"] .sheet-card { background: var(--paper-2); }
html[data-theme="sleep"] .big-name { font-family: var(--hand); font-weight: 900; letter-spacing: 0; }
html[data-theme="sleep"] .sub-name { font-family: var(--type); font-weight: 700; }
html[data-theme="sleep"] .stat3 b { font-family: var(--type); font-weight: 900; }
html[data-theme="sleep"] .size-badge { font-family: var(--type); font-weight: 900; border-radius: 7px; }
html[data-theme="sleep"] .chip-static { border: 0; background: var(--paper-3); font-weight: 700; }
html[data-theme="sleep"] .cv-note { background: var(--paper-3); }
html[data-theme="sleep"] .caught-line { font-weight: 700; }
html[data-theme="sleep"] .catch-row { border: 2px solid var(--line); background: var(--paper-2); }
html[data-theme="sleep"] .cpill { border: 2px solid var(--line); }

/* 记录表单：底部弹出，标题用珊瑚色斜角条 */
html[data-theme="sleep"] .overlay .sheet { background: var(--paper); }
html[data-theme="sleep"] .sheet-head h2 {
  font-family: var(--hand); font-weight: 900; font-size: 18px; letter-spacing: 0; color: #fff;
  background: var(--coral); padding: 6px 22px 6px 16px; border-radius: 10px; transform: skewX(-8deg); box-shadow: 0 3px 0 var(--coral-dk);
}
html[data-theme="sleep"] .sheet-head h2 .bi small { color: #ffe6de; font-family: var(--type); }
html[data-theme="sleep"] .sheet-foot { background: var(--coral); border-top: 0; }
html[data-theme="sleep"] .sheet-foot .btn.primary { background: #fff; color: var(--coral-dk); box-shadow: 0 4px 0 #d9d9d9; }
html[data-theme="sleep"] .sheet-foot .btn.danger { background: rgba(255,255,255,.2); color: #fff; box-shadow: none; }
html[data-theme="sleep"] .photo-box { border: 2px dashed #bfe9cc; background: var(--paper-2); }
html[data-theme="sleep"] .sp-chip { border: 2px solid var(--line); background: var(--paper-2); }
html[data-theme="sleep"] .sp-chip.on { border-color: var(--brown); background: #e6f9ec; }
html[data-theme="sleep"] .sp-chip.on b { color: #1f9a4c; }
html[data-theme="sleep"] .flabel { font-weight: 800; }

/* 抓到了！ */
html[data-theme="sleep"] .gotcha-card { background: var(--paper-2); }
html[data-theme="sleep"] .gotcha-title { font-family: var(--hand); font-weight: 900; color: var(--coral); letter-spacing: 1px; }
html[data-theme="sleep"] .gotcha-title .bi small { font-family: var(--type); font-weight: 800; }
html[data-theme="sleep"] .gotcha-name { font-weight: 900; }
html[data-theme="sleep"] .gotcha-size, html[data-theme="sleep"] .gotcha-xp b { font-family: var(--type); font-weight: 900; }
html[data-theme="sleep"] .gotcha-xp b { color: var(--brown); }
html[data-theme="sleep"] .gotcha-orb { border-color: #fff; box-shadow: 0 6px 0 #d3ddd6, 0 10px 24px rgba(0,0,0,.18); }
html[data-theme="sleep"] .gotcha-levelup { background: linear-gradient(90deg, #ffc23a, #ff9f2e); }

/* 登录页 */
html[data-theme="sleep"] .auth { background: var(--paper); }
html[data-theme="sleep"] .auth-hero { background: #7ce87a var(--leaf); background-size: 96px 96px; margin: calc(-28px - env(safe-area-inset-top)) -24px 0; padding: calc(env(safe-area-inset-top) + 40px) 24px 30px; border-radius: 0 0 32px 32px; }
html[data-theme="sleep"] .auth-logo { background: #fff; border-radius: 50%; padding: 10px; box-shadow: 0 6px 0 #4fc85a; }
html[data-theme="sleep"] .auth-title { font-family: var(--hand); font-weight: 900; color: #fff; letter-spacing: 2px; text-shadow: 0 3px 0 #3bb24f; }
html[data-theme="sleep"] .auth-sub { font-family: var(--type); font-weight: 900; color: #fff; }
html[data-theme="sleep"] .auth-tag { color: #1c5a2f; font-weight: 700; }
html[data-theme="sleep"] .auth-h { font-family: var(--hand); font-weight: 900; color: var(--ink); letter-spacing: 0; }

/* 潮汐页 */
html[data-theme="sleep"] .tp-bar { background: var(--paper-2); border-bottom: 3px solid var(--brown); }
html[data-theme="sleep"] .tp-bar h2 { font-weight: 900; }
html[data-theme="sleep"] .pg { border: 2px solid var(--line); }
html[data-theme="sleep"] .pg.best { border-color: var(--coral); background: #fff1ed; }

/* ---------- 新手引导 ---------- */
.coach { position: fixed; inset: 0; z-index: 2600; }
.coach-dim { position: absolute; inset: 0; background: rgba(20, 30, 25, .55); animation: fadeIn .2s; }
.coach-hole {
  position: absolute; border-radius: 20px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(20, 30, 25, .55), 0 0 0 3px #fff inset;
  animation: coachPulse 1.4s ease-in-out infinite;
}
@keyframes coachPulse { 50% { box-shadow: 0 0 0 9999px rgba(20, 30, 25, .55), 0 0 0 5px var(--brown) inset; } }
.coach-bubble {
  position: absolute; left: 14px; right: 14px; max-width: 440px; margin: 0 auto;
  background: var(--paper-2); color: var(--ink); border-radius: 22px; padding: 14px 16px 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1);
}
.coach-bubble.center { top: 50%; transform: translateY(-50%); }
.coach-bubble.center { animation: fadeIn .25s; }
.coach-who { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.coach-who .finn { width: 64px; height: 58px; flex: none; animation: bob 2.6s ease-in-out infinite; }
.coach-who b { font-family: var(--hand); font-size: 20px; color: var(--brown); font-weight: 400; }
.coach-who b .bi small { font-family: var(--type); font-size: 12px; color: var(--muted); }
.coach-bubble p { margin: 0 0 12px; font-size: 15px; line-height: 1.6; }
.coach-bubble p .bi small { display: block; margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; }
.coach-foot { display: flex; align-items: center; gap: 12px; }
.coach-dots { flex: 1; display: flex; gap: 5px; }
.coach-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.coach-dots i.on { background: var(--brown); width: 18px; border-radius: 4px; }
.coach-foot .link-btn { font-size: 13px; color: var(--muted); }
html[data-theme="sleep"] .coach-bubble { border: 3px solid var(--brown); box-shadow: 0 5px 0 #1f9a4c, 0 12px 30px rgba(0,0,0,.25); }
html[data-theme="sleep"] .coach-who b { font-weight: 900; }
html[data-theme="sleep"] .coach-bubble p { font-weight: 700; }

/* ---------- 好友消息：红点 / NEW ---------- */
.tab { position: relative; }
.tab-dot, .seg-dot {
  position: absolute; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #e5483b; color: #fff; font-style: normal; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  border: 2px solid var(--paper-2); box-sizing: content-box; pointer-events: none; animation: popIn .35s cubic-bezier(.2, 1.5, .4, 1);
}
.tab-dot { top: 4px; left: 54%; }
.bag-mode { position: relative; }
.seg-dot { top: -6px; right: 6px; }
.friend-card { position: relative; }
.friend-card.is-new { box-shadow: 0 0 0 2px #e5483b; }
.new-tag {
  position: absolute; top: -7px; left: 50%; transform: translateX(-50%); z-index: 2;
  background: #e5483b; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 1px; padding: 1px 8px; border-radius: 8px;
}

/* ---------- 出钓参谋：地图左下角的助手 ---------- */
.adv-float {
  position: absolute; left: 12px; bottom: calc(172px + env(safe-area-inset-bottom)); z-index: 500;
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 90px);
}
.af-av { position: relative; flex: none; padding: 0; border: 0; background: none; cursor: pointer; }
.buddy-av.float { width: 58px; height: 58px; animation: bob 2.8s ease-in-out infinite; }
.finn-av { background: #e4f4fd; overflow: visible; }
.finn-av .finn { width: 82%; height: 82%; }
.af-stars {
  position: absolute; right: -6px; top: -6px; font-style: normal; font-size: 11px; font-weight: 800; line-height: 1;
  background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 3px 5px; box-shadow: var(--shadow);
}
.af-say {
  position: relative; display: flex; align-items: flex-start; background: var(--paper-2); color: var(--ink); border-radius: 14px;
  border: 1px solid var(--line); box-shadow: var(--shadow); max-width: 240px;
}
.af-say::before { content: ""; position: absolute; left: -6px; top: 50%; margin-top: -6px; border: 6px solid transparent; border-left: 0; border-right-color: var(--paper-2); }
.af-text { flex: 1; border: 0; background: none; font: inherit; color: inherit; text-align: left; font-size: 12px; line-height: 1.45; padding: 7px 2px 7px 11px; cursor: pointer; }
.af-x { flex: none; border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 6px 8px; cursor: pointer; }
#view-map.popup-open .adv-float { display: none; }
.buddy-go { margin-left: auto; font-size: 22px; color: var(--muted); }
.buddy-banner { display: block; width: 100%; text-align: left; border: 0; font: inherit; color: inherit; cursor: pointer; }
.buddy-av.row { width: 46px; height: 46px; border-width: 2px; }
.buddy-row.empty { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.bd-h { font-style: normal; color: #d23c3c; letter-spacing: 1px; }

/* ---------- 出钓参谋页 ---------- */
.adv-hero { display: flex; align-items: center; gap: 12px; }
.buddy-av.hero { width: 72px; height: 72px; flex: none; animation: bob 3s ease-in-out infinite; }
.adv-say { position: relative; flex: 1; background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px; padding: 9px 12px; font-size: 13.5px; line-height: 1.5; }
.adv-say small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.adv-say::before { content: ""; position: absolute; left: -7px; top: 50%; margin-top: -7px; border: 7px solid transparent; border-left: 0; border-right-color: var(--line); }
.adv-week { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.adv-day {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 5px; border-radius: 12px; cursor: pointer; font: inherit; color: var(--ink);
  border: 1.5px solid var(--line); background: var(--paper-2);
}
.adv-day small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.adv-day b { font-size: 17px; line-height: 1.1; }
.adv-day span { font-size: 10px; }
.adv-day.s5, .adv-day.s4 { background: color-mix(in srgb, #3fa45b 12%, var(--paper-2)); }
.adv-day.s1 { background: color-mix(in srgb, #d23c3c 8%, var(--paper-2)); }
.adv-day.on { border-color: var(--brown); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brown) 35%, transparent); }
.adv-rate { padding: 14px; }
.adv-rate-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.adv-rate-top small { display: block; font-size: 12px; color: var(--muted); }
.adv-rate-top b { font-size: 22px; }
.adv-rate-top b .bi small { display: inline; font-size: 12px; margin-left: 6px; }
.adv-fish { text-align: right; font-size: 17px; letter-spacing: 1px; }
.adv-fish .muted { opacity: .25; }
.adv-fish small { display: block; font-size: 11px; color: var(--muted); font-family: var(--type); letter-spacing: 0; }
.adv-warn { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, #d23c3c 12%, var(--paper-2)); color: #b3261e; font-size: 13px; font-weight: 700; }
.adv-why { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.adv-why li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; padding-left: 8px; border-left: 3px solid var(--line); }
.adv-why li.good { border-left-color: #3fa45b; }
.adv-why li.bad { border-left-color: #d23c3c; }
.adv-why li > span { flex: none; }
.adv-rate .sec { margin: 14px 0 6px; }
.adv-wins { display: flex; flex-direction: column; gap: 6px; }
.adv-win { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; background: var(--paper); border-radius: 10px; padding: 7px 10px; }
.adv-win b { font-family: var(--type); font-size: 15px; }
.adv-win span { font-size: 12.5px; color: var(--muted); }
.adv-season { display: flex; flex-direction: column; gap: 8px; }
.adv-sp {
  display: flex; gap: 10px; align-items: center; text-align: left; padding: 9px 12px; border-radius: 14px; cursor: pointer; font: inherit; color: var(--ink);
  border: 1px solid var(--line); background: var(--paper-2); border-left: 4px solid var(--sc);
}
.adv-sp-wrap { border-radius: 14px; background: var(--paper-2); border: 1px solid var(--line); border-left: 4px solid var(--sc); overflow: hidden; }
.adv-sp-wrap .adv-sp { width: 100%; border: 0; border-radius: 0; background: none; }
.adv-sp-more { margin-left: auto; flex: none; align-self: center; font-size: 12px; font-weight: 700; color: var(--brown); white-space: nowrap; }
.adv-sp-more .bi small { display: none; }
.adv-how { padding: 0 12px 12px; border-top: 1px dashed var(--line); }
.adv-how-acts { display: flex; gap: 8px; margin-top: 10px; }
.adv-how-acts .btn { flex: 1; padding: 9px 10px; font-size: 13.5px; }
.howto { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.ht-now { font-size: 13px; line-height: 1.5; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, #3fa45b 10%, var(--paper-2)); border: 1px solid color-mix(in srgb, #3fa45b 30%, var(--line)); }
.ht-row { display: flex; gap: 10px; align-items: flex-start; }
.ht-row > span { flex: none; width: 22px; text-align: center; font-size: 17px; line-height: 1.3; }
.ht-row b { font-size: 12.5px; color: var(--muted); }
.ht-row b .bi small { display: inline; margin-left: 4px; }
.ht-row p { margin: 1px 0 0; font-size: 13.5px; line-height: 1.5; }
.ht-mine { padding: 8px 10px; border-radius: 10px; background: var(--paper); }
.sheet-card .howto { padding-top: 0; }
.adv-sp-ic { flex: none; width: 44px; height: 30px; }
.adv-sp-ic svg { width: 100%; height: 100%; }
.adv-sp-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adv-sp-main b { font-size: 14.5px; }
.adv-sp-main small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.adv-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.adv-tags i { font-style: normal; font-size: 10.5px; padding: 1px 7px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); color: var(--muted); }
.adv-tags i.new { background: #fff4cf; border-color: #e9b949; color: #8a6400; }
.adv-tags i.ends { color: #b3261e; }
.adv-buddy { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper-2); font: inherit; color: inherit; cursor: pointer; }
.adv-buddy small { font-size: 12px; color: var(--muted); }
.adv-tip { margin-top: 6px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, #2f6f8f 8%, var(--paper-2)); border: 1px dashed color-mix(in srgb, #2f6f8f 40%, var(--line)); font-size: 13px; }
.adv-tip p { margin: 4px 0 0; line-height: 1.5; }
.fr-buddy { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.fr-buddy i { font-style: normal; color: #d23c3c; }
html[data-theme="sleep"] .adv-day, html[data-theme="sleep"] .adv-sp-wrap, html[data-theme="sleep"] .adv-say, html[data-theme="sleep"] .adv-buddy { border-width: 2px; box-shadow: 0 3px 0 #e2efe6; }
html[data-theme="sleep"] .af-say { border: 2px solid var(--brown); font-weight: 700; }
html[data-theme="sleep"] .adv-day.on { border-color: var(--brown); }

/* ---------- 空军记录 ---------- */
.log-mode { margin-bottom: 12px; }
.log-mode button { font-size: 14px; padding: 9px 0; }
.skunk-only { display: none; }
.skunk-mode .skunk-only { display: block; }
.skunk-mode .fish-only:not(.gift-show), .skunk-mode:not(.gift-mode) .gift-show { display: none !important; }
/* 空军·有人送：空军复盘 + 送的鱼（照片、鱼种、尺寸、谁送的） */
.gift-only { display: none; }
.gift-mode .gift-only { display: block; }
.gift-mode .field.gift-only { display: flex; }
.gift-mode .not-gift { display: none !important; }
.gift-head { margin: 6px 0 -4px; font-size: 13px; letter-spacing: 1px; color: var(--brown); font-weight: 600; }
.gift-tag { display: inline-block; font-size: 11px; padding: 1px 6px; border: 1px solid currentColor; border-radius: 8px; color: var(--muted); margin-left: 4px; vertical-align: 1px; }
.sk-gift { display: flex; gap: 12px; align-items: center; }
.sk-gift img, .sk-gift .noimg { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex: none; cursor: zoom-in; background: var(--paper2, #eee6d6); display: grid; place-items: center; }
.sk-gift .noimg { cursor: default; }
.sk-gift b { display: block; font-size: 18px; }
.sk-gift small { color: var(--muted); }
.skunk-hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: -4px 2px 12px; }
.spot.skunk { background: #eeeae3; border-style: dashed; }
.spot .sk-face { font-size: 18px; line-height: 1; }
.popup-list .noimg.sk { font-size: 20px; }
.popup-rec { font-size: 11.5px; color: var(--muted); margin: -2px 0 6px; }
.popup-rec .bi small { display: none; }
.popup-btns { display: flex; gap: 6px; margin-top: 8px; }
.popup-btns .popup-add { margin-top: 0; flex: 1.3; }
.popup-btns .popup-skunk { flex: 1; }
.cal-day .ring.sk { --c: #9a958c; border-style: dashed; outline: 0; font-weight: 400; }
.skunk-tile {
  grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  padding: 10px 12px; border-radius: 14px; border: 1.5px dashed var(--line); background: var(--paper-2);
}
.skunk-tile .sk-face { font-size: 24px; flex: none; }
img.sk-face { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.skunk-tile small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.adv-rec { font-size: 12.5px; color: var(--muted); margin-top: -4px; }
html[data-theme="sleep"] .spot.skunk { background: #eef3ef; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.seg-wrap button { font-size: 12.5px; padding: 8px 2px; white-space: nowrap; }
.skunk-box { border-top: 1px dashed var(--line); padding-top: 12px; margin-bottom: 4px; }
.day-chart .dc-span { fill: #9a958c; opacity: .18; }
.lg-span { background: #9a958c; opacity: .35; }
.sk-body .card { padding: 14px; }
.sk-hero { display: flex; flex-direction: column; gap: 4px; }
.sk-date { font-size: 20px; font-weight: 700; }
.sk-place, .sk-time { font-size: 14px; }
.sk-rec { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.sk-detail { display: flex; flex-direction: column; gap: 10px; }
.sk-row { display: flex; gap: 10px; align-items: flex-start; }
.sk-row > span { flex: none; width: 22px; text-align: center; font-size: 17px; line-height: 1.4; }
.sk-row small { display: block; font-size: 11.5px; color: var(--muted); }
.sk-row small .bi small { display: inline; margin-left: 4px; }
.sk-row b { font-size: 14px; font-weight: 600; line-height: 1.45; }
.sk-why { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.sk-why i { font-style: normal; font-size: 12.5px; padding: 2px 9px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.skunk-box .field { margin-bottom: 14px; }
.day-chart .dc-slack { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1.2; }
.cur-row { margin-top: 4px; }
.cur-row .hl b { font-size: 13px; }
.skunk-mode .dt-row > .field:first-child { grid-column: 1 / -1; } /* 空军：日期单独一行，开始 | 收竿 并排 */
.skunk-span-hint { font-size: 12px; color: var(--muted); margin: -6px 2px 12px; line-height: 1.45; }
.sk-span { display: flex; flex-direction: column; gap: 9px; margin-bottom: 10px; }
.sk-span-h { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.sk-row b small { font-weight: 400; color: var(--muted); font-size: 12px; }
.skr .skr-ins { list-style: none; padding: 0; margin: 6px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.skr .skr-ins li { font-size: 13px; line-height: 1.5; padding: 7px 10px; border-radius: 10px; background: color-mix(in srgb, #e0a458 12%, var(--paper-2)); }
.cmp { display: flex; flex-direction: column; gap: 6px; }
.cmp-row { display: grid; grid-template-columns: 76px 1fr 64px; gap: 8px; align-items: center; font-size: 12.5px; }
.cmp-row .bl .bi small { display: none; }
.cmp-bars { display: flex; flex-direction: column; gap: 2px; }
.cmp-bars i, .cmp-key i { display: block; height: 6px; border-radius: 3px; min-width: 2px; }
.cmp i.fish, .cmp-key i.fish { background: var(--brown); }
.cmp i.sk, .cmp-key i.sk { background: #9a958c; }
.cmp-row .bn { text-align: right; font-family: var(--type); font-size: 11.5px; }
.cmp-row .bn small { color: var(--muted); }
.cmp-key { display: flex; gap: 14px; justify-content: center; font-size: 11px; color: var(--muted); margin-top: 2px; }
.cmp-key span { display: inline-flex; align-items: center; gap: 5px; }
.cmp-key i { width: 14px; }
.cmp-key .bi small { display: none; }
.skr-list { display: flex; flex-direction: column; gap: 6px; }
/* 你现在的位置 */
.leaflet-interactive.here-dot, path.here-dot { fill: #2f80ed; fill-opacity: 1; stroke: #fff; stroke-width: 3; }
path.here-acc { fill: #2f80ed; fill-opacity: .12; stroke: #2f80ed; stroke-opacity: .3; stroke-width: 1; }
.af-where { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; margin-bottom: 1px; }
.adv-noloc { font-size: 12.5px; line-height: 1.5; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, #e0a458 14%, var(--paper-2)); }
.adv-noloc .link-btn { font-size: 12.5px; }
.app-ver { text-align: center; margin-top: 4px; }
/* 挑钓伴 / 性格 / 回忆 */
.af-col { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.af-pick { border: 1.5px solid var(--brown); background: var(--paper-2); color: var(--brown); font: inherit; font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; box-shadow: var(--shadow); cursor: pointer; }
.pick-card { max-height: 86vh; display: flex; flex-direction: column; gap: 8px; }
.pick-card h2 { margin: 0; }
.pick-grid { overflow-y: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 2px; min-height: 0; flex: 1; }
.pick-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper-2); font: inherit; color: var(--ink); cursor: pointer; text-align: center; }
.pick-item.on { border-color: var(--brown); }
.pick-item b { font-size: 12.5px; line-height: 1.2; }
.pick-item small { font-size: 10.5px; color: var(--muted); }
.pick-item i { font-style: normal; font-size: 10.5px; }
.pick-item i .bi small { display: none; }
.buddy-av.pick { width: 54px; height: 54px; }
.welcome-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.welcome-stage { position: relative; padding: 6px; }
.buddy-av.welcome { width: 110px; height: 110px; animation: pop-in .6s cubic-bezier(.2, 1.6, .4, 1) both, bob 3s ease-in-out .6s infinite; }
.welcome-stage .spark { position: absolute; top: -4px; right: -10px; font-size: 26px; animation: twinkle 1.2s ease-in-out infinite; }
@keyframes pop-in { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes twinkle { 50% { transform: scale(1.35) rotate(15deg); opacity: .6; } }
.persona-tag { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); }
.persona-tag.small { font-size: 10.5px; padding: 1px 7px; font-weight: 600; vertical-align: middle; }
.persona-tag .bi small { display: none; }
.welcome-say { text-align: left; width: 100%; }
.welcome-say::before { display: none; }
.mem-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.mem-list h4 { margin: 4px 0 0; font-size: 13px; }
.mem-row { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper-2); font: inherit; color: var(--ink); font-size: 13px; line-height: 1.45; cursor: pointer; }
.mem-row i { font-style: normal; font-size: 18px; }
.mem-row small { display: block; font-size: 11px; color: var(--muted); }
#advPick.link-btn { margin-top: 6px; }
.skunk-mode .flabel .skunk-only { display: inline; }
.skunk-mode .field.skunk-only { display: flex; }
/* 钓鱼证的三个标签 */
.me-tabs { position: sticky; top: 0; z-index: 5; }
.me-tabs button { position: relative; font-size: 13.5px; }
.me-dot { position: absolute; top: 2px; right: 10%; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #e5483b; color: #fff; font-style: normal; font-size: 10px; font-weight: 800; line-height: 16px; }
.me-pane { display: flex; flex-direction: column; gap: 14px; }
.me-pane[hidden] { display: none; }

/* 老用户不用再看「点地图记钓点」 */
.map-hint.gone { display: none; }
/* 参谋页：今天已经过去的好时段 */
.adv-win.past { opacity: 0.5; }
.adv-win.past em { font-style: normal; font-size: 0.75em; font-weight: 600; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--paper-2, #eee6d8); }
/* 潮汐页：潮汐 / 咬口规律 / 空军复盘 三个标签 */
.tp-tabs { margin: 0; }
.tp-pane { display: flex; flex-direction: column; gap: 10px; }
.tp-pane[hidden] { display: none; }

/* 一次导入多张照片：表单顶上的进度条 */
.batch-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--paper-2); border: 1px dashed var(--line); font-size: 14px; font-weight: 700; }
.batch-bar[hidden] { display: none; }
/* AI 认鱼的建议 */
.ai-sugg { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 8px; }
.ai-sugg[hidden] { display: none; }
.ai-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ai-lbl, .ai-msg { font-size: 13px; color: var(--muted); }
.ai-wait { animation: aiPulse 1.2s ease-in-out infinite; }
@keyframes aiPulse { 50% { opacity: 0.45; } }
.ai-pick small { opacity: 0.7; font-weight: 600; }
.ai-pick.top { border-color: var(--brown); }
.ai-note { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
/* 小地图下面：位置从哪来；没有位置时提醒 */
.loc-note { margin-top: 6px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.loc-note[hidden] { display: none; }
.loc-note.warn { color: var(--brown); background: var(--paper-2); border: 1px dashed var(--line); border-radius: 10px; padding: 7px 10px; }

/* 好友主页 */
.fr-open { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.fr-chip { border: 0; cursor: pointer; font: inherit; color: inherit; }
.pal-body { gap: 12px; }
.pal-hero { display: flex; align-items: center; gap: 14px; }
.pal-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pal-who b { font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-who small { color: var(--muted); font-size: 12px; }
.pal-stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 12px 6px; }
.pal-stats > div { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.pal-stats > div + div { border-left: 1px solid var(--line); }
.pal-stats b { font-family: var(--type); font-weight: 400; font-size: 20px; }
.pal-stats b small { font-size: 11px; margin-left: 2px; color: var(--muted); }
.pal-stats span { font-size: 12px; color: var(--muted); }
.pal-together, .pal-buddy { font-size: 14px; line-height: 1.5; }
.pal-dex { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.pal-dex .chips { gap: 6px; }

/* AI 认鱼：照片上的扫描层 */
.ai-scan { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.ai-scan[hidden] { display: none; }
.ai-scan.loading { background: linear-gradient(180deg, rgba(20, 40, 60, 0.18), rgba(20, 40, 60, 0.05)); }
.ai-beam { position: absolute; left: 0; right: 0; height: 28%; top: -28%; opacity: 0; }
.ai-scan.loading .ai-beam {
  opacity: 1;
  background: linear-gradient(180deg, transparent, rgba(140, 220, 255, 0.35) 70%, rgba(200, 245, 255, 0.9) 98%, transparent);
  box-shadow: 0 6px 18px rgba(140, 220, 255, 0.5);
  animation: aiBeam 1.6s ease-in-out infinite alternate;
}
@keyframes aiBeam { from { top: -28%; } to { top: 100%; } }
.ai-badge {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  max-width: calc(100% - 24px); display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; border: 0; font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #fff; background: rgba(25, 30, 35, 0.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); pointer-events: none;
}
.ai-scan.done .ai-badge { pointer-events: auto; cursor: pointer; background: rgba(160, 112, 63, 0.92); animation: aiIn 0.35s ease-out both, aiPulse2 1.6s ease-in-out 0.4s 2; }
.ai-scan.picked .ai-badge { background: rgba(80, 130, 70, 0.92); animation: aiIn 0.25s ease-out both; }
.ai-scan.none .ai-badge { animation: aiIn 0.3s ease-out both; }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: #8fe3ff; box-shadow: 0 0 0 0 rgba(143, 227, 255, 0.7); animation: aiPing 1.2s infinite; flex: none; }
@keyframes aiPing { 70% { box-shadow: 0 0 0 8px rgba(143, 227, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(143, 227, 255, 0); } }
@keyframes aiIn { from { opacity: 0; transform: translate(-50%, -8px) scale(0.92); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes aiPulse2 { 50% { transform: translate(-50%, 0) scale(1.06); } }
/* 下面那排建议：一个个弹出来，第一名闪一下 */
.ai-pick { animation: aiPop 0.35s ease-out both; animation-delay: calc(var(--i, 0) * 90ms); }
.ai-pick.top { animation: aiPop 0.35s ease-out both, aiGlow 1.4s ease-in-out 0.4s 2; }
@keyframes aiPop { from { opacity: 0; transform: translateY(6px) scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes aiGlow { 50% { box-shadow: 0 0 0 4px rgba(160, 112, 63, 0.25); } }
@media (prefers-reduced-motion: reduce) {
  .ai-scan.loading .ai-beam, .ai-dot, .ai-badge, .ai-pick, .ai-pick.top { animation: none !important; }
  .ai-scan.loading .ai-beam { top: 0; height: 100%; background: rgba(140, 220, 255, 0.12); box-shadow: none; }
}

/* AI 复查 */
#fpAi:empty { display: none; }
#fpAi { margin: 6px 0 2px; }
.rc-btn { width: 100%; }
.rc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.rc-ok { border-color: #9fc49a; }
.rc-diff { border: 1.5px solid var(--brown); align-items: flex-start; }
.rc-wait span { animation: aiPulse 1.2s ease-in-out infinite; }
.rc-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rc-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.rc-thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; cursor: pointer; }
.rc-card { display: flex; flex-direction: column; gap: 10px; }
.rc-prog { display: flex; flex-direction: column; gap: 8px; }
.rc-prog i { display: block; height: 8px; border-radius: 99px; background: var(--paper-3); overflow: hidden; }
.rc-prog i span { display: block; height: 100%; background: var(--brown); transition: width 0.3s; }
.rc-sum { font-weight: 700; }
.rc-list { display: flex; flex-direction: column; gap: 10px; }
.rc-item { display: flex; flex-direction: column; gap: 6px; padding: 10px; }
.rc-item .rc { background: none; border: 0; padding: 0; }
.rc-meta { color: var(--muted); font-size: 12px; }

/* 图鉴：我的收集 / 全部图鉴 */
.dex-mode { margin: 0; }
.dex-top { padding: 6px 16px 4px; display: flex; flex-direction: column; gap: 12px; }
.dex-mode button { font-size: 13.5px; }

/* 足迹图鉴 */
.book.geo { border-style: dashed; }
.book.geo .book-num { font-size: 12px; }
/* 好友：等级、没名字、提醒 */
.lv-tag { font-style: normal; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: var(--brown); color: #fff; vertical-align: 1px; }
.no-name { font-size: 11px; color: var(--muted); font-weight: 400; }
.fr-nudge { flex: none; }
.name-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--paper-2); border: 1px dashed var(--brown); font-size: 13.5px; line-height: 1.45; }
.pal-lv { font-size: 13px; }
.adv-more { display: block; margin: 8px auto 0; }

/* 全屏看照片 */
#fpPhoto, #frPhoto { cursor: zoom-in; }
.viewer { position: fixed; inset: 0; z-index: 9999; background: rgba(0, 0, 0, 0.92); display: flex; align-items: center; justify-content: center; touch-action: none; opacity: 0; transition: opacity 0.18s ease; overscroll-behavior: contain; }
.viewer.in { opacity: 1; }
.viewer.out { opacity: 0; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transform-origin: center center; will-change: transform; }
.viewer-x { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }

/* ---------- 拼图 ---------- */
.pz-mode .dex-head .search, .pz-mode #dexFilter, .pz-mode .books { display: none; }
.pz-mode #dexGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pz-top { grid-column: 1 / -1; }
.pz-sum { font-size: 15px; font-weight: 600; color: var(--ink); margin: 2px 4px; }
.pz-intro { margin: 4px 4px 8px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.pz-cats { flex-wrap: wrap; margin-bottom: 2px; }
.pz-card { background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 16px; padding: 10px 10px 8px; cursor: pointer; min-width: 0; }
.pz-card.open { grid-column: 1 / -1; padding: 14px 14px 12px; cursor: default; }
.pz-card.done { border-color: var(--pc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 22%, transparent); }
.pz-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.pz-head b { font-size: 13px; color: var(--ink); line-height: 1.25; }
.pz-card.open .pz-head b { font-size: 16px; }
.pz-num { font-family: var(--type); font-size: 13px; color: var(--pc); font-weight: 600; white-space: nowrap; }
.pz-bar { height: 4px; border-radius: 3px; background: var(--paper-3); margin: 6px 0 8px; overflow: hidden; }
.pz-bar i { display: block; height: 100%; background: var(--pc); border-radius: 3px; }
.pz-svg { display: block; width: 100%; max-width: 360px; margin: 0 auto; overflow: visible; }
.pz-card.open .pz-piece { cursor: pointer; }
.pz-empty { fill: var(--paper); stroke: color-mix(in srgb, var(--pc) 45%, var(--line)); stroke-width: 1.5; stroke-dasharray: 5 4; }
.pz-edge { fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 2; }
.pz-name { font-size: 11px; text-anchor: middle; fill: var(--muted); font-family: inherit; pointer-events: none; }
.pz-name.on { fill: #fff; font-weight: 600; }
.pz-q { font-size: 26px; opacity: .35; }
.pz-card:not(.open) .pz-name:not(.pz-q) { display: none; }
.pz-piece.got path:first-child { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); }
.pz-foot { margin-top: 10px; text-align: center; font-size: 12.5px; color: var(--muted); }
.pz-card:not(.open) .pz-foot { display: none; }
.pz-card.done .pz-foot { color: var(--pc); font-weight: 600; }

/* 背包里别人送的鱼：虚线边框 + 「送的」 */
.bag-card.gift { border-style: dashed; }
.bag-card.gift .gift-tag { margin-left: 0; }
.bag-giver { font-size: 11px; color: var(--muted); text-align: center; min-height: 14px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
