:root {
            --primary-color: #2A5C82;
            --secondary-color: #4F8BB7;
            --background: #ffffff;
            --sidebar-bg: #f8f9fa;
            --text-primary: #2d3748;
            --text-secondary: #4a5568;
            --border-color: #e2e8f0;
            --transition: cubic-bezier(0.4, 0, 0.2, 1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', system-ui, sans-serif;
        }

        body {
            display: grid;
            grid-template-columns: 280px 1fr;
            min-height: 100vh;
            background: var(--background);
          overflow-x: hidden;
        }

        .main-header {
    grid-column: 1 / -1;  /* 在网格布局中占满全部列 */
    width: 100%;          /* 占满父容器宽度 */
    position: sticky;
    top: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    height: 72px;
    /* 新增： */
    display: flex;
    justify-content: center; /* 内容居中 */
}
      .header-nav-container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

        .nav-container {
            max-width: 1440px;
            margin: 0 auto;
            padding: 1rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .brand {
            font-size: 1.8rem;
            font-weight: 700;
            color: var(--primary-color);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .nav-menu {
            display: flex;
            gap: 2rem;
            align-items: center;
        }

        .nav-link {
            color: var(--text-primary);
            text-decoration: none;
            font-weight: 500;
            transition: color 0.2s var(--transition);
        }

        .nav-link:hover {
            color: var(--secondary-color);
        }

        .sidebar {
            position: fixed;
            width: 280px;
            height: calc(100vh - 72px);
            margin-top: 72px;
            background: var(--sidebar-bg);
            border-right: 1px solid var(--border-color);
            padding: 2rem 1.5rem;
            overflow-y: auto;
        }

        .nav-module {
            list-style: none;
            display: grid;
            gap: 1rem;
        }

        .nav-item {
            padding: 1.5rem;
            background: white;
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
            transition: transform 0.2s var(--transition);
        }

        .nav-item:hover {
            transform: translateX(8px);
        }

        /* 主内容区域调整 */
        .main-content {
            padding: 2rem;
            margin-left: 280px;
            margin-top: 72px;
            width: calc(100% - 280px) !important;
            max-width: none !important;
            box-sizing: border-box;
        }

        .content-section {
            width: 100% !important;
            max-width: 100% !important;
            overflow: visible !important;
        }

        .section-title {
            writing-mode: horizontal-tb !important;
            text-orientation: mixed !important;
            direction: ltr !important;
            font-size: 1.8rem;
            color: var(--primary-color);
            margin-bottom: 2rem;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid var(--secondary-color);
            width:150px;
        }

        .scroll-grid {
            display: grid;             /* 改为网格布局 */
            grid-template-columns: repeat(5, 1fr); /* 每行5个 */
            gap: 1rem;                 /* 设置间距 */
            width: 100%;               /* 确保占满宽度 */
            overflow: visible;         /* 允许内容溢出（不裁剪） */
            padding-bottom: 1rem;
        }

        .content {
            padding: 0.8rem;
            flex-grow: 1; /* 让内容区域自动填充剩余空间 */
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

       /* 调整卡片大小 */
        .design-item,
        .product-card,
        .designer-card,
        .gallery-item {
            flex: 1 1 calc(20% - 1rem); /* 每行5个，减去间距 */
            min-width: 200px; /* 设置最小宽度 */
            max-width: 100%; /* 确保不超出父容器 */
            box-sizing: border-box; /* 包括内边距和边框 */
            color: #2e2d2d; /* 改为您想要的注释文字颜色，例如#666 */
        }

        .design-item:hover,
        .product-card:hover,
        .designer-card:hover,
        .gallery-item:hover {
            transform: translateY(-5px);
        }

        /* 调整图片大小 */
        .design-item img,
        .product-card img,
        .designer-card img,
        .gallery-item img {
            width: 100%;
            height: 200px; /* 适当减小图片高度 */
            object-fit: cover;
            display: block;
            border-radius: 12px 12px 12px 12px;
            position: relative;
            z-index: 3;
        }
        .scroll-grid img {
            transition: opacity 0.3s ease;
            opacity: 1;               /* 确保图片默认可见 */
        }
        .scroll-grid img.loaded {
            opacity: 1;
        }
        /* 新增导航栏样式 */
        .category-nav {
    position: sticky;
    top: 72px;
    left: 280px;
    right: 0; /* 新增：强制延伸到右侧 */
    width: 1640px; /* 改为自动宽度 */
    min-width: 1140px; /* 保持最小宽度 */
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 100;
    margin: -2rem 0 2rem -2rem;
    padding: 0 2rem;
    display: flex;
    align-items: center;
}

        .nav-tabs {
            display: flex;
            gap: 1.5rem;
            height: 100%;
            align-items: center;
            overflow-x: auto;
            scrollbar-width: none; /* Firefox */
          margin-left: -605px; /* 或其他具体数值微调位置 */
        }

        .nav-tabs::-webkit-scrollbar { 
            display: none; /* Chrome/Safari */
        }

        .nav-tab {
            color: var(--text-primary);
            text-decoration: none;
            font-weight: 500;
            padding: 8px 16px;
            border-radius: 8px;
            white-space: nowrap;
            transition: all 0.2s var(--transition);
            position: relative;
        }

        .nav-tab.active {
    background: rgba(42,92,130,0.1) !important;
    color: var(--primary-color) !important;
    position: relative;
}
.nav-tab.active::after {
    content: "" !important;
    position: absolute !important;
    bottom: -12px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 60% !important;
    height: 2px !important;
    background: var(--primary-color) !important;
}


        /* 必须修改侧边栏层级 */
        .sidebar {
            z-index: 1000; /* 低于导航栏 */
        }

        /* 响应式调整 */
        @media (max-width: 768px) {
            .category-nav {
                left: 0;
                width: 100%;
                top: 60px; /* 移动端页眉高度 */
                margin: 0;
                padding: 0 1rem;
            }
            
            .nav-tab.active::after {
                bottom: -8px;
            }
        }

        .design-content,
        .product-info,
        .designer-info {
            padding: 1.5rem;
        }

        .ai-badge {
            background: #4F8BB7;
            color: white;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.85rem;
        }

        .view-more {
            display: inline-block;
            margin-bottom: 1.5rem;
            padding: 8px 20px;
            background: var(--primary-color);
            color: white;
            border-radius: 20px;
            text-decoration: none;
            transition: none;
            width:110px;
        }
        .user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
}

.user-dropdown {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        padding: 0.5rem;
        min-width: 120px;
        z-index: 100;
      }
.user-dropdown a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    transition: color 0.2s ease;
}
      .user-menu:hover .user-dropdown {
        display: block;
      }
      .user-dropdown a:hover {
         background-color: #9f9c9c32;
      }

/* 保持原有登录按钮样式 */
.authing-login-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}
/* 下拉菜单 */
.dropdown {
            position: relative;
            margin-right: 1px;
        }

        .dropdown-menu {
            display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: 0.5rem;
  min-width: 120px;
  z-index: 100;
          font-weight: 500; /* 新增字体加粗效果 */
}

        .dropdown:hover .dropdown-menu {
            display: block;
        }

        .dropdown-menu a {
        color: #333;
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    transition: color 0.2s ease;
}
.search-mode .view-more {
    display: none !important;
}
      .dropdown-menu a:hover {
         background-color: #9f9c9c32;
      }
        .view-more:hover {
            transform: translateY(-2px);
        }
        .modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    animation: fadeIn 0.3s;
}

.modal-content {
    display: block;
    max-width: 90%;
    max-height: 80vh;
    margin: 5vh auto 0;
    object-fit: contain;
}

.close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close:hover {
    color: #ccc;
}

.modal-footer {
    text-align: center;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.unsplash-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    color: #000;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
}

.unsplash-button:hover {
    background: #f1f1f1;
    transform: translateY(-2px);
}

.photographer-credit {
    color: #fff;
}
.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.clear-search {
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
}

.clear-search:hover {
    color: #2A5C82;
    text-decoration: underline;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.1rem;
}

.search-highlight {
    background-color: #fffacd;
    padding: 0 2px;
    border-radius: 2px;
}

/* 加载动画 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 2rem auto;
    border: 4px solid #e2e8f0;
    border-top-color: #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.photographer-credit a {
    color: #fff;
    text-decoration: underline;
}

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

/* 点击动画 */
.gallery-item .image-container {
    cursor: zoom-in;
    transition: transform 0.2s;
}
.search-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9em;
}

/* 没有更多提示 */
.no-more-results {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}
.gallery-item .image-container:active {
    transform: scale(0.98);
}
        @media (max-width: 768px) {
            body {
                grid-template-columns: 1fr;
            }

            .sidebar {
                display: none;
            }

            .main-content {
                margin-left: 0;
                padding: 1rem;
            }
             .error-card {
            padding: 2rem;
            text-align: center;
            background: #fff5f5;
            border-radius: 8px;
            border: 1px solid #fed7d7;
        }
        
        .error-card i {
            color: #f56565;
            font-size: 2rem;
            margin-bottom: 1rem;
        }
         
        .error-card button {
            margin-top: 1rem;
            padding: 8px 16px;
            background: #4299e1;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        
        .loading-spinner {
            width: 40px;
            height: 40px;
            margin: 2rem auto;
            border: 4px solid #e2e8f0;
            border-top-color: #4299e1;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        }
        
        @media (min-width: 1921px) {
  .scroll-grid {
    grid-template-columns: repeat(9, 1fr); /* 强制8列 */
  }
}
@media (min-width: 1441px) and (max-width: 1920px) {
  .scroll-grid {
    grid-template-columns: repeat(7, 1fr); /* 强制6列 */
  }
}
@media (min-width: 1024px) and (max-width: 1440px) {
  .scroll-grid {
    grid-template-columns: repeat(5, 1fr); /* 强制5列 */
  }
}
@media (max-width: 1023px) {
  .scroll-grid {
    grid-template-columns: repeat(4, 1fr); /* 强制4列 */
  }
}