* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  /* Prevent scrolling */
  height: 100vh;
  width: 100vw;
  position: fixed;
  /* Lock body in place */
  left: 0;
  top: 0;
  touch-action: none;
  /* 防止触摸缩放 */
  -webkit-user-select: none;
  /* 防止选择文本 */
  user-select: none;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Helvetica, sans-serif;
  background-color: var(--ios-bg);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  color: var(--text-dark);
}

.global-wallpaper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.8s cubic-bezier(0.32, 0.72, 0, 1), filter 0.8s ease, opacity 0.5s ease;
  pointer-events: none;
}

body.wallpaper-blur .global-wallpaper {
  filter: blur(3px) brightness(1.05);
  /* Reduced blur for subtler effect */
  transform: scale(1.03);
  /* Minimal zoom to keep edges clean */
}

/* Ensure the body background doesn't show white gaps when blurring */
body {
  background-color: #000 !important;
}

   Home Screen Layout
   ============================================ */
.phone-screen {
  overflow: hidden;
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.6s cubic-bezier(0.32, 0.72, 0, 1);
  padding: 0;
  z-index: 1;
  /* Removed padding to allow header to be full-width */
}

.phone-screen.hidden {
  transform: scale(0.9) translateY(40px);
  opacity: 0;
  pointer-events: none;
}

/* Header & Dynamic Island & Status Bar */
.screen-header {
  background: transparent;
  width: 100%;
  margin: 0;
  height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  font-weight: 600;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.status-left {
  width: 70px;
  padding-left: 14px;
}

.time {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: #fff;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8), 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Dynamic Island (Simplified) */
.dynamic-island {
  background: #000;
  width: 126px;
  height: 36px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  /* Align camera right */
  padding-right: 12px;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  /* 调淡灵动岛边框，避免看起来像灰线 */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 0 2px rgba(255, 255, 255, 0.05);
}

.status-center-placeholder {
  width: 126px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-top-avatar-slot {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  display: flex;
  justify-content: center;
  z-index: 120;
  pointer-events: none;
}

.home-header-avatar-btn {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 1.6px solid rgba(255, 214, 226, 0.96);
  background: rgba(255, 255, 255, 0.18);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 225, 234, 0.5);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  position: relative;
}

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

.home-header-avatar-btn.has-image .home-header-avatar-img {
  display: block;
}

.home-header-avatar-fallback {
  display: none;
}

.home-header-avatar-btn.has-image .home-header-avatar-fallback {
  display: none;
}

.home-header-avatar-btn.has-image .home-header-avatar-hint {
  display: none;
}

.home-header-avatar-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(232, 232, 232, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.home-header-avatar-hint::before,
.home-header-avatar-hint::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(126, 126, 126, 0.95);
  border-radius: 999px;
}

.home-header-avatar-hint::before {
  width: 10px;
  height: 1.5px;
}

.home-header-avatar-hint::after {
  width: 1.5px;
  height: 10px;
}

.home-top-avatar-slot.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.island-camera {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #111;
  box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.1);
}

/* Status Right Icons - Pure CSS */
.status-right {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 86px;
  justify-content: flex-end;
  padding-right: 2px;
}

/* Signal Bars */
.signal-icon {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  width: 18px;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.8)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.signal-bar {
  width: 3px;
  background: #fff;
  border-radius: 1px;
}

.bar-1 {
  height: 4px;
  opacity: 0.4;
}

.bar-2 {
  height: 6px;
}

.bar-3 {
  height: 8px;
}

.bar-4 {
  height: 11px;
}

/* WiFi Arc - SVG Container */
.wifi-icon {
  width: 22px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.8)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.wifi-icon svg {
  width: 100%;
  height: 100%;
}

/* Battery Icon */
.battery-icon {
  width: 25px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  padding: 1px;
  position: relative;
  display: flex;
  align-items: center;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.8)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.battery-icon::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 3px;
  height: 4px;
  width: 2px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 0 1px 1px 0;
}

.battery-body {
  width: 100%;
  height: 100%;
  border-radius: 2px;
  overflow: hidden;
}

.battery-fill {
  width: 60%;
  height: 100%;
  background: #fff;
}

/* Home Content Area - Swipeable Pages - GPU Accelerated */
.home-pages-container {
  flex: 1;
  position: relative;
  overflow: visible;
  touch-action: pan-y; /* Allow vertical scroll, handle horizontal in JS */
}

.home-pages-wrapper {
  display: flex;
  width: 200%;
  height: 100%;
  /* Hardware acceleration */
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
  /* Smooth transition */
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.home-page {
  width: 50%;
  height: 100%;
  overflow: visible;
  position: relative;
  /* Prevent content from affecting performance */
  transform: translateZ(0);
  backface-visibility: hidden;
}

.home-scrollbox {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  padding-bottom: 140px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* 使用 auto-rows 配合 aspect-ratio 保持比例 */
  grid-auto-rows: var(--home-grid-row, auto);
  gap: 8px 15px;
  /* Hide scrollbar for Firefox */
  scrollbar-width: none;
  /* Hide scrollbar for IE/Edge */
  -ms-overflow-style: none;
}

.home-scrollbox::-webkit-scrollbar {
  display: none;
}

/* Home Edit Mode */
.home-edit-toolbar {
  position: absolute;
  top: 82px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.home-edit-title {
  font-size: 14px;
  font-weight: 600;
  color: #1A1A1A;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.home-edit-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  color: #1A1A1A;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  pointer-events: auto;
}

.home-edit-btn.primary {
  background: #FF8FAB;
  color: #fff;
}

body.home-edit-mode .home-edit-toolbar {
  opacity: 1;
  pointer-events: auto;
}

body.home-edit-mode .home-top-avatar-slot {
  opacity: 0.35;
  pointer-events: none;
}

@keyframes homeWiggle {
  0% { transform: rotate(-1.2deg); }
  50% { transform: rotate(1.2deg); }
  100% { transform: rotate(-1.2deg); }
}

body.home-edit-mode .home-scrollbox .app-icon,
body.home-edit-mode .home-scrollbox .widget,
body.home-edit-mode .home-scrollbox .music-widget,
body.home-edit-mode .dock-item {
  animation: homeWiggle 0.18s ease-in-out infinite;
  transform-origin: center;
  -webkit-touch-callout: none;
  user-select: none;
}

body.home-edit-mode .home-deletable {
  overflow: visible !important;
}

body.home-edit-mode .home-dragging {
  animation: none !important;
}

body.home-edit-mode .home-scrollbox {
  overflow: hidden !important;
  touch-action: none;
  background-image:
    linear-gradient(to right, rgba(255, 143, 171, 0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 143, 171, 0.2) 1px, transparent 1px);
  background-size: calc(var(--home-grid-col, 60px) + var(--home-grid-col-gap, 0px))
      calc(var(--home-grid-row, 60px) + var(--home-grid-row-gap, 0px));
  background-origin: content-box;
  background-clip: content-box;
  background-position: 0 0;
}

.home-scrollbox .dock-item {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.home-scrollbox .dock-item .dock-icon-bg {
  width: var(--home-icon-size);
  height: var(--home-icon-size);
  border-radius: 22.5%;
}

.dock-inner .app-icon {
  width: var(--dock-item-size);
  height: var(--dock-item-size);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dock-inner .app-icon:active {
  transform: scale(0.85);
}

.dock-inner .app-icon .icon-img-box {
  width: 100%;
  height: 100%;
  border-radius: 22.5%;
}

.dock-inner .app-icon .icon-label {
  display: none !important;
}

.home-selected {
  outline: 2px solid rgba(255, 143, 171, 0.9);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(255, 143, 171, 0.35) !important;
  border-radius: 18px;
}

.gallery-widget-large.home-selected,
.cute-clock-widget.home-selected,
.large-photo-widget.home-selected {
  box-shadow: 0 0 0 3px rgba(255, 143, 171, 0.88) inset, 0 0 0 2px rgba(255, 143, 171, 0.35) !important;
}

.home-move-pad {
  position: absolute;
  right: 16px;
  bottom: 120px;
  width: 110px;
  height: 110px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10020;
}

body.home-edit-mode .home-move-pad {
  display: flex;
}

.home-move-pad .pad-btn {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #FF8FAB;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.home-move-pad .pad-btn.up { top: 0; left: 50%; transform: translateX(-50%); }
.home-move-pad .pad-btn.down { bottom: 0; left: 50%; transform: translateX(-50%); }
.home-move-pad .pad-btn.left { left: 0; top: 50%; transform: translateY(-50%); }
.home-move-pad .pad-btn.right { right: 0; top: 50%; transform: translateY(-50%); }
.home-move-pad .pad-btn.center {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 700;
  background: #FF8FAB;
  color: #fff;
}

.home-widget-delete {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #FF5C8A;
  color: #fff;
  font-size: 14px;
  line-height: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(255, 92, 138, 0.35);
  z-index: 120;
  cursor: pointer;
}

body.home-edit-mode .home-widget-delete {
  display: flex;
}

.home-drop-preview {
  border: 2px dashed rgba(255, 143, 171, 0.8);
  background: rgba(255, 143, 171, 0.12);
  border-radius: 16px;
  pointer-events: none;
}

.home-custom-widget {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.6);
  aspect-ratio: auto;
}

.home-custom-widget img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-custom-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.6);
}

.home-widget-modal {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  z-index: 10010;
  backdrop-filter: blur(4px);
}

.home-widget-modal.active {
  display: flex;
}

.home-widget-card {
  width: 260px;
  padding: 18px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
}

.home-widget-title {
  font-size: 14px;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 12px;
}

.home-widget-size {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #555;
  margin-bottom: 16px;
}

.home-widget-size select {
  height: 28px;
  border-radius: 8px;
  border: 1px solid #E6E6E6;
  padding: 0 8px;
  background: #fff;
}

.home-widget-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.home-widget-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.home-widget-btn.ghost {
  background: #F2F2F2;
  color: #555;
}

.home-widget-btn.primary {
  background: #FF8FAB;
  color: #fff;
}

/* Page Indicator */
.page-indicator {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.page-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.page-dot.active {
  background: rgba(0, 0, 0, 0.6);
  width: 20px;
  border-radius: 4px;
}

/* Widgets Styling */
.widget {
  background: var(--widget-bg);
  border-radius: var(--radius-widget);
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1;
  /* 默认1:1比例，特殊组件会覆盖 */
}

.widget-footer {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #666;
  font-weight: 500;
}

/* Photo Frame Widget (Replacing Music Widget) */
.large-photo-widget {
  height: 100%;
  aspect-ratio: auto;
  background: var(--widget-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-widget);
  position: relative;
  overflow: hidden;
}

.photo-widget-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.photo-widget-copy {
  margin-top: auto;
  padding: 18px 16px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.44), rgba(0, 0, 0, 0));
}

.photo-widget-location {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  cursor: text;
  width: fit-content;
}

.photo-widget-location-icon {
  font-size: 13px;
  line-height: 1;
}

.photo-widget-title {
  margin-top: 8px;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.42);
  pointer-events: auto;
  cursor: text;
  width: fit-content;
}

.large-photo-widget:active {
  transform: scale(0.96);
}

.photo-widget-placeholder {
  position: absolute;
  left: 50%;
  top: 64%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9a9a9a;
  pointer-events: none;
}

.photo-widget-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(160, 160, 160, 0.65);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
}

.large-photo-widget img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  /* Shown via JS if image exists */
}

body.home-edit-mode .large-photo-widget img {
  border-radius: inherit;
}

.large-photo-widget.has-image .photo-widget-placeholder {
  display: none;
}

.large-photo-widget.has-image img {
  display: block;
}

.large-photo-widget:not(.has-image) .photo-widget-copy {
  display: none;
}

/* Twin Widgets Container (Gallery + Weather) */
.twin-widgets {
  display: flex;
  gap: 12px;
  flex: 1;
  justify-content: flex-end;
}

.twin-widget {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-icon);
  /* Match icon shape */
  display: flex;
  flex-direction: column;
  padding: 10px;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
  overflow: hidden;
}

.twin-widget:active {
  transform: scale(0.97);
}

.twin-widget-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #666;
  font-weight: 500;
  white-space: nowrap;
}

/* Clock Twin Widget (New Small Version) */
.clock-twin-widget {
  grid-column: 3;
  grid-row: 3 / 5;
  background: linear-gradient(135deg,
      rgba(60, 60, 60, 0.6) 0%,
      rgba(40, 40, 40, 0.5) 50%,
      rgba(20, 20, 20, 0.6) 100%);
  backdrop-filter: blur(25px) saturate(150%);
  -webkit-backdrop-filter: blur(25px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
  color: #fff;
  align-items: center;
  justify-content: center;
}

.clock-twin-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: #fff;
  gap: 12px;
}

.clock-twin-time {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
}

.clock-twin-date {
  font-size: 14px;
  opacity: 0.8;
  font-weight: 500;
}

/* Weather Twin Widget - Premium Glassmorphism */
.weather-widget.twin-widget {
  grid-column: 4;
  grid-row: 3 / 5;
  background: linear-gradient(135deg,
      rgba(180, 100, 120, 0.6) 0%,
      rgba(140, 80, 100, 0.5) 50%,
      rgba(120, 70, 90, 0.6) 100%);
  backdrop-filter: blur(25px) saturate(150%);
  -webkit-backdrop-filter: blur(25px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.15),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.weather-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  color: #fff;
}

.weather-location {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 2px;
}

/* Vertical Weather Widget specific adjustments */
.weather-vertical-widget .weather-location {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.weather-city {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.location-arrow {
  opacity: 0.9;
  transform: rotate(45deg);
}

.weather-temp {
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -2px;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  margin: 2px 0 auto;
}

.weather-condition {
  display: flex;
  align-items: center;
  gap: 5px;
}

.weather-icon {
  opacity: 0.95;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.weather-desc {
  font-size: 12px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Gallery Twin Widget (Vertical) */
.gallery-twin-widget {
  background: linear-gradient(135deg,
      rgba(140, 120, 180, 0.55) 0%,
      rgba(120, 100, 160, 0.5) 50%,
      rgba(100, 80, 140, 0.55) 100%);
  backdrop-filter: blur(25px) saturate(150%);
  -webkit-backdrop-filter: blur(25px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-icon);
  /* Match icon shape */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Gallery Widget Row - Large - Bottom Right */
.gallery-widget-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Gallery Widget - Large Square */
.gallery-widget-large {
  width: 100%;
  height: 100%;
  background: transparent;
  /* 透明背景，依靠图片填充 */
  /* 移除 backdrop-filter 避免灰边 */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: none;
  /* 移除边框 */
  box-shadow: none !important;
  /* 强制移除阴影 */
  border-radius: 28px !important;
  /* 强制大圆角 */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  /* 确保内容不会溢出圆角 */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
  /* 标准属性兼容性 */
  /* 修复 Safari/iOS 圆角溢出问题 - 强制 GPU 渲染 */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.gallery-large-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.gallery-large-icon {
  font-size: 64px;
  filter: none;
  /* 移除图标阴影 */
}

.gallery-large-text {
  font-size: 18px;
  font-weight: 600;
  text-shadow: none;
  /* 移除文字阴影 */
}

/* Gallery custom icon mode: full-bleed fill only when customized */
.gallery-widget-large.is-custom-icon .gallery-large-content {
  width: 100%;
  height: 100%;
  justify-content: center;
  gap: 0;
}

.gallery-widget-large.is-custom-icon .gallery-large-icon {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-widget-large.is-custom-icon .gallery-large-icon img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
  mix-blend-mode: normal !important;
}

/* Browser Styles */
.dock-icon-bg.browser-blue {
  background: linear-gradient(135deg, #007AFF, #5856D6);
  color: white;
  font-size: 32px;
}

.music-content {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  padding: 0 24px;
}

.vinyl-record {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: #111;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Vinyl Grooves */
.vinyl-grooves {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: repeating-radial-gradient(#111 0,
      #111 2px,
      #222 3px,
      #111 4px);
}

.album-art {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 100%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 4px solid #fff;
}

/* Animation */
.vinyl-record.playing {
  animation: rotateVinyl 6s linear infinite;
}

@keyframes rotateVinyl {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.music-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.music-info h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.music-info p {
  font-size: 12px;
  color: #888;
}

.progress-container {
  width: 100%;
  height: 4px;
  background: #F0F0F0;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: #333;
  transition: width 0.1s linear;
}

.control-buttons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.control-btn {
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}

.control-btn:active {
  transform: scale(0.9);
}

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #333;
  color: #fff;
  font-size: 18px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sm-btn {
  font-size: 20px;
  color: #666;
}

/* Mid Row Layout */
.widgets-row {
  display: flex;
  gap: 16px;
  height: 160px;
}

.icons-column {
  width: calc(50% - 8px);
  flex: 0 0 auto;
  /* Stop letting flex guess width */
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.icon-pair {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  aspect-ratio: 1 / 1;
  /* 保持1:1正方形比例 */
  width: 100%;
}

.icon-img-box {
  width: var(--home-icon-size);
  height: var(--home-icon-size);
  border-radius: var(--radius-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

/* Home page key app icons: slightly larger as requested */
#homePage1 .app-icon[data-app="douyin"] .icon-img-box,
#homePage1 .app-icon[data-app="worldbook"] .icon-img-box,
#homePage1 .app-icon[data-app="xhs_worldbook"] .icon-img-box,
#homePage1 .app-icon[data-app="xhs"] .icon-img-box,
#homePage1 .app-icon[data-app="theme_workshop"] .icon-img-box {
  width: calc(var(--home-icon-size) + 6px);
  height: calc(var(--home-icon-size) + 6px);
}

.settings-bg {
  background: #8E8E93;
  color: #fff;
}

.camera-bg {
  background: #D1D1D6;
}

.browser-bg {
  background: linear-gradient(135deg, #007AFF, #5AC8FA);
  color: #fff;
}

.worldbook-bg {
  background: linear-gradient(135deg, #FF9F0A, #FFD60A);
  color: #fff;
}

.icon-label {
  font-size: 12px;
  margin-top: 5px;
  color: #000;
  font-weight: 600;
  display: none;
  /* 隐藏应用名称 */
}

.folder-icon {
  width: 54px;
  height: 54px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-icon);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.folder-grid span {
  font-size: 8px;
  color: #ccc;
}

.folder-indicators {
  font-size: 6px;
  margin-top: auto;
}

/* Gallery Widget */
.gallery-widget {
  width: calc(50% - 8px) !important;
  flex: 0 0 auto !important;
  /* Simplified for clean edges */
  background-image: url('pink_tulips_widget_1769951744233.png') !important;
  background-size: cover !important;
  background-position: center !important;

  /* Use a simple overlay via box-shadow inset instead of blend-mode */
  box-shadow: inset 0 0 0 200px rgba(255, 255, 255, 0.1), var(--shadow-soft) !important;

  border: 1px solid transparent !important;
  /* Anti-aliasing hack */
  border-radius: var(--radius-widget) !important;

  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  /* Ensure content doesn't bleed */
}

.gallery-widget:active {
  transform: scale(0.96);
}

.gallery-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  font-size: 40px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.gallery-label {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Gallery App View */

/* App Navigation Bar (Unified) */
.app-navbar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 17px;
  font-weight: 600;
  color: #000;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.nav-action-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  color: #007AFF;
  font-size: 17px;
  cursor: pointer;
  gap: 2px;
  padding: 8px;
}

/* System Widget */
.wide-widget {
  height: 120px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
}

.system-flex {
  display: flex;
  height: 100%;
}

.butterfly-side {
  width: 100px;
  background-image: url('butterfly_glass_widget_1769951760160.png');
  background-size: cover;
  background-position: center;
}

.info-side {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quote-text {
  font-size: 11px;
  font-weight: 500;
  color: #555;
}

.status-capsules {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.capsule {
  background: rgba(255, 255, 255, 0.6);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
}

.storage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
}

.storage-info {
  background: rgba(255, 255, 255, 0.6);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Search Bar */
.search-pill {
  background: rgba(255, 255, 255, 0.5);
  width: 100px;
  height: 28px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  font-size: 11px;
  color: #666;
  margin: 10px 0;
}

/* ============================================
   Dock System (Floating)
   ============================================ */
.dock-container {
  height: auto;
  min-height: 94px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 40px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  pointer-events: none;
  z-index: 9999;
}

.dock-inner {
  pointer-events: auto;
  --dock-item-size: 60px;
  --dock-gap: 22px;
  --dock-pad-y: 12px;
  --dock-pad-x: 22px;
  /* Trendy Morandi Pink Glassmemorphism */
  /* Ultra Transparent Electric Purple Glass */
  background: rgba(75, 0, 130, 0.15) !important;
  backdrop-filter: blur(40px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.2);
  /* 增加内部光泽感 */
  padding: var(--dock-pad-y) var(--dock-pad-x);
  border-radius: 34px;
  display: flex;
  gap: var(--dock-gap);
  /* Subtle pinkish border to match the theme */
  border: none;
}

.dock-item {
  width: var(--dock-item-size);
  height: var(--dock-item-size);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dock-item:active {
  transform: scale(0.85);
}

.dock-icon-bg {
  width: 100%;
  height: 100%;
  border-radius: 22px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}


.home-bar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 5px;
  background: rgba(0, 0, 0, 0.5);
  /* Deep grey, not pure black */
  border-radius: 38px;
  /* More rounded ends */
}

/* ============================================
   Phone Container (Desktop)
   ============================================ */
.phone-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ============================================
   Cute App Shell - 可爱应用外壳
   ============================================ */
.app-shell {
  position: fixed;
  inset: 0;
  background: var(--bg-secondary);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
  height: 100vh;
  width: 100vw;
}

.app-shell.hidden {
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  /* Ensure it's gone */
  pointer-events: none;
}

/* ============================================
   Cute Header - 可爱风格导航栏
   ============================================ */

/* 使用 Grid 布局确保标题真正居中：左右两侧占据相同宽度 */
.shell-header {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 1000;
  min-height: 52px;
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

/* 可爱圆形返回按钮 */
.shell-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: 500;
  color: var(--accent-pink-dark);
  cursor: pointer;
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

.shell-back:hover {
  background: var(--accent-pink-light);
  transform: scale(1.05);
}

.shell-back:active {
  transform: scale(0.95);
  background: var(--accent-pink);
}

.shell-back svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent-pink-dark);
  stroke-width: 2.5;
}

/* 标题盒子 - 居中显示 */
.shell-title-box {
  flex: 1;
  text-align: center;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.shell-title-box h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

/* 右侧操作按钮 */
.shell-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
}

.shell-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.shell-menu-btn:hover {
  background: var(--accent-pink-light);
  color: var(--accent-pink-dark);
  transform: scale(1.05);
}

.shell-menu-btn:active {
  transform: scale(0.95);
}

.shell-menu-btn svg {
  width: 20px;
  height: 20px;
}

.shell-title-box p {
  display: none;
}

.shell-main {
  flex: 1;
  overflow: hidden;
  /* Each view handles its own scroll */
  position: relative;
}

.view {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  /* transition: opacity 0.3s; */
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* Individual view scroll */
  z-index: 1;
  background: transparent;
}

/* 朋友圈视图 - INS 风背景 (moved to css/views/moments.css) */

/* 聊天视图不需要底部 padding（使用 shell-nav 而不是 dock） */
#chatView {
  padding-bottom: 0 !important;
}

/* 聊天设置视图不需要底部 padding */
#chatSettingsView {
  padding-bottom: 0 !important;
  position: absolute;
  inset: 0;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y !important;
  pointer-events: auto !important;
}

/* ============================================
   Chat Settings - INS 风设计
   ============================================ */

/* 动态渐变背景 */
.chat-settings-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #FFF5F7 0%, #FFE8F0 50%, #FFF0F5 100%);
  z-index: 0;
  pointer-events: none;
}

/* 浮动装饰元素 - 已隐藏以节省空间 */
.chat-settings-decorations {
  display: none;
}

/* 顶部导航 - 玻璃拟态 */
.chat-settings-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.settings-back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(255, 182, 193, 0.2);
}

.settings-back-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(255, 182, 193, 0.3);
}

.settings-back-btn:active {
  transform: scale(0.95);
}

.settings-title {
  font-size: 18px;
  font-weight: 700;
  color: #5A3D4A;
  margin: 0;
}

/* 主内容区 */
.chat-settings-content {
  position: relative;
  z-index: 5;
  padding: 10px 16px 80px;
}

/* 设置卡片 - 玻璃拟态 */
#chatSettingsView .settings-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 
    0 4px 20px rgba(255, 182, 193, 0.1),
    0 1px 3px rgba(255, 182, 193, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.settings-card:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 30px rgba(255, 182, 193, 0.15),
    0 2px 4px rgba(255, 182, 193, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* 卡片头部 */
#chatSettingsView .card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

#chatSettingsView .card-icon {
  font-size: 16px;
}

#chatSettingsView .card-title {
  font-size: 14px;
  font-weight: 700;
  color: #5A3D4A;
}

/* 设置列表 */
#chatSettingsView .settings-list {
  display: flex;
  flex-direction: column;
}

#chatSettingsView .settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  cursor: pointer;
}

#chatSettingsView .settings-item:hover {
  opacity: 0.8;
}

#chatSettingsView .settings-item:active {
  opacity: 0.6;
}

#chatSettingsView .item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

#chatSettingsView .item-icon-wrapper {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chatSettingsView .item-icon-wrapper.pink {
  background: linear-gradient(135deg, #FFE4E9 0%, #FFD1DC 100%);
}

#chatSettingsView .item-icon-wrapper.purple {
  background: linear-gradient(135deg, #F0E6FF 0%, #E6D9FF 100%);
}

#chatSettingsView .item-label {
  font-size: 13px;
  font-weight: 600;
  color: #5A3D4A;
}

#chatSettingsView .item-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

#chatSettingsView .item-value {
  font-size: 14px;
  color: #8B5A6B;
}

#chatSettingsView .item-arrow {
  transition: transform 0.2s ease;
}

#chatSettingsView .settings-item:hover .item-arrow {
  transform: translateX(3px);
}

#chatSettingsView .settings-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 182, 193, 0.3), transparent);
  margin: 4px 0;
}

/* 颜色选择区域 */
#chatSettingsView .color-section {
  margin-bottom: 8px;
}

#chatSettingsView .color-section:last-child {
  margin-bottom: 0;
}

#chatSettingsView .color-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #8B5A6B;
  margin-bottom: 6px;
}

#chatSettingsView .color-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

#chatSettingsView .color-btn {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  border: 2px solid transparent !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  padding: 0 !important;
  margin: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  outline: none !important;
  min-width: 24px;
  min-height: 24px;
}

#chatSettingsView .color-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#chatSettingsView .color-btn.active {
  border-color: white;
  box-shadow: 0 0 0 3px rgba(255, 107, 138, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
}

#chatSettingsView .color-btn.active:not(.transparent-swatch)::after {
  content: '✓';
  font-size: 13px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  line-height: 1;
}

#chatSettingsView .color-btn.active.is-light-swatch:not(.transparent-swatch)::after {
  color: rgba(27, 35, 48, 0.92);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

#chatSettingsView .color-btn .check-icon {
  opacity: 0;
  transition: opacity 0.2s ease;
}

#chatSettingsView .color-btn.active .check-icon {
  opacity: 1;
}

#chatSettingsView .color-btn.transparent-swatch {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.46) 62%, rgba(255, 255, 255, 0.26) 100%),
    repeating-conic-gradient(from 45deg, rgba(255, 255, 255, 0.56) 0 25%, rgba(255, 255, 255, 0.22) 0 50%) 50% / 10px 10px !important;
  border-color: rgba(255, 255, 255, 0.9) !important;
}

#chatSettingsView .color-btn.transparent-swatch::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.52) 0%, rgba(255, 255, 255, 0.16) 100%);
  pointer-events: none;
}

#chatSettingsView .color-btn.transparent-swatch .check-icon {
  position: relative;
  z-index: 1;
  stroke: #667387;
}

/* 预览卡片 */
#chatSettingsView .preview-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 250, 252, 0.9) 100%);
}

#chatSettingsView .preview-container {
  background: linear-gradient(135deg, #F8F9FA 0%, #F0F0F5 100%);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

#chatSettingsView .preview-message {
  display: flex;
}

#chatSettingsView .preview-message.my-message {
  justify-content: flex-end;
}

#chatSettingsView .preview-message.friend-message {
  justify-content: flex-start;
}

#chatSettingsView .preview-bubble {
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 13px;
  max-width: 70%;
  word-wrap: break-word;
  border: 1px solid rgba(255, 255, 255, 0.46);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.44) 0%, rgba(255, 255, 255, 0.15) 52%, rgba(255, 255, 255, 0.08) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), inset 0 -1px 0 rgba(255, 255, 255, 0.14), 0 8px 20px rgba(14, 24, 40, 0.13);
  backdrop-filter: blur(14px) saturate(165%) contrast(104%);
  -webkit-backdrop-filter: blur(14px) saturate(165%) contrast(104%);
  color: #1F2430;
  display: inline-block;
}

#chatSettingsView .preview-bubble.my-bubble {
  border-bottom-right-radius: 4px;
}

#chatSettingsView .preview-bubble.friend-bubble {
  border-bottom-left-radius: 4px;
}

/* 底部文字 */
#chatSettingsView .settings-footer {
  text-align: center;
  color: #8B5A6B;
  font-size: 10px;
  margin-top: 4px;
  margin-bottom: 4px;
  opacity: 0.7;
  flex-shrink: 0;
}

/* 文字大小设置 */
#chatSettingsView .font-size-section {
  margin-top: 8px;
}

#chatSettingsView .font-size-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #8B5A6B;
  margin-bottom: 10px;
}

#chatSettingsView .font-size-slider-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

#chatSettingsView .font-size-small,
#chatSettingsView .font-size-large {
  font-size: 12px;
  color: #8B5A6B;
  font-weight: 500;
}

#chatSettingsView .font-size-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #FFE4E9, #FF8FAB);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

#chatSettingsView .font-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FF8FAB;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(255, 107, 138, 0.4);
}

#chatSettingsView .font-size-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FF8FAB;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(255, 107, 138, 0.4);
}

#chatSettingsView .font-size-value {
  text-align: center;
  font-size: 13px;
  color: #5A3D4A;
  font-weight: 600;
}

/* 系统设置视图不需要底部 padding */
#globalSettingsView {
  padding-bottom: 0 !important;
  display: flex;
  flex-direction: column;
}

#globalSettingsView .app-navbar {
  position: relative;
  flex-shrink: 0;
}

#globalSettingsView .settings-viewport {
  flex: 1;
  overflow-y: auto;
}

/* 我的页面不需要底部 padding */
#chatProfileView {
  padding-bottom: 0 !important;
  overflow: hidden !important;
}

/* 聊天子视图不需要底部 padding */
.chat-subview {
  padding-bottom: 0 !important;
}

/* 详细资料页面不需要底部 padding */
#friendDetailPage {
  padding-bottom: 0 !important;
}

/* 好友资料容器不需要底部 padding */
.friend-profile-container {
  padding-bottom: 0 !important;
}

.view.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
}

/* Chat View Container - 可爱聊天视图 */
#chatView {
  display: none;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg-secondary);
}

#chatView.active {
  display: flex;
}

#chatViewContent {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg-secondary);
}

/* Chat View - 可爱聊天视口 */
.chat-viewport {
  flex: 1;
  padding: 20px 16px 0 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 14px;
  background: var(--bg-secondary);
  overflow-y: auto;
}

/* ============================================
   Cute Message Bubbles - 可爱消息气泡
   ============================================ */
.message {
  display: flex;
  gap: 10px;
  max-width: 80%;
  animation: messagePopIn 0.4s var(--transition-spring) forwards;
}

@keyframes messagePopIn {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  70% {
    transform: translateY(-2px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.assistant {
  align-self: flex-start;
}

/* 可爱圆形头像 */
.message-avatar {
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal);
}

.message-avatar:hover {
  transform: scale(1.1);
}

.message.user .message-avatar {
  background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-pink-dark) 100%);
  border-color: var(--accent-pink-light);
}

.message.assistant .message-avatar {
  background: linear-gradient(135deg, var(--accent-lavender) 0%, var(--accent-blue) 100%);
  border-color: white;
}

/* 可爱消息气泡 */
.message-content {
  padding: 12px 18px;
  border-radius: var(--radius-xl);
  font-size: 15px;
  line-height: 1.6;
  word-wrap: break-word;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

/* 图片消息 - 无气泡背景 */
.message-image-content {
  max-width: 75%;
  padding: 0;
  background: transparent !important;
  box-shadow: none !important;
}

.message-image-content img {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 自定义表情包消息 */
.message-sticker-content {
  max-width: 120px;
  padding: 0;
  background: transparent !important;
  box-shadow: none !important;
}

.message-sticker-content img {
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Emoji 表情消息 */
.message-emoji-content {
  max-width: 75%;
  padding: 0;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 48px;
  line-height: 1;
}

/* 我的消息 - 柔和粉色 */
.message.user .message-content {
  background: linear-gradient(135deg, var(--accent-pink-light) 0%, var(--accent-pink) 100%);
  color: var(--text-primary);
  border-bottom-right-radius: var(--radius-sm);
}

.message.user .message-content:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* 对方消息 - 纯白+阴影 */
.message.assistant .message-content {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-bottom-left-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.message.assistant .message-content:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* 动作气泡样式 - 柔和灰色 */
.message.assistant .message-content.message-action-bubble {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-style: italic;
  font-size: 14px;
  border-bottom-left-radius: var(--radius-sm);
  border: 1px dashed var(--border-light);
}

/* Markdown Specific Styles */
.message-content p {
  margin-bottom: 8px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content pre {
  background: rgba(0, 0, 0, 0.05);
  padding: 12px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 10px 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.message.user .message-content pre {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.1);
}

.message-content code {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 4px;
  border-radius: 4px;
}

.message.user .message-content code {
  background: rgba(255, 255, 255, 0.2);
}

.message-content pre code {
  background: transparent;
  padding: 0;
  display: block;
}

.message-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
  font-size: 14px;
}

.message-content th,
.message-content td {
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 6px 10px;
  text-align: left;
}

.message.user .message-content th,
.message.user .message-content td {
  border-color: rgba(255, 255, 255, 0.2);
}

.message-content blockquote {
  border-left: 4px solid rgba(0, 0, 0, 0.1);
  margin-left: 0;
  padding-left: 12px;
  color: rgba(0, 0, 0, 0.6);
  font-style: italic;
}

.message.user .message-content blockquote {
  border-left-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
}

.message-content img {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 8px;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-msg {
  text-align: center;
  margin-top: 20px;
  /* Reduced top margin */
  color: #8E8E93;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.welcome-msg h2 {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #f2f2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 15px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 40px;
  line-height: 1;
}

.welcome-msg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   Cute Chat Composer - 可爱输入区域
   ============================================ */
.chat-composer {
  padding: 12px 16px !important;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 !important;
}

/* 可爱圆角输入框 */
.chat-composer textarea {
  flex: 1;
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-2xl);
  padding: 10px 16px !important;
  resize: none;
  font-family: inherit;
  font-size: 15px;
  margin: 0 !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 120px !important;
  line-height: 20px !important;
  overflow-y: auto;
  box-sizing: border-box;
  transition: all var(--transition-normal);
  color: var(--text-primary);
}

.chat-composer textarea::placeholder {
  color: var(--text-tertiary);
}

.chat-composer textarea:focus {
  outline: none;
  border-color: var(--accent-pink);
  background: var(--bg-primary);
  box-shadow: 0 0 0 4px var(--accent-pink-light);
}

/* 发送按钮 - 可爱粉色圆形 */
.chat-composer button {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-pink-dark) 100%);
  color: white;
  border: none;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition-normal);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

/* 工具按钮 - 可爱灰色 */
.chat-tool-btn {
  background: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
  font-size: 20px !important;
  font-weight: 300;
  border: 2px solid transparent;
}

.chat-emoji-btn {
  font-size: 18px !important;
}

.chat-tool-btn:hover {
  background: var(--accent-pink-light) !important;
  color: var(--accent-pink-dark) !important;
  border-color: var(--accent-pink);
}

.chat-composer button:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.chat-composer button:active {
  transform: scale(0.95);
}

/* 等待回复中：输入区与按钮统一弱化 */
.chat-composer textarea:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.chat-composer button:disabled {
  opacity: 0.58;
  box-shadow: none;
  transform: none !important;
  cursor: not-allowed;
}

.chat-composer button:disabled:hover,
.chat-composer button:disabled:active {
  transform: none !important;
  box-shadow: none !important;
}

/* 引用预览 - 可爱风格 */
.quote-preview {
  background: var(--accent-pink-light);
  border-left: 3px solid var(--accent-pink);
  padding: 8px 12px;
  margin: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quote-close {
  color: var(--accent-pink-dark);
  cursor: pointer;
  font-size: 18px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.quote-close:hover {
  background: var(--accent-pink);
  color: white;
}

/* Modal */
.modal-dimmer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-dimmer.active {
  display: flex;
}

.ios-modal {
  background: #fff;
  border-radius: 20px;
  width: 90%;
  max-width: 360px;
  max-height: 80vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Confirm Modal - Premium Design */
.confirm-modal {
  background: #fff;
  border-radius: 20px;
  width: 85%;
  max-width: 340px;
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.confirm-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 59, 48, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.confirm-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #000;
  margin: 0 0 8px;
}

.confirm-modal-message {
  font-size: 15px;
  color: #8E8E93;
  line-height: 1.5;
  margin: 0 0 24px;
}

.confirm-modal-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.confirm-btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.confirm-btn.cancel {
  background: #F2F2F7;
  color: #1C1C1E;
}

.confirm-btn.cancel:hover {
  background: #E5E5EA;
}

.confirm-btn.confirm {
  background: #FF3B30;
  color: #fff;
}

.confirm-btn.confirm:hover {
  background: #E6352B;
}

/* Menu Animation */
@keyframes menuAppear {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.ios-modal input,
.ios-modal textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #E5E5EA;
  border-radius: 8px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 5px;
}

.modal-buttons button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-weight: 500;
}

#saveEntryBtn {
  background: var(--accent-blue);
  color: #fff;
}

/* Action Sheet (iOS Style) */
.action-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
  /* Safe area */
  opacity: 0;
  transition: opacity 0.3s;
}

.action-sheet-overlay.active {
  display: flex;
  opacity: 1;
}

.action-sheet {
  width: 94%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.action-sheet-overlay.active .action-sheet {
  transform: translateY(0);
}

.action-group {
  background: rgba(255, 255, 255, 0.6);
  /* Proper iOS blur bg color - Lighter */
  backdrop-filter: blur(25px);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.action-preview {
  display: none;
  /* Hidden by default, can serve as preview */
  margin-bottom: 8px;
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
  align-self: center;
  width: 100px;
  height: 100px;
}

.action-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.action-btn {
  width: 100%;
  padding: 18px;
  background: transparent;
  /* Transparent to show blur */
  border: none;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.15);
  /* Separator */
  font-size: 20px;
  color: #007AFF;
  font-weight: 400;
  /* Regular weight like iOS */
  cursor: pointer;
  transition: background 0.2s;
}

.action-btn:last-child {
  border-bottom: none;
}

.action-btn:active {
  background: rgba(0, 0, 0, 0.05);
}

.cancel-btn {
  font-weight: 600;
  /* Bold for cancel */
  background: transparent;
  /* Cancel is usually solid white or lighter */
  border-radius: 14px;
  /* Separate group */
}

/* Adjust action group for single cancel button */
.action-group:last-child .action-btn {
  background: transparent;
  border-radius: 14px;
}

/* =========================================
   GLASSMORPHISM OVERRIDES (More Transparent)
   ========================================= */

/* Global Widget Glass - Ultra Clear */
.widget {
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: none !important;
  /* 移除硬边框 */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02) !important;
  color: #000;
}

/* Music Widget Specifics */
.music-widget {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* Icon Box Glass */
.icon-img-box {
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(12px) !important;
  border: none !important;
  /* 移除边框 */
  /* Enhance icons inside glass */
  font-size: 28px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Override specific icon colors */
.settings-glass,
.worldbook-glass,
.camera-glass,
.settings-bg,
.camera-bg,
.browser-bg,
.worldbook-bg,
.phone-green,
.calendar-white,
.notes-yellow,
.photos-multi,
.dock-icon-bg {
  background: rgba(255, 255, 255, 0.1) !important;
  border: none !important;
  /* 移除边框 */
}

/* Gallery Widget - Restored color & Gradient Blur edges */
.gallery-widget {
  width: calc(50% - 8px) !important;
  flex: 0 0 auto !important;
  /* Simplified for clean edges */
  background-image: url('pink_tulips_widget_1769951744233.png') !important;
  background-size: cover !important;
  background-position: center !important;

  /* Use a simple overlay via box-shadow inset instead of blend-mode */
  box-shadow: inset 0 0 0 200px rgba(255, 255, 255, 0.1), var(--shadow-soft) !important;

  border: 1px solid transparent !important;
  /* Anti-aliasing hack */
  border-radius: var(--radius-widget) !important;

  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  /* Ensure content doesn't bleed */
}

/* Dock Glass */
.dock-inner {
  pointer-events: auto;
  /* Trendy Morandi Pink Glassmemorphism */
  /* Ultra Transparent Electric Purple Glass */
  background: rgba(75, 0, 130, 0.15) !important;
  backdrop-filter: blur(40px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.2);
  /* 增加内部光泽感 */
  padding: 12px 22px;
  border-radius: 34px;
  display: flex;
  gap: 22px;
  /* Subtle pinkish border to match the theme */
  border: none;
}

/* Refined Icon Styles */
.settings-glass,
.worldbook-glass,
.camera-glass {
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 22px !important;
  /* Unified Radius */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.app-svg-icon {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Ensure all icon boxes have correct radius */
.icon-img-box {
  border-radius: 22px !important;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 24px;
  padding: 0 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #8E8E93;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typingBounce {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}


/* ===========================================
   Cute Chat List & Friend System - 可爱联系人列表
   =========================================== */
.chat-subview {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease;
  will-change: transform, opacity;
  position: absolute;
  top: 0;
  left: 0;
  background: var(--bg-secondary);
  padding-top: 0;
  /* 在聊天视图中，子视图需要为独立标题栏留出空间 */
}

/* 聊天视图中的子视图需要调整位置 */
#chatView .chat-subview {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  background: var(--bg-secondary);
}

/* 确保 active 状态的子视图有正确的高度 */
#chatView .chat-subview.active {
  height: 100%;
}

/* 聊天会话页面背景色 */
#chatConversationPage {
  background: var(--bg-secondary) !important;
}

#chatConversationPage.chat-conversation-bg-enabled {
  background-color: transparent !important;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)),
    var(--chat-conversation-bg-image) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

#chatConversationPage.chat-conversation-bg-enabled .chat-viewport,
#chatConversationPage.chat-conversation-bg-enabled #chatMessages.chat-viewport {
  background: transparent !important;
}

#chatConversationPage.chat-conversation-bg-enabled .chat-composer {
  /* Keep message background continuous; avoid full-width white band at bottom */
  background: transparent !important;
  border-top-color: transparent !important;
  backdrop-filter: none !important;
}

/* 背景开启时：仅在可交互状态下柔化控件（避免与等待态叠加过淡） */
#chatView.chat-bg-soft-controls #chatConversationPage .chat-composer #chatPlusBtn,
#chatView.chat-bg-soft-controls #chatConversationPage .chat-composer #chatEmojiBtn,
#chatView.chat-bg-soft-controls #chatConversationPage .chat-composer #chatVoiceBtn,
#chatView.chat-bg-soft-controls #chatConversationPage .chat-composer #sendButton,
#chatView.chat-bg-soft-controls #chatHeader #chatBackBtn,
#chatView.chat-bg-soft-controls #chatHeader #chatMenuBtn2,
#chatView.chat-bg-soft-controls #chatHeader #chatHomeBtn {
  opacity: 0.68;
}

#chatView.chat-bg-soft-controls #chatConversationPage .chat-composer #chatInput,
#chatView.chat-bg-soft-controls #chatConversationPage .chat-composer .chat-input-pill {
  opacity: 0.74;
}

/* 背景开启时：标题提重并增强深色背景可读性 */
#chatView.chat-bg-title-contrast #chatHeaderTitle {
  color: #FFFFFF !important;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.68), 0 0 10px rgba(0, 0, 0, 0.34);
}

.chat-subview.active {
  transform: translateX(0);
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
}

.chat-subview.next {
  transform: translateX(100%);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
}

.chat-subview.prev {
  transform: translateX(-30%);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
}

/* Friend Detail Page - Scrollable */
#friendDetailPage {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  background: var(--bg-secondary);
}

#friendDetailPage .detail-hero {
  flex-shrink: 0;
}

#friendDetailPage .ios-list-group {
  flex-shrink: 0;
}

/* Question Box Page - Nested in Friend Detail */
#questionBoxPage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#questionBoxPage.active {
  transform: translateX(0);
}

#questionBoxPage.next {
  transform: translateX(100%);
}

/* Contact List - 可爱卡片式 */
.chat-list-container {
  padding: 20px 12px 12px 12px;
  flex: 1;
  background: transparent;
}

/* 可爱联系人卡片 */
.contact-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: var(--bg-primary);
  margin: 0 0 10px 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.contact-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.contact-item:active {
  transform: scale(0.98);
  background: var(--bg-tertiary);
}

/* 自定义背景时的卡片样式 */
.has-custom-bg .contact-item {
  margin: 0 0 10px 0;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
}

.has-custom-bg .contact-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.has-custom-bg .contact-item:active {
  background: rgba(255, 255, 255, 0.9) !important;
  transform: scale(0.98);
}

/* 可爱圆形头像 */
.contact-avatar {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--accent-pink-light) 0%, var(--accent-lavender) 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 2px solid white;
  transition: transform var(--transition-normal);
}

.contact-item:hover .contact-avatar {
  transform: scale(1.05);
}

.contact-info {
  flex: 1;
  overflow: hidden;
}

.contact-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 可爱未读标记 - 柔和粉色 */
.contact-unread-badge {
  background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-pink-dark) 100%);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-sizing: border-box;
  box-shadow: var(--shadow-xs);
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.contact-last-msg {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

.contact-time {
  font-size: 12px;
  color: var(--text-tertiary);
  align-self: center;
  font-weight: 500;
}

/* Friend Modal Specifics */
.friend-avatar-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 15px;
}



/* Wallpaper Fit Fix */
body {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  transition: background-image 0.4s ease-in-out;
}

/* Premium Modal Inputs */
.ios-modal input[type='text'],
.ios-modal textarea {
  width: 100%;
  background: #F2F2F7;
  /* iOS Input bg */
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  margin-bottom: 12px;
  font-family: inherit;
  transition: background 0.2s;
}

.ios-modal input[type='text']:focus,
.ios-modal textarea:focus {
  background: #E5E5EA;
  outline: none;
}

.ios-modal h3 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 18px;
  font-weight: 600;
}



/* iOS Switch Toggle */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 30px;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #E9E9EA;
  transition: .4s;
  border-radius: 34px;
}

.ios-switch .slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ios-switch input:checked+.slider {
  background-color: #34C759;
}

.ios-switch input:checked+.slider:before {
  transform: translateX(20px);
}

/* Form Row Layout */
.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
  margin-bottom: 12px;
}

.form-row label {
  font-weight: 500;
  font-size: 16px;
}


/* iOS Select Style */
.ios-select {
  appearance: none;
  -webkit-appearance: none;
  background: #F2F2F7;
  border: none;
  border-radius: 8px;
  padding: 8px 30px 8px 12px;
  /* Space for arrow */
  font-size: 14px;
  color: #007AFF;
  font-weight: 500;
  outline: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23007AFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  min-width: 140px;
}


/* Friend Detail View */
.detail-header {
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.detail-title {
  font-weight: 600;
  font-size: 17px;
}

.detail-content {
  padding: 20px;
  background: #F2F2F7;
  /* iOS Grouped BG */
  min-height: calc(100% - 60px);
  padding-bottom: 80px;
}

.detail-hero {
  padding: 40px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.detail-avatar {
  width: 84px;
  height: 84px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 4px solid #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.detail-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.detail-avatar:active {
  transform: scale(0.95);
}

.detail-name {
  font-size: 24px;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.5px;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.detail-name:hover {
  background: rgba(0, 122, 255, 0.1);
}

.detail-bio {
  font-size: 14px;
  color: #8E8E93;
  text-align: center;
  max-width: 80%;
  line-height: 1.4;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.detail-bio:hover {
  background: rgba(0, 122, 255, 0.1);
}

.has-custom-bg .detail-hero {
  background: transparent;
}

.has-custom-bg .detail-name {
  color: #111;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* ============================================
   Friend Profile - Minimalist Premium Design
   ============================================ */
/* ============================================
   Cute Friend Profile - 可爱详细资料页
   ============================================ */
.friend-profile-container {
  min-height: 100%;
  background: var(--bg-secondary);
  padding-bottom: 40px;
}

/* Hero Section - 粉白渐变 */
.friend-profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 32px;
  background: linear-gradient(180deg, var(--accent-pink-light) 0%, var(--bg-secondary) 100%);
}

/* 可爱大头像 */
.friend-avatar-wrapper {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-spring);
}

.friend-avatar-wrapper:hover {
  transform: scale(1.05);
}

.friend-avatar-wrapper:active {
  transform: scale(0.95);
}

.friend-avatar {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 4px solid white;
  box-shadow: var(--shadow-md);
}

.friend-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  background: rgba(255, 182, 193, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.friend-avatar-overlay svg {
  color: white;
  stroke-width: 2;
}

.friend-avatar-wrapper:hover .friend-avatar-overlay {
  opacity: 1;
}

/* 可爱名字样式 */
.friend-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 16px;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
  cursor: pointer;
  padding: 4px 16px;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  line-height: 1.2;
}

.friend-name:hover {
  background: var(--accent-pink-light);
  color: var(--accent-pink-dark);
}

/* 可爱签名 */
.friend-bio {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  margin-bottom: 4px;
  text-align: center;
  max-width: 280px;
  line-height: 1.4;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.friend-bio:hover {
  background: var(--accent-pink-light);
  color: var(--accent-pink-dark);
}

/* Status Indicator - 可爱状态 */
.friend-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 14px;
  background: var(--accent-mint);
  border-radius: var(--radius-full);
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.friend-status-indicator:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--text-tertiary);
}

.status-dot.active {
  background: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(144, 238, 144, 0.3);
  animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(144, 238, 144, 0.3);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(144, 238, 144, 0.1);
  }
}

.status-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.friend-status-indicator.blocked {
  background: #FFE4E1;
  border-color: white;
}

.friend-status-indicator.blocked .status-dot {
  background: #FF6B6B;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.3);
}

.friend-status-indicator.blocked .status-text {
  color: #FF6B6B;
}

/* Actions Grid - 可爱操作卡片 */
.friend-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0 20px;
  margin-top: 8px;
}

.friend-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-spring);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.friend-action-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-pink);
}

.friend-action-card:active {
  transform: scale(0.96);
}

/* 可爱图标按钮 */
.action-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-pink-light) 0%, var(--accent-lavender) 100%);
  border-radius: var(--radius-md);
  color: var(--accent-pink-dark);
  transition: all var(--transition-normal);
}

.friend-action-card:hover .action-icon {
  transform: scale(1.1);
  background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-pink-dark) 100%);
  color: white;
}

.action-icon svg {
  stroke-width: 1.5;
}

.action-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Danger Zone */
.friend-danger-zone {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 20px;
  margin-top: 32px;
}

/* ============================================
   Cute Buttons - 可爱按钮样式
   ============================================ */
.danger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  color: #FF6B6B;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.danger-btn:hover {
  background: #FFE4E1;
  border-color: #FFB6C1;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.danger-btn:active {
  transform: scale(0.96);
}

.danger-btn.delete {
  color: #FF6B6B;
}

.danger-btn svg {
  opacity: 0.9;
}

/* 主按钮 - 可爱粉色 */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-pink-dark) 100%);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: scale(0.96);
}

/* 次按钮 - 可爱边框 */
.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--bg-primary);
  border: 2px solid var(--accent-pink);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-pink-dark);
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--accent-pink-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary:active {
  transform: scale(0.96);
}

/* ============================================
   Chat List - Premium Minimal Design
   ============================================ */
.chat-list-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #F2F2F7;
  padding-top: 20px;
}

/* 搜索框和排序区域 - 可爱紧凑风格 */
.chat-search-box {
  padding: 50px 16px 8px;
  background: var(--bg-secondary);
}

.search-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  color: var(--text-tertiary);
  font-size: 15px;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.search-inner:hover {
  background: var(--accent-pink-light);
  border-color: var(--accent-pink);
  color: var(--accent-pink-dark);
}

.chat-sort-label {
  padding: 4px 16px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-secondary);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 20px;
  background: var(--bg-secondary);
}

.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  background: var(--bg-secondary);
  color: var(--text-tertiary);
}

.empty-icon {
  margin-bottom: 16px;
  opacity: 0.3;
}

.chat-empty-state p {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.chat-empty-state span {
  font-size: 13px;
  color: var(--text-tertiary);
}

.chat-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.chat-list-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.chat-list-item:active {
  transform: scale(0.98);
  background: var(--bg-tertiary);
}

.chat-list-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-pink-light);
}

.chat-list-item.pinned {
  background: linear-gradient(135deg, var(--accent-pink-light) 0%, var(--bg-primary) 100%);
  border: 1px solid var(--accent-pink);
}

.chat-item-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-pink-light) 0%, var(--accent-lavender) 100%);
  box-shadow: var(--shadow-sm);
  border: 2px solid white;
}

.chat-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.replying-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: var(--accent-green);
  border-radius: var(--radius-full);
  border: 2px solid white;
  box-shadow: var(--shadow-xs);
  animation: statusPulse 2s infinite;
}

.chat-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-item-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pin-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-pink);
  border-radius: var(--radius-full);
}

.unread-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-pink-dark) 100%);
  color: white;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  animation: badgePulse 2s infinite;
}

.chat-item-preview {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Custom Background Mode */
.has-custom-bg .chat-list-container,
.has-custom-bg .chat-search-box,
.has-custom-bg .chat-sort-label,
.has-custom-bg .chat-list,
.has-custom-bg .chat-empty-state {
  background: transparent;
}

.has-custom-bg .chat-list-item {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.has-custom-bg .search-inner {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

/* ============================================
   Add Friend Modal - Premium Design
   ============================================ */
.add-friend-modal {
  background: #fff;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.add-friend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.add-friend-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: #000;
  margin: 0;
}

.add-friend-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(142, 142, 147, 0.12);
  border: none;
  border-radius: 50%;
  color: #8E8E93;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-friend-close:hover {
  background: rgba(142, 142, 147, 0.2);
  color: #636366;
}

.add-friend-save {
  padding: 8px 16px;
  background: #007AFF;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-friend-save:hover {
  background: #0056D3;
}

.add-friend-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #F2F2F7;
}

.add-friend-avatar-section {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.add-friend-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #fff;
  border: 2px dashed #C7C7CC;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.add-friend-avatar:hover {
  border-color: #007AFF;
  background: #F5F5F7;
}

.add-friend-avatar svg {
  color: #8E8E93;
}

.add-friend-avatar span {
  font-size: 11px;
  color: #8E8E93;
}

.add-friend-avatar.has-image {
  border: none;
  background: transparent;
}

.add-friend-avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.add-friend-field {
  margin-bottom: 20px;
}

.add-friend-field:last-child {
  margin-bottom: 0;
}

.add-friend-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #8E8E93;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.add-friend-field input,
.add-friend-field textarea {
  width: 100%;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  font-size: 15px;
  color: #1C1C1E;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.add-friend-field input:focus,
.add-friend-field textarea:focus {
  outline: none;
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.add-friend-field input::placeholder,
.add-friend-field textarea::placeholder {
  color: #C7C7CC;
}

.add-friend-field textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

/* ============================================
   Character Settings Modal - Premium Design
   ============================================ */
.character-settings-modal {
  background: #fff;
  border-radius: 20px;
  width: 90%;
  max-width: 420px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.character-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.character-settings-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: #000;
  margin: 0;
}

.character-settings-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(142, 142, 147, 0.12);
  border: none;
  border-radius: 50%;
  color: #8E8E93;
  cursor: pointer;
  transition: all 0.2s ease;
}

.character-settings-close:hover {
  background: rgba(142, 142, 147, 0.2);
  color: #636366;
}

.character-settings-save {
  padding: 8px 16px;
  background: #007AFF;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.character-settings-save:hover {
  background: #0056D3;
}

.character-settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #F2F2F7;
}

.settings-section {
  margin-bottom: 28px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #8E8E93;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.settings-textarea {
  width: 100%;
  min-height: 140px;
  padding: 16px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
  color: #1C1C1E;
  resize: vertical;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.settings-textarea:focus {
  outline: none;
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.settings-textarea::placeholder {
  color: #C7C7CC;
}

.temperature-slider-container {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.temperature-slider {
  width: 100%;
  height: 4px;
  background: #E5E5EA;
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  margin-bottom: 12px;
}

.temperature-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: #007AFF;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3);
  transition: transform 0.2s ease;
}

.temperature-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.temperature-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #007AFF;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3);
}

.temperature-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #8E8E93;
  font-weight: 500;
}

.temperature-description {
  margin-top: 16px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.temperature-description strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #007AFF;
  margin-bottom: 4px;
}

.temperature-description span {
  font-size: 13px;
  color: #8E8E93;
}

/* Block Status Cards */
.friend-block-actions {
  padding: 0 20px;
  margin-top: 16px;
}

.block-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #8E8E93;
  cursor: pointer;
  transition: all 0.2s ease;
}

.block-btn:hover {
  background: rgba(255, 59, 48, 0.05);
  border-color: rgba(255, 59, 48, 0.2);
  color: #FF3B30;
}

.block-btn svg {
  opacity: 0.6;
}

.friend-block-card {
  margin: 16px 20px;
  padding: 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.friend-block-card.blocked {
  background: linear-gradient(135deg, #FFF5F5 0%, #FFF0F0 100%);
  border: 1px solid rgba(255, 59, 48, 0.1);
}

.friend-block-card.warning {
  background: linear-gradient(135deg, #FFFBF5 0%, #FFF8F0 100%);
  border: 1px solid rgba(255, 149, 0, 0.1);
}

.friend-block-card.info {
  background: linear-gradient(135deg, #F5F9FF 0%, #F0F5FF 100%);
  border: 1px solid rgba(0, 122, 255, 0.1);
}

.block-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.friend-block-card.blocked .block-card-header {
  color: #FF3B30;
}

.friend-block-card.warning .block-card-header {
  color: #FF9500;
}

.friend-block-card.info .block-card-header {
  color: #007AFF;
}

.block-card-desc {
  font-size: 14px;
  color: #8E8E93;
  margin-bottom: 16px;
  line-height: 1.4;
}

.block-card-info {
  font-size: 13px;
  color: #007AFF;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(0, 122, 255, 0.06);
  border-radius: 8px;
}

.block-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.block-action-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.block-action-btn.primary {
  background: #007AFF;
  color: #fff;
}

.block-action-btn.primary:hover {
  background: #0056D3;
}

.block-action-btn.secondary {
  background: rgba(142, 142, 147, 0.12);
  color: #8E8E93;
}

.block-action-btn.secondary:hover {
  background: rgba(142, 142, 147, 0.2);
}


/* Profile styles moved to css/views/profile.css */

/* ============================================
   Cute iOS List - 可爱列表样式
   ============================================ */
.ios-list-group {
  background: transparent;
  border-radius: 0;
  overflow: visible;
  margin: 0 0 20px 0;
  width: 100%;
  box-shadow: none;
}

/* 可爱列表项 */
.ios-list-item {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: 14px 20px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg) !important;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all var(--transition-normal);
  min-height: auto;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.ios-list-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-pink-light);
}

.ios-list-item:last-child {
  margin-bottom: 0;
}

.ios-list-item:active {
  transform: scale(0.98);
  background: var(--bg-tertiary);
}

/* 自定义背景时的列表样式 */
.has-custom-bg .ios-list-group {
  background: transparent !important;
  box-shadow: none !important;
  border: none;
  overflow: visible;
}

.has-custom-bg .ios-list-item {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-lg) !important;
}

.has-custom-bg .ios-list-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-pink);
}

.has-custom-bg .ios-list-item:last-child {
  border-bottom: none;
}

.has-custom-bg .ios-list-item:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.95) !important;
}

/* 可爱图标 */
.item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-right: 14px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-pink-light) 0%, var(--accent-lavender) 100%);
  color: var(--accent-pink-dark);
}

.item-label {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.item-arrow {
  color: var(--accent-pink);
  font-size: 18px;
  font-weight: 500;
  margin-left: 8px;
}

.item-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  color: var(--text-primary);
}

.item-content.center-text {
  justify-content: center;
  font-weight: 500;
}

.chevron {
  color: #C7C7CC;
  font-weight: 600;
  font-size: 18px;
}

/* ============================================
   Premium Settings View
   ============================================ */
.settings-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 100px;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #8E8E93;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 24px 0 12px 4px;
}

.settings-section-title:first-child {
  margin-top: 8px;
}

.settings-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.has-custom-bg .settings-card {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.settings-card-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
}

.settings-card-divider {
  height: 1px;
  background: #E5E5EA;
  margin: 0 16px;
}

.settings-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  color: #fff;
}

.settings-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-item-content label {
  font-size: 12px;
  font-weight: 500;
  color: #8E8E93;
  letter-spacing: 0.2px;
}

.settings-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #E5E5EA;
  border-radius: 10px;
  font-size: 15px;
  background: #F9F9F9;
  transition: all 0.2s;
  color: #1c1c1e;
}

.settings-input:focus {
  outline: none;
  border-color: #007AFF;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.settings-input-short {
  width: 100px;
  text-align: center;
}

.settings-select {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #E5E5EA;
  border-radius: 10px;
  font-size: 15px;
  background: #F9F9F9;
  color: #1c1c1e;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.model-selector-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.refresh-models-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #E5E5EA;
  background: #F9F9F9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #007AFF;
  transition: all 0.2s;
}

.refresh-models-btn:hover {
  background: #E5E5EA;
}

.refresh-models-btn:active {
  transform: scale(0.95);
  background: #D1D1D6;
}

.settings-save-btn {
  width: 100%;
  padding: 16px;
  margin-top: 30px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #007AFF, #0A84FF);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.settings-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.settings-save-btn:active {
  transform: scale(0.98);
}

.settings-footer-note {
  text-align: center;
  font-size: 12px;
  color: #8E8E93;
  margin-top: 16px;
}


/* ===========================================
   Archive View (Memory)
   =========================================== */
.archive-dashboard {
  display: flex;
  justify-content: space-around;
  padding: 20px 0;
  background: white;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.stat-item {
  text-align: center;
  position: relative;
  flex: 1;
}

.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 10%;
  height: 80%;
  width: 1px;
  background: #E5E5EA;
}

.stat-num {
  font-size: 20px;
  font-weight: 700;
  color: #1c1c1e;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 11px;
  color: #8E8E93;
}

/* Tabs */
.archive-tabs {
  display: flex;
  background: #E5E5EA;
  /* Light grey track */
  padding: 3px;
  border-radius: 9px;
  margin: 0 20px 20px;
}

.archive-tab {
  flex: 1;
  text-align: center;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 500;
  color: #636366;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
}

.archive-tab.active {
  background: white;
  color: #1c1c1e;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Memory Card */
.memory-card {
  background: white;
  margin: 0 20px 16px;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
  border-left: 4px solid var(--accent-blue);
  animation: slideUp 0.3s ease;
}

.memory-summary-card {
  border-left-color: #FF9F0A;
  background: #FFF7E6;
}

.memory-summary-title {
  font-size: 13px;
  font-weight: 600;
  color: #8E8E93;
  margin-bottom: 6px;
}

.memory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.memory-date {
  font-size: 12px;
  color: #8E8E93;
  font-weight: 600;
  background: #F2F2F7;
  padding: 4px 8px;
  border-radius: 6px;
}

.memory-type {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  background: #F2F2F7;
  color: #8E8E93;
  margin-left: 8px;
}

.memory-type-plot {
  background: #E3F2FD;
  color: #1E88E5;
}

.memory-type-promise {
  background: #E8F5E9;
  color: #43A047;
}

.memory-type-fragment {
  background: #F3E5F5;
  color: #8E24AA;
}

.memory-actions {
  display: flex;
  gap: 12px;
}

.memory-action-btn {
  border: none;
  background: none;
  font-size: 14px;
  opacity: 0.4;
  cursor: pointer;
  padding: 0;
}

.memory-action-btn:hover {
  opacity: 1;
}

.memory-content {
  font-size: 15px;
  color: #333;
  line-height: 1.6;
  white-space: pre-wrap;
}

.archive-list {
  padding-bottom: 40px;
  overflow-y: auto;
  height: calc(100% - 200px);
  /* Adjust based on header/stats */
}


.archive-pill {
  background: #F2F2F7;
  border: 1px solid #E5E5EA;
  color: #8E8E93;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  margin: 15px auto;
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  transition: all 0.2s;
}

.archive-pill:hover {
  background: #E5E5EA;
  color: #007AFF;
  border-color: #007AFF;
}

/* Contacts styles moved to css/views/contacts.css */

/* iOS List Group & Items */
.ios-list-group {
  background: transparent;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
  width: 100%;
}

.ios-list-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: transparent;
  border-bottom: 0.5px solid #E5E5EA;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 48px;
}

.ios-list-item:active {
  background: #F2F2F7;
}

.ios-list-item:last-child {
  border-bottom: none;
}

.item-icon {
  font-size: 20px;
  margin-right: 12px;
  width: 24px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-label {
  font-size: 16px;
  color: #000;
  flex: 1;
  /* Pushes arrow to the right */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-arrow {
  font-size: 18px;
  color: #C7C7CC;
  font-weight: 400;
  margin-left: 8px;
  font-family: system-ui, -apple-system, sans-serif;
}

/* Moments styles moved to css/views/moments.css */

/* Switch UI */
.switch-ui {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
}

.switch-ui input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-ui span {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e9e9ea;
  transition: .4s;
  border-radius: 34px;
}

.switch-ui span:before {
  position: absolute;
  content: "";
  height: 27px;
  width: 27px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.switch-ui input:checked+span {
  background-color: #34c759;
}

.switch-ui input:checked+span:before {
  transform: translateX(20px);
}


/* Premium Glassmorphism & Background Support */
.has-custom-bg .view,
.has-custom-bg .chat-subview,
.has-custom-bg .chat-list-container,
.has-custom-bg .shell-main {
  background: transparent !important;
}

/* App shell with custom background should be transparent */
.app-shell.has-custom-bg {
  background: transparent !important;
}

/* Ensure System Views remain opaque */
.has-custom-bg #globalSettingsView,
.has-custom-bg #userPersonasView,
.has-custom-bg #userPersonaEditorView,
.has-custom-bg #galleryView,
.has-custom-bg #worldbookView {
  background: #F2F2F7 !important;
}

.has-custom-bg #chatProfileView {
  background: var(--app-gradient) !important;
}

/* 聊天主应用四个主页面统一背景（仅这四页） */
.has-custom-bg #chatView,
.has-custom-bg #contactsView,
.has-custom-bg #momentsView,
.has-custom-bg #chatProfileView {
  background: var(--app-gradient) !important;
}

.has-custom-bg .shell-header {
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(25px) saturate(180%);
  border-bottom: none;
}

.has-custom-bg .contact-item {
  background: rgba(255, 255, 255, 0.98) !important;
  border-radius: 20px;
  margin: 10px 16px !important;
  border: 1px solid #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.has-custom-bg .message.assistant .message-content {
  background: rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: blur(10px);
}

.has-custom-bg .message.user .message-content {
  background: rgba(0, 122, 255, 0.55) !important;
  backdrop-filter: blur(10px);
}

/* ============================================
   Cute Search Container - 可爱搜索框
   ============================================ */
.search-container {
  padding: 50px 16px 8px;
  display: block;
}

.search-bar-inner {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-tertiary);
  font-size: 15px;
  font-weight: 400;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.search-bar-inner:hover {
  background: var(--accent-pink-light);
  border-color: var(--accent-pink);
  color: var(--accent-pink-dark);
  box-shadow: var(--shadow-md);
}

.has-custom-bg .search-bar-inner {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.search-bar-inner:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-xs);
}

/* iOS Action Sheet */
.ios-action-sheet {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 95%;
  max-width: 400px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideUp {
  from {
    transform: translate(-50%, 100%);
    opacity: 0;
  }

  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.action-sheet-group {
  background: rgba(245, 245, 245, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  overflow: hidden;
}

.action-sheet-item {
  width: 100%;
  padding: 18px 0;
  background: transparent;
  border: none;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
  font-size: 20px;
  color: #007AFF;
  font-weight: 400;
  cursor: pointer;
}

.action-sheet-item:last-child {
  border-bottom: none;
}

.action-sheet-item:active {
  background: rgba(0, 0, 0, 0.05);
}

.action-sheet-item.cancel {
  font-weight: 600;
}

.action-sheet-item.destructive {
  color: #FF3B30;
}

/* ===========================================
   Responsive Design for Real Mobile Devices
   =========================================== */
@media screen and (max-width: 768px) {

  /* Lock Body Scroll */
  html,
  body {
    height: 100% !important;
    height: 100dvh !important;
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    overscroll-behavior: none;
  }

  /* Main container takes full screen */
  .phone-container {
    width: 100%;
    height: 100% !important;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
    background: black;
    overflow: hidden !important;
  }

  /* App Shell Layout Fix */
  .app-shell {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100% !important;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
  }

  /* Force Chat View Flex Layout */
  #chatView {
    display: none;
    flex-direction: column !important;
    height: 100% !important;
    width: 100%;
    overflow: hidden !important;
    background: transparent;
  }

  .view#chatView.active {
    display: flex !important;
  }

  /* Key Fix: The inner content wrapper */
  #chatViewContent {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100% !important;
    overflow: hidden !important;
    position: relative;
  }

  /* Header stays top */
  .shell-header {
    flex-shrink: 0;
    padding-top: max(env(safe-area-inset-top), 10px);
    height: auto;
    min-height: 50px;
    position: relative;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
  }

  /* App Content grows */
  .app-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: auto !important;
    display: flex;
    flex-direction: column;
  }

  /* Chat Messages scrolls */
  #chatMessages.chat-viewport,
  .chat-viewport {
    flex: 1 !important;
    min-height: 0;
    overflow-y: auto !important;
    padding: 60px 10px 0 10px !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    background: var(--bg-secondary) !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
  }

  /* Composer stays bottom */
  .chat-composer {
    flex-shrink: 0;
    position: sticky !important;
    bottom: 0 !important;
    width: 100% !important;
    padding: 4px 8px max(env(safe-area-inset-bottom), 4px) !important;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    margin: 0 !important;
    z-index: 20;
  }

  /* Mobile textarea fixed height */
  .chat-composer textarea {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding: 8px 12px !important;
    line-height: 20px !important;
  }

  /* Fix other views */
  .phone-screen {
    border-radius: 0;
    width: 100%;
    height: 100% !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
  }
  
  /* 锁屏在移动端保持可滑动 */
  .lock-screen {
    border-radius: 0;
    width: 100%;
    height: 100% !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateY(0) !important;
    opacity: 1 !important;
  }

  /* 移动端聊天会话页面背景色 */
  #chatConversationPage {
    background: var(--bg-secondary) !important;
    justify-content: flex-start !important;
  }

  #chatConversationPage.chat-conversation-bg-enabled {
    background-color: transparent !important;
    background-image:
      linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)),
      var(--chat-conversation-bg-image) !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
  }

  #chatConversationPage.chat-conversation-bg-enabled .chat-viewport,
  #chatConversationPage.chat-conversation-bg-enabled #chatMessages.chat-viewport {
    background: transparent !important;
  }

  #chatConversationPage.chat-conversation-bg-enabled .chat-composer {
    background: transparent !important;
    border-top-color: transparent !important;
    backdrop-filter: none !important;
  }
}

   Lock Screen
   =========================================== */
.lock-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 50%, #1a1a2e 100%);
  z-index: 99999;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding-top: 80px;
  padding-bottom: 20px;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
}

.lock-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="30" r="20" fill="rgba(255,255,255,0.03)"/></svg>');
  background-size: 200px;
  opacity: 0.5;
  pointer-events: none;
}

.lock-screen.unlocked {
  transform: translateY(-100%);
  pointer-events: none;
}

.lock-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.lock-date {
  font-size: 18px;
  font-weight: 500;
  opacity: 0.85;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.lock-time {
  font-size: 76px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}

.lock-bottom {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 1;
}

.lock-shortcuts {
  width: 85%;
  display: flex;
  justify-content: space-between;
}

.lock-btn {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: transform 0.15s, background 0.15s;
}

.lock-btn:active {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0.92);
}

.swipe-hint {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.7;
  animation: pulseHint 2s infinite;
}

@keyframes pulseHint {

  0%,
  100% {
    opacity: 0.5;
    transform: translateY(0);
  }

  50% {
    opacity: 0.9;
    transform: translateY(-3px);
  }
}

.home-bar-line {
  width: 135px;
  height: 5px;
  background: rgba(128, 128, 128, 0.6);
  border-radius: 100px;
}

/* iPhone 16 Lock Screen Enhancements */
.lock-screen {
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  cursor: default;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
}

/* Wallpaper Layers */
.lock-wallpaper-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 0;
}



/* Status Bar */
.lock-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px 0;
  font-size: 14px;
  font-weight: 600;
  z-index: 5;
}

.carrier-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.lock-status-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 11px;
}

.signal-bars .bar {
  width: 3px;
  background: white;
  border-radius: 1px;
}

.signal-bars .bar:nth-child(1) {
  height: 3px;
}

.signal-bars .bar:nth-child(2) {
  height: 5px;
}

.signal-bars .bar:nth-child(3) {
  height: 7px;
}

.signal-bars .bar:nth-child(4) {
  height: 10px;
}

.signal-bars .bar.dim {
  opacity: 0.35;
}

.wifi-icon {
  width: 16px;
  height: 12px;
}

.battery-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.battery-percent {
  font-size: 14px;
  font-weight: 600;
}

.battery-icon {
  width: 24px;
  height: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 3px;
  position: relative;
  padding: 1.5px;
}

.battery-icon::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5px;
  height: 4px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0 1px 1px 0;
}

.battery-level {
  height: 100%;
  width: 100%;
  background: #34C759;
  border-radius: 1px;
}

/* Main Content */
.lock-main {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.lock-date-row {
  font-size: 2.5vw;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.date-separator {
  margin: 0 0.3em;
  opacity: 0.8;
}

.lock-time-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-top: 5px;
}

.lock-time {
  display: block;
  font-size: 22vw;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.85;
  color: #D4A84B;
  transform: scaleY(1.2) scaleX(1.1);
  transform-origin: center top;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.lock-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding-bottom: 15px;
  z-index: 5;
}

.lock-shortcuts {
  width: 85%;
  max-width: 320px;
  display: flex;
  justify-content: space-between;
}

.lock-btn {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(20px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
}

/* Settings Button */
.lock-settings-btn {
  position: absolute;
  top: 60px;
  /* Moved down */
  right: 20px;
  /* Moved left */
  width: 40px;
  /* Larger touch target */
  height: 40px;
  background: rgba(0, 0, 0, 0.3);
  /* Darker background */
  backdrop-filter: blur(10px);
  z-index: 9999;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  cursor: pointer;

  z-index: 10;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.lock-settings-btn:hover {
  opacity: 1;
}

/* Settings Modal */
.lock-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  z-index: 100000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.lock-settings-modal.active {
  display: flex;
}

.lock-settings-content {
  background: #2c2c2e;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  color: white;
}

.lock-settings-content h3 {
  margin: 0 0 20px;
  font-size: 18px;
  text-align: center;
}

.setting-group {
  margin-bottom: 16px;
}

.setting-group label {
  display: block;
  font-size: 13px;
  color: #8e8e93;
  margin-bottom: 6px;
}

.setting-group input[type="text"],
.setting-group input[type="color"] {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: #3a3a3c;
  color: white;
  font-size: 15px;
  box-sizing: border-box;
}

.setting-group input[type="color"] {
  height: 40px;
  cursor: pointer;
}

.upload-btn {
  width: 100%;
  padding: 10px;
  background: #0a84ff;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.setting-group .hint {
  font-size: 11px;
  color: #8e8e93;
  margin-top: 6px;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.cancel-btn {
  background: #3a3a3c;
  color: white;
}

.save-btn {
  background: #34C759;
  color: white;
}

/* Lock Screen Styles */
.lock-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#globalWallpaper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Fallback color */
  background-color: #f0f2f5;
  background-image: url('default_bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
  transition: transform 0.3s, filter 0.3s;
}

.lock-wallpaper-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.lock-status-bar {
  height: 54px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  z-index: 10;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding-top: 10px;
  /* Make transparent like home screen */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  /* Change text to Black for light wallpapers */
  color: #000;
  text-shadow: none;
}

.lock-status-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Ensure icons use black filter for visibility on light wallpapers */
.lock-status-bar svg,
.lock-status-bar .signal-bars,
.lock-status-bar .battery-icon {
  filter: none;
  /* Remove white shadow */
  color: #000;
  /* Ensure implicit currentColor uses black */
}

/* Force SVG fill to black */
.lock-status-bar svg {
  fill: #000;
}

.lock-status-bar .signal-bar {
  background: #000;
  /* Change signal bars to black */
}

.lock-status-bar .battery-icon {
  border-color: #000;
  /* Change battery border to black */
}

.lock-status-bar .battery-icon::after {
  background: #000;
  /* Change battery tip to black */
}

.lock-status-bar .battery-fill {
  background: #000;
  /* Change battery fill to black */
}

.lock-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0px;
  /* Move to the absolute top */
  z-index: 10;
  position: relative;
}

.lock-date-row {
  font-size: 18px;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  color: #c926d1;
}

.lock-time-container {
  position: relative;
}

.lock-time {
  font-size: 140px;
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #c926d1 !important;
  /* Force the purple color from the image */
  /* Subtle shadow for depth */
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.lock-hint {
  position: absolute;
  bottom: 30px;
  width: 100%;
  text-align: center;
  font-size: 14px;
  opacity: 0.6;
  z-index: 10;
  animation: bounceHint 2s infinite;
}

@keyframes bounceHint {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-5px);
  }

  60% {
    transform: translateY(-3px);
  }
}

/* Unlock Hint Visible */
.lock-hint-btn {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 24px;
  border-radius: 20px;
  color: white;
  font-size: 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  z-index: 10000;
  cursor: pointer;
  animation: pulseBtn 2s infinite;
}

@keyframes pulseBtn {
  0% {
    opacity: 0.8;
    transform: translateX(-50%) scale(1);
  }

  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.05);
  }

  100% {
    opacity: 0.8;
    transform: translateX(-50%) scale(1);
  }
}

/* Fallback Gradient for Lock Screen if Image Fails */
.lock-wallpaper-bg {
  background-color: #2c3e50;
  /* Fallback color */
  background-image: url('default_bg.jpg');
  /* Default Image */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Music Player Widget - Ins Style Vinyl */
.music-widget {
  grid-column: 1 / 3;
  grid-row: 5 / 7;
  margin-top: 0;
  justify-self: stretch;
  align-self: stretch;
  width: 100%;
  height: 100%;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 50%;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}

.vinyl-record {
  width: min(100%, 140px);
  height: min(100%, 140px);
  border-radius: 50%;
  background: radial-gradient(circle, #222 0%, #111 60%, #000 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  position: relative;
  /* Groove texture lines */
  background-image: repeating-radial-gradient(#333 0,
      #333 2px,
      #111 3px,
      #111 4px);
  animation: spinRecord 10s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vinyl-label {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
  border: 4px solid #111;
  position: relative;
  z-index: 2;
}

/* Tone arm or aesthetic decoration */
.music-decoration {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
  font-family: serif;
}

@keyframes spinRecord {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Vinyl Tonearm (The Stick) */
/* Floating Music Note Icon */
.vinyl-arm {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: auto;
  z-index: 20;
  pointer-events: none;
  font-size: 40px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  animation: floatNote 3s ease-in-out infinite;
}

.vinyl-arm::before {
  content: '🎵';
  /* Simple Music Note */
  background: none;
  box-shadow: none;
  width: auto;
  height: auto;
  position: static;
  transform: none;
}

.vinyl-arm::after {
  content: none;
}

.music-widget::after {
  content: none;
}

@keyframes floatNote {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    transform: translate(-50%, -60%) scale(1.1);
  }
}

/* Cloud Music View */
.music-cloud-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.music-cloud-search {
  flex: 1;
  min-width: 0;
}

.music-cloud-search input {
  width: 100%;
  height: 36px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 18px;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  background: #f7f7fa;
  color: #111;
}

.music-cloud-search input:focus {
  border-color: rgba(0, 122, 255, 0.5);
  background: #fff;
}

.music-cloud-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.music-cloud-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 6px 12px;
  background: #f8f8fb;
  color: #222;
  font-size: 12px;
  font-weight: 500;
}

.music-cloud-open-btn {
  flex: 0 0 auto;
  border: none;
  border-radius: 14px;
  padding: 6px 12px;
  background: #007AFF;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.music-cloud-body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #fff;
}

.music-cloud-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #8a8a99;
  pointer-events: none;
}

.music-cloud-empty-emoji {
  font-size: 42px;
}

.music-cloud-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #444;
}

.music-cloud-empty-tip {
  font-size: 13px;
}

/* Custom Lock Screen Icons */
#lockFlashlight,
#lockCamera {
  background-color: transparent !important;
  /* Remove default circle bg */
  backdrop-filter: none !important;
  border-radius: 0 !important;
  background-image: url('lock_icons.png');
  background-repeat: no-repeat;
  /* Adjusting size to fit the icons properly. Assuming the image is a screenshot of the bottom row */
  /* Since standard buttons are small and far apart, we use a large percentage for width match */
  background-size: auto 50px;
  /* Force height to match button */
  width: 50px;
  height: 50px;
}

#lockFlashlight {
  background-position: left center;
}

#lockCamera {
  background-position: right center;
}

/* ============================================
   RESCUE STYLES - FORCE VISIBILITY
   ============================================ */

/* 页面容器 */
#chatProfileView .profile-page-container {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

/* 顶部标题栏 */
#chatProfileView .profile-page-header {
  display: block !important;
  padding: 16px 24px 8px !important;
  text-align: center !important;
  background: transparent !important;
  flex-shrink: 0 !important;
}

#chatProfileView .profile-page-header h1 {
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #1D1D1F !important;
  letter-spacing: -0.3px !important;
  margin: 0 !important;
}

#chatProfileView .profile-scroll-content {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 100 !important;
  min-height: 100% !important;
  width: 100% !important;
  overflow-y: auto !important;
  background: transparent !important;
  padding: 16px 20px 100px !important;
  flex: 1 !important;
}

#chatProfileView .profile-header-card {
  display: flex !important;
  flex-direction: column !important;
  opacity: 1 !important;
  visibility: visible !important;
  background: #FFFFFF !important;
  min-height: 100px !important;
  width: 100% !important;
  margin: 0 0 24px 0 !important;
  border-radius: 28px !important;
  padding: 32px 24px !important;
  position: relative !important;
  z-index: 101 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  box-sizing: border-box !important;
}

#chatProfileView .profile-avatar-wrapper {
  display: block !important;
  width: 90px !important;
  height: 90px !important;
  background: transparent !important;
  border-radius: 50% !important;
  margin-bottom: 18px !important;
}

#chatProfileView .profile-avatar-wrapper img {
  border: 3px solid #FFFFFF !important;
  box-shadow: 0 4px 15px rgba(255, 182, 193, 0.25) !important;
}

#chatProfileView .profile-info-text {
  display: block !important;
}

#chatProfileView .profile-info-text h2 {
  font-size: 22px !important;
  margin-bottom: 6px !important;
  color: #1D1D1F !important;
  font-weight: 700 !important;
}

#chatProfileView .profile-info-text p {
  color: #8E8E93 !important;
  font-size: 14px !important;
}

/* 菜单区块强制样式 */
#chatProfileView .profile-menu-section {
  display: block !important;
  width: 100% !important;
  margin-bottom: 16px !important;
  background: #FFFFFF !important;
  border-radius: 20px !important;
  padding: 8px !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.01) !important;
  border: 1px solid rgba(0, 0, 0, 0.02) !important;
  box-sizing: border-box !important;
}

#chatProfileView .profile-menu-item {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  padding: 14px 16px !important;
  border-radius: 14px !important;
  margin-bottom: 4px !important;
  box-sizing: border-box !important;
}

#chatProfileView .profile-menu-item:last-child {
  margin-bottom: 0 !important;
}

#chatProfileView .menu-icon-wrapper {
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-right: 14px !important;
}

#chatProfileView .menu-label {
  flex: 1 !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: #1D1D1F !important;
}

#chatProfileView .ios-list-group {
  display: none !important;
}


/* ============================================
   INS STYLE MESSAGE MENU & QUOTE PREVIEW
   ============================================ */

/* Context Menu Dimmer */
.msg-menu-dimmer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.msg-menu-dimmer.active {
  display: block;
  opacity: 1;
}

/* Glassmorphism Menu */
.msg-context-menu {
  position: absolute;
  width: 180px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67);
  z-index: 10001;
}

.msg-menu-dimmer.active .msg-context-menu {
  transform: scale(1);
}

.msg-menu-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: #1c1c1e;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
}

.msg-menu-item:last-child {
  border-bottom: none;
}

.msg-menu-item:active {
  background: rgba(0, 0, 0, 0.05);
}

.msg-menu-item.danger {
  color: #ff3b30;
}

.msg-menu-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

/* Quote Preview Bar */
.quote-preview {
  display: none;
  background: rgba(0, 0, 0, 0.03);
  border-left: 3px solid var(--accent-blue);
  padding: 6px 10px;
  margin: 0 12px 4px;
  border-radius: 4px;
  position: relative;
  font-size: 13px;
  color: #666;
  max-height: 60px;
  overflow: hidden;
  animation: slideDown 0.3s ease;
}

.quote-preview.active {
  display: block;
}

.quote-preview .quote-close {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 16px;
  cursor: pointer;
  color: #999;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Highlight target message when menu is open */
.message.highlight-bubble .message-content {
  box-shadow: 0 0 0 3px var(--accent-blue);
  transition: box-shadow 0.2s;
}

/* Recalled Message Pill (WeChat Style) */
.recalled-msg-pill {
  text-align: center;
  font-size: 12px;
  color: #8e8e93;
  margin: 12px 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.reedit-link {
  color: #007aff;
  cursor: pointer;
  text-decoration: none;
}

.reedit-link:hover {
  text-decoration: underline;
}

/* Segmented Control (WeChat/iOS Style) */
.segmented-control {
  display: flex;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px;
  border-radius: 8px;
  width: fit-content;
}

.segmented-control input {
  display: none;
}

.segmented-control label {
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  color: #666;
}

.segmented-control input:checked+label {
  background: white;
  color: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mini-icon-btn {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 8px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 16px;
}

/* Quote inside bubble */
.msg-quote-bubble {
  background: rgba(0, 0, 0, 0.05);
  border-left: 2px solid rgba(0, 0, 0, 0.2);
  padding: 4px 8px;
  margin-bottom: 6px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0.8;
  font-style: italic;
}

/* For user messages, quote might need lighter text */
.message.user .msg-quote-bubble {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: rgba(255, 255, 255, 0.4);
  color: #eee;
}

/* Moments override moved to css/views/moments.css */

/* ============================================ */
/* Minimalist INS Style - Wallet & Tool Menu */
/* ============================================ */

/* Chat Tool Menu redesign */
.chat-tool-menu {
  position: fixed;
  bottom: 70px;
  left: 0;
  right: 0;
  background: #fdfdfd;
  border-top: 0.5px solid rgba(0, 0, 0, 0.1);
  padding: 20px 10px;
  z-index: 99999;
  display: none;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  border-radius: 20px 20px 0 0;
}

.chat-tool-menu.active {
  display: block;
}

.tool-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  max-width: 400px;
  margin: 0 auto;
}

.tool-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.tool-icon {
  width: 60px;
  height: 60px;
  background: #fff;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 0.5px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
  color: #000;
}

.tool-item:active .tool-icon {
  transform: scale(0.95);
  background: #f0f0f0;
}

.tool-item span {
  font-size: 12px;
  color: #8E8E93;
  font-weight: 400;
}

/* ============================================
   Mini Game (Gomoku) - Floating Window
   ============================================ */
.mini-game-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  z-index: 100000;
}

.mini-game-modal.active {
  display: flex;
}

.mini-game-panel {
  width: min(92vw, 360px);
  background: var(--mini-game-bg);
  border-radius: 20px;
  box-shadow: var(--mini-game-shadow);
  border: 1px solid var(--mini-game-border);
  padding: 16px;
}

.mini-game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.mini-game-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--mini-game-accent-soft);
  color: #666;
  font-size: 18px;
  cursor: pointer;
}

.mini-game-list {
  display: grid;
  gap: 12px;
}

.mini-game-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--mini-game-border);
  background: var(--mini-game-surface);
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mini-game-card:active {
  transform: scale(0.98);
}

/* ============================================
   Spy Phone - Floating Window
   ============================================ */
.spy-phone-float {
  --spy-phone-bg: #fff7fb;
  --spy-phone-surface: #ffffff;
  --spy-phone-accent: #ff8fb2;
  --spy-phone-accent-soft: #ffe3ee;
  --spy-phone-text: #2b2b2b;
  --spy-phone-muted: #8b8b8b;
  --spy-phone-radius: 24px;
  --spy-phone-shadow: 0 18px 45px rgba(23, 22, 24, 0.22);

  position: fixed;
  right: 16px;
  bottom: 120px;
  width: min(92vw, 360px);
  display: none;
  flex-direction: column;
  border-radius: var(--spy-phone-radius);
  background: var(--spy-phone-surface);
  box-shadow: var(--spy-phone-shadow);
  border: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 100005;
}

.spy-phone-float.active {
  display: flex;
  animation: spyPhonePop 0.25s ease;
}

.spy-phone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 15px;
  font-weight: 600;
  color: var(--spy-phone-text);
  background: linear-gradient(135deg, #fff0f7 0%, #fff7fb 100%);
  border-radius: var(--spy-phone-radius) var(--spy-phone-radius) 16px 16px;
  touch-action: none;
}

.spy-phone-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.spy-phone-actions {
  display: flex;
  gap: 8px;
}

.spy-phone-btn {
  border: none;
  background: var(--spy-phone-accent);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.spy-phone-btn.ghost {
  background: var(--spy-phone-accent-soft);
  color: #a14666;
}

.spy-phone-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.spy-phone-body {
  position: relative;
  padding: 12px;
  background: var(--spy-phone-bg);
  border-radius: 0 0 var(--spy-phone-radius) var(--spy-phone-radius);
  min-height: 420px;
  overflow: hidden;
}

.spy-phone-screen {
  display: none;
  height: 100%;
  overflow: hidden;
}

.spy-phone-screen.active {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.spy-phone-lock-time {
  font-size: 44px;
  font-weight: 700;
  color: var(--spy-phone-text);
  text-align: center;
  margin-top: 28px;
}

.spy-phone-lock-date {
  text-align: center;
  font-size: 14px;
  color: var(--spy-phone-muted);
  margin-top: 4px;
}

.spy-phone-lock-tip {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: #b05b79;
}

.spy-phone-lock-input-row {
  margin: 20px auto 8px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.spy-phone-passcode {
  width: 120px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  text-align: center;
  font-size: 16px;
  letter-spacing: 6px;
}

.spy-phone-passcode.shake {
  border-color: #ff6b6b;
  animation: spyPhoneShake 0.3s;
}

.spy-phone-unlock-btn {
  border: none;
  background: var(--spy-phone-accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}

.spy-phone-lock-hint {
  text-align: center;
  font-size: 12px;
  color: var(--spy-phone-muted);
}

.spy-phone-home-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--spy-phone-text);
  margin: 6px 4px 12px;
}

.spy-phone-home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.spy-phone-app-icon {
  border: none;
  background: var(--spy-phone-surface);
  border-radius: 18px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  color: var(--spy-phone-text);
  font-size: 12px;
}

.spy-phone-app-emoji {
  font-size: 22px;
}

.spy-phone-home-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--spy-phone-muted);
  text-align: center;
}

.spy-phone-app-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.spy-phone-back {
  border: none;
  background: var(--spy-phone-accent-soft);
  color: #a14666;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.spy-phone-app-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--spy-phone-text);
}

.spy-phone-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.spy-phone-card {
  background: var(--spy-phone-surface);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.spy-phone-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--spy-phone-text);
  margin-bottom: 4px;
}

.spy-phone-card-sub {
  font-size: 12px;
  color: var(--spy-phone-muted);
}

.spy-phone-card-note {
  margin-top: 6px;
  font-size: 12px;
  color: #6c4b59;
  background: #fff4f8;
  padding: 6px 8px;
  border-radius: 8px;
}

.spy-phone-chat-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.spy-phone-chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.spy-phone-chat-item {
  background: var(--spy-phone-surface);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.04);
  cursor: pointer;
}

.spy-phone-chat-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--spy-phone-text);
}

.spy-phone-chat-item-sub {
  font-size: 12px;
  color: var(--spy-phone-muted);
  margin-top: 4px;
}

.spy-phone-chat-detail {
  position: absolute;
  inset: 0;
  background: var(--spy-phone-bg);
  display: none;
  flex-direction: column;
}

.spy-phone-chat-detail.active {
  display: flex;
}

.spy-phone-chat-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.spy-phone-chat-detail-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--spy-phone-text);
}

.spy-phone-chat-detail-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.spy-phone-msg {
  max-width: 80%;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.4;
}

.spy-phone-msg.them {
  align-self: flex-start;
  background: var(--spy-phone-surface);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.spy-phone-msg.me {
  align-self: flex-end;
  background: var(--spy-phone-accent-soft);
  color: #6b3a4d;
}

.spy-phone-empty {
  text-align: center;
  font-size: 12px;
  color: var(--spy-phone-muted);
  padding: 16px 0;
}

@keyframes spyPhonePop {
  from {
    transform: translateY(12px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes spyPhoneShake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

.mini-game-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--mini-game-accent) 0%, #FF6B8A 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  font-weight: 700;
}

.mini-game-card-info {
  display: flex;
  flex-direction: column;
}

.mini-game-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.mini-game-card-subtitle {
  font-size: 12px;
  color: #8E8E93;
  margin-top: 2px;
}

.mini-game-float {
  position: fixed;
  right: 14px;
  bottom: 110px;
  width: 270px;
  background: var(--mini-game-bg);
  border-radius: 18px;
  border: 1px solid var(--mini-game-border);
  box-shadow: var(--mini-game-shadow);
  z-index: 99998;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.mini-game-float.active {
  display: flex;
}

.mini-game-float-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: linear-gradient(135deg, #FFF6F8 0%, #FFFFFF 100%);
  border-bottom: 1px solid var(--mini-game-border);
  cursor: grab;
  touch-action: none;
}

.mini-game-float-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.mini-game-float-actions {
  display: flex;
  gap: 6px;
}

.mini-game-btn {
  border: none;
  padding: 4px 8px;
  border-radius: 10px;
  background: var(--mini-game-accent);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}

.mini-game-btn.ghost {
  background: #F2F2F7;
  color: #555;
}

.mini-game-float-body {
  padding: 10px 12px 12px;
}

.mini-game-status {
  font-size: 13px;
  color: #333;
  font-weight: 600;
}

.mini-game-substatus {
  font-size: 11px;
  color: #8E8E93;
  margin-top: 2px;
  margin-bottom: 8px;
}

.gomoku-board {
  --gomoku-size: 13;
  display: grid;
  grid-template-columns: repeat(var(--gomoku-size), 1fr);
  gap: 2px;
  background: var(--mini-game-board);
  border-radius: 12px;
  padding: 8px;
  box-shadow: inset 0 0 0 1px var(--mini-game-line);
}

.gomoku-cell {
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  position: relative;
}

.gomoku-cell.last {
  box-shadow: 0 0 0 2px var(--mini-game-accent) inset;
}

.gomoku-piece {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.gomoku-piece.black {
  background: radial-gradient(circle at 30% 30%, #5B5B5B, var(--mini-game-black));
}

.gomoku-piece.white {
  background: radial-gradient(circle at 30% 30%, #FFFFFF, #F1F1F1);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.mini-game-fab {
  position: fixed;
  right: 16px;
  bottom: 96px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--mini-game-border);
  background: #fff;
  color: #333;
  font-size: 12px;
  box-shadow: var(--mini-game-shadow);
  cursor: pointer;
  touch-action: none;
  z-index: 99997;
  display: none;
}

.mini-game-fab.active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   Question Box (提问箱)
   ============================================ */

.question-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #E5E5EA;
  position: sticky;
  top: 0;
  z-index: 100;
}

.question-box-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: #000;
  margin: 0;
}

.question-box-header .back-btn {
  background: none;
  border: none;
  color: #007AFF;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
}

.question-box-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  background: #F2F2F7;
  min-height: calc(100% - 60px);
}

.question-box-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 30px 20px;
  text-align: center;
  margin-bottom: 20px;
  color: #fff;
}

.question-box-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.question-box-subtitle {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 20px;
}

.ask-question-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.ask-question-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.ask-question-btn span {
  font-size: 20px;
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.question-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.question-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.question-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E5E5EA;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.question-meta {
  flex: 1;
}

.question-asker {
  font-size: 14px;
  font-weight: 600;
  color: #000;
}

.question-time {
  font-size: 12px;
  color: #8E8E93;
}

.question-content {
  font-size: 15px;
  color: #000;
  line-height: 1.5;
  margin-bottom: 12px;
  padding: 12px;
  background: #F2F2F7;
  border-radius: 12px;
}

.question-content::before {
  content: '问：';
  font-weight: 600;
  color: #007AFF;
}

.answer-section {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.answer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.answer-content {
  flex: 1;
  font-size: 15px;
  color: #333;
  line-height: 1.5;
  padding: 10px 12px;
  background: #F9F9F9;
  border-radius: 12px;
}

.answer-content::before {
  content: '答：';
  font-weight: 600;
  color: #34C759;
}

.question-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #E5E5EA;
}

.question-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #8E8E93;
}

.question-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.question-actions {
  display: flex;
  gap: 12px;
}

.question-actions button {
  background: none;
  border: none;
  color: #8E8E93;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.question-actions button:hover {
  color: #007AFF;
}

.question-actions button.liked {
  color: #FF3B30;
}

.question-pending {
  text-align: center;
  padding: 20px;
  color: #8E8E93;
  font-size: 14px;
}

.question-pending::before {
  content: '⏳ ';
}

.empty-questions {
  text-align: center;
  padding: 60px 20px;
  color: #8E8E93;
}

.empty-questions-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-questions-text {
  font-size: 16px;
  margin-bottom: 8px;
}

.empty-questions-hint {
  font-size: 14px;
  opacity: 0.7;
}

/* Item Badge */
.item-badge {
  background: #FF3B30;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Wallet styles moved to css/views/wallet.css */

/* Call Overlay - Dark Call UI */
.call-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 20000;
  display: none;
  overflow: hidden;
  transition: all 0.3s ease;
  color: #fff;
  font-family: "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.call-overlay.active {
  display: block;
}

.call-audio-unlock {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}

.call-audio-unlock.show {
  display: flex;
}

.call-audio-card {
  background: rgba(20, 20, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 18px 20px;
  text-align: center;
  color: #fff;
  width: min(260px, 80vw);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.call-audio-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.call-audio-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 12px;
}

.call-audio-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  background: #ffd447;
  color: #2a2a2a;
  font-weight: 600;
  cursor: pointer;
}

.call-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: none;
  opacity: 1;
  z-index: 0;
  pointer-events: none;
}

.call-min-btn {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
}

.call-info {
  position: absolute;
  top: 90px;
  left: 24px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.call-name {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #f5f5f5;
}

.call-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
}

.call-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c0c400;
  box-shadow: 0 0 8px rgba(192, 196, 0, 0.7);
}

.call-status {
  margin: 0;
  font-size: 16px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.7);
}

.local-video {
  position: absolute;
  top: 88px;
  right: 24px;
  width: 96px;
  height: 136px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  z-index: 7;
  background: #000;
}

.call-overlay.video-off .local-video {
  filter: grayscale(1) brightness(0.3);
}

.call-network-pill {
  position: absolute;
  left: 50%;
  bottom: 150px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #eaeaea;
  padding: 8px 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  z-index: 5;
  backdrop-filter: blur(10px);
}

.call-network-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
}

.call-network-bars i {
  display: block;
  width: 4px;
  background: #c0c400;
  border-radius: 2px;
}

.call-network-bars i:nth-child(1) { height: 6px; }
.call-network-bars i:nth-child(2) { height: 10px; }
.call-network-bars i:nth-child(3) { height: 14px; }

.call-controls {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 40px;
  height: 96px;
  border-radius: 52px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 18px;
  z-index: 6;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.call-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(30, 30, 30, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f0f0f0;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.call-btn:active {
  transform: scale(0.96);
}

.call-btn.hangup {
  background: #ff4d4d;
  color: #fff;
  border: none;
}

.call-btn.video-toggle {
  background: rgba(192, 196, 0, 0.45);
  color: #fefefe;
  border: 1px solid rgba(192, 196, 0, 0.6);
}

.call-btn.video-toggle.is-off {
  background: rgba(40, 40, 40, 0.9);
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.call-btn.video-toggle.is-off::after {
  content: "";
  position: absolute;
  width: 36px;
  height: 2px;
  background: rgba(255, 255, 255, 0.6);
  transform: rotate(-45deg);
}

.call-btn.mute.is-muted {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.call-btn-label {
  display: none;
  position: absolute;
  bottom: -26px;
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 2px;
}

.call-overlay.voice-mode .call-info {
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  align-items: center;
}

.call-overlay.voice-mode .call-name {
  font-size: 32px;
}

.call-overlay.voice-mode .call-meta {
  font-size: 18px;
}

.call-overlay.voice-mode .call-dot {
  display: none;
}

.call-overlay.voice-mode .call-network-pill,
.call-overlay.voice-mode .call-btn.camera,
.call-overlay.voice-mode .call-btn.video-toggle,
.call-overlay.voice-mode .local-video {
  display: none;
}

.call-overlay.voice-mode .call-controls {
  background: transparent;
  border: none;
  box-shadow: none;
  bottom: 120px;
  justify-content: center;
  gap: 80px;
}

.call-overlay.voice-mode .call-btn {
  width: 74px;
  height: 74px;
  background: rgba(30, 30, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.call-overlay.voice-mode .call-btn-label {
  display: block;
}

.call-mini-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 18px;
  line-height: 28px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 7;
  cursor: pointer;
}

.call-overlay.minimized {
  width: 150px;
  height: 210px;
  top: 18px;
  right: 18px;
  left: auto;
  bottom: auto;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  cursor: move;
}

.call-overlay.minimized .call-min-btn,
.call-overlay.minimized .call-info,
.call-overlay.minimized .call-network-pill,
.call-overlay.minimized .call-controls {
  display: none;
}

.call-overlay.minimized .local-video {
  top: 10px;
  right: 10px;
  width: 130px;
  height: 190px;
}

.call-overlay.minimized .call-mini-close {
  display: flex;
}

/* Message Styles for Transfer & Location */
.message-content.message-special-card {
  padding: 0 !important;
  min-width: 198px;
  max-width: 248px;
  border-radius: 20px !important;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 22px rgba(20, 24, 34, 0.12);
}

.message.user .message-content.message-special-card,
.message.assistant .message-content.message-special-card {
  border-bottom-left-radius: 20px !important;
  border-bottom-right-radius: 20px !important;
}

.message.user .message-content.message-special-card:hover,
.message.assistant .message-content.message-special-card:hover {
  transform: none;
  box-shadow: 0 10px 24px rgba(20, 24, 34, 0.16);
}

.message-content.transfer {
  background: linear-gradient(145deg, #FFB67A 0%, #FF8FA3 100%) !important;
  color: #fff !important;
}

.transfer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 12px 14px 4px;
  text-transform: uppercase;
}

.transfer-title-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #ffffff;
  flex-shrink: 0;
}

.transfer-title-icon svg {
  width: 14px;
  height: 14px;
}

.transfer-amount {
  font-size: 24px;
  font-weight: 700;
  padding: 0 14px 10px;
  line-height: 1.1;
}

.transfer-footer {
  font-size: 11px;
  opacity: 0.95;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  padding: 8px 14px 10px;
  background: rgba(0, 0, 0, 0.08);
}

.message-content.location {
  background: #fff !important;
  color: #1f2937 !important;
}

.location-map-stub {
  height: 112px;
  background: linear-gradient(160deg, #ffe4eb 0%, #f2f7ff 55%, #f6f3ff 100%);
  position: relative;
}

.location-map-stub::before {
  content: '📍';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  filter: drop-shadow(0 4px 8px rgba(255, 105, 135, 0.24));
}

.location-info {
  padding: 10px 12px 12px;
}

.location-name {
  font-size: 15px;
  font-weight: 600;
  color: #293042;
  margin-bottom: 3px;
}

.location-meta {
  font-size: 12px;
  color: #7b8497;
}

.has-custom-bg .message.user .message-content.message-special-card,
.has-custom-bg .message.assistant .message-content.message-special-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.has-custom-bg .message.user .message-content.transfer,
.has-custom-bg .message.assistant .message-content.transfer {
  background: linear-gradient(145deg, #FFB67A 0%, #FF8FA3 100%) !important;
}

.has-custom-bg .message.user .message-content.location,
.has-custom-bg .message.assistant .message-content.location {
  background: #fff !important;
}

/* ============================================ */
/* Group Chat & Chat Add Menu Styles */
/* ============================================ */

.chat-add-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: none;
  background: rgba(245, 246, 243, 0.32);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
}

.chat-add-backdrop.active {
  display: block;
}

.chat-add-menu {
  position: fixed;
  /* 使用 fixed 定位，通过 JS 动态设置 top/right */
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  width: 188px;
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(31, 39, 56, 0.18);
  z-index: 10000;
  display: none;
  flex-direction: column;
  overflow: visible;
  /* Allow arrow to show */
  color: #1f2a44;
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.chat-add-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  right: var(--arrow-right, 15px);
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.92);
  transform: rotate(45deg);
  border-left: 1px solid rgba(255, 255, 255, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.75);
}

.chat-add-menu.active {
  display: flex;
  animation: menuFadeIn 0.2s ease-out forwards;
}

@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.add-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(30, 41, 59, 0.08);
}

.add-menu-item:last-child {
  border-bottom: none;
}

.add-menu-item:active {
  background: rgba(20, 36, 66, 0.05);
}

.add-menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ef8ca7;
  background: rgba(255, 162, 187, 0.18);
  flex-shrink: 0;
}

.add-menu-item:nth-child(2) .add-menu-icon {
  color: #5aa2f7;
  background: rgba(139, 191, 255, 0.2);
}

.add-menu-item span {
  font-size: 16px;
  font-weight: 600;
  color: #1f2a44;
  letter-spacing: -0.2px;
}

/* Group Member Selection Item */
.group-member-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 16px;
  border-bottom: 0.5px solid #f0f0f0;
  cursor: pointer;
}

.group-member-item:active {
  background: #f9f9f9;
}

.member-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid #ddd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.group-member-item.selected .member-checkbox {
  background: #007AFF;
  border-color: #007AFF;
}

.group-member-item.selected .member-checkbox::after {
  content: '✓';
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: #f0f0f0;
}

.member-name {
  font-size: 16px;
  color: #333;
  flex: 1;
}

/* ============================================
   Custom Prompt Modal - Claymorphism Cute Style
   简约高级可爱的黏土风格弹窗
   ============================================ */
.custom-prompt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 182, 193, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.custom-prompt-overlay.active {
  display: flex;
  opacity: 1;
}

.custom-prompt-modal {
  background: linear-gradient(145deg, #FFF5F7 0%, #FFE4E9 100%);
  border-radius: 24px;
  width: 100%;
  max-width: 300px;
  border: 3px solid #FFB6C1;
  box-shadow: 
    8px 8px 16px rgba(255, 182, 193, 0.4),
    -4px -4px 12px rgba(255, 255, 255, 0.8),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  transform: scale(0.8) translateY(30px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  padding: 24px 20px 20px;
}

.custom-prompt-overlay.active .custom-prompt-modal {
  transform: scale(1) translateY(0);
  animation: cuteBounce 0.5s ease-out;
}

@keyframes cuteBounce {
  0% { transform: scale(0.8) translateY(30px); }
  60% { transform: scale(1.05) translateY(-5px); }
  100% { transform: scale(1) translateY(0); }
}

.custom-prompt-title {
  font-size: 18px;
  font-weight: 700;
  color: #FF6B8A;
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.4;
  text-shadow: 1px 1px 2px rgba(255, 182, 193, 0.3);
}

.custom-prompt-input-wrapper {
  margin-bottom: 20px;
}

.custom-prompt-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 16px;
  color: #5A5A5A;
  background: #FFFFFF;
  border: 3px solid #FFD1DC;
  border-radius: 16px;
  outline: none;
  transition: all 0.3s ease;
  box-sizing: border-box;
  box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.05);
}

.custom-prompt-input::placeholder {
  color: #FFB6C1;
}

.custom-prompt-input:focus {
  border-color: #FF8FAB;
  box-shadow: 
    inset 2px 2px 6px rgba(0, 0, 0, 0.05),
    0 0 0 4px rgba(255, 182, 193, 0.2);
  transform: translateY(-2px);
}

.custom-prompt-actions {
  display: flex;
  gap: 12px;
}

.custom-prompt-btn {
  flex: 1;
  height: 44px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.custom-prompt-btn.cancel {
  background: linear-gradient(145deg, #FFF0F3 0%, #FFE4E9 100%);
  color: #FF8FAB;
  border: 2px solid #FFD1DC;
}

.custom-prompt-btn.confirm {
  background: linear-gradient(145deg, #FF8FAB 0%, #FF6B8A 100%);
  color: #FFFFFF;
  border: 2px solid #FF6B8A;
}

.custom-prompt-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.custom-prompt-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-prompt-btn.cancel:hover {
  background: linear-gradient(145deg, #FFE4E9 0%, #FFD1DC 100%);
}

.custom-prompt-btn.confirm:hover {
  background: linear-gradient(145deg, #FF6B8A 0%, #FF5274 100%);
}

/* Group Avatar Grid (Mini Icons) */
.group-avatar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
  padding: 2px;
  background: #e0e0e0;
  width: 100%;
  height: 100%;
}

.group-avatar-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* ============================================ */
/* Global Search Overlay Styles (INS Style) */
/* ============================================ */

.search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: none;
    flex-direction: column;
    animation: fadeIn 0.2s ease-out;
}

.search-overlay.active {
    display: flex;
}

.search-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    background: #fff;
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f0f0f2;
    padding: 8px 12px;
    border-radius: 12px;
    gap: 8px;
}

.search-icon {
    font-size: 14px;
    opacity: 0.5;
}

#globalSearchInput {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 16px;
    outline: none;
    color: #333;
}

.clear-search-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
}

.cancel-search-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #007AFF;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.search-results-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 20px 0;
}

.search-result-group-title {
    font-size: 13px;
    color: #8e8e93;
    padding: 20px 16px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-item {
    display: flex;
    padding: 12px 16px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 0.5px solid rgba(0,0,0,0.05);
}

.search-result-item:active {
    background: #f2f2f7;
}

.result-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f0f0;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
    overflow: hidden;
}

.result-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.result-name {
    font-weight: 600;
    font-size: 15px;
    color: #000;
}

.result-date {
    font-size: 12px;
    color: #8e8e93;
}

.result-content {
    font-size: 14px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.keyword-highlight {
    color: #007AFF;
    font-weight: 600;
    background: rgba(0, 122, 255, 0.1);
    padding: 0 2px;
    border-radius: 2px;
}

.no-results {
    padding: 100px 40px;
    text-align: center;
    color: #8e8e93;
    font-size: 15px;
}

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

.search-container:active .search-bar-inner {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.8);
}

/* Home Indicator (iPhone Style) */
.home-indicator-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    cursor: pointer;
}
.home-indicator {
    width: 120px;
    height: 5px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 100px;
    transition: background 0.3s;
}
.home-indicator-container:hover .home-indicator {
    background: rgba(0, 0, 0, 0.4);
}


