/* ==========================================================================
   拍呗网页版（PaiDD Web App）自适应视口壳与纯浏览器体验层
   - 手机 Safari / Chrome / 微信内置浏览器：100% 全屏原生沉浸体验
   - 电脑大屏浏览器（>= 860px）：居中精致 Silver-iOS 手机/平板自适应视口壳
   - 纯浏览器环境自动隐藏仅限原生 App 硬件层的壳依赖
   ========================================================================== */

:root {
  --pb-web-stage-max: 430px;
  --pb-web-bg-outer: #eef1ef;
  --pb-web-frame-shadow: 0 24px 70px rgba(22, 38, 33, 0.13), 0 2px 12px rgba(22, 38, 33, 0.06);
  --pb-web-brand-green: #1e4d42;
}

html.pb-pure-web [data-native-app-only],
html.pb-pure-web .native-only-control,
html.pb-pure-web #quickTransferV2HardwareTip {
  display: none !important;
}

/* 顶部分享快捷角标（置于机位详情、租服装顶栏右侧，与摄影师主页右上角分享保持一致交互） */
.pb-top-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(34, 59, 52, 0.12);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #1f3a33;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 2px 8px rgba(18, 34, 29, 0.06);
  flex-shrink: 0;
}
.pb-top-share-btn:hover {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(18, 34, 29, 0.1);
}
.pb-top-share-btn:active {
  transform: scale(0.95);
}
.pb-top-share-btn svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

/* 机位详情右上角动作组（保留原有 + 号投稿按钮并排展示分享按钮） */
.sanctuary-nav .pb-sanctuary-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* 租服装页面顶栏右侧分享按钮对齐 */
.rental-module-page .page-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 14px;
}
.rental-module-page .page-head .page-title {
  flex: 1;
  min-width: 0;
}

/* 灵感作品详情顶栏右上角分享按钮 */
#inspirationDetail .pb-inspiration-share-btn {
  margin-left: auto;
}

/* ================= 桌面端居中视口壳（>= 860px） ================= */
html.pb-desktop-tablet {
  --pb-web-stage-max: 820px;
}
html.pb-desktop-full {
  --pb-web-stage-max: 1180px;
}

.pb-desktop-dock,
.pb-desktop-brand {
  display: none;
}

@media (min-width: 860px) and (hover: hover) {
  html.pb-pure-web {
    background: radial-gradient(circle at 18% 12%, #f7faf8 0%, #e9eeec 52%, #e2e8e5 100%);
    min-height: 100%;
  }

  html.pb-pure-web body {
    max-width: var(--pb-web-stage-max);
    min-height: 100dvh;
    margin: 0 auto !important;
    background: #faf9f6;
    box-shadow: var(--pb-web-frame-shadow);
    border-left: 1px solid rgba(30, 77, 66, 0.08);
    border-right: 1px solid rgba(30, 77, 66, 0.08);
    position: relative;
    overflow-x: clip;
  }

  /* 约束所有全屏 fixed 页面与浮层严格对齐桌面居中的手机/平板视口宽度 */
  html.pb-pure-web .page,
  html.pb-pure-web .ps-page,
  html.pb-pure-web .ps-builder,
  html.pb-pure-web .ps-editor,
  html.pb-pure-web #inspirationDetail,
  html.pb-pure-web iframe[title="拍朵朵摄影社区"] {
    left: max(0px, calc(50vw - var(--pb-web-stage-max) / 2)) !important;
    right: max(0px, calc(50vw - var(--pb-web-stage-max) / 2)) !important;
    width: min(100vw, var(--pb-web-stage-max)) !important;
    max-width: var(--pb-web-stage-max) !important;
  }

  html.pb-pure-web .bottom-nav {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: calc(min(100vw, var(--pb-web-stage-max)) - 24px) !important;
    max-width: calc(var(--pb-web-stage-max) - 24px) !important;
  }

  /* 桌面左侧品牌铭牌 */
  html.pb-pure-web .pb-desktop-brand {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: fixed;
    left: max(20px, calc(50vw - var(--pb-web-stage-max) / 2 - 236px));
    top: 36px;
    width: 204px;
    padding: 18px 18px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(30, 77, 66, 0.09);
    box-shadow: 0 12px 32px rgba(20, 40, 34, 0.06);
    color: #1f352f;
    z-index: 90;
    pointer-events: auto;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  }
  .pb-desktop-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #1e5a4c;
    background: rgba(30, 90, 76, 0.09);
    padding: 4px 9px;
    border-radius: 999px;
    width: fit-content;
  }
  .pb-desktop-brand h2 {
    margin: 2px 0 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #162924;
  }
  .pb-desktop-brand p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: #5b6e68;
  }

  /* 桌面右侧视口模式与快速分享悬浮控制条 */
  html.pb-pure-web .pb-desktop-dock {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: fixed;
    right: max(20px, calc(50vw - var(--pb-web-stage-max) / 2 - 172px));
    top: 36px;
    width: 144px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(30, 77, 66, 0.09);
    box-shadow: 0 12px 32px rgba(20, 40, 34, 0.06);
    z-index: 90;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  }
  .pb-desktop-dock button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: transparent;
    color: #364f47;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .pb-desktop-dock button:hover {
    background: rgba(30, 90, 76, 0.07);
  }
  .pb-desktop-dock button.active {
    background: #1e4d42;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(30, 77, 66, 0.2);
  }
  .pb-desktop-dock hr {
    width: 100%;
    border: 0;
    border-top: 1px solid rgba(30, 77, 66, 0.1);
    margin: 2px 0;
  }
  .pb-desktop-dock .pb-dock-share {
    background: rgba(30, 90, 76, 0.1);
    color: #18493e;
  }
  .pb-desktop-dock .pb-dock-share:hover {
    background: #1e4d42;
    color: #ffffff;
  }
}

/* 当窗口宽度不足以放下左右边栏时自动收起侧栏，避免遮挡平板模式主体 */
@media (min-width: 860px) and (max-width: 1240px) {
  html.pb-desktop-tablet .pb-desktop-brand,
  html.pb-desktop-full .pb-desktop-brand {
    display: none !important;
  }
}
@media (min-width: 860px) and (max-width: 1040px) {
  html.pb-desktop-tablet .pb-desktop-dock,
  html.pb-desktop-full .pb-desktop-dock {
    right: 12px;
    top: auto;
    bottom: 20px;
    width: auto;
    flex-direction: row;
  }
}
