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

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

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

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

/* ===== 桌面多页区 ===== */
.desktop-wrapper {
  flex: 1;
  display: flex;
  overflow: hidden;
  transition: transform 0.3s var(--ease);
}
.desktop-page {
  min-width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 20px 12px;
  align-content: start;
}

/* ===== 应用图标 ===== */
.app-icon {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px; padding: 4px;
  transition: transform 0.15s var(--ease), opacity 0.15s;
}
.app-icon:active { transform: scale(0.85); opacity: 0.75; }

/* 图标背景：毛玻璃圆角方形 */
.icon-bg {
  width: 60px; height: 60px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  position: relative; overflow: hidden;
}
.icon-bg i {
  font-size: 26px;
  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(--c-accent-dark);
}
.icon-bg::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
  border-radius: 14px 14px 0 0;
  pointer-events: 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);
}
.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));
}
.dock-glass {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 10px 16px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Dock图标按钮 */
.dock-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  padding: 4px 20px;
  color: var(--c-sub); font-size: 10px;
  transition: all 0.15s var(--ease);
}
.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.45);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  position: relative; overflow: hidden;
}
.dock-icon-bg i {
  font-size: 22px;
  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(--c-accent-dark);
}
.dock-icon-bg::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
  border-radius: 13px 13px 0 0;
  pointer-events: none;
}

/* ===== 通知下拉面板 ===== */
#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;
}
