/* ==========================================================
   Lucky 表白墙 前端增强样式（index.php 与 gdxx.html 共用）
   ========================================================== */

/* ---------- 1. 全局滚动条美化 ---------- */
/* 底部留白：给固定的 ICP 备案条让位，避免遮住翻页按钮 */
body {
  padding-bottom: 76px;
}
* {
  scrollbar-width: thin;
  scrollbar-color: #E16B8C rgba(255, 255, 255, 0.35);
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #F596AA, #E16B8C);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: #DB4D6D;
}

/* ---------- 2. 响应式：卡片/横幅宽度自适应 ---------- */
/* 头部条与横幅同宽对齐（手机） */
.bbq_bt {
  width: calc(100vw - 24px) !important;
  max-width: 430px;
}
@media (min-width: 480px) {
  .lo_ve, .n-r, .gonggao { width: 400px !important; }
  .ggt { width: min(94vw, 420px) !important; }
  .tzl { width: min(94vw, 430px) !important; }
}
@media (max-width: 479px) {
  .lo_ve, .n-r, .gonggao { width: calc(100vw - 32px) !important; max-width: 350px; }
  .ggt { width: calc(100vw - 24px) !important; max-width: 356px; }
  .tzl { width: calc(100vw - 24px) !important; max-width: 356px; }
}
.lo_ve, .n-r {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.lo_ve:hover, .n-r:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(225, 107, 140, 0.28);
}
.lo_ve:active, .n-r:active {
  transform: scale(0.97);
}

/* ---------- 3. 公告走马灯（替代 marquee） ---------- */
.tzl {
  overflow: hidden;
  white-space: nowrap;
}
.tzl-track {
  display: inline-block;
  padding-left: 100%;
  animation: tzlmove 14s linear infinite;
  will-change: transform;
}
.tzl:hover .tzl-track {
  animation-play-state: paused;
}
@keyframes tzlmove {
  to { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .tzl-track { animation: none; padding-left: 0; }
}

/* ---------- 4. 头部加号 + 屏幕中央两个大方块 ---------- */
.fab-box {
  position: relative;
  height: 100%;
  width: 50px;
  float: right;
}
.fab-main {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F596AA;
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}
.fab-main:hover {
  background: #E16B8C;
  transform: rotate(90deg);
}
.fab-mask {
  position: fixed;
  inset: 0;
  background: rgba(64, 30, 40, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.fab-mask.show {
  opacity: 1;
  visibility: visible;
}
.fab-modal {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 20px;
}
.fab-tile {
  width: min(40vw, 250px);
  aspect-ratio: 1 / 1;
  border-radius: 26px;
  background: linear-gradient(160deg, #FFF5F8 0%, #FEDFE1 60%, #FBC7D4 100%);
  border: 1px solid #F5B5C8;
  box-shadow: 0 20px 60px rgba(150, 40, 80, 0.35), 0 0 0 6px rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #DB4D6D;
  text-decoration: none;
  opacity: 0;
  transform: scale(0.4) rotate(-7deg);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.28s ease, box-shadow 0.2s;
}
.fab-mask.show .fab-tile {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
.fab-mask.show .fab-tile:nth-child(2) {
  transition-delay: 0.09s;
}
.fab-tile:hover {
  transform: translateY(-8px) scale(1.04);
  box-shadow: 0 28px 70px rgba(150, 40, 80, 0.45), 0 0 0 6px rgba(255, 255, 255, 0.4);
}
.fab-tile:active {
  transform: scale(0.96);
}
.fab-tile .ft-ic {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(135deg, #E16B8C, #F596AA);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 20px rgba(225, 107, 140, 0.4);
}
.fab-tile .ft-ic svg {
  width: 36px;
  height: 36px;
}
.fab-tile .ft-t {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 2px;
}
.fab-tile .ft-d {
  font-size: 12px;
  color: #C77E8E;
}

/* ---------- 5. 大卡（点击表白/日常卡片弹出） ---------- */
.bc-mask {
  position: fixed;
  inset: 0;
  background: rgba(64, 30, 40, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s;
}
.bc-mask.show {
  opacity: 1;
  visibility: visible;
}
.big-card {
  position: relative;
  width: min(92vw, 460px);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #FFF5F8 0%, #FEDFE1 55%, #FBC7D4 100%);
  border: 1px solid #F5A8BC;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(150, 40, 80, 0.35), 0 0 0 6px rgba(255, 255, 255, 0.35);
  overflow: hidden;
  transform-origin: 50% 60%;
}
/* 入场：弹出 + 挤压回弹（Q 弹果冻感全部由关键帧完成） */
.bc-mask.show .big-card {
  animation: bcPop 0.95s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes bcPop {
  0%   { opacity: 0; transform: perspective(1000px) translateY(70px) scale(0.2) rotate(-10deg); }
  40%  { opacity: 1; transform: perspective(1000px) translateY(-8px) scale(1.1, 0.88) rotate(2.5deg); }
  58%  { transform: perspective(1000px) translateY(0) scale(0.93, 1.08) rotate(-1.5deg); }
  74%  { transform: perspective(1000px) scale(1.045, 0.965) rotate(0.8deg); }
  88%  { transform: perspective(1000px) scale(0.985, 1.015) rotate(0deg); }
  100% { opacity: 1; transform: perspective(1000px) scale(1, 1); }
}
/* 独立果冻抖动（发布页预览 / 内容刷新时重放） */
.big-card.jelly {
  animation: bcJelly 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes bcJelly {
  0%   { transform: scale(1, 1); }
  24%  { transform: scale(1.07, 0.9); }
  44%  { transform: scale(0.93, 1.07); }
  62%  { transform: scale(1.035, 0.968); }
  80%  { transform: scale(0.988, 1.012); }
  100% { transform: scale(1, 1); }
}
.bc-mask.closing {
  opacity: 0;
}
.bc-mask.closing .big-card {
  transform: perspective(1000px) translateY(30px) scale(0.55) rotate(4deg);
  opacity: 0;
  transition: transform 0.25s ease-in, opacity 0.25s ease-in;
}
.bc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 56px 14px 18px;
  background: linear-gradient(90deg, #E16B8C, #F596AA);
  color: #fff;
  flex: none;
}
.bc-ta {
  font-weight: 900;
  font-size: 16px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.12);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 62%;
}
.bc-badge {
  font-size: 12px;
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.5);
  padding: 3px 10px;
  border-radius: 20px;
  flex: none;
}
.bc-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.3);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.25s, background 0.2s;
}
.bc-close:hover {
  background: rgba(255,255,255,0.5);
  transform: rotate(90deg);
}
.bc-img {
  flex: none;
  margin: 14px 18px 0;
  height: 200px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  background-color: #fff;
  border: 1px solid rgba(225, 107, 140, 0.35);
  box-shadow: 0 4px 14px rgba(150, 40, 80, 0.15);
}
.bc-body {
  padding: 16px 20px 6px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  color: #64363C;
  line-height: 1.85;
  word-break: break-word;
}
.bc-foot {
  flex: none;
  padding: 10px 18px 14px;
  text-align: right;
  color: #A05A64;
  font-size: 12px;
  font-weight: 700;
}
.bc-loading {
  text-align: center;
  color: #C77E8E;
  padding: 30px 0;
  font-weight: 700;
}
/* 大卡上的樱花装饰角标 */
.bc-deco {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 40px;
  opacity: 0.35;
  pointer-events: none;
  transform: rotate(-15deg);
}

/* ---------- 6. Markdown 渲染样式 ---------- */
.md-body h1, .md-body h2, .md-body h3,
.md-body h4, .md-body h5, .md-body h6 {
  color: #DB4D6D;
  margin: 14px 0 8px;
  line-height: 1.4;
}
.md-body h1 { font-size: 22px; border-bottom: 2px solid #F5B5C8; padding-bottom: 6px; }
.md-body h2 { font-size: 19px; }
.md-body h3 { font-size: 17px; }
.md-body h4, .md-body h5, .md-body h6 { font-size: 15px; }
.md-body p.md-p { margin: 8px 0; }
.md-body strong.md-strong { color: #DB4D6D; }
.md-body em.md-em { color: #B85A70; }
.md-body del.md-del { color: #B08A94; }
.md-body code.md-code {
  background: rgba(225, 107, 140, 0.12);
  color: #C2455F;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}
.md-body pre.md-pre {
  background: #3B2430;
  color: #FFE3EC;
  border-radius: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.6;
}
.md-body pre.md-pre code { background: none; color: inherit; padding: 0; }
.md-body blockquote.md-quote {
  border-left: 4px solid #E16B8C;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 0 10px 10px 0;
  padding: 8px 12px;
  margin: 10px 0;
  color: #8A5560;
}
.md-body ul.md-list, .md-body ol.md-list {
  margin: 8px 0 8px 22px;
}
.md-body ul.md-list li, .md-body ol.md-list li { margin: 4px 0; }
.md-body a.md-link { color: #1677ff; }
.md-body img.md-img {
  max-width: 100%;
  border-radius: 10px;
  margin: 6px 0;
  box-shadow: 0 4px 14px rgba(150, 40, 80, 0.18);
}
.md-body hr.md-hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #E8A0B4, transparent);
  margin: 14px 0;
}
.md-body span.md-badimg { color: #B08A94; font-size: 12px; }

/* ---------- 7. 烟花画布 ---------- */
#fwCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1200;
}

/* ---------- 8. 通用气泡提示 ---------- */
#wallToast {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(59, 36, 48, 0.92);
  color: #FFE3EC;
  padding: 9px 20px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 1300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  max-width: 82vw;
}
#wallToast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 9. 桌面端表白墙整体适配 ---------- */
.love {
  column-gap: 14px;
}
.love > .lo_ve,
.love > .n-r,
.love > .gonggao,
.love > .ssk {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
@media (min-width: 900px) {
  /* 整个墙居中收拢，头部/横幅/选项卡/卡片同宽，不再各定各的 */
  .bbq_bt_bj {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
  }
  .bbq_bt {
    width: 100% !important;
    max-width: none !important;
  }
  /* 选项卡在宽屏下居中排布 */
  .xzk > div[style] {
    width: 100% !important;
    display: flex;
    justify-content: center;
  }
  .xzk > div[style] .love_xz {
    float: none;
  }
  .ggt {
    width: 100% !important;
    height: 240px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
  }
  .tzl {
    width: 100% !important;
  }
  .xzk > div[style] {
    width: 100% !important;
  }
  .zd_love {
    width: 100% !important;
  }
  .love {
    column-count: 2;
  }
  .love > .lo_ve, .love > .n-r, .love > .gonggao, .love > .ssk {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 14px;
  }
  .zd_love .lo_ve {
    width: 100% !important;
  }
}
@media (min-width: 1360px) {
  .bbq_bt_bj { max-width: 1240px; }
  .love { column-count: 3; }
}

/* ---------- 10. 公告卡片（支持换行、墙上限高防撑爆）与 SVG 小图标 ---------- */
.gonggao {
  cursor: pointer;
}
.gonggao .gg-hd {
  font-weight: 900;
  color: #DB4D6D;
  padding-bottom: 6px;
  border-bottom: 1px dashed #F0B9C8;
  margin-bottom: 8px;
}
.gonggao .gg-bd {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.9;
  color: #64363C;
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gonggao:hover .gg-hd {
  color: #E16B8C;
}
/* 大卡里的公告正文不截断 */
.bc-body .gg-bd {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  font-size: 14px;
}
svg.mi {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
  fill: none;
  stroke: #8A5560;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg.meg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  fill: none;
  stroke: #DB4D6D;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg.flower {
  fill: currentColor;
}

/* ---------- 11. 桌面端 SVG 主视觉（手机端保留大图） ---------- */
.pc-hero { display: none; }
@media (min-width: 900px) {
  .ggt { display: none !important; }
  .pc-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    height: 250px;
    border-radius: 16px;
    margin: 0 0 10px;
    background: linear-gradient(160deg, #FFF7FA 0%, #FEDFE1 55%, #FBC7D4 100%);
    border: 1px solid #F5B5C8;
    box-shadow: 0 10px 30px rgba(225, 107, 140, 0.18);
    cursor: pointer;
    transition: box-shadow 0.2s;
  }
  .pc-hero:hover { box-shadow: 0 14px 40px rgba(225, 107, 140, 0.28); }
  .ph-logo {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 4px 10px rgba(225, 107, 140, 0.35));
  }
  .ph-title {
    margin-top: 10px;
    font-size: 40px;
    font-weight: 900;
    letter-spacing: 6px;
    background: linear-gradient(90deg, #DB4D6D, #E16B8C 55%, #F596AA);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .ph-sub {
    margin-top: 8px;
    font-size: 14px;
    color: #C77E8E;
    letter-spacing: 3px;
  }
  .ph-petal {
    position: absolute;
    width: 26px;
    height: 26px;
    fill: #F5A8BC;
    opacity: 0.5;
    animation: phFloat 6s ease-in-out infinite;
  }
  .ph-petal.p1 { left: 6%; top: 22%; transform: rotate(-25deg); }
  .ph-petal.p2 { right: 8%; top: 18%; transform: rotate(20deg); animation-delay: 1.5s; width: 20px; height: 20px; }
  .ph-petal.p3 { right: 16%; bottom: 14%; transform: rotate(45deg); animation-delay: 3s; width: 16px; height: 16px; }
  @keyframes phFloat {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -8px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .ph-petal { animation: none; }
  }
}
