/* LWA WeChat Share — 文章页转发弹层 / 微信内引导
   视觉沿用站点 VI：奶油底、墨色文字、橙 #e8833a 强调、零圆角 */

#lwaShareRoot {
  --lwa-ink: #141414;
  --lwa-mut: #55534d;
  --lwa-dim: #8a8880;
  --lwa-bg: #fcfbf7;
  --lwa-line: #e2ded4;
  --lwa-accent: #e8833a;
}

/* ---------- 通用按钮 ---------- */
.lwa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
  line-height: 1;
  border: 1px solid var(--lwa-line);
  border-radius: 0;
  background: #fff;
  color: var(--lwa-ink);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, color .15s;
  -webkit-appearance: none;
  appearance: none;
}
.lwa-btn:hover { border-color: var(--lwa-ink); }
.lwa-btn--main {
  background: var(--lwa-ink);
  border-color: var(--lwa-ink);
  color: #fff;
}
.lwa-btn--main:hover { background: #000; }
.lwa-btn--ghost { background: transparent; }

/* 「系统分享」只在浏览器真的支持 Web Share API 时才出现。
   不支持时藏起来，避免点下去变成静默复制——那才是体验最差的情况。 */
[data-lwa-native] { display: none; }
.lwa-can-native [data-lwa-native] { display: inline-flex; }

/* 复制链接：降级为视觉最低的兜底入口，不再是主按钮 */
.lwa-share__copy {
  margin: 10px 0 0;
  text-align: center;
}
.lwa-share__copy button {
  padding: 6px 8px;
  border: 0;
  background: none;
  color: var(--lwa-dim);
  font-size: 12px;
  line-height: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--lwa-line);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.lwa-share__copy button:hover {
  color: var(--lwa-ink);
  text-decoration-color: var(--lwa-ink);
}

/* ---------- 弹层 ---------- */
.lwa-share {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: none;
}
.lwa-share.is-open { display: block; }
.lwa-share__mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, .55);
}
.lwa-share__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--lwa-bg);
  border: 1px solid var(--lwa-line);
}
.lwa-share__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--lwa-line);
}
.lwa-share__ttl {
  font-size: 14px;
  font-weight: 500;
  color: var(--lwa-ink);
  letter-spacing: .02em;
}
.lwa-share__x {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--lwa-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.lwa-share__x:hover { color: var(--lwa-ink); }

.lwa-share__body {
  display: flex;
  gap: 24px;
  padding: 24px 20px 22px;
}
.lwa-share__qrwrap { flex: 0 0 auto; text-align: center; }
.lwa-share__qrbox {
  position: relative;
  width: 240px;
  height: 240px;
  background: #fff;
  border: 1px solid var(--lwa-line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lwa-share__qr {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lwa-share__qrlogo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lwa-share__qrlogo img {
  width: 36px;
  height: 36px;
  display: block;
  object-fit: contain;
  border-radius: 3px;
}
.lwa-share__qrtip {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--lwa-dim);
}

.lwa-share__info { flex: 1 1 auto; min-width: 0; }
.lwa-share__label {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--lwa-dim);
}
.lwa-share__card {
  display: flex;
  gap: 12px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--lwa-line);
  align-items: stretch;
}
.lwa-share__thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: block;
}
.lwa-share__txt { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.lwa-share__t {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--lwa-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lwa-share__d {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--lwa-dim);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lwa-share__hint {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--lwa-mut);
}
.lwa-share__hint b { color: var(--lwa-accent); font-weight: 500; }
.lwa-share__acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
[data-lwa-native] { display: none; }
html.lwa-can-native [data-lwa-native] { display: inline-flex; }

/* ---------- 微信内引导 ---------- */
.lwa-tip {
  position: fixed;
  inset: 0;
  z-index: 9991;
  display: none;
  pointer-events: none;
}
.lwa-tip.is-open { display: block; }
.lwa-tip__mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, .72);
  pointer-events: auto;
}
.lwa-tip__arrow {
  position: absolute;
  top: 8px;
  right: 16px;
  width: 46px;
  height: 56px;
  pointer-events: none;
}
.lwa-tip__arrow::before {
  content: "";
  position: absolute;
  top: 18px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
  transform: rotate(-45deg);
  border-radius: 2px;
  opacity: .95;
}
.lwa-tip__arrow::after {
  content: "";
  position: absolute;
  top: 40px;
  right: 18px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 9px solid #fff;
  opacity: .95;
}
.lwa-tip__panel {
  position: absolute;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100vw - 40px);
  max-width: 380px;
  padding: 20px 18px 18px;
  background: var(--lwa-bg);
  pointer-events: auto;
}
.lwa-tip__p {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 500;
  color: var(--lwa-ink);
}
.lwa-tip__p b { color: var(--lwa-accent); font-weight: 500; }
.lwa-tip__s {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--lwa-mut);
}
.lwa-tip__card {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--lwa-line);
}
.lwa-tip__card img {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  object-fit: cover;
}
.lwa-tip__card > div { min-width: 0; }
.lwa-tip__t {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--lwa-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lwa-tip__d {
  margin: 0;
  font-size: 12px;
  color: var(--lwa-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lwa-tip__acts {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.lwa-tip__acts .lwa-btn { flex: 1 1 0; }

/* ---------- 正文内联入口（上/下各一处） ---------- */
.lwa-share-inline {
  display: flex;
  margin: 20px 0 24px;
  font-size: 13px;
  line-height: 1;
}
.lwa-share-inline--top { justify-content: flex-end; margin: 16px 0 22px; }
.lwa-share-inline--bottom {
  margin: 30px 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--lwa-line);
}
.lwa-share-inline__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 2px;
  margin: -8px -2px;
  border: 0;
  background: none;
  color: var(--lwa-mut);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  text-indent: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: color .15s;
}
.lwa-share-inline__btn:hover { color: var(--lwa-accent); }
.lwa-share-inline__ico {
  display: inline-block;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  vertical-align: -2.5px;
  opacity: .82;
}

/* ---------- 移动端 ---------- */
@media (max-width: 767px) {
  .lwa-share__panel {
    top: auto;
    bottom: 0;
    left: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    max-height: 88vh;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .lwa-share__body {
    flex-direction: column;
    gap: 18px;
    padding: 20px 16px 24px;
  }
  .lwa-share__qrwrap { align-self: center; }
  .lwa-share__qrbox { width: 200px; height: 200px; }
  .lwa-share__acts .lwa-btn { flex: 1 1 auto; }
  .lwa-can-native .lwa-share__acts { display: flex; }
  /* 手机上没有 Web Share（极少数）：唯一的出路就是复制，此时让它变主按钮 */
  html.lwa-is-mobile:not(.lwa-can-native) .lwa-share__acts { display: none; }
  html.lwa-is-mobile:not(.lwa-can-native) .lwa-share__copy { margin-top: 16px; }
  html.lwa-is-mobile:not(.lwa-can-native) .lwa-share__copy button {
    display: block;
    width: 100%;
    height: 42px;
    padding: 0;
    border: 1px solid var(--lwa-ink);
    background: var(--lwa-ink);
    color: #fff;
    font-size: 13px;
    text-decoration: none;
  }
  [data-lwa-dl] { display: none !important; }
  .lwa-share-inline--top { justify-content: flex-start; }
  .lwa-share-inline--bottom { margin: 26px 0 6px; }
}
