/* 都市形格 - 主样式文件 */
@import 'https://cdn.tailwindcss.com';

/* 自定义Tailwind配置 */
@layer base {
  :root {
    --color-primary: #000000;
    --color-secondary: #333333;
    --color-accent: #666666;
    --color-bg: #ffffff;
    --color-surface: #f8f8f8;
    --color-earth: #d4a574;
    --color-sand: #e8dcc6;
    --color-steel: #71797e;
    --font-chinese: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-english: "Helvetica Neue", Arial, sans-serif;
  }

  * {
    scroll-behavior: smooth;
  }

  html {
    font-family: var(--font-chinese), var(--font-english), sans-serif;
    box-sizing: border-box;
  }

  body {
    background-color: var(--color-bg);
    color: var(--color-primary);
    line-height: 1.6;
    overflow-x: hidden;
  }
}

/* 导航栏样式 */
@layer components {
  .navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
  }

  .navbar-scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
  }

  .nav-link {
    position: relative;
    transition: color 0.3s ease;
    font-weight: 300;
    letter-spacing: 0.05em;
  }

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

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

  /* 卡片样式 */
  .fashion-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  }

  .fashion-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  }

  .fashion-card img {
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .fashion-card:hover img {
    transform: scale(1.05);
  }

  /* 按钮样式 */
  .btn-ghost {
    border: 1px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }

  .btn-ghost:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
  }

  /* 瀑布流布局 */
  .masonry {
    column-count: 3;
    column-gap: 1.5rem;
  }

  .masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
  }

  /* 模态框样式 */
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .modal.active {
    display: flex;
    opacity: 1;
  }

  /* 文章卡片样式 */
  .article-card {
    transition: all 0.3s ease;
  }

  .article-card:hover {
    background-color: var(--color-surface);
  }

  /* 加载动画 */
  .fade-in {
    animation: fadeIn 0.8s ease-out;
  }

  .slide-up {
    animation: slideUp 0.6s ease-out;
  }

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

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

/* 响应式设计 */
@layer utilities {
  @media (max-width: 1024px) {
    .masonry {
      column-count: 2;
    }
  }

  @media (max-width: 640px) {
    .masonry {
      column-count: 1;
    }

    .navbar {
      padding: 1rem;
    }

    .hamburger-menu {
      display: block;
    }

    .nav-menu {
      position: fixed;
      left: -100%;
      top: 70px;
      flex-direction: column;
      background-color: rgba(255, 255, 255, 0.98);
      width: 100%;
      text-align: center;
      transition: 0.3s;
      box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
      padding: 2rem 0;
    }

    .nav-menu.active {
      left: 0;
    }
  }

  /* 图片懒加载占位符 */
  .lazy-image {
    background-color: var(--color-surface);
    transition: opacity 0.3s ease;
  }

  .lazy-image.loaded {
    opacity: 1;
  }

  /* 大地色调实用类 */
  .bg-earth {
    background-color: var(--color-earth);
  }

  .bg-sand {
    background-color: var(--color-sand);
  }

  .text-steel {
    color: var(--color-steel);
  }

  /* 自定义间距 */
  .section-padding {
    padding: 5rem 0;
  }

  /* 文字样式 */
  .text-light {
    font-weight: 300;
  }

  .text-regular {
    font-weight: 400;
  }

  .text-medium {
    font-weight: 500;
  }

  .text-bold {
    font-weight: 700;
  }
}

/* 打印样式 */
@media print {
  .navbar,
  .footer {
    display: none;
  }
}