/* --- 全局重置 --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  background-color: #000;

  /* 禁用双击缩放（配合 meta viewport + JS） */
  touch-action: manipulation;
}

/* --- 1. 背景与动画层 --- */
#bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: filter 1s ease, transform 1s ease;
}

/* 默认移动端背景 */
#bg-layer { background-image: url('/res/mobile_background.webp'); }

/* 桌面端背景 */
@media (min-width: 768px) {
  #bg-layer { background-image: url('/res/pc_background.webp'); }
}

body.active #bg-layer {
  filter: blur(20px) brightness(0.6);
  transform: scale(1.05);
}

/* --- 2. 主卡片容器 (从下方滑入) --- */
#card-container {
  position: fixed;
  left: 50%;
  width: 90%;
  height: 90%;
  z-index: 1;

  top: 50%;
  transform: translate(-50%, 150vh);
  opacity: 0;
  visibility: hidden;

  transition: transform 1s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.8s ease, visibility 0.8s;

  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border-radius: 30px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);

  display: flex;
  overflow: hidden;
}

/* 激活状态：回到屏幕正中央 */
body.active #card-container {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
}

/* --- 3. 布局 --- */
@media (min-width: 769px) {
  #card-container {
    flex-direction: row;
    max-width: 1200px;
    max-height: 800px;
  }

  .content-area {
    flex: 2;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
  }

  .divider {
    width: 1px;
    height: 80%;
    align-self: center;
    background-color: rgba(0,0,0,0.2);
    position: relative;
    flex-shrink: 0;
  }

  .divider::before, .divider::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: rgba(0,0,0,0.4);
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
  }

  .divider::before { top: -8px; }
  .divider::after { bottom: -8px; }

  .photo-area {
    flex: 1;
    position: relative;
    overflow: hidden;
  }
}

@media (max-width: 768px) {
  #card-container { flex-direction: column; }

  .content-area {
    flex: 2;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .divider { display: none; }

  .photo-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(0,0,0,0.1);
  }
}

/* --- 4. 内容与按钮 --- */
#self-intro {
  height: 40%;
  overflow-y: auto;
  margin-bottom: 20px;

  font-size: 16px; /* JS 会自动调大/调小 */
  line-height: 1.6;
  color: #333;
}

.social-buttons {
  display: flex;
  gap: 20px;
  justify-content: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.social-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  color: #555;
  font-size: 24px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.social-btn:hover, .social-btn:active {
  transform: scale(1.15) rotate(5deg);
  color: #fff;
  box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.social-btn.qq:hover { background-color: #12B7F5; }
.social-btn.douyin:hover { background-color: #000; }
.social-btn.bilibili:hover { background-color: #FB7299; }
.social-btn.twitter:hover { background-color: #000; }

/* --- love/hate 区域（默认：love 和 hate 同时显示） --- */
#love-hate-box {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 20px;
  padding: 15px;
  flex-grow: 1;
  color: #444;

  display: flex;
  gap: 15px;

  /* 默认：并排 + 自动换行，避免“只看到第一个” */
  flex-direction: row;
  flex-wrap: wrap;
  align-content: flex-start;

  overflow-y: auto;

  font-size: 16px; /* JS 会自动调大/调小 */
}

#love-hate-box > .love,
#love-hate-box > .hate {
  flex: 1 1 240px;
  min-width: 240px;
}

#love-hate-box strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1.1em;
  color: #222;
}

/* --- 5. 兽装照片 & 点击范围（整张图可点） --- */
.photo-link {
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
  cursor: pointer;
}

.photo-link picture {
  display: block;
  width: 100%;
  height: 100%;
}

.furry-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  text-align: center;
  transition: opacity 0.3s ease;
  pointer-events: none; /* overlay 不抢点击，点击仍落在 a.photo-link 上 */
}

.photo-overlay p {
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 1px;
}

/* 图标库未加载时的兜底显示 */
.icon-fallback {
  display: inline-flex;
  width: 1em;
  height: 1em;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

@media (min-width: 769px) {
  .photo-overlay { opacity: 0; }
  .photo-area:hover .photo-overlay { opacity: 1; }
}

@media (max-width: 768px) {
  .photo-overlay { opacity: 1; }
  .photo-overlay p { font-size: 12px; }
}

/* --- 6. 仅“短屏小手机”启用分块滑动（避免误伤其它设备） --- */
@media (max-width: 430px) and (max-height: 700px) {
  #love-hate-box {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding: 10px;
    gap: 15px;
  }

  #love-hate-box > div {
    min-width: 100%;
    scroll-snap-align: center;
    background: rgba(255,255,255,0.4);
    padding: 10px;
    border-radius: 15px;
  }
}
