/* ===== 基础 ===== */
* {
  box-sizing: border-box;
}

:root {
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef2ff;
  --ink: #1f2937;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  background: #f5f7fa;
}

/* 背景光斑（柔和的漂浮动效） */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
}
body::before {
  width: 480px;
  height: 480px;
  top: -120px;
  left: -120px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35), transparent 65%);
  animation: blobFloat 14s ease-in-out infinite alternate;
}
body::after {
  width: 420px;
  height: 420px;
  bottom: -140px;
  right: -100px;
  background: radial-gradient(circle, rgba(217, 70, 239, 0.25), transparent 65%);
  animation: blobFloat 18s ease-in-out infinite alternate-reverse;
}

.header,
.container,
.footer {
  position: relative;
  z-index: 1;
}

@keyframes blobFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.12); }
}

/* ===== 头部（滑下入场 + 悬浮毛玻璃） ===== */
.header {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  animation: headerIn 0.5s ease-out both;
}
@keyframes headerIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { font-size: 24px; animation: popIn 0.6s ease-out both; }
.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
@keyframes popIn {
  0% { opacity: 0; transform: scale(0.5); }
  70% { transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}

.user { display: flex; align-items: center; gap: 12px; }

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.user-meta { line-height: 1.2; }
.user-name { font-size: 14px; font-weight: 600; }
.user-no { font-size: 12px; color: var(--muted); }

/* 退出按钮：已隐藏 */
.logout { display: none; }

/* ===== 主体 ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 40px;
  flex: 1;
  width: 100%;
}

/* ---- 欢迎区：依次浮现 ---- */
.hero {
  text-align: center;
  padding: 24px 0 32px;
}
.hero .hero-badge { animation: riseIn 0.5s ease-out 0.05s both; }
.hero .hero-title { animation: riseIn 0.5s ease-out 0.12s both; }
.hero .hero-sub   { animation: riseIn 0.5s ease-out 0.2s both; }

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

.hero-badge {
  display: inline-block;
  font-size: 13px;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #e0e7ff;
  border-radius: 999px;
  padding: 4px 16px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
/* 徽标流光扫过动画 */
.hero-badge::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine {
  0% { left: -80%; }
  55% { left: 130%; }
  100% { left: 130%; }
}

.hero-title { margin: 0; font-size: 30px; font-weight: 800; }
.hero-sub { margin: 10px 0 24px; color: var(--muted); font-size: 15px; }

.search {
  position: relative;
  flex: 1 1 320px;
  max-width: 420px;
  margin: 0 8px;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  opacity: 0.6;
}
.search input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  outline: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.search input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
  transform: translateY(-1px);
}

/* ===== 应用区 ===== */
.apps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 2px 16px;
  animation: riseIn 0.5s ease-out 0.32s both;
}
.apps-title { margin: 0; font-size: 18px; font-weight: 700; }
.apps-count { font-size: 13px; color: var(--faint); }

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

/* 卡片：错峰弹入 + 悬停抬升 + 通往箭头滑动 */
.app-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 16px;
  padding: 22px;
  color: inherit;
  animation: cardIn 0.5s ease-out both;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.3, 1),
    box-shadow 0.22s ease, border-color 0.22s ease;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* 卡片顶部的进度条：悬停时从左向右铺满 */
.app-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--brand), #a855f7);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.55s ease;
  z-index: 1;
}
.app-card:hover::before {
  transform: scaleX(1);
}
.app-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.14);
  border-color: #c7d2fe;
}

.app-card-top { display: flex; align-items: flex-start; gap: 14px; }
.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.app-card:hover .app-icon { transform: scale(1.12) rotate(-5deg); }
.app-name { font-size: 16px; font-weight: 700; line-height: 1.3; }

.app-detail {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  font-size: 12px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 6px;
  padding: 3px 9px;
  transition: all 0.18s ease;
}
.app-card:hover .tag { background: #e0e7ff; }

.app-meta {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--faint);
}
.app-enter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  font-weight: 600;
}
/* 「进入 →」箭头滑动动效 */
.app-enter .arrow { transition: transform 0.2s ease; }
.app-card:hover .app-enter .arrow { transform: translateX(4px); }

/* 空态 */
.empty {
  text-align: center;
  color: var(--faint);
  padding: 60px 0;
  animation: riseIn 0.4s ease-out both;
}

/* 页脚 */
.footer {
  text-align: center;
  color: #c3c8d8;
  font-size: 12px;
  padding: 20px;
}

/* 适配减弱动画偏好，提升可访问性 */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 640px) {
  .container { padding: 24px 16px 32px; }
  .hero-title { font-size: 24px; }
  .apps-grid { grid-template-columns: 1fr; }
  .user-no { display: none; }
  /* 头部搜索框在窄屏时换行到整行 */
  .search { order: 3; flex-basis: 100%; max-width: none; margin: 6px 0 2px; }
}