/* phone.css — 查看记录入口与角色手机模拟界面 */

.phone-records-home-page .miss-section-title,
.phone-records-home-page .miss-list,
.phone-records-home-page .miss-empty,
.phone-records-home-page .miss-loading {
  overflow: visible;
}

/* ===== 全屏手机模拟层 ===== */
.phone-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.phone-fullscreen.show {
  opacity: 1;
}

.phone-fullscreen.is-closing {
  opacity: 0;
  pointer-events: none;
}

/* ===== 锁屏 ===== */
.phone-lock-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--c-text);
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

.phone-lock-wallpaper {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(200, 200, 200, 0.15), transparent 50%),
    linear-gradient(160deg, #f0f0f0 0%, #e8e8e8 30%, #f5f5f5 50%, #eaeaea 70%, #f2f2f2 100%);
}

/* 锁屏时间 */
.phone-lock-time {
  margin-top: calc(60px + env(safe-area-inset-top, 0px));
  text-align: center;
  z-index: 1;
}

.phone-lock-time-digits {
  font-size: clamp(64px, 22vw, 96px);
  font-weight: 200;
  letter-spacing: 2px;
  line-height: 1;
  color: var(--c-text);
}

.phone-lock-date {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 500;
  color: var(--c-sub);
  letter-spacing: 0.5px;
}

/* 锁屏占位，把通知和指纹推到底部 */
.phone-lock-spacer {
  flex: 1;
}

/* 锁屏通知卡片 */
.phone-lock-notification {
  margin: 0 20px 16px;
  width: calc(100% - 40px);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.06);
  z-index: 1;
  animation: phoneSlideUp 0.4s var(--ease) both;
  animation-delay: 0.15s;
}

@keyframes phoneSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.phone-lock-notif-avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--c-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--c-sub);
}

.phone-lock-notif-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-lock-notif-body {
  flex: 1;
  min-width: 0;
}

.phone-lock-notif-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--c-text);
}

.phone-lock-notif-hint {
  margin-top: 2px;
  font-size: 12px;
  color: var(--c-hint);
}

/* 指纹区域 */
.phone-fingerprint-area {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  z-index: 2;
}

.phone-fingerprint {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: var(--c-hint);
  background: rgba(0, 0, 0, 0.04);
  border: 1.5px solid var(--c-border-m);
  transition: all 0.3s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-fingerprint i {
  font-size: 28px;
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}

.phone-fingerprint:active {
  transform: scale(0.92);
  background: rgba(0, 0, 0, 0.07);
}

.phone-fingerprint-hint {
  font-size: 11px;
  color: var(--c-hint);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* 指纹扫描动画 */
.phone-fingerprint.scanning {
  border-color: var(--c-accent);
  background: rgba(138, 138, 138, 0.1);
  box-shadow: 0 0 20px rgba(138, 138, 138, 0.15);
}

.phone-fingerprint.scanning i {
  color: var(--c-accent-dark);
  animation: phoneFpPulse 0.6s var(--ease);
}

@keyframes phoneFpPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.phone-fingerprint.scanning::before,
.phone-fingerprint.scanning::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--c-accent);
  animation: phoneFpRipple 0.8s var(--ease) forwards;
}

.phone-fingerprint.scanning::after {
  animation-delay: 0.15s;
}

@keyframes phoneFpRipple {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* 指纹成功 */
.phone-fingerprint.success {
  border-color: var(--c-accent-dark);
  background: rgba(138, 138, 138, 0.12);
  box-shadow: 0 0 24px rgba(138, 138, 138, 0.2);
}

.phone-fingerprint.success i {
  color: var(--c-text);
}

/* ===== 主页 ===== */
.phone-home-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  color: var(--c-text);
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

.phone-home-wallpaper {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 30% 25%, rgba(255, 255, 255, 0.5), transparent 55%),
    radial-gradient(ellipse at 75% 75%, rgba(220, 220, 220, 0.2), transparent 50%),
    linear-gradient(155deg, #f2f2f2 0%, #eaeaea 40%, #f0f0f0 60%, #e6e6e6 80%, #f4f4f4 100%);
}

/* 主页头部用户信息 */
.phone-home-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 20px 0;
  margin-top: calc(8px + env(safe-area-inset-top, 0px));
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow:
    inset 1px 1px 0 0 rgba(255, 255, 255, 0.6),
    inset -1px -1px 0 0 rgba(255, 255, 255, 0.2),
    0 4px 16px rgba(0, 0, 0, 0.04);
  z-index: 1;
}

.phone-home-avatar {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--c-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--c-sub);
}

.phone-home-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-home-name {
  max-width: min(220px, 60vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--c-text);
}

.phone-home-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--c-hint);
  font-weight: 500;
}

/* 角色资料组件 */
.phone-profile-card {
  margin: calc(8px + env(safe-area-inset-top, 0px)) 20px 0;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow:
    inset 1px 1px 0 0 rgba(255, 255, 255, 0.62),
    inset -1px -1px 0 0 rgba(255, 255, 255, 0.2),
    0 4px 16px rgba(0, 0, 0, 0.045);
  z-index: 1;
}

.phone-profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.phone-profile-avatar {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--c-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-sub);
  font-size: 22px;
  font-weight: 800;
}

.phone-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-profile-main {
  flex: 1;
  min-width: 0;
}

.phone-profile-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--c-text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.phone-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.phone-profile-stat {
  min-width: 0;
  text-align: center;
}

.phone-profile-stat strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--c-text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
}

.phone-profile-stat span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--c-hint);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
}

.phone-profile-account {
  margin-top: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--c-sub);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.phone-profile-bio {
  margin-top: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--c-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  word-break: break-word;
}

.phone-profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.phone-profile-action {
  min-width: 0;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.72);
  color: var(--c-text);
  font-size: 13px;
  font-weight: 750;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.045);
}

.phone-profile-action-primary {
  background: rgba(36, 36, 36, 0.88);
  color: #fff;
  box-shadow: none;
}

/* 应用网格 */
.phone-home-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 82px;
  align-content: start;
  gap: 12px 8px;
  padding: 16px 20px 10px;
  z-index: 1;
}

/* Dock 栏 */
.phone-home-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 20px 6px;
  padding: 10px 16px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow:
    inset 1px 1px 0 0 rgba(255, 255, 255, 0.55),
    inset -1px -1px 0 0 rgba(255, 255, 255, 0.2),
    0 4px 16px rgba(0, 0, 0, 0.04);
  z-index: 1;
}

/* 应用按钮 */
.phone-home-app {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  max-width: 78px;
  padding: 4px 8px;
  color: var(--c-text);
  transition: transform 0.15s var(--ease), opacity 0.15s var(--ease);
}

.phone-home-grid .phone-home-app {
  flex: none;
  max-width: none;
  padding: 0;
}

.phone-home-app:active {
  transform: scale(0.88);
  opacity: 0.75;
}

/* 玻璃质感图标 — 和主页 icon-bg 一致 */
.phone-home-app-icon {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%) brightness(1.05);
  -webkit-backdrop-filter: blur(20px) saturate(180%) brightness(1.05);
  box-shadow:
    inset 1px 1px 0 0 rgba(255, 255, 255, 0.55),
    inset -1px -1px 0 0 rgba(255, 255, 255, 0.2);
  color: var(--icon-color, var(--c-accent-dark));
  position: relative;
  overflow: hidden;
}

.phone-home-dock .phone-home-app-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
}

.phone-home-app-icon i {
  font-size: 24px;
}

.phone-home-app-icon svg {
  width: 26px;
  height: 26px;
}

.phone-home-app-icon svg path {
  fill: var(--icon-color, var(--c-accent-dark));
}

.phone-home-app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-home-app-label {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--c-text);
  opacity: 0.7;
}

/* ===== 查看记录手机 iScreen ===== */
.phone-iscreen-page {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  color: var(--c-text);
  transform: translateY(100%);
  transition: transform 0.28s var(--ease);
  overflow: hidden;
}

.phone-iscreen-page.show {
  transform: translateY(0);
}

.phone-iscreen-page.is-closing {
  pointer-events: none;
}

.phone-iscreen-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.phone-iscreen-section-title {
  color: var(--c-text);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.phone-iscreen-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.phone-iscreen-gallery-section,
.phone-iscreen-wallpaper-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phone-gallery-grid,
.phone-wallpaper-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.phone-gallery-card,
.phone-wallpaper-card {
  min-width: 0;
  padding: 10px;
  border-radius: 16px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

.phone-gallery-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.phone-gallery-card-title,
.phone-wallpaper-card-title {
  min-width: 0;
  color: var(--c-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.phone-wallpaper-card-title {
  margin-bottom: 8px;
}

.phone-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-height: 48px;
}

.phone-gallery-thumb {
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 10px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
}

.phone-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.phone-gallery-empty {
  grid-column: 1 / -1;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--c-surface);
  color: var(--c-hint);
  font-size: 12px;
}

.phone-wallpaper-preview {
  position: relative;
  aspect-ratio: 9 / 19.5;
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
}

.phone-wallpaper-preview-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 25%, rgba(255, 255, 255, 0.5), transparent 55%),
    radial-gradient(ellipse at 75% 75%, rgba(220, 220, 220, 0.2), transparent 50%),
    linear-gradient(155deg, #f2f2f2 0%, #eaeaea 40%, #f0f0f0 60%, #e6e6e6 80%, #f4f4f4 100%);
  background-size: cover;
  background-position: center;
}

.phone-wallpaper-pick {
  width: 100%;
  height: 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  color: var(--c-text);
  font-size: 13px;
  font-weight: 600;
}

.phone-wallpaper-pick:active {
  background: var(--c-surface-2);
}

.phone-wallpaper-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.phone-iscreen-page .iscreen-row {
  box-shadow: var(--shadow-sm);
}

.phone-iscreen-page .iscreen-row-icon .phone-home-app-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
}

/* ===== iOS Home Indicator 退出条 ===== */
.phone-home-indicator {
  width: 100%;
  padding: 6px 0;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  z-index: 10;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.phone-home-indicator-bar {
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.18);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}

.phone-home-indicator:active .phone-home-indicator-bar {
  transform: scaleX(0.92);
  background: rgba(0, 0, 0, 0.35);
}

/* ===== 锁屏 → 主页过渡 ===== */
.phone-lock-screen.unlocking {
  animation: phoneLockOut 0.5s var(--ease) forwards;
}

@keyframes phoneLockOut {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
    filter: blur(8px);
  }
}

.phone-home-screen.entering {
  animation: phoneHomeIn 0.45s var(--ease) both;
}

@keyframes phoneHomeIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== 响应式 ===== */
@media (max-height: 640px) {
  .phone-lock-time {
    margin-top: calc(30px + env(safe-area-inset-top, 0px));
  }

  .phone-lock-time-digits {
    font-size: clamp(52px, 18vw, 76px);
  }

  .phone-lock-notification {
    bottom: 110px;
  }

  .phone-home-grid {
    grid-auto-rows: 78px;
    gap: 10px 8px;
    padding: 14px 18px 8px;
  }

  .phone-home-app-icon {
    width: 50px;
    height: 50px;
  }

  .phone-home-dock .phone-home-app-icon {
    width: 48px;
    height: 48px;
  }
}

@media (min-height: 800px) {
  .phone-lock-time {
    margin-top: calc(80px + env(safe-area-inset-top, 0px));
  }

  .phone-lock-notification {
    bottom: 170px;
  }
}
