/* ===== LENLOC · 小红书风格 ===== */
:root {
  --red: #ff2e4d;
  --red-soft: #fff1f3;
  --ink: #1f1f1f;
  --ink-2: #57575c;
  --ink-3: #9a9aa2;
  --line: #ededf0;
  --bg: #f7f7f8;
  --card: #fff;
  --r-lg: 10px;
  --r-md: 8px;
  --r-pill: 999px;
  --shadow: 0 2px 12px rgba(0, 0, 0, .06);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; }

/* 组件样式里设了 display 的元素（.modal / .modal__nav 等）会盖掉浏览器默认的
   [hidden]{display:none}，导致 hidden 属性失效，这里统一兜底。 */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  flex: none;
}

.logo__mark {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--ink);
}

.logo__mark em {
  font-style: normal;
  color: var(--red);
}

.logo__sub {
  font-size: 13px;
  color: var(--ink-3);
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

/* 搜索框 */
.search {
  position: relative;
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
}

.search input {
  width: 100%;
  height: 40px;
  padding: 0 38px 0 40px;
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  background: #f1f1f3;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: background .2s, border-color .2s;
  -webkit-appearance: none;
}

.search input::-webkit-search-cancel-button { display: none; }

.search input:focus {
  background: #fff;
  border-color: var(--red);
}

.search input::placeholder { color: var(--ink-3); }

.search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.search__clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: #d8d8dd;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  display: none;
  place-items: center;
}

.search.is-filled .search__clear { display: grid; }

.topbar__count {
  flex: none;
  font-size: 13px;
  color: var(--ink-3);
}

.topbar__count b { color: var(--red); font-size: 15px; }

/* 城市筛选 */
.cities {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.city {
  flex: none;
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: #f1f1f3;
  color: var(--ink-2);
  font-size: 14px;
  white-space: nowrap;
  transition: background .18s, color .18s;
}

.city:hover { background: #e7e7ea; }

.city.is-active {
  background: var(--red);
  color: #fff;
  font-weight: 600;
}

.city small {
  opacity: .6;
  margin-left: 4px;
  font-size: 12px;
}

/* ---------- 顶栏账号区 ---------- */
.account {
  flex: none;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.credits {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #ffd9df;
  border-radius: var(--r-pill);
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  transition: filter .18s;
}

.credits:hover { filter: brightness(.97); }
.credits b { font-size: 14.5px; font-weight: 700; }
.credits__icon { font-size: 11px; opacity: .8; }
.credits__unit { opacity: .75; }

.btn-login {
  height: 34px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--red);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: filter .18s;
}

.btn-login:hover { filter: brightness(1.07); }

.me__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  transition: border-color .18s;
}

.me__btn:hover { border-color: #d8d8dd; }

.avatar--me {
  width: 26px;
  height: 26px;
  font-size: 13px;
}

.me__name {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 168px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
  z-index: 60;
}

.me__id {
  margin: 0 0 2px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--ink-3);
  word-break: break-all;
}

.me__state {
  margin: 0 0 8px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--ink-2);
}

.me__recharge {
  width: 100%;
  height: 34px;
  margin-bottom: 6px;
  border: 0;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
}

.me__recharge:hover { filter: brightness(1.07); }

.me__logout {
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13.5px;
  font-weight: 600;
}

.me__logout:hover { filter: brightness(.97); }

/* ---------- 瀑布流 ---------- */
.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.feed {
  column-count: 5;
  column-gap: 14px;
}

@media (max-width: 1400px) { .feed { column-count: 4; } }
@media (max-width: 1080px) { .feed { column-count: 3; } }
@media (max-width: 760px)  { .feed { column-count: 2; column-gap: 10px; } }

.card {
  break-inside: avoid;
  margin-bottom: 18px;
  cursor: pointer;
  transition: transform .22s cubic-bezier(.2, .7, .3, 1);
  animation: rise .38s backwards;
}

@media (max-width: 760px) { .card { margin-bottom: 14px; } }

.card:hover { transform: translateY(-3px); }

/* 圆角在图片本身（四角均圆），卡片外壳不再带底色与阴影 */
.card__media {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(135deg, #ececf0, #f6f6f8);
  box-shadow: var(--shadow);
  transition: box-shadow .22s;
}

.card__media img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .4s ease;
}

.card:hover .card__media { box-shadow: 0 10px 28px rgba(0, 0, 0, .14); }
.card:hover .card__media img { transform: scale(1.04); }

.card__city {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11px;
  letter-spacing: .3px;
}

.card__info { padding: 9px 4px 0; }

.card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.46;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--red-soft);
  font-size: 14px;
  flex: none;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.empty {
  padding: 80px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 15px;
}

.foot {
  padding: 40px 0 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}

.foot p { margin: 4px 0; }
.foot b { color: var(--red); }
.foot__tip { font-size: 12px; opacity: .8; }

/* ---------- 详情弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  animation: fade .2s;
}

@keyframes fade { from { opacity: 0; } }

.modal__box {
  position: relative;
  display: flex;
  width: min(1080px, 100%);
  max-height: min(88vh, 760px);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: pop .26s cubic-bezier(.2, .8, .3, 1);
}

@keyframes pop {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
}

.modal__media {
  position: relative;
  flex: 1 1 62%;
  min-width: 0;
  margin: 0;
  background: #101014;
  display: grid;
  place-items: center;
}

.modal__media img {
  max-width: 100%;
  max-height: min(88vh, 760px);
  object-fit: contain;
}

.modal__side {
  flex: 0 0 372px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.modal__author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 60px 16px 20px;
  border-bottom: 1px solid var(--line);
}

.modal__author b { font-size: 14px; display: block; }
.modal__author small { font-size: 12px; color: var(--ink-3); }

.chip {
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  background: #f1f1f3;
  color: var(--ink-2);
}

.chip--city {
  margin-left: auto;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 600;
}

.modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
}

.modal__body h2 {
  margin: 0 0 16px;
  font-size: 19px;
  line-height: 1.4;
  font-weight: 700;
}

/* 副标题：紧贴在大标题下方的朴素描述 */
.modal__sub {
  margin: -10px 0 16px;
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.5;
}

.block { margin-bottom: 18px; }

.block h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}

.block p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tag {
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: #f4f4f6;
  color: #6a6a72;
  font-size: 12.5px;
}

.modal__actions {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.btn {
  flex: 1;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ink-2);
  font-size: 14px;
  transition: background .18s, filter .18s;
}

.btn:hover { background: #f7f7f8; }

.btn--primary {
  border-color: transparent;
  background: var(--red);
  color: #fff;
  font-weight: 600;
}

.btn--primary:hover { filter: brightness(1.06); background: var(--red); }

.btn--ghost {
  height: 36px;
  border-color: transparent;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
}

.btn--ghost:hover { background: #ffe3e8; }

/* 锁态下两个 CTA 竖排；横排会把「解锁全部 35 个 · 300 积分」挤得溢出 */
.modal__actions.is-locked { flex-direction: column; gap: 8px; }
.modal__actions.is-locked .btn { flex: none; width: 100%; }

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .12);
  color: var(--ink-2);
  font-size: 0;              /* 隐藏 × 字形，改用两条线画叉，跨平台都能真正居中 */
  transition: background .18s;
}

/* 两条线绝对定位钉在按钮正中心，各自旋转成叉；不受残留的 × 文本节点影响 */
.modal__close::before,
.modal__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.modal__close::before { transform: translate(-50%, -50%) rotate(45deg); }
.modal__close::after { transform: translate(-50%, -50%) rotate(-45deg); }

.modal__close:hover { background: rgba(0, 0, 0, .2); }

.modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  transition: background .18s;
}

/* 箭头改用内联 SVG，viewBox 内天然对称，grid 居中即像素级正中 */
.modal__nav svg { width: 22px; height: 22px; display: block; }

.modal__nav:hover { background: #fff; }
.modal__nav--prev { left: 14px; }
.modal__nav--next { right: 14px; }

/* 移动端：弹窗改为竖向滚动 */
@media (max-width: 860px) {
  .modal { padding: 0; }

  .modal__box {
    flex-direction: column;
    width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
    overflow-y: auto;
  }

  .modal__media { flex: none; }
  .modal__media img { max-height: 52vh; }
  .modal__side { flex: 1; }
  .modal__body { overflow: visible; }

  .modal__actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 760px) {
  .topbar__inner { gap: 12px; padding: 10px 14px; }
  .logo__sub { display: none; }
  .logo__mark { font-size: 20px; }
  .topbar__count { display: none; }
  .cities { padding: 0 14px 10px; }
  .wrap { padding: 14px; }
  .me__name { display: none; }
  .me__btn { padding: 0 4px; }
  .btn-login { padding: 0 14px; }
}

/* ---------- 地址锁态 ---------- */
.lock {
  position: relative;
  border-radius: var(--r-md);
  background: #fafafb;
  border: 1px solid var(--line);
  overflow: hidden;
}

.lock__blur {
  padding: 12px 14px 0;
  font-size: 14px;
  line-height: 1.7;
  color: #c9c9d0;
  letter-spacing: 1px;
  word-break: break-all;
  user-select: none;
  filter: blur(3px);
}

.lock__cta {
  position: relative;
  padding: 14px;
  text-align: center;
}

.lock__cta p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
}

/* ---------- 登录弹窗 ---------- */
.login {
  position: relative;
  width: min(400px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  animation: pop .26s cubic-bezier(.2, .8, .3, 1);
}

.login__head {
  padding: 26px 24px 18px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.login__head h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
}

.login__head p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.6;
}

.login__body { padding: 20px 24px 24px; }

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

.login__steps li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--ink-2);
}

.login__steps b {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
}

.login__qr {
  display: grid;
  place-items: center;
  padding: 6px;
  margin-bottom: 16px;
}

.login__qr img {
  width: 180px;
  height: 180px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}

.login__code {
  text-align: center;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--red-soft);
  border: 1px solid rgba(255, 46, 77, .18);
}

.login__code-label {
  font-size: 12.5px;
  color: var(--ink-3);
}

.login__code-value {
  margin: 6px 0 10px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .28em;
  text-indent: .28em;
  color: var(--red);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  user-select: all;
}

.login__copy {
  height: 30px;
  padding: 0 16px;
  border: 1px solid rgba(255, 46, 77, .3);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--red);
  font-size: 12.5px;
}

.login__copy:hover { background: #fff6f7; }

.login__status {
  min-height: 22px;
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
}

.login__status.is-wait { color: var(--ink-3); }
.login__status.is-ok   { color: #14a058; font-weight: 600; }
.login__status.is-warn { color: #d08700; }
.login__status.is-err  { color: var(--red); }

.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 1.3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.7); }
}

.login__retry {
  margin-left: 6px;
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ink-2);
  font-size: 12.5px;
}

.login__retry:hover { background: #f7f7f8; }

.modal--login .modal__close { background: rgba(0, 0, 0, .06); }

@media (max-width: 480px) {
  .login { border-radius: 10px; }
  .login__qr img { width: 150px; height: 150px; }
  .login__code-value { font-size: 28px; }
}

/* ---------- 充值弹窗 ---------- */
.rc__balance { color: var(--red); font-size: 17px; }

.price {
  display: flex;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.price li {
  position: relative;
  flex: 1;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fafafb;
  font-size: 13px;
  color: var(--ink-2);
  text-align: center;
}

.price li b {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.price li span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
}

.price--hot {
  border-color: #ffd0d8 !important;
  background: var(--red-soft) !important;
}

.price--hot b { color: var(--red) !important; }

.price--hot em {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.rc__step { margin-bottom: 16px; }
.rc__step:last-child { margin-bottom: 0; }

.rc__step h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.rc__step h3 b {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 11px;
}

.rc__shop {
  margin: 0 0 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fafafb;
  border: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-2);
  word-break: break-all;
}

.rc__shop b { color: var(--red); }
.rc__link { color: var(--red); font-weight: 600; }

.rc__note {
  margin: 0;
  font-size: 12px;
  color: var(--ink-3);
}

.rc__note code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1f1f3;
  font-size: 11.5px;
}

.rc__row { display: flex; gap: 8px; }

.rc__row input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: #fafafb;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: border-color .18s, background .18s;
}

.rc__row input:focus {
  outline: 0;
  border-color: #ffd0d8;
  background: #fff;
}

.rc__row input::placeholder { color: var(--ink-3); letter-spacing: 0; }

.rc__row .btn {
  flex: none;
  width: 84px;
}

.rc__row .btn:disabled { opacity: .6; }

.recharge .login__status { margin-top: 10px; min-height: 20px; }

@media (max-width: 480px) {
  .price { flex-direction: column; gap: 14px; }
  .price li { display: flex; align-items: center; gap: 10px; text-align: left; }
  .price li b { font-size: 19px; }
  .price li span { margin-top: 0; }
  .price--hot em { left: auto; right: 12px; transform: none; }
}

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 12px);
  z-index: 200;
  max-width: 80vw;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  background: rgba(20, 20, 24, .92);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
  opacity: 0;
  transition: opacity .22s, transform .22s;
  pointer-events: none;
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 键盘可达性 */
.card:focus-visible,
.city:focus-visible,
.btn:focus-visible,
.search input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
