/* ============================================================
   天机LTS V10 基础样式 - Reset & 全局排版
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 深空背景渐变 + 噪点纹理 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(40, 60, 120, 0.18), transparent),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(20, 30, 70, 0.25), transparent);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* 滚动条 */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--border-card); border-radius: 2px; }
::-webkit-scrollbar-track { background: transparent; }

/* App Shell - 移动优先，最大宽度460px */
.app-shell {
  max-width: 460px;
  margin: 0 auto;
  padding: var(--space-md);
  padding-bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* 链接 */
a { color: var(--text-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 选择文字颜色 */
::selection {
  background: rgba(100, 140, 255, 0.3);
  color: var(--text-primary);
}

/* 动画 */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 0.6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }

/* --- P1: 骨架屏 Shimmer 动画 --- */
@keyframes skeletonShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-glass) 25%,
    rgba(100,140,255,0.08) 37%,
    var(--bg-glass) 63%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.8s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton-line { height: 14px; margin-bottom: 10px; width: 100%; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-card { height: 60px; margin-bottom: 8px; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }

/* --- P1: 旋转加载圈 --- */
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-card);
  border-top-color: var(--text-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-spinner.lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

/* --- P1: 页面切换过渡动画 --- */
.module-section {
  animation: pageEnter 0.35s var(--ease-out-expo);
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 页面离开动画（用于切换效果） */
.module-section.leaving {
  animation: pageLeave 0.2s var(--ease-out-expo) forwards;
}
@keyframes pageLeave {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.97); }
}

/* ====== 通用工具类 ====== */
.hidden { display: none !important; }
.flex-col { display: flex; flex-direction: column; gap: var(--space-md); }
.text-center { text-align: center; }
.overflow-x-auto { overflow-x: auto; }

/* ====== 首页区域（替代 inline display:flex...） ====== */
.home-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* 响应式 */
@media (max-width: 360px) {
  .app-shell { padding: var(--space-sm); padding-bottom: 76px; }
}
