/* ============================================================
   NexAI Store — App Store / 商城聚合风格
   高端、浅色、聚焦应用图标
   ============================================================ */

:root {
  --bg-page: #f5f5f7; /* Apple canvas-parchment */
  --bg-surface: #ffffff; /* Apple canvas */
  --bg-hover: #f0f0f0; /* Apple divider-soft / hover */
  
  --text-main: #1d1d1f; /* Apple ink / body */
  --text-muted: #7a7a7a; /* Apple ink-muted-48 */
  --text-light: #cccccc; /* Apple body-muted */
  
  --border: #e0e0e0; /* Apple hairline */
  --border-light: #f0f0f0;
  
  --primary: #0066cc; /* Apple Action Blue */
  --primary-hover: #0071e3; /* Apple Focus Blue */
  
  --radius-sm: 8px; /* rounded.sm */
  --radius-md: 11px; /* rounded.md */
  --radius-lg: 18px; /* rounded.lg */
  --radius-squircle: 22.5%;
  --radius-pill: 9999px; /* rounded.pill */
  
  --shadow-sm: 0 1px 1px rgba(0,0,0,0.02), 0 2px 2px rgba(0,0,0,0.04);
  --shadow-hover: 0 2px 4px rgba(0,0,0,0.04), 0 8px 16px -4px rgba(0,0,0,0.08), 0 24px 32px -8px rgba(0,0,0,0.04);
  --shadow-inset-hairline: inset 0 0 0 1px rgba(0,0,0,0.06);
  --product-shadow: rgba(0, 0, 0, 0.22) 3px 5px 30px 0; /* Apple's signature product shadow */
  
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-out: cubic-bezier(0.21, 0.61, 0.35, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.mall-body {
  font-family: "SF Pro Text", "SF Pro Display", system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.47;
  letter-spacing: -0.374px;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }

/* --- 顶部导航 --- */
.mall-header {
  position: sticky; top: 0; z-index: 100;
  height: 64px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}

.header-left .logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1.125rem;
}
.logo-icon {
  width: 28px; height: 28px;
  background: var(--text-main); color: white;
  border-radius: 8px; display: grid; place-items: center;
}
.logo-icon svg { width: 16px; height: 16px; }
.logo-badge {
  font-size: 0.75rem; color: var(--primary);
  background: rgba(15, 98, 254, 0.1);
  padding: 2px 6px; border-radius: 4px; font-weight: 600;
  margin-left: 4px; vertical-align: middle;
}

.header-search { flex: 1; max-width: 480px; margin: 0 24px; }
.search-bar {
  display: flex; align-items: center;
  background: var(--bg-hover);
  border-radius: 99px;
  padding: 0 16px; height: 40px;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.search-bar:focus-within {
  background: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.1);
}
.search-icon { width: 18px; height: 18px; color: var(--text-muted); }
.search-bar input {
  border: none; background: none; outline: none;
  flex: 1; padding: 0 12px; font-size: 0.95rem;
  color: var(--text-main);
}
.search-bar input::placeholder { color: var(--text-light); }
.search-shortcut {
  font-size: 0.75rem; color: var(--text-light);
  background: var(--bg-surface); border: 1px solid var(--border);
  padding: 2px 6px; border-radius: 4px;
}

.header-right { display: flex; align-items: center; gap: 20px; }
.header-link { font-size: 0.95rem; font-weight: 500; color: var(--text-muted); transition: color 0.2s; }
.header-link:hover { color: var(--text-main); }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-hover); display: grid; place-items: center;
  color: var(--text-muted); cursor: pointer;
}
.user-avatar svg { width: 20px; height: 20px; }

/* --- 主体布局 --- */
.mall-layout {
  display: flex;
  max-width: 1440px; margin: 0 auto;
  padding: 32px 24px; gap: 40px;
}

/* --- 侧边栏 --- */
.sidebar {
  width: 240px; flex-shrink: 0;
  position: sticky; top: 96px;
  height: calc(100vh - 120px);
  display: flex; flex-direction: column; gap: 32px;
}
.menu-group { display: flex; flex-direction: column; gap: 4px; }
.menu-title {
  font-size: 0.75rem; font-weight: 600; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 8px; padding-left: 12px;
}
.menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 10px 12px; border-radius: var(--radius-md);
  font-size: 0.95rem; font-weight: 500; color: var(--text-muted);
  transition: all 0.2s;
}
.menu-item svg { width: 18px; height: 18px; }
.menu-item span { margin-left: auto; font-size: 0.8rem; color: var(--text-light); }
.menu-item:hover { background: var(--bg-hover); color: var(--text-main); }
.menu-item.active { background: var(--bg-surface); color: var(--primary); box-shadow: var(--shadow-sm); }

.sidebar-promo { margin-top: auto; }
.promo-box {
  background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 100%);
  padding: 16px; border-radius: var(--radius-md);
  border: 1px solid #bbf7d0;
}
.promo-box h5 { display: flex; align-items: center; gap: 6px; color: #166534; font-size: 0.9rem; margin-bottom: 8px; }
.promo-box h5 svg { width: 16px; height: 16px; }
.promo-box p { font-size: 0.75rem; color: #15803d; line-height: 1.5; }

/* --- 右侧内容区 --- */
.main-content { flex: 1; min-width: 0; }

/* Banner 推荐位 */
.showcase-banner-container {
  display: grid;
  margin-bottom: 48px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.15);
  position: relative;
}
.showcase-banner {
  grid-area: 1 / 1;
  padding: 48px;
  display: flex; align-items: center; justify-content: space-between;
  position: relative; overflow: hidden;
  opacity: 0; pointer-events: none;
  transition: opacity 0.8s ease-in-out;
}
.showcase-banner.active {
  opacity: 1; pointer-events: auto; z-index: 2;
}
.banner-indicators {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 10;
}
.indicator {
  width: 32px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.3);
  cursor: pointer; transition: all 0.3s;
}
.indicator.active { background: white; }

.showcase-banner::before {
  content: ""; position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.05), transparent);
  transform: rotate(30deg);
  animation: banner-sweep 6s linear infinite;
  pointer-events: none;
}
@keyframes banner-sweep {
  0% { transform: translateX(-50%) rotate(30deg); }
  100% { transform: translateX(50%) rotate(30deg); }
}
.showcase-banner::after {
  content: ""; position: absolute; right: -50px; top: -50px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.3) 0%, transparent 70%);
  pointer-events: none;
  animation: pulse-glow 4s ease-in-out infinite alternate;
}
@keyframes pulse-glow {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.1); opacity: 1; }
}
.banner-info { max-width: 500px; position: relative; z-index: 1; }
.banner-eyebrow {
  color: #A78BFA; font-size: 0.875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; display: block; margin-bottom: 12px;
}
.banner-info h2 { 
  font-size: 2.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 16px; line-height: 1.1; 
  background: linear-gradient(to right, #FFFFFF 20%, #A78BFA 50%, #FFFFFF 80%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: text-shine 3s linear infinite;
}
@keyframes text-shine {
  to { background-position: 200% center; }
}
.banner-info p { color: #94A3B8; font-size: 1.1rem; line-height: 1.6; margin-bottom: 32px; }
.btn-banner {
  display: inline-block; background: white; color: #0F172A;
  padding: 12px 24px; border-radius: 99px; font-weight: 600; font-size: 1rem;
  transition: transform 0.2s;
}
.btn-banner:hover { transform: scale(1.05); }

.banner-visual { position: relative; z-index: 1; margin-right: 40px; }
.banner-app-icon {
  width: 140px; height: 140px; border-radius: 32px;
  display: grid; place-items: center; color: white;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  animation: float-icon 6s ease-in-out infinite;
}
@keyframes float-icon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.banner-app-icon svg { width: 70px; height: 70px; }

/* 列表区 */
.store-section { margin-bottom: 48px; }
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-head h3 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.see-all { font-size: 0.95rem; color: var(--primary); font-weight: 500; }
.see-all:hover { color: var(--primary-hover); text-decoration: underline; }

/* App 网格 (类似 App Store 列表模式卡片) */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* App 卡片设计核心 */
.app-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; border-radius: var(--radius-lg);
  background: var(--bg-surface); 
  box-shadow: var(--shadow-sm), var(--shadow-inset-hairline);
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
}
.app-card:hover {
  box-shadow: var(--shadow-hover), inset 0 0 0 1px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

/* 核心：App 圆角大图标 */
.app-icon {
  width: 72px; height: 72px; flex-shrink: 0;
  border-radius: var(--radius-squircle);
  display: block; /* 移除 grid 和 place-items */
  background: white;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.05);
  overflow: hidden;
  position: relative;
}
.app-icon img, .app-icon svg { 
  width: 100%; height: 100%; 
  display: block; 
  object-fit: cover; /* 填满整个圆角矩形 */
}

/* Banner 里的超大图标 */
.banner-app-icon {
  width: 140px; height: 140px;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.banner-app-icon img { width: 100%; height: 100%; object-fit: cover; }

/* 各种 App 图标的背景色 */
.openai-bg { background: #10A37F; }
.claude-bg { background: #D97757; }
.cursor-bg { background: #000000; }
.github-bg { background: #ffffff; color: #000 !important; }
.mj-bg { background: #111827; }
.runway-bg { background: #8b5cf6; }
.suno-bg { background: #f59e0b; }
.notion-bg { background: white; border: 1px solid #e5e7eb; box-shadow: none; }
.gemini-bg { background: #1E88E5; }
.perplexity-bg { background: #000000; }

.brand-title { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
}
.brand-icon img, .brand-icon svg { width: 20px; height: 20px; }
.brand-title h3 span { font-size: 0.9rem; color: var(--text-muted); font-weight: normal; margin-left: 6px; }

.menu-icon { width: 20px; height: 20px; flex-shrink: 0; }
img.menu-icon { width: 18px; height: 18px; }

.app-info { flex: 1; min-width: 0; }
.app-name { font-size: 1.05rem; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; letter-spacing: -0.2px; }
.app-vendor { 
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; 
  color: var(--text-light); margin-bottom: 4px; 
}
.app-desc { font-size: 0.8rem; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 操作区：价格 + 按钮 */
.app-action {
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  flex-shrink: 0; margin-left: 12px;
}
.btn-get {
  background: var(--bg-hover); color: var(--primary);
  font-weight: 600; font-size: 0.95rem;
  padding: 8px 20px; border-radius: var(--radius-pill);
  transition: all 0.2s var(--ease-out);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-get:hover { background: var(--border); }
.btn-get:active { transform: scale(0.95); }
.app-price { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.app-price small { font-size: 0.75rem; font-weight: 400; color: var(--text-light); }

/* 响应式 */
@media (max-width: 1200px) {
  .mall-layout { padding: 32px 24px; gap: 32px; }
  .app-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}
@media (max-width: 900px) {
  .mall-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; overflow-x: auto; padding-bottom: 12px; gap: 24px; }
  .menu-group { flex-direction: row; align-items: center; }
  .menu-title { display: none; }
  .menu-item { white-space: nowrap; width: auto; }
  .sidebar-promo { display: none; }
  .showcase-banner { flex-direction: column; text-align: center; gap: 32px; padding: 40px 24px; }
  .banner-visual { margin-right: 0; order: -1; }
}
@media (max-width: 640px) {
  .header-search { display: none; }
  .mall-header { padding: 0 20px; }
  .mall-layout { padding: 20px 16px; }
  .app-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Dropdown & Modal Styles
   ============================================================ */
/* --- 顶部右侧下拉菜单 --- */
.dropdown-wrapper { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--bg-surface);
  border-radius: 16px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.02), 0 8px 16px -4px rgba(0,0,0,0.04), 0 24px 32px -8px rgba(0,0,0,0.06), inset 0 0 0 1px rgba(0,0,0,0.06);
  width: 260px;
  padding: 8px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: all 0.2s var(--ease-spring);
  z-index: 100;
}
.dropdown-menu.right { left: auto; right: 0; transform: translateY(8px); }
.dropdown-wrapper.open .dropdown-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.dropdown-wrapper.open .dropdown-menu.right { transform: translateY(0); }

.dropdown-header { padding: 12px 16px 8px; font-size: 0.85rem; font-weight: 700; color: var(--text-muted); }
.user-name { font-size: 1.05rem; font-weight: 700; color: var(--text-main); margin-bottom: 2px; }
.user-email { font-size: 0.85rem; color: var(--text-muted); font-weight: 400; }
.dropdown-divider { height: 1px; background: var(--border); margin: 8px 0; }

.dropdown-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  color: var(--text-main); font-weight: 500; font-size: 0.95rem;
  border-radius: 10px; transition: all 0.2s;
}
.dropdown-item svg { width: 18px; height: 18px; color: var(--text-muted); transition: color 0.2s; }
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item:hover svg { color: var(--primary); }

/* --- Modal 弹窗 --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-content {
  background: var(--bg-surface);
  width: 100%; max-width: 440px;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.02), 0 8px 16px -4px rgba(0,0,0,0.08), 0 24px 32px -8px rgba(0,0,0,0.12), inset 0 0 0 1px rgba(0,0,0,0.06);
  transform: translateY(20px) scale(0.96);
  transition: all 0.4s var(--ease-spring);
  opacity: 0;
}
.modal-overlay.open .modal-content { transform: translateY(0) scale(1); opacity: 1; }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-title { font-size: 1.5rem; font-weight: 600; color: var(--text-main); letter-spacing: -0.6px; }
.modal-close {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg-hover);
  color: var(--text-muted); cursor: pointer; transition: all 0.2s;
}
.modal-close:hover { background: #E2E8F0; color: var(--text-main); }
.modal-close svg { width: 20px; height: 20px; }

.modal-desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 24px; }
.form-group { margin-bottom: 24px; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-main); margin-bottom: 8px; }
.form-input {
  width: 100%; padding: 14px 16px;
  background: white; border: 1px solid var(--border);
  border-radius: 8px; font-size: 1rem; color: var(--text-main); font-weight: 400;
  transition: all 0.2s var(--ease-out); outline: none;
}
.form-input::placeholder { color: var(--text-light); }
.form-input:focus { border-color: transparent; box-shadow: 0 0 0 1px var(--primary), 0 0 0 4px rgba(0, 102, 204, 0.15); }

.btn-primary {
  background: var(--primary); color: white;
  font-weight: 600; border-radius: var(--radius-pill);
  transition: all 0.2s var(--ease-out); display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary:hover { background: var(--primary-hover); transform: scale(0.98); }
.btn-primary:active { transform: scale(0.95); }

