/* home.css — 主界面桌面样式（iOS 26 Liquid Glass风格） */

/* iOS安全区兼容变量 */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --desktop-grid-rows: 3;
}

/* 主页容器 */
#home-page {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--c-surface);
  background-size: cover;
  background-position: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.desktop-edit-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 8px 20px 4px;
  color: var(--c-text);
  font-size: 13px;
  font-weight: 500;
}
.desktop-edit-bar button {
  height: 30px;
  padding: 0 14px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.32);
  color: var(--c-text);
  font-size: 13px;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}
#home-page.desktop-editing .desktop-edit-bar {
  display: flex;
}

/* iOS状态栏安全区占位 */
.status-bar {
  height: var(--sat);
  min-height: 0;
  flex-shrink: 0;
}

/* ===== 桌面多页区 ===== */
.desktop-viewport {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.desktop-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  transition: transform 0.3s var(--ease);
  overflow: visible;
}
.desktop-page {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 16px 20px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(var(--desktop-grid-rows), minmax(0, 1fr));
  gap: 20px 12px;
  align-content: stretch;
}
.desktop-page.desktop-page-empty::before {
  content: "拖到这里创建新页面";
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.24);
  color: var(--c-sub);
  font-size: 12px;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}
.desktop-slot {
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
}
.desktop-widget-slot {
  align-items: stretch;
  justify-content: stretch;
}

/* ===== 应用图标 ===== */
.app-icon {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px; padding: 4px;
  transition: transform 0.15s var(--ease), opacity 0.15s;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.app-icon:active { transform: scale(0.85); opacity: 0.75; }
.desktop-measure-icon {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
  left: -9999px;
  top: -9999px;
}

/* 图标背景：毛玻璃圆角方形 */
.icon-bg {
  width: 60px; height: 60px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%) brightness(1.05);
  -webkit-backdrop-filter: blur(20px) saturate(180%) brightness(1.05);
  border: none;
  box-shadow:
    inset 1px 1px 0 0 rgba(255, 255, 255, 0.55),
    inset -1px -1px 0 0 rgba(255, 255, 255, 0.2);
  position: relative; overflow: hidden;
}
.icon-bg i {
  font-size: 26px;
  color: var(--icon-color, var(--c-accent-dark));
}
.icon-bg svg {
  width: 30px; height: 30px;
}
.icon-bg svg path, .icon-bg svg circle, .icon-bg svg rect, .icon-bg svg ellipse {
  fill: var(--icon-color, var(--c-accent-dark));
}
.icon-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.icon-label {
  font-size: 11px; color: var(--c-text);
  font-weight: 400; text-align: center;
  line-height: 1.2; white-space: nowrap;
  max-width: 72px; overflow: hidden; text-overflow: ellipsis;
}

/* ===== 页面指示点 ===== */
.page-dots {
  display: flex; justify-content: center;
  gap: 6px; padding: 8px 0; flex-shrink: 0;
}
.dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--c-border-m);
  transition: background var(--dur), transform var(--dur);
  cursor: pointer;
}
.dot.active { background: var(--c-accent); transform: scale(1.2); }

/* ===== iOS 26 液态玻璃 Dock 栏 ===== */
.dock-area {
  flex-shrink: 0;
  padding: 6px 24px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}
html.has-android-bottom-inset .dock-area {
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px) + var(--android-bottom-inset));
}
.dock-glass {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: none;
  box-shadow:
    inset 1px 1px 0 0 rgba(255, 255, 255, 0.55),
    inset -1px -1px 0 0 rgba(255, 255, 255, 0.2),
    0 3px 12px rgba(0, 0, 0, 0.04);
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
}
.dock-area.dock-empty .dock-glass {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}
.dock-area.dock-empty.desktop-drop-zone .dock-glass {
  opacity: 1;
  transform: translateY(0);
}

/* Dock图标按钮 */
.dock-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  flex: 1 1 0;
  max-width: 78px;
  min-width: 0;
  padding: 4px 8px;
  color: var(--c-sub); font-size: 10px;
  transition: all 0.15s var(--ease);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.dock-item:active { transform: scale(0.88); }
.dock-item span {
  font-size: 10px; font-weight: 400;
  color: var(--c-text); opacity: 0.7;
}
.dock-icon-bg {
  width: 52px; height: 52px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%) brightness(1.05);
  -webkit-backdrop-filter: blur(20px) saturate(180%) brightness(1.05);
  border: none;
  box-shadow:
    inset 1px 1px 0 0 rgba(255, 255, 255, 0.55),
    inset -1px -1px 0 0 rgba(255, 255, 255, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.035);
  position: relative; overflow: hidden;
}
.dock-icon-bg i {
  font-size: 22px;
  color: var(--icon-color, var(--c-accent-dark));
}
.dock-icon-bg svg {
  width: 26px; height: 26px;
}
.dock-icon-bg svg path, .dock-icon-bg svg circle, .dock-icon-bg svg rect, .dock-icon-bg svg ellipse {
  fill: var(--icon-color, var(--c-accent-dark));
}

#home-page.desktop-editing .app-icon,
#home-page.desktop-editing .dock-item {
  cursor: grab;
  touch-action: none;
  animation: desktop-icon-wiggle 0.18s ease-in-out infinite alternate;
}
#home-page.desktop-editing .app-icon:active,
#home-page.desktop-editing .dock-item:active {
  cursor: grabbing;
}
.is-dragging-source {
  opacity: 0.25;
}
.desktop-drag-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.96;
  box-sizing: border-box;
  contain: layout paint style;
  transform-origin: center;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.18));
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.desktop-widget-drag-layer {
  position: absolute;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  overflow: hidden;
}
.desktop-widget-drag-layer .desktop-drag-ghost {
  position: absolute;
}
.desktop-drop-target,
.desktop-drop-zone {
  outline: 2px solid rgba(120, 120, 120, 0.32);
  outline-offset: 4px;
}
.desktop-drop-zone {
  border-radius: 24px;
}
.desktop-widget {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 12px;
  color: var(--c-text);
  text-align: left;
  background: var(--widget-bg, rgba(255, 255, 255, 0.34));
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.65),
    inset -1px -1px 0 rgba(255, 255, 255, 0.2),
    0 8px 18px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  touch-action: manipulation;
}
.desktop-widget-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(70, 70, 70, 0.82);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: none;
}
.desktop-widget-remove i {
  font-size: 12px;
  line-height: 1;
}
.desktop-widget-remove:active {
  transform: scale(0.9);
}
#home-page.desktop-editing .desktop-widget {
  cursor: grab;
  touch-action: none;
  animation: desktop-icon-wiggle 0.18s ease-in-out infinite alternate;
}
.desktop-widget:active {
  transform: scale(0.98);
}
.top-widget {
  display: flex;
  align-items: center;
  gap: 12px;
}
.widget-avatar,
.chat-bubble-avatar,
.profile-avatar-img,
.music-album-art,
.circle-photo .img,
.bio-avatar {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.38)),
    url('../img/wanwan.png') center/cover;
}
.widget-avatar {
  width: 48px;
  height: 48px;
  position: relative;
  overflow: visible;
  border-radius: 50%;
  flex-shrink: 0;
}
.widget-avatar-img {
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}
.widget-avatar-wechat {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: linear-gradient(135deg, #eef0f3 0%, #c4c7cc 100%);
}
.widget-avatar-wechat i {
  color: #fff;
  font-size: 10px;
  line-height: 1;
}
.widget-text {
  flex: 1;
  min-width: 0;
}
.widget-title,
.text-mood-title,
.music-title,
.profile-name,
.bio-name,
.custom-widget-title {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-name {
  position: relative;
  top: 6px;
  font-weight: 600;
}
.widget-subtext,
.text-mood-sub,
.music-artist,
.custom-widget-sub {
  margin-top: 4px;
  color: var(--c-sub);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.widget-badge {
  min-width: 24px;
  height: 18px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(132, 132, 132, 0.78);
  color: rgba(255, 255, 255, 0.96);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.text-mood-widget {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.text-mood-date {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--widget-accent, #b8b8b8);
  font-size: 20px;
  font-weight: 700;
}
.chat-bubble-widget {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 4px 8px;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.chat-bubble-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-bubble-row:first-child {
  transform: translateY(-2px);
}
.chat-bubble-right {
  justify-content: flex-end;
}
.chat-bubble-msg {
  position: relative;
  max-width: calc(100% - 44px);
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: visible;
}
.chat-bubble-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-bubble-msg::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 12px;
  transform: translateY(-50%);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.chat-bubble-msg-right {
  background: var(--widget-accent, #787878);
  color: #fff;
}
.chat-bubble-msg-right::after {
  right: -5px;
  background: var(--widget-accent, #787878);
}
.chat-bubble-msg-left {
  background: rgba(255, 255, 255, 0.72);
}
.chat-bubble-msg-left::after {
  left: -5px;
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-50%) rotate(180deg);
}
.chat-bubble-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  max-width: none;
  display: block;
  object-fit: cover;
}
.angel-status-widget {
  padding: 0;
  display: flex;
  flex-direction: column;
  background: rgba(246, 246, 246, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.68),
    0 10px 24px rgba(0, 0, 0, 0.055);
}
.angel-status-top {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px 14px 18px;
  background:
    radial-gradient(circle at 68% 38%, rgba(255,255,255,0.92) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 70%, rgba(255,255,255,0.88) 0 2px, transparent 3px),
    radial-gradient(circle at 58% 66%, rgba(255,255,255,0.74) 0 1px, transparent 2px),
    var(--angel-top-image, linear-gradient(135deg, rgba(255,255,255,0.72), rgba(238,238,238,0.76)));
  background-size: auto, auto, auto, cover;
  background-position: center;
}
.angel-avatar-card {
  width: 68px;
  height: 68px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(226, 226, 226, 0.82);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.035);
}
.angel-avatar-card img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.angel-status-main {
  min-width: 0;
  padding-top: 8px;
}
.angel-status-title {
  color: rgba(40, 40, 40, 0.74);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.18;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.angel-status-handle {
  margin-top: 9px;
  color: rgba(74, 74, 74, 0.38);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.angel-status-date {
  padding-top: 7px;
  color: rgba(45, 45, 45, 0.62);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.angel-status-bubble {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 66px;
  display: flex;
  align-items: center;
  padding: 14px 20px 16px;
  border-radius: 0 0 18px 18px;
  background: rgba(255, 255, 255, 0.95);
  color: rgba(42, 42, 42, 0.76);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.angel-status-message {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.angel-status-triangle {
  position: absolute;
  left: 92px;
  bottom: 64px;
  z-index: 2;
  width: 36px;
  height: 20px;
  background: #fff;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  pointer-events: none;
}
.angel-status-bubble .angel-status-triangle {
  display: none;
}
.angel-editor-modal {
  padding: 20px 18px 18px;
}
.angel-editor-heading {
  margin-bottom: 16px;
  color: var(--c-text);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}
.angel-editor-avatar-wrap {
  display: flex;
  justify-content: center;
  padding: 0 0 18px;
}
.angel-editor-avatar {
  position: relative;
  width: 86px;
  height: 86px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(226, 226, 226, 0.9);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  padding: 0;
  line-height: 0;
  appearance: none;
  -webkit-appearance: none;
}
.angel-editor-avatar img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.top-editor-avatar {
  border-radius: 50%;
}
.chat-editor-avatars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 0 18px;
}
.chat-editor-avatar {
  width: 100%;
  height: auto;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.chat-editor-avatar img {
  width: 68px;
  height: 68px;
  max-width: none;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.chat-editor-avatar span {
  color: var(--c-sub);
  font-size: 12px;
  line-height: 1.2;
}
.angel-editor-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.angel-editor-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--c-sub);
  font-size: 12px;
  font-weight: 600;
}
.angel-editor-bg-picker {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 14px;
  text-align: left;
}
.angel-editor-bg-preview {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.72), rgba(238,238,238,0.76));
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.angel-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 4px;
}
.angel-editor-save {
  color: #fff;
  background: var(--c-accent);
}
.profile-widget,
.music-widget,
.couple-widget,
.bio-card-widget,
.custom-style-widget {
  display: flex;
  flex-direction: column;
}
.profile-widget {
  padding: 0;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  background: #fff;
}
.profile-widget-cover,
.profile-widget-body {
  width: 100%;
  height: 50%;
}
.profile-widget-cover {
  position: relative;
  background: var(--profile-cover-image, linear-gradient(180deg, rgba(104, 104, 104, 0.34) 0%, rgba(220, 220, 220, 0.34) 100%));
  background-size: cover;
  background-position: center center;
}
.profile-widget-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 54%,
    rgba(255, 255, 255, 0.16) 72%,
    rgba(255, 255, 255, 0.62) 100%
  );
  pointer-events: none;
}
.profile-widget-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 26px 8px 10px;
  background: #fff;
}
.profile-avatar-ring {
  width: 58px;
  height: 58px;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  padding: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.64);
  transform: translate(-50%, -50%);
}
.profile-avatar-img {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.profile-location-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--c-sub);
  font-size: 10px;
}
.music-widget {
  gap: 7px;
}
.music-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.music-album-art {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
}
.music-album-art img {
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
  object-fit: cover;
}
.music-play-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--widget-accent, #787878);
  background: transparent;
  font-size: 24px;
  line-height: 1;
}
.music-progress-area {
  margin-top: auto;
}
.music-progress-bar {
  height: 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.08);
  position: relative;
}
.music-progress-fill {
  width: 36%;
  height: 100%;
  border-radius: inherit;
  background: var(--widget-accent, #787878);
}
.music-progress-dot {
  position: absolute;
  left: 36%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.16);
}
.music-times {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--c-sub);
  font-size: 9px;
}
.couple-widget {
  justify-content: space-between;
  gap: 8px;
}
.couple-bubbles-row,
.couple-avatars-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.couple-bubbles-row {
  transform: translateY(-2px);
}
.couple-bubble-item {
  position: relative;
  max-width: 48%;
  padding: 3px 8px;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, currentColor 32%, transparent);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--c-sub);
  font-size: 10px;
  overflow: visible;
}
.couple-bubble-item span {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.couple-bubble-item::after {
  content: "";
  position: absolute;
  bottom: -10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, currentColor 32%, transparent);
  background: rgba(255, 255, 255, 0.62);
}
.couple-bubble-left-note::after {
  left: 26%;
}
.couple-bubble-right-note::after {
  right: 26%;
}
.circle-photo {
  min-width: 0;
  text-align: center;
}
.img-ring {
  width: 42px;
  height: 42px;
  margin: 0 auto 4px;
  padding: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.66);
}
.circle-photo .img {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 50%;
  display: block;
  object-fit: cover;
}
.circle-photo .name {
  max-width: 50px;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.couple-ekg {
  flex: 1;
  color: var(--widget-accent, #787878);
}
.couple-ekg svg {
  width: 100%;
  height: 22px;
}
.couple-days-area {
  padding: 7px 9px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  text-align: center;
}
.couple-days-label {
  color: var(--c-sub);
  font-size: 9px;
}
.couple-days-value {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 700;
}
.bio-card-widget {
  align-items: center;
  padding-top: 0;
}
.bio-cover {
  width: calc(100% + 24px);
  height: calc(50% + 6px);
  flex-shrink: 0;
  margin: 0 -12px;
  background: var(--bio-cover-image, linear-gradient(180deg, rgba(120, 120, 120, 0.42) 0%, rgba(224, 224, 224, 0.34) 100%));
  background-size: cover;
  background-position: center;
}
.bio-avatar-wrap {
  margin-top: -30px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
}
.bio-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
}
.bio-avatar img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
}
.bio-name {
  margin-top: 6px;
}
.bio-quote {
  max-width: 100%;
  margin-top: 6px;
  color: var(--c-sub);
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.bio-quote-mark {
  color: var(--widget-accent, #787878);
  font-size: 0.78em;
  font-weight: 700;
  margin: 0 3px;
}
.custom-style-widget {
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--widget-accent, #787878) 38%, transparent);
}
.custom-widget-title {
  color: var(--widget-accent, var(--c-text));
}
@keyframes desktop-icon-wiggle {
  from { transform: rotate(-0.8deg); }
  to { transform: rotate(0.8deg); }
}

/* ===== iScreen ===== */
.iscreen-page {
  background: var(--c-surface);
}
.iscreen-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.iscreen-entry-card {
  width: 100%;
  min-height: 104px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.iscreen-entry-card:active {
  background: var(--c-surface);
}
.iscreen-entry-main {
  flex: 1;
  min-width: 0;
}
.iscreen-entry-title {
  color: var(--c-text);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}
.iscreen-entry-sub {
  margin-top: 6px;
  color: var(--c-sub);
  font-size: 13px;
  line-height: 1.3;
}
.iscreen-entry-preview {
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.iscreen-entry-preview .icon-bg {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.iscreen-entry-preview .icon-bg i {
  font-size: 16px;
}
.iscreen-entry-preview .icon-bg svg {
  width: 18px;
  height: 18px;
}
.iscreen-widget-preview {
  width: 78px;
  height: 74px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 5px;
}
.widget-preview-wide,
.widget-preview-square {
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(120, 120, 120, 0.58), rgba(255, 255, 255, 0.7));
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.72);
}
.widget-preview-wide {
  grid-column: span 4;
}
.widget-preview-square {
  grid-column: span 2;
}
.widget-preview-muted {
  background: linear-gradient(135deg, rgba(160, 160, 160, 0.48), rgba(255, 255, 255, 0.72));
}
.iscreen-entry-arrow {
  flex: 0 0 auto;
  color: var(--c-hint);
  font-size: 16px;
}
.iscreen-transfer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.iscreen-transfer-btn {
  min-width: 0;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.iscreen-transfer-btn:active {
  background: var(--c-surface);
}
.iscreen-transfer-btn i {
  color: var(--c-sub);
  font-size: 14px;
}
.iscreen-reset-all {
  flex-shrink: 0;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  background: var(--c-surface);
  color: var(--c-sub);
  font-size: 13px;
}
.iscreen-reset-all:active {
  background: var(--c-surface-2);
}
.iscreen-pack-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.iscreen-pack-subtitle {
  color: var(--c-sub);
  font-size: 13px;
  line-height: 1.3;
}
.iscreen-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.iscreen-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 14px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.iscreen-row-icon {
  flex: 0 0 auto;
}
.iscreen-row-icon .icon-bg {
  width: 52px;
  height: 52px;
  border-radius: 13px;
}
.iscreen-row-main {
  flex: 1;
  min-width: 0;
}
.iscreen-row-label {
  color: var(--c-text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
}
.iscreen-row-sub {
  margin-top: 4px;
  color: var(--c-sub);
  font-size: 12px;
  line-height: 1.2;
}
.iscreen-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.iscreen-action {
  height: 30px;
  padding: 0 10px;
  border-radius: 15px;
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 12px;
}
.iscreen-action:active {
  background: var(--c-surface-2);
}
.iscreen-color-control {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background:
    linear-gradient(var(--c-bg), var(--c-bg)) padding-box,
    linear-gradient(135deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.04)) border-box;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.iscreen-color-control:active {
  transform: scale(0.94);
}
.iscreen-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--c-bg);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.12);
}
.iscreen-color-control input {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  opacity: 0;
  background: transparent;
  cursor: pointer;
}
.widget-gallery-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.widget-gallery-heading {
  margin-top: 4px;
  color: var(--c-sub);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.widget-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.widget-gallery-card {
  min-width: 0;
  padding: 10px;
  border-radius: 16px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.widget-gallery-card:active {
  background: var(--c-surface);
}
.widget-gallery-preview {
  width: 100%;
  height: 90px;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  margin-bottom: 10px;
}
.widget-gallery-preview.preview-4x1 {
  height: 58px;
}
.widget-gallery-preview.preview-4x2 {
  height: 110px;
}
.widget-gallery-preview.preview-2x2 {
  height: 100px;
}
.widget-gallery-preview.preview-4x3 {
  height: 140px;
}
.widget-gallery-preview .desktop-widget {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  max-width: none;
  height: 200%;
  max-height: none;
  transform: scale(0.5);
  transform-origin: top left;
  pointer-events: none;
  animation: none;
}
.widget-gallery-preview .desktop-widget * {
  min-width: 0;
}
.widget-gallery-title {
  color: var(--c-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.widget-gallery-sub {
  margin-top: 4px;
  color: var(--c-sub);
  font-size: 12px;
  line-height: 1.2;
}
.widget-custom-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
.widget-custom-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--c-sub);
  font-size: 12px;
}
.widget-custom-form input,
.widget-custom-form select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 13px;
}
.widget-custom-form input[type="color"] {
  padding: 3px;
}
.widget-add-custom {
  grid-column: 1 / -1;
  width: 100%;
  height: 36px;
  border-radius: 12px;
  background: var(--c-accent);
  color: #fff;
  font-size: 13px;
}

@media (max-width: 360px) {
  .iscreen-row {
    gap: 10px;
    padding: 12px;
  }
  .iscreen-row-icon .icon-bg {
    width: 48px;
    height: 48px;
  }
  .iscreen-action {
    padding: 0 8px;
  }
  .widget-gallery-grid,
  .widget-custom-form {
    grid-template-columns: 1fr;
  }
}

/* ===== 通知下拉面板 ===== */
#notif-panel {
  position: absolute;
  top: calc(var(--sat) + 80px);
  left: 16px; right: 16px;
  background: var(--c-bg);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s var(--ease);
  z-index: 10;
}
#notif-panel.show { max-height: 300px; }

/* ===== 壁纸模式适配 ===== */
#home-page.has-wallpaper .icon-label {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
#home-page.has-wallpaper .dock-item span {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  opacity: 1;
}
#home-page.has-wallpaper .dot {
  background: rgba(255, 255, 255, 0.4);
}
#home-page.has-wallpaper .dot.active {
  background: #fff;
}
