/**
 * 首页CSS样式
 * 
 * 功能：提供首页的CSS样式
 * 原则：无全局状态，无初始硬编码，所有数据都从接口获取
 */
/* ========== PC端和移动端显示控制 ========== */
.pc-only {
  display: block;
}
.mobile-only {
  display: none;
}
/* ========== 搜索区域 ========== */
.search-section {
  margin-bottom: 20px;
  flex-shrink: 0;
}
.search-box {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
  gap: 12px;
}
.search-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.search-btn {
  padding: 12px 32px;
  font-size: 15px;
  border-radius: 8px;
}
/* ========== 主要内容区 ========== */
.home-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.home-left,
.home-right {
  min-width: 0;
}
/* ========== 分类网格 ========== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  cursor: pointer;
}
.category-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}
.category-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3b82f6;
}
.category-icon svg {
  width: 100%;
  height: 100%;
}
.category-name {
  font-size: 15px;
  font-weight: 500;
  color: #1f2937;
  text-align: center;
}
/* ========== 上传卡片 ========== */
.upload-card {
  height: 100%;
}
.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.upload-illustration {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  color: #10b981;
}
.upload-illustration svg {
  width: 100%;
  height: 100%;
}
.upload-slogan {
  font-size: 16px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 20px;
}
/* ========== 推荐品牌 ========== */
.brand-section {
  margin-bottom: 24px;
}
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}
.brand-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}
.brand-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}
.brand-logo {
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f3f4f6;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}
.brand-name {
  font-size: 12px;
  font-weight: 500;
  color: #1f2937;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
/* ========== 头部用户区域 ========== */
.header-user .btn {
  padding: 6px 16px;
  font-size: 13px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
/* ========== 移动端全新设计 ========== */
@media (max-width: 768px) {
  /* 隐藏PC端内容，显示移动端内容 */
  .pc-only {
    display: none !important;
  }
  .mobile-only {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
  }
  body {
    background: #f5f7fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    height: var(--app-height, 100dvh);
    height: 100dvh;
    min-height: var(--app-height, 100dvh);
  }
  .page {
    height: var(--app-height, 100dvh);
    height: 100dvh;
    min-height: var(--app-height, 100dvh);
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  /* 移动端顶部标题栏 */
  .mobile-header {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 100;
    flex: 0 0 auto;
  }
  .mobile-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    gap: 8px;
  }
  .mobile-header-logo {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .mobile-header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
  }
  .mobile-header-nav a {
    font-size: 13px;
    color: #666;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
  }
  .mobile-header-nav a.active {
    color: #1677ff;
    font-weight: 600;
  }
  .mobile-header-user {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 32px;
    justify-content: flex-end;
  }
  .mobile-header-user .user-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
    background: #1677ff;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
  }
  .mobile-header-user .btn {
    padding: 6px 12px;
    font-size: 12px;
    background: #1677ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
  }
  /* 移动端搜索栏 */
  .mobile-search-section {
    background: #fff;
    padding: 0 12px 12px;
    flex: 0 0 auto;
  }
  .mobile-search-box {
    display: flex;
    gap: 10px;
  }
  .mobile-search-input {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    height: 48px;
    background: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
  }
  .mobile-search-input:focus {
    outline: none;
    border-color: #1677ff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
  }
  .mobile-search-btn {
    padding: 14px 20px;
    background: #1677ff;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    height: 48px;
    transition: background 0.2s;
    box-sizing: border-box;
  }
  .mobile-search-btn:active {
    background: #0958d9;
  }
  /* 移动端主要内容 */
  .mobile-main {
    padding: 12px;
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: space-around;
    align-items: stretch;
    height: 100%;
    min-height: 0;
  }
  /* 功能入口卡片网格 */
  .mobile-feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
    flex: 0 0 auto;
  }
  .mobile-feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 16px;
    padding: 24px 16px;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 170px;
    min-height: 170px;
    box-sizing: border-box;
  }
  .mobile-feature-card:active {
    transform: scale(0.98);
  }
  .mobile-feature-icon {
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    flex-shrink: 0;
  }
  .mobile-feature-icon svg {
    width: 40px;
    height: 40px;
  }
  .mobile-feature-blue .mobile-feature-icon {
    background: linear-gradient(135deg, #e6f0ff 0%, #d4e4ff 100%);
    color: #1677ff;
  }
  .mobile-feature-green .mobile-feature-icon {
    background: linear-gradient(135deg, #e6fff0 0%, #d4ffe4 100%);
    color: #00b96b;
  }
  .mobile-feature-info {
    flex: 1;
  }
  .mobile-feature-title {
    font-size: 19px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
    text-align: center;
  }
  .mobile-feature-desc {
    font-size: 14px;
    color: #999;
    text-align: center;
  }
  .mobile-feature-arrow {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-feature-arrow svg {
    width: 24px;
    height: 24px;
  }
  .mobile-feature-blue .mobile-feature-arrow {
    color: #1677ff;
  }
  .mobile-feature-green .mobile-feature-arrow {
    color: #00b96b;
  }
  /* 推荐品牌区域 */
  .mobile-brand-section {
    background: #fff;
    border-radius: 16px;
    padding: 16px 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    flex: 0 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-sizing: border-box;
  }
  .mobile-brand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex: 0 0 auto;
  }
  .mobile-brand-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
  }
  .mobile-brand-more {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #1677ff;
    text-decoration: none;
    font-weight: 500;
  }
  .mobile-brand-more svg {
    width: 14px;
    height: 14px;
  }
  .mobile-brand-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    align-content: start;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-brand-grid::-webkit-scrollbar {
    display: none;
  }
  .mobile-brand-grid {
    scrollbar-width: none;
  }
  .mobile-brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    background: #fafafa;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    flex-shrink: 0;
    min-height: 90px;
    box-sizing: border-box;
  }
  .mobile-brand-card:active {
    background: #f0f0f0;
  }
  .mobile-brand-logo {
    width: 56px;
    height: 56px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #fff;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
  }
  .mobile-brand-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
  }
}
@media (max-width: 375px) {
  .mobile-feature-title {
    font-size: 18px;
  }
  .mobile-feature-card {
    padding: 20px 14px;
    height: 155px;
    min-height: 155px;
  }
  .mobile-feature-icon {
    width: 64px;
    height: 64px;
  }
  .mobile-feature-icon svg {
    width: 36px;
    height: 36px;
  }
  .mobile-feature-desc {
    font-size: 13px;
  }
  .mobile-brand-grid {
    gap: 10px;
  }
  .mobile-brand-section {
    padding: 12px;
  }
  .mobile-brand-logo {
    width: 48px;
    height: 48px;
    font-size: 17px;
  }
  .mobile-brand-name {
    font-size: 13px;
  }
  .mobile-brand-card {
    padding: 12px 6px;
    min-height: 80px;
  }
  .mobile-main {
    gap: 14px;
    padding: 12px 10px;
  }
}