/* ==========================================================================
   OPC圈子 · H5 Premium Layer (v3)
   与 PC 共享设计语言，移动端强调：大标题、留白、悬浮导航、触感反馈
   ========================================================================== */

body.h5 {
  background: #f4f6fb;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  /* 旧版为固定顶栏预留的 padding，顶栏已改为 sticky，清零 */
  padding-top: 0;
  padding-bottom: 0;
}

/* 只允许垂直滚动条的柔和底色 */
body.h5::-webkit-scrollbar {
  width: 0;
}

/* --------------------------------------------------------------------------
   顶部栏
   -------------------------------------------------------------------------- */
.h5-topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  height: 56px;
  padding: env(safe-area-inset-top) 16px 0;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(8, 16, 31, 0.05);
  transition: background 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.h5-topbar.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 30px -26px rgba(8, 16, 31, 0.55);
}

.h5-topbar .brand {
  font-size: 16px;
  letter-spacing: -0.02em;
  gap: 8px;
}

.h5-topbar .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(112deg, #2f6bff, #6d4bf0 55%, #a855f7);
  box-shadow: 0 8px 18px -8px rgba(47, 107, 255, 0.7);
  font-size: 11.5px;
}

/* --------------------------------------------------------------------------
   视图切换动画
   -------------------------------------------------------------------------- */
.view {
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
  animation: h5-view-enter 0.34s var(--ease-out);
}

@keyframes h5-view-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   首屏：深空极光卡
   -------------------------------------------------------------------------- */
.h5-hero {
  position: relative;
  isolation: isolate;
  border-radius: 24px;
  padding: 26px 22px 24px;
  background: linear-gradient(168deg, #070b17 0%, #0c1226 52%, #170f31 100%);
  box-shadow: 0 30px 60px -32px rgba(8, 16, 31, 0.65);
  overflow: hidden;
}

.h5-hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 150%;
  background:
    radial-gradient(42% 40% at 20% 20%, rgba(47, 107, 255, 0.6) 0%, rgba(47, 107, 255, 0) 64%),
    radial-gradient(38% 38% at 86% 4%, rgba(124, 77, 240, 0.55) 0%, rgba(124, 77, 240, 0) 66%),
    radial-gradient(30% 30% at 66% 92%, rgba(34, 211, 238, 0.24) 0%, rgba(34, 211, 238, 0) 68%);
  filter: blur(18px);
  z-index: -1;
  animation: h5-aurora 18s ease-in-out infinite alternate;
}

.h5-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
  pointer-events: none;
  z-index: -1;
}

@keyframes h5-aurora {
  0% {
    transform: translate3d(-3%, -2%, 0) scale(1);
  }
  100% {
    transform: translate3d(4%, 3%, 0) scale(1.08);
  }
}

.h5-hero h1 {
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: -0.04em;
  font-weight: 800;
  color: #fff;
}

.h5-hero p {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.85;
  color: rgba(226, 234, 252, 0.7);
}

.h5-hero .row {
  margin-top: 22px;
  gap: 10px;
}

.h5-hero .btn {
  height: 42px;
  flex: 1;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
}

.h5-hero .row .btn:not(.ghost) {
  background: linear-gradient(112deg, #2f6bff, #6d4bf0 58%, #8b5cf6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 14px 26px -14px rgba(47, 107, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.h5-hero .btn.ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #eef4ff;
  backdrop-filter: blur(10px);
}

/* 数据条：玻璃卡，上浮压住首屏底边 */
.h5-stats {
  margin: -20px 6px 0;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid rgba(8, 16, 31, 0.06);
  box-shadow: 0 22px 40px -30px rgba(8, 16, 31, 0.6);
}

.h5-stat {
  text-align: center;
  border-radius: 12px;
  padding: 6px 2px;
}

.h5-stat b {
  display: block;
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.2;
}

.h5-stat span {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   快捷入口
   -------------------------------------------------------------------------- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.quick {
  background: #fff;
  border: 1px solid rgba(8, 16, 31, 0.06);
  border-radius: 16px;
  padding: 14px 4px 11px;
  font-size: 11px;
  color: var(--ink-2);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(8, 16, 31, 0.03);
  transition: transform 0.2s var(--ease-out), box-shadow 0.24s var(--ease-out);
}

.quick i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 auto 7px;
  border-radius: 11px;
  background: linear-gradient(150deg, #f1f6ff, #f7f1ff);
  border: 1px solid #e8eeff;
  font-size: 17px;
  font-style: normal;
}

.quick:active {
  transform: scale(0.965);
}

/* --------------------------------------------------------------------------
   内容卡与区块
   -------------------------------------------------------------------------- */
.block {
  margin-top: 22px;
}

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
}

.block-head b,
.block-head h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.block-head .more {
  font-size: 12px;
  color: var(--brand);
  font-weight: 550;
}

.m-card {
  background: #fff;
  border: 1px solid rgba(8, 16, 31, 0.06);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(8, 16, 31, 0.03);
  transition: transform 0.2s var(--ease-out), box-shadow 0.24s var(--ease-out);
}

.m-card:active {
  transform: scale(0.99);
}

.m-card .ttl {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.5;
}

.m-card .dsc {
  font-size: 12.5px;
  line-height: 1.78;
  color: var(--ink-3);
  margin-top: 6px;
}

.m-card .foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(8, 16, 31, 0.07);
  font-size: 11.5px;
  color: var(--ink-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 横向筛选 chips */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: none;
}

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

.chip {
  flex: none;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(8, 16, 31, 0.08);
  background: #fff;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.22s var(--ease-out);
}

.chip.on {
  background: linear-gradient(112deg, #2f6bff, #6d4bf0);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 20px -12px rgba(47, 107, 255, 0.9);
}

/* 按钮 */
.h5 .btn {
  border-radius: 11px;
  font-weight: 550;
  transition: transform 0.18s var(--ease-out), box-shadow 0.22s var(--ease-out);
}

.h5 .btn-primary {
  background: linear-gradient(112deg, #2f6bff, #6d4bf0 60%, #8b5cf6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 24px -14px rgba(47, 107, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.h5 .btn:active {
  transform: scale(0.975);
}

/* 搜索框 */
.h5 .input,
.h5 .select,
.h5 .textarea {
  border-radius: 12px;
  border-color: rgba(8, 16, 31, 0.08);
  background: #fff;
}

.h5 .input:focus,
.h5 .textarea:focus {
  border-color: rgba(47, 107, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.1);
  outline: none;
}

/* --------------------------------------------------------------------------
   底部悬浮导航
   -------------------------------------------------------------------------- */
.h5-tabbar {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  height: 62px;
  max-width: 540px;
  margin: 0 auto;
  padding: 0 6px;
  border-radius: 22px;
  border: 1px solid rgba(8, 16, 31, 0.07);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 26px 50px -26px rgba(8, 16, 31, 0.45), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  z-index: 90;
  display: flex;
  align-items: center;
}

.h5-tabbar button {
  flex: 1;
  height: 48px;
  border: 0;
  background: transparent;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  color: var(--ink-4);
  font-weight: 500;
  position: relative;
  transition: color 0.24s ease, transform 0.2s var(--ease-out);
}

.h5-tabbar button i {
  font-size: 18px;
  font-style: normal;
  line-height: 1;
  transition: transform 0.28s var(--ease-out);
}

.h5-tabbar button.on {
  color: var(--brand);
  font-weight: 650;
  background: linear-gradient(180deg, rgba(47, 107, 255, 0.09), rgba(124, 77, 240, 0.05));
}

.h5-tabbar button.on i {
  transform: translateY(-1px) scale(1.08);
}

.h5-tabbar button:active i {
  transform: scale(0.92);
}

/* 悬浮发布按钮 */
.fab {
  bottom: calc(84px + env(safe-area-inset-bottom));
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, #2f6bff, #7c4df0);
  box-shadow: 0 20px 36px -18px rgba(47, 107, 255, 0.9);
  font-size: 22px;
  transition: transform 0.24s var(--ease-out);
}

.fab:active {
  transform: scale(0.94);
}

/* --------------------------------------------------------------------------
   弹层 / 抽屉
   -------------------------------------------------------------------------- */
.modal-mask,
.sheet-mask {
  backdrop-filter: blur(6px);
  background: rgba(8, 16, 31, 0.45);
  animation: h5-fade 0.24s ease;
}

.modal,
.sheet {
  animation: h5-rise 0.34s var(--ease-out);
}

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

@keyframes h5-rise {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.99);
  }
}

/* --------------------------------------------------------------------------
   我的页 / 页脚
   -------------------------------------------------------------------------- */
.me-card {
  border-radius: 20px;
  border: 1px solid rgba(8, 16, 31, 0.06);
  box-shadow: 0 18px 40px -34px rgba(8, 16, 31, 0.55);
}

.me-row {
  transition: background 0.2s ease, padding-left 0.2s var(--ease-out);
}

.me-row:active {
  background: rgba(47, 107, 255, 0.05);
  padding-left: 14px;
}

.me-sec {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 650;
}

.h5-foot {
  padding: 30px 0 8px;
  font-size: 11.5px;
  line-height: 1.9;
  color: var(--ink-4);
}

.h5-foot a {
  color: var(--ink-3);
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  .h5-hero::before {
    animation: none;
  }
  .view {
    animation: none;
  }
}
