/* fashion-art-gallery-050410/frontend/public/styles/main.css */

/* =========================================
   全局变量定义 (Design Tokens)
   ========================================= */
:root {
  /* 字体系统 - 优先使用现代无衬线字体 */
  --font-primary: 'Source Han Sans CN', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  
  /* 颜色系统 - 极简主义色盘 */
  --color-bg-body: #ffffff;
  --color-bg-alt: #f5f5f7;
  --color-text-main: #1a1a1a;
  --color-text-muted: #737373;
  --color-border: #eaeaea;
  
  /* 布局尺寸 */
  --nav-height: 80px;
  --container-width: 1440px;
  
  /* 动效 - 优雅的缓动曲线 */
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --transition-base: 0.3s ease;
}

/* =========================================
   基础重置与样式基调
   ========================================= */
html {
  scroll-behavior: smooth;
  font-size: 16px;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg-body);
  color: var(--color-text-main);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 覆盖默认容器样式，移除不必要的内边距 */
main {
  flex: 1;
  width: 100%;
  position: relative;
  padding: 0;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-base);
  cursor: pointer;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================================
   主导航栏 (Navigation)
   ========================================= */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  display: flex;
  justify-content: center; /* 居中布局，强调视觉平衡 */
  align-items: center;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  transition: transform 0.4s var(--ease-out-expo), background-color 0.4s ease;
}

/* 导航列表容器 */
.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 5rem; /* 宽间距，增加呼吸感 */
}

.nav-item {
  position: relative;
}

.nav-link {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-text-muted);
  font-weight: 300;
  padding: 0.5rem 0;
  display: block;
  position: relative;
}

/* 悬停与激活交互：下划线伸展 */
.nav-link:hover,
.nav-link.active {
  color: var(--color-text-main);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background-color: var(--color-text-main);
  transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  left: 0;
}

/* 移动端菜单切换按钮 */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1rem;
  z-index: 1001;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background-color: var(--color-text-main);
  margin: 6px 0;
  transition: 0.3s ease;
}

/* =========================================
   页脚 (Footer)
   ========================================= */
.main-footer {
  width: 100%;
  padding: 3rem 0;
  background-color: var(--color-bg-body);
  border-top: 1px solid #f9f9f9; /* 极淡分割线 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: auto;
}

.footer-copyright {
  font-size: 0.8rem;
  color: #333333; /* 严格要求：深灰色 */
  font-weight: 300;
  letter-spacing: 0.1em;
  font-family: var(--font-primary);
}

/* =========================================
   通用工具类 (Utilities)
   ========================================= */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* 动态内容槽位 - 用于TS/JS动态注入内容 */
.content-slot {
  display: contents;
}

/* 骨架屏加载态 */
.loading-skeleton {
  background: linear-gradient(90deg, #f5f5f7 25%, #ececec 50%, #f5f5f7 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 辅助类 */
.hidden { display: none !important; }
.text-center { text-align: center; }
.fade-in { animation: fadeIn 1s ease forwards; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =========================================
   响应式适配 (Responsive)
   ========================================= */
@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
  }

  .main-nav {
    justify-content: center; /* 移动端依然保持容器结构 */
  }

  .mobile-toggle {
    display: block;
  }

  .nav-list {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-bg-body);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    transform: translateX(100%);
    transition: transform 0.5s var(--ease-out-expo);
    z-index: 1000; /* 低于toggle按钮 */
  }

  .nav-list.open {
    transform: translateX(0);
    box-shadow: -5px 0 20px rgba(0,0,0,0.05);
  }

  .nav-link {
    font-size: 1.2rem;
    color: var(--color-text-main); /* 移动端菜单更醒目 */
  }

  .mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .mobile-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
}