:root {
  --paper: #f4f1e9;
  --paper-2: #ece7db;
  --card: #fffdf8;
  --ink: #22231f;
  --muted: #7d7a70;
  --line: #ded8c9;
  --green: #2f7d5b;
  --green-dark: #235f45;
  --green-soft: #e7f1ec;
  --shadow: 0 10px 30px rgba(42, 40, 32, 0.08);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  overflow-anchor: none;
}

body {
  min-height: 0;
  background-image: radial-gradient(circle at 18% 0%, #fbf8f0 0%, transparent 45%),
    radial-gradient(circle at 92% 12%, #f0ede3 0%, transparent 40%);
  background-attachment: fixed;
}

/* 页面内容放进固定滚动容器：微信/iOS 底部工具栏改变视口高度时，
   容器 scrollTop 不会像 window 一样被浏览器重算，页面不会突然跳一截。 */
#pageScroll {
  position: fixed;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  overflow-anchor: none;
}

button { font-family: inherit; }

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 241, 233, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 22px 12px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.brand-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  position: relative;
}
.brand-dot::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
}

.tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 2px 2px 4px;
  flex: 1;
  min-width: 0;
}

.tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  padding: 8px 17px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.tab:hover { background: rgba(34, 35, 31, 0.06); }
.tab.active {
  background: var(--ink);
  color: #faf8f2;
  border-color: var(--ink);
}
.tab.period-tab::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  opacity: 0.5;
  transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}
.tab.period-tab.active::before {
  background: currentColor;
  border-color: currentColor;
  opacity: 1;
}
.tab.me-tab {
  border-color: rgba(47, 125, 91, 0.4);
  background: rgba(231, 241, 236, 0.62);
  color: var(--green-dark);
  font-weight: 700;
}
.tab.me-tab:hover {
  background: var(--green-soft);
  border-color: var(--green);
}
.tab.me-tab.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.tab.me-tab::before {
  content: "★";
  font-size: 12px;
  margin-right: 5px;
  opacity: 0.8;
}
.tab.me-tab.active::before { content: "★"; opacity: 1; }

/* ---------------- 标签筛选条 ---------------- */

.tag-bar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px 11px;
}
.tag-bar:empty { display: none; }

.tag-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  overflow: hidden;
  transition: max-height 0.28s ease;
}
.tag-list.open {
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #c7c0af transparent;
}
.tag-list.open::-webkit-scrollbar { width: 5px; }
.tag-list.open::-webkit-scrollbar-thumb {
  background: #c7c0af;
  border-radius: 5px;
}
.tag-toggle {
  appearance: none;
  display: block;
  margin: 6px auto 0;
  padding: 0 14px;
  height: 24px;
  border: 1px solid #d7d0c0;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--green-dark);
  font-size: 12px;
  line-height: 22px;
  cursor: pointer;
  transition: transform 0.24s ease, background 0.16s ease, border-color 0.16s ease;
}
.tag-toggle:hover { border-color: var(--green); background: var(--green-soft); }
.tag-toggle.open {
  position: sticky;
  bottom: 0;
  z-index: 2;
  height: 32px;
  padding: 0 18px;
  line-height: 30px;
  font-weight: 600;
  background: rgba(255, 253, 248, 0.98);
  border-color: var(--green);
  box-shadow: 0 -8px 16px rgba(244, 241, 233, 0.9);
}

.tag-chip {
  appearance: none;
  border: 1px solid #d7d0c0;
  background: rgba(255, 253, 248, 0.78);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.tag-chip:hover {
  border-color: var(--green);
  background: var(--green-soft);
}
.tag-chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.tag-chip .tag-count {
  margin-left: 4px;
  font-size: 10.5px;
  opacity: 0.62;
}
.tag-chip.active .tag-count { opacity: 0.8; }

/* ---------------- 页码 ---------------- */

.pager {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 22px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  row-gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.pager.bottom { padding: 26px 22px calc(60px + env(safe-area-inset-bottom)); }
.pager:empty { display: none; }

.page-btn {
  flex: none;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  transition: 0.16s ease;
}
.page-btn:hover:not(:disabled) { border-color: var(--ink); }
.page-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 600;
}
.page-btn:disabled { opacity: 0.38; cursor: default; }

.page-jump {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.page-jump-input {
  flex: none;
  width: 58px;
  height: 34px;
  padding: 0 8px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink);
  font-size: 13px;
  text-align: center;
}
.page-jump-input:focus {
  outline: none;
  border-color: var(--ink);
}

.page-meta {
  margin: 0 10px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* 手机端页码信息行：左侧侧边栏按钮，中间页码信息保持居中 */
.pager-meta-row {
  position: relative;
  width: 100%;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drawer-open-btn {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 30px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink);
  font-size: 11.5px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.drawer-open-btn:active { border-color: var(--ink); }

.page-gap { flex: none; color: var(--muted); padding: 0 2px; }

/* ---------------- 站点页脚（备案信息） ---------------- */

.site-foot {
  max-width: 1180px;
  margin: 8px auto 0;
  padding: 22px 22px calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--muted);
}
.site-foot-links a {
  color: var(--muted);
  text-decoration: none;
}
.site-foot-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.site-foot-links .sep {
  margin: 0 7px;
  opacity: 0.5;
}
.site-foot-icp {
  margin-top: 3px;
}
.site-foot-icp a {
  color: #5b5c55;
  text-decoration: none;
}
.site-foot-icp a:hover {
  text-decoration: underline;
}

/* ---------------- 画廊 ---------------- */

.gallery-wrap {
  max-width: 1600px;
  margin: 0 auto;
  padding: 4px 8px 8px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 6px;
  align-items: start;
  overflow-anchor: none;
}

.card {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px;
  box-shadow: 0 2px 0 rgba(42, 40, 32, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #cfc7b4;
}
.card.selected {
  border-color: rgba(47, 125, 91, 0.55);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.card.card-leaving {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}
@keyframes cardEnter {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}
.card.card-entering {
  animation: cardEnter 0.28s ease both;
}

.thumb {
  display: block;
  width: 100%;
  aspect-ratio: auto;
  border-radius: 9px;
  overflow: hidden;
  background: #e8e3d8;
  cursor: zoom-in;
  position: relative;
}
.thumb img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.thumb img.is-loaded {
  opacity: 1;
}
.thumb img.is-failed {
  display: none;
}
.thumb.img-failed::after {
  content: "图片加载失败";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: #8c8577;
  font-size: 13px;
  text-align: center;
}

.card-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 1px 1px;
  min-height: 32px;
}

.check {
  appearance: none;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1.6px solid #c8c2b2;
  background: #fffdf8;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.12s ease;
  padding: 0;
  flex: none;
}
.check:hover { border-color: var(--green); }
.check:active { transform: scale(0.9); }
.check svg {
  width: 15px;
  height: 15px;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.14s ease, transform 0.18s cubic-bezier(0.2, 1.4, 0.4, 1);
  stroke: #fff;
}
.check.on {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.14);
}
.check.on svg { opacity: 1; transform: scale(1); stroke: #fff; }

.like {
  appearance: none;
  border: none;
  background: transparent;
  color: #8b877c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 3px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1;
  transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease;
  flex: none;
  margin-left: 10px;
}
.like:hover { background: rgba(254, 44, 85, 0.06); color: #fe2c55; }
.like:active { transform: scale(0.94); }
.like svg { width: 18px; height: 18px; display: block; }
.like .like-count { font-size: 12px; color: #8b877c; }
.like.on { color: #fe2c55; }
.like.on svg path { fill: #fe2c55; stroke: #fe2c55; }
.like.on .like-count { color: #fe2c55; }
.like:disabled { opacity: 0.6; cursor: default; }

.zoom {
  appearance: none;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: #6d6a60;
  cursor: zoom-in;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, color 0.16s ease;
  padding: 0;
  flex: none;
  margin-left: auto;
}
.zoom:hover { background: var(--paper-2); color: var(--ink); }
.zoom svg { width: 18px; height: 18px; }

/* ---------------- 空状态 / 加载 ---------------- */

.state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 90px 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}
.state .big { font-size: 19px; color: var(--ink); margin-bottom: 8px; }

.skeleton {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  aspect-ratio: 4 / 3.35;
}
.skeleton::before {
  content: "";
  display: block;
  width: 100%;
  height: calc(100% - 44px);
  border-radius: 9px;
  background: linear-gradient(100deg, #ece7da 20%, #f5f1e7 40%, #ece7da 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer {
  from { background-position: 120% 0; }
  to { background-position: -80% 0; }
}

/* ---------------- 提交篮悬浮按钮 ---------------- */

.fab {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 60;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(35, 95, 69, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, background 0.18s ease;
}
.fab:hover { transform: translateY(-2px) scale(1.03); background: var(--green-dark); }
.fab:active { transform: scale(0.96); }
.fab svg { width: 27px; height: 27px; }

.fab-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 23px;
  height: 23px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 2px solid var(--paper);
}
.fab-badge.show { display: flex; }

/* ---------------- 弹窗通用 ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(24, 25, 22, 0.46);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: fadeIn 0.18s ease;
}
.overlay.show { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 80vw;
  height: 80vh;
  max-width: 1180px;
  background: var(--paper);
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(20, 20, 16, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.sheet-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.sheet-sub {
  font-size: 12.5px;
  color: var(--muted);
}
.sheet-close {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.16s ease;
  flex: none;
}
.sheet-close:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.sheet-close svg { width: 16px; height: 16px; }

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 22px;
}

.sheet-foot {
  flex: none;
  border-top: 1px solid var(--line);
  padding: 14px 22px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 253, 248, 0.6);
}

.basket-foot {
  display: block;
  padding-top: 12px;
}

.basket-message-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.basket-message {
  display: block;
  width: 100%;
  min-height: 58px;
  max-height: 112px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.basket-message::placeholder { color: #a5a093; }
.basket-message:focus {
  border-color: rgba(47, 125, 91, 0.55);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.basket-foot-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.submission-message {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(47, 125, 91, 0.2);
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sumbit-note {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 11px 24px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.16s ease;
  background: var(--paper-2);
  color: var(--ink);
}
.btn:hover { filter: brightness(0.96); }
.btn.primary {
  background: var(--green);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(47, 125, 91, 0.22);
}
.btn.primary:hover { background: var(--green-dark); }
.btn:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.btn.line {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn.line:hover { background: rgba(34, 35, 31, 0.04); }

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  align-items: start;
}

.pick {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  cursor: zoom-in;
  transition: 0.17s ease;
  position: relative;
}
.pick-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(42, 40, 32, 0.18);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.94);
  color: #5f5b50;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(42, 40, 32, 0.12);
}
.pick-remove:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.pick:hover { border-color: #c9c1ad; box-shadow: 0 8px 20px rgba(42, 40, 32, 0.09); }
.pick img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  background: #e8e3d8;
}
.pick .pick-name {
  font-size: 10.5px;
  color: var(--muted);
  padding: 5px 2px 1px;
  text-align: center;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 70px 20px;
  font-size: 14px;
  line-height: 2;
}
.empty .icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a09b8e;
}

html, body {
  touch-action: pan-y;
}

/* ---------------- 全屏查看 ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(12, 13, 11, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-out;
}
.lightbox.show { display: flex; animation: fadeIn 0.16s ease; }
.lightbox img {
  max-width: 94vw;
  max-height: 94vh;
  object-fit: contain;
  border-radius: 4px;
  background: #11120f;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: zoom-out;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}
.lightbox-peek {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}
.lightbox > #lightboxImg {
  position: relative;
  z-index: 4;
}
.lightbox-report {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 14px;
  z-index: 6;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(30, 32, 28, 0.68);
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  touch-action: manipulation;
  transform: none;
}
.lightbox-report:active { background: rgba(255, 255, 255, 0.22); }

.lightbox-like {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 64px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(30, 32, 28, 0.68);
  color: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  touch-action: manipulation;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.16s ease;
}
.lightbox-actions {
  position: absolute;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transform: translateX(-50%);
}
.lightbox-check {
  appearance: none;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(30, 32, 28, 0.68);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  touch-action: manipulation;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.16s ease;
}
.lightbox-check svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.lightbox-check.on {
  color: #fff;
  border-color: rgba(47, 125, 91, 0.9);
  background: rgba(35, 95, 69, 0.9);
}
.lightbox-check:active { transform: scale(0.94); }
.lightbox-like svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.lightbox-like .like-count {
  min-width: 12px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.lightbox-like.on {
  color: #ff8fa6;
  border-color: rgba(255, 143, 166, 0.65);
  background: rgba(58, 28, 36, 0.74);
}
.lightbox-like.on svg path {
  fill: currentColor;
  stroke: currentColor;
}
.lightbox-like:active { transform: scale(0.96); }

.report-overlay { z-index: 150; }
.report-sheet {
  width: min(430px, 92vw);
  max-height: 88vh;
  background: var(--paper);
  border-radius: 16px;
  box-shadow: 0 26px 70px rgba(20, 20, 16, 0.32);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.report-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.report-title { font-size: 17px; font-weight: 600; letter-spacing: 0.02em; }
.report-sub { margin-top: 4px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.report-body { padding: 14px 20px; overflow-y: auto; }
.report-options { display: flex; flex-direction: column; gap: 8px; }
.report-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.report-option:hover { border-color: rgba(47, 125, 91, 0.45); }
.report-option.active {
  border-color: var(--green);
  background: rgba(231, 241, 236, 0.88);
}
.report-option span { font-size: 14px; font-weight: 600; }
.report-option small { font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.report-detail-wrap { display: block; margin-top: 12px; }
.report-detail-wrap > span { display: block; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.report-detail-wrap textarea {
  width: 100%;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}
.report-detail-wrap textarea:focus { outline: none; border-color: var(--green); }
.report-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
  flex: none;
}
.report-msg { flex: 1; min-height: 16px; font-size: 12px; color: #b44737; }

.lightbox-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  letter-spacing: 0.14em;
}

/* ---------------- 我的页面 ---------------- */

.profile {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px 10px;
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  flex: none;
}
.profile-name { font-size: 20px; font-weight: 600; margin-bottom: 5px; }
.profile-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.profile-actions { margin-left: auto; display: flex; gap: 8px; }

.nickname-editor {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.nickname-editor-head {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.nickname-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nickname-edit-row input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffefa;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
  outline: none;
}
.nickname-edit-row input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 125, 91, 0.08); }
.nickname-edit-row .btn { padding: 9px 15px; }
.nickname-msg {
  min-height: 16px;
  margin-top: 6px;
  font-size: 12px;
  color: #b44737;
}

.me-tabs {
  max-width: 1180px;
  margin: 0 auto;
  padding: 4px 22px 0;
  display: flex;
  gap: 8px;
}
.me-tab-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.16s ease;
}
.me-tab-btn:hover { border-color: #cdc5b2; color: var(--ink); }
.me-tab-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.me-tab-btn .count {
  font-size: 11px;
  opacity: 0.75;
  margin-left: 3px;
}
.me-content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px 40px;
}

.like-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: start;
  padding-top: 14px;
}
.like-card {
  margin: 0;
  padding: 3px;
  cursor: default;
}
.like-card:hover {
  border-color: #cdc5b2;
  box-shadow: 0 8px 22px rgba(42, 40, 32, 0.07);
}
.like-thumb img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 9px;
  background: #e8e3d8;
}
.like-cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 3px 2px;
  font-size: 11.5px;
  color: var(--muted);
}
.like-period {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.like-num {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #fe2c55;
  flex: none;
}
.like-num svg { width: 14px; height: 14px; display: block; }
.like-num svg path { fill: #fe2c55; stroke: #fe2c55; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 30px 2px 14px;
  font-size: 15px;
  font-weight: 600;
}
.section-title .count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.sub-list {
  display: grid;
  gap: 10px;
  padding-bottom: 40px;
}
.sub-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 18px;
  cursor: pointer;
  transition: 0.16s ease;
}
.sub-row:hover { border-color: #cdc5b2; box-shadow: 0 8px 22px rgba(42, 40, 32, 0.07); }
.sub-name {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.sub-time { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sub-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--green-dark);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 5px 12px;
}
.sub-arrow { color: #a6a094; font-size: 18px; padding-left: 4px; }

/* ---------------- 等待 / 入口页 ---------------- */

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gate-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 38px 34px 32px;
  text-align: center;
}
.gate-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--green);
  margin: 0 auto 20px;
}
.gate h1 { font-size: 22px; margin: 0 0 10px; font-weight: 600; letter-spacing: 0.02em; }
.gate p { font-size: 13.5px; color: var(--muted); line-height: 1.9; margin: 0 0 24px; }
.gate .hint { font-size: 12px; color: #999385; line-height: 1.8; }
.gate-info {
  margin: 4px 0 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  text-align: left;
}
.gate-info-row {
  display: flex;
  gap: 12px;
  padding: 5px 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: #625d53;
}
.gate-info-label {
  flex: 0 0 60px;
  color: #9a9488;
}
.gate .subtle-btn {
  margin-top: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.field { text-align: left; margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
}
.field input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 13px 14px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  font-family: inherit;
}
.field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.gate .btn { width: 100%; padding: 13px; font-size: 15px; }

.status-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px dashed #c6bfae;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 22px;
  animation: breathe 2.4s infinite ease-in-out;
}
@keyframes breathe {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 12px);
  background: rgba(28, 29, 25, 0.92);
  color: #fff;
  font-size: 13.5px;
  padding: 11px 20px;
  border-radius: 999px;
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 86vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 手机侧边栏（桌面端隐藏） ---------------- */

.drawer-layer,
.drawer-hint {
  display: none;
}

/* ---------------- 移动端 ---------------- */

@media (max-width: 720px) {
  body { background-attachment: scroll; }
  .topbar-inner { padding: 10px 12px 8px; gap: 10px; }
  .brand { display: none; }
  .tabs { gap: 3px 6px; }
  .tab { padding: 6px 10px; font-size: 13.5px; }
  .tab.period-tab::before {
    width: 7px;
    height: 7px;
    margin-right: 4px;
  }
  .tag-bar { padding: 0 12px 9px; }
  .tag-list { gap: 6px; }
  .tag-toggle { margin-top: 5px; height: 22px; line-height: 20px; }
  .tag-toggle.open { height: 32px; line-height: 30px; padding: 0 16px; }
  .tag-chip { padding: 5px 10px; font-size: 11.5px; }
  .gallery-wrap { padding: 3px 6px 6px; }
  .gallery { gap: 5px 5px; }
  .card { padding: 2px; border-radius: 10px; }
  .thumb { border-radius: 7px; aspect-ratio: auto; }
  .card-bar { padding: 3px 1px 1px; min-height: 30px; gap: 4px; }
  .check { width: 23px; height: 23px; }
  .check svg { width: 13px; height: 13px; }
  .like { gap: 2px; padding: 3px 1px; font-size: 11px; margin-left: 6px; }
  .like svg { width: 16px; height: 16px; }
  .like .like-count { font-size: 11px; }
  .zoom { width: 24px; height: 24px; }
  .zoom svg { width: 16px; height: 16px; }
  .pager { padding: 12px 12px 4px; }
  .pager.bottom { padding: 20px 12px calc(40px + env(safe-area-inset-bottom)); }
  .page-meta { font-size: 11.5px; margin: 0 4px; }
  .page-btn { min-width: 30px; height: 30px; font-size: 12px; padding: 0 8px; }
  .page-jump { width: 100%; justify-content: center; margin-top: 2px; }
  .page-jump-input { width: 56px; height: 30px; font-size: 12px; padding: 0 6px; }
  .page-jump-input:focus { font-size: 16px; }
  .fab { right: 16px; bottom: 18px; width: 52px; height: 52px; }
  .fab svg { width: 24px; height: 24px; }
  .sheet { width: 92vw; height: 84vh; }
  .sheet-head { padding: 14px 16px 12px; }
  .sheet-body { padding: 12px 16px 16px; }
  .sheet-foot { padding: 12px 16px 14px; }
  .grid-4 { gap: 4px; }
  .pick { padding: 2px; border-radius: 8px; }
  .pick-remove { top: 3px; right: 3px; width: 21px; height: 21px; font-size: 14px; }
  .me-tabs { padding: 2px 12px 0; }
  .me-content { padding: 0 12px 30px; }
  .like-grid { gap: 5px; padding-top: 12px; }
  .like-card { padding: 2px; border-radius: 10px; }
  .like-thumb img { border-radius: 7px; }
  .like-cap { padding: 4px 2px 1px; font-size: 10.5px; }
  .profile { padding: 16px 12px 8px; }
  .profile-head { padding: 18px; gap: 12px; flex-wrap: wrap; }
  .profile-actions { margin-left: 0; width: 100%; }
  .profile-actions .btn { flex: 1; }
  .sub-row { padding: 13px 14px; }
  .gate-card { padding: 30px 22px 26px; }
}

/* ---------------- 手机主页侧边栏 ---------------------------- */

@media (max-width: 720px) {
  /* 手机端去掉顶部整排导航；电脑端完全不受影响 */
  .topbar { display: none !important; }
  #pageScroll { touch-action: pan-y; }

  .drawer-layer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    background: rgba(32, 31, 26, 0.18);
    -webkit-backdrop-filter: blur(9px) saturate(0.92);
    backdrop-filter: blur(9px) saturate(0.92);
    transition: opacity 0.28s ease;
    touch-action: none;
  }
  .drawer-layer.is-active { pointer-events: auto; }
  .drawer-layer.dragging { transition: none; }

  .drawer-panel {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 66.6667vw;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border-right: 1px solid rgba(125, 122, 112, 0.22);
    box-shadow: 14px 0 40px rgba(42, 40, 32, 0.16);
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.28s cubic-bezier(0.22, 0.78, 0.32, 1);
    will-change: transform;
    touch-action: none;
  }
  .drawer-layer.dragging .drawer-panel { transition: none; }
  .drawer-panel button {
    -webkit-tap-highlight-color: transparent;
  }

  .drawer-head {
    flex: none;
    padding: max(14px, env(safe-area-inset-top)) 16px 4px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }

  .drawer-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 6px 16px calc(24px + env(safe-area-inset-bottom));
    scrollbar-width: none;
  }
  .drawer-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  .drawer-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    justify-items: center;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid var(--line);
  }

  .drawer-nav-btn {
    appearance: none;
    justify-self: center;
    min-width: 0;
    height: 40px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-size: 15px;
    letter-spacing: 0.04em;
    cursor: pointer;
  }

  .drawer-nav-btn.is-active {
    border-color: rgba(47, 125, 91, 0.28);
    background: var(--green-soft);
    color: var(--green-dark);
    font-weight: 700;
  }

  .drawer-nav-btn[data-kind="me"].is-active::before {
    content: "★";
    display: inline-block;
    margin-right: 4px;
    font-size: 11px;
    vertical-align: 1px;
  }

  .drawer-period-section {
    padding: 8px 0 0;
  }

  .drawer-periods {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 8px;
    overflow: hidden;
    transition: max-height 0.24s ease;
  }

  .drawer-period-btn {
    appearance: none;
    height: 34px;
    min-width: 0;
    padding: 0 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.72);
    color: var(--ink);
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
  }
  .drawer-period-btn::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    border: 1px solid currentColor;
    vertical-align: 1px;
  }
  .drawer-period-btn.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fffdf8;
  }
  .drawer-period-btn.is-active::before { background: #fffdf8; border-color: #fffdf8; }

  .drawer-fold {
    appearance: none;
    display: block;
    width: 100%;
    height: 22px;
    margin: 4px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--green);
    font-size: 14px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.3s ease;
    transform-origin: center;
  }

  .drawer-fold.open {
    transform: rotate(180deg);
  }

  .drawer-tags-section {
    padding: 6px 0 0;
  }

  .drawer-tags {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px 7px;
  }

  .drawer-empty {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 12px;
    padding: 10px 3px;
  }

  .drawer-tag {
    appearance: none;
    min-width: 0;
    min-height: 34px;
    padding: 7px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.72);
    color: var(--ink);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 2px;
    text-align: left;
    cursor: pointer;
  }
  .drawer-tag .drawer-tag-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .drawer-tag .drawer-tag-count {
    margin-left: auto;
    color: var(--muted);
    font-size: 9.5px;
    flex: none;
  }
  .drawer-tag.is-active {
    border-color: rgba(47, 125, 91, 0.45);
    background: var(--green-soft);
    color: var(--green-dark);
  }

  .drawer-hint {
    display: flex;
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 96;
    align-items: center;
    gap: 10px;
    max-width: 82vw;
    padding: 14px 18px 14px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(22, 27, 23, 0.94);
    box-shadow: 0 14px 44px rgba(20, 24, 21, 0.32);
    color: #fffdf8;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.94);
  }
  .drawer-hint-arrow {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(154, 231, 178, 0.18);
    color: #b2f0c5;
    font-size: 23px;
    line-height: 1;
    animation: drawerHintArrow 1.15s ease-in-out infinite;
  }
  .drawer-hint.show {
    animation: drawerHintIn 4.2s cubic-bezier(0.22, 0.78, 0.32, 1) both;
  }
  @keyframes drawerHintIn {
    0% { opacity: 0; transform: translate(-50%, -46%) scale(0.92); }
    10% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    24%, 76% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    88% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -52%) scale(0.98); }
  }
  @keyframes drawerHintArrow {
    0%, 100% { transform: translateX(-2px); }
    50% { transform: translateX(7px); }
  }

  body.drawer-open #pageScroll { overflow-y: hidden; }
}
