/* phone.css —— "手机数据页"：每天确认发布 vlog 之后弹出的互动数据面板。
   跟 ui.css 那套仿 macOS 的灰调窗口刻意区分开：这里是玩家掏出手机看后台数据，
   用暖色玻璃拟态 + 竖屏手机外壳，视觉自成一套，所以单独一个文件、单独一套
   变量（--p* 前缀），不去动 ui.css 的 :root。逻辑见 engine/vlogstats.js。 */

.phone-overlay {
  position: fixed;
  inset: 0;
  z-index: 160; /* 盖过 modal-overlay(100) 与对话气泡(150)，但低于 toast(200) */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  /* 手机背后的暖色氛围光：几层大半径径向渐变叠在近黑底上 */
  background:
    radial-gradient(ellipse 65% 55% at 15% 52%, rgba(168, 78, 10, 0.22), transparent 72%),
    radial-gradient(ellipse 52% 48% at 83% 26%, rgba(122, 52, 8, 0.17), transparent 72%),
    radial-gradient(ellipse 44% 52% at 56% 92%, rgba(98, 36, 5, 0.14), transparent 72%),
    radial-gradient(ellipse 30% 30% at 72% 75%, rgba(60, 20, 5, 0.10), transparent 72%),
    rgba(7, 4, 2, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: phoneOverlayIn 0.35s ease-out;

  --pbg: #180a06;
  --pcard: rgba(255, 255, 255, 0.06);
  --ptext: #ede4d8;
  --pmuted: rgba(235, 220, 205, 0.55);
  --pdim: #baaa9a8c;
  --pradius: 24px;

  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Display",
    "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Inter, Roboto, sans-serif;
  color: var(--ptext);
}

@keyframes phoneOverlayIn { from { opacity: 0; } to { opacity: 1; } }

/* --- 手机外壳：固定 390x844 的竖屏尺寸，靠 --phone-scale 缩放塞进当前视口
   （游戏本体是横屏的，竖屏手机高度基本装不下，缩放值由 vlogstats.js 按窗口算） --- */
.phone-frame {
  position: relative;
  width: 390px;
  height: 844px;
  flex: none;
  background: #000;
  border-radius: 44px;
  overflow: hidden;
  transform: scale(var(--phone-scale, 0.78));
  transform-origin: center center;
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 60px rgba(180, 80, 20, 0.10);
}

.phone-screen {
  position: absolute;
  inset: 0;
  background: var(--pbg);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 28px;
  /* 滚轮之外还能按住鼠标上下拖（见 vlogstats.js 的 wireDragScroll）；
     禁掉选中，免得拖的时候把文字刷成一片蓝 */
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.phone-screen.dragging { cursor: grabbing; }
.phone-screen::-webkit-scrollbar { display: none; }

/* --- 手机左边空地上的"还能往下划"提示：竖排一列字 + 一个上下点头的箭头。
   点它往下翻一屏；玩家自己滚过之后就淡出，不再出现。位置用 clamp 夹住，
   窗口再窄也不会糊到手机上。 --- */
.phone-scroll-hint {
  position: absolute;
  top: 50%;
  left: clamp(16px, 24%, calc(50% - 230px));
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px 6px;
  border: none;
  background: none;
  font-family: inherit;
  color: rgba(235, 220, 205, 0.52);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.6s ease, color 0.2s ease;
  animation: fadeIn 1s ease-out 1.3s both;
}
.phone-scroll-hint:hover { color: rgba(255, 190, 140, 0.8); }
.phone-scroll-hint.is-gone { opacity: 0; pointer-events: none; }

.phone-scroll-hint-text {
  writing-mode: vertical-rl;
  font-size: 13px;
  letter-spacing: 0.3em;
}

.phone-scroll-hint svg {
  width: 16px;
  height: 16px;
  animation: hintNudge 1.8s ease-in-out infinite;
}

@keyframes hintNudge {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%      { transform: translateY(6px); opacity: 1; }
}

/* --- 顶部封面：没有视频素材，用"现代版"卫星底图当视频封面，
   压暖色调 + 缓慢推近，模拟一段循环播放的片头 --- */
.phone-hero {
  position: relative;
  height: 430px;
  overflow: hidden;
  animation: heroReveal 1.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.phone-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.5) contrast(1.12) brightness(0.44) sepia(0.4) hue-rotate(-12deg);
  animation: heroDrift 26s ease-in-out infinite alternate;
}

/* 暖光 + 底部渐隐到背景色，让封面和下面的内容连成一整块 */
.phone-hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 18%, rgba(226, 110, 24, 0.38), transparent 68%),
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255, 70, 10, 0.22), transparent 70%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.phone-hero-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(8, 4, 2, 0.55) 0%,
    rgba(8, 4, 2, 0.12) 26%,
    rgba(20, 9, 5, 0.72) 68%,
    var(--pbg) 100%);
  pointer-events: none;
}

.phone-topbar {
  position: absolute;
  top: 18px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.phone-hero-meta {
  position: absolute;
  left: 80px;
  right: 80px;
  top: 32px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(235, 220, 205, 0.62);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.8s ease-out 0.6s both;
}

/* --- 玻璃按钮体系：无边框，靠内阴影勾边 + 背景模糊做出玻璃感 --- */
.glass {
  border: none;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ptext);
  font-family: inherit;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.28),
    inset 0 -1px 0.5px rgba(255, 255, 255, 0.10),
    inset 1px 0 0.5px rgba(255, 255, 255, 0.12),
    inset -1px 0 0.5px rgba(255, 255, 255, 0.12),
    0 2px 10px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(2px) saturate(1.3);
  -webkit-backdrop-filter: blur(2px) saturate(1.3);
  transition: transform 0.16s ease, background 0.16s ease;
}
.glass:hover { background: rgba(255, 255, 255, 0.08); }
.glass:active { transform: scale(0.94); }

.glass.circle {
  width: 58px;
  height: 44px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glass.pill {
  height: 54px;
  border-radius: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  font-size: 18px;
  font-weight: 500;
}

.glass svg { width: 20px; height: 20px; display: block; }

/* --- 身份区：频道名 + 左右月桂枝，整体上移压在封面上 --- */
.phone-identity {
  position: relative;
  margin-top: -112px;
  text-align: center;
  padding: 0 16px;
}

.phone-laurel {
  position: absolute;
  top: -14px;
  height: 73px;
  width: auto;
  opacity: 0.6;
  color: var(--ptext);
  animation: fadeIn 0.8s ease-out 0.5s both;
  pointer-events: none;
}
.phone-laurel-left  { right: calc(50% + 66px); }
.phone-laurel-right { left: calc(50% + 66px); transform: scaleX(-1); }

.phone-name {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
  animation: fadeRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

.phone-subtitle {
  margin-top: 6px;
  font-size: 15px;
  color: var(--pmuted);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  animation: fadeRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.58s both;
}

/* --- 本期/累计切换胶囊 --- */
.phone-toggle-row {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  animation: fadeRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.66s both;
}
.phone-toggle { min-width: 225px; }
.phone-toggle .phone-trophy { font-size: 18px; line-height: 1; }

/* --- 三宫格数据卡 --- */
.phone-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 26px 16px 0;
}

.phone-card {
  background: var(--pcard);
  border-radius: var(--pradius);
}

.phone-stat {
  padding: 18px 6px 16px;
  text-align: center;
}
.phone-stat:nth-child(1) { animation: fadeRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.74s both; }
.phone-stat:nth-child(2) { animation: fadeRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.80s both; }
.phone-stat:nth-child(3) { animation: fadeRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.86s both; }

.phone-stat-icon {
  width: 56px;
  height: 56px;
  margin: 4px auto 10px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(255, 150, 60, 0.22), rgba(120, 40, 8, 0.24));
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.22);
}
.phone-stat-icon svg { width: 26px; height: 26px; color: #ffb070; }

.phone-stat-num {
  font-size: 25px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.phone-stat-label {
  margin-top: 4px;
  font-size: 13px;
  color: var(--pdim);
  line-height: 1.35;
}

/* --- 最热片段卡 --- */
.phone-favorite {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 110px;
  margin: 12px 16px 0;
  padding: 0 16px 0 0;
  animation: fadeRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.94s both;
}

.phone-thumb {
  width: 108px;
  height: 108px;
  flex: none;
  border-radius: var(--pradius);
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 30% 25%, rgba(255, 160, 70, 0.30), transparent 60%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02));
  position: relative;
  overflow: hidden;
}
.phone-thumb svg { width: 34px; height: 34px; color: rgba(255, 220, 190, 0.85); }
/* 缩略图上的扫描线，提示"这是一段视频素材" */
.phone-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.05) 0 1px, transparent 1px 4px);
  pointer-events: none;
}

.phone-fav-text { flex: 1; min-width: 0; }
.phone-fav-kicker { font-size: 13px; font-weight: 500; color: var(--pmuted); }
.phone-fav-title {
  font-size: 18px;
  font-weight: 500;
  margin: 2px 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone-fav-sub { font-size: 13px; color: var(--pdim); }

.phone-fav-btn { flex: none; width: 44px; height: 44px; border-radius: 22px; }

/* --- 折线以下：完播率 / 新增关注 / 评论区 --- */
.phone-block {
  margin: 12px 16px 0;
  padding: 16px;
  animation: fadeIn 0.8s ease-out 1.02s both;
}

.phone-block-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--pmuted);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.phone-block-value { font-size: 19px; font-weight: 500; color: var(--ptext); font-variant-numeric: tabular-nums; }

.phone-bar {
  margin-top: 10px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.phone-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #d8641c, #ffb070);
  width: 0;
  transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

.phone-subrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 14px;
  font-size: 13px;
  color: var(--pdim);
}
.phone-subrow strong { font-size: 17px; font-weight: 500; color: #ffb070; font-variant-numeric: tabular-nums; }

.phone-comment {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.phone-comment:first-of-type { border-top: none; }

.phone-avatar {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #2a1206;
  font-weight: 600;
  background: linear-gradient(150deg, #e8a06a, #b35a1e);
}
.phone-comment-body { flex: 1; min-width: 0; }
.phone-comment-user { font-size: 12px; color: var(--pmuted); }
.phone-comment-text { font-size: 13px; line-height: 1.55; margin-top: 2px; word-break: break-word; }
.phone-comment-likes { font-size: 12px; color: var(--pdim); flex: none; align-self: center; }

/* 未知来源的评论：呼应"置顶那条不是我们发的" */
.phone-comment-alien .phone-avatar { background: linear-gradient(150deg, #6d6d72, #2f2f33); color: #d8d8d8; }
.phone-comment-alien .phone-comment-text { color: #c9b8ab; font-style: italic; }

.phone-warning {
  margin: 12px 16px 0;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.5;
  color: #ffc9a8;
  background: rgba(180, 60, 20, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 140, 90, 0.18);
  animation: fadeIn 0.8s ease-out 1.1s both;
}

.phone-actions {
  display: flex;
  justify-content: center;
  padding: 22px 16px 10px;
  animation: fadeIn 0.8s ease-out 1.1s both;
}
.phone-actions .glass.pill { width: 100%; font-size: 16px; }

/* --- 理智濒崩 / 素材出错时的"信号不好"观感 --- */
.phone-glitch .phone-hero-img { filter: saturate(0.4) contrast(1.3) brightness(0.55) sepia(0.5) hue-rotate(-25deg); }
.phone-glitch .phone-name { animation: fadeRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both, phoneGlitchShift 4.5s steps(1) infinite; }
.phone-glitch .phone-stat-num { animation: phoneGlitchShift 6s steps(1) infinite; }

@keyframes phoneGlitchShift {
  0%, 96%  { text-shadow: none; transform: translateX(0); }
  97%      { text-shadow: -1.5px 0 rgba(255,60,40,0.8), 1.5px 0 rgba(60,180,255,0.6); transform: translateX(1px); }
  98%      { text-shadow: 1.5px 0 rgba(255,60,40,0.8), -1.5px 0 rgba(60,180,255,0.6); transform: translateX(-1px); }
  99%      { text-shadow: none; transform: translateX(0); }
}

/* --- 入场动画 --- */
@keyframes heroReveal {
  from { opacity: 0; transform: scale(1.01); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes heroDrift {
  from { transform: scale(1.02) translateY(0); }
  to   { transform: scale(1.12) translateY(-10px); }
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeRise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.phone-topbar .glass.circle:nth-child(1) { animation: dropIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both; }
.phone-topbar .glass.circle:nth-child(2) { animation: dropIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.42s both; }

@media (prefers-reduced-motion: reduce) {
  .phone-overlay,
  .phone-overlay * {
    animation: none !important;
    transition: none !important;
  }
  .phone-bar-fill { transition: none !important; }
}
