/* 校园闲置交易平台 - 自定义样式 */

/* 全局配色 */
:root {
  --primary: #1890ff;
  --primary-dark: #096dd9;
  --secondary: #52c41a;
  --accent: #faad14;
  --danger: #ff4d4f;
  --bg-light: #f5f7fa;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --border-color: #e8e8e8;
}

body {
  background-color: var(--bg-light);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 导航栏 */
.navbar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 0.5rem 1rem;
}

.navbar-brand {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.navbar-brand .brand-icon {
  font-size: 1.6rem;
  margin-right: 5px;
}

.nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  transition: opacity 0.2s;
}

.nav-link:hover {
  opacity: 0.85;
}

/* 搜索框 */
.search-form .form-control {
  border-radius: 20px 0 0 20px;
  border: none;
  padding: 0.5rem 1.2rem;
}

.search-form .btn {
  border-radius: 0 20px 20px 0;
  padding: 0.5rem 1.2rem;
}

/* 主内容区 */
.main-content {
  flex: 1;
  padding-top: 20px;
  padding-bottom: 40px;
}

/* 分类导航 */
.category-nav {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.category-nav .category-item {
  text-align: center;
  padding: 12px 8px;
  border-radius: 8px;
  transition: all 0.3s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
}

.category-nav .category-item:hover {
  background-color: #e6f7ff;
  transform: translateY(-2px);
}

.category-nav .category-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 6px;
}

.category-nav .category-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* 商品卡片 */
.product-card {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  background: white;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.product-card .card-img-top {
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}

.product-card .card-body {
  padding: 12px 16px;
}

.product-card .card-title {
  font-size: 0.95rem;
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .price {
  color: var(--danger);
  font-size: 1.1rem;
  font-weight: 700;
}

.product-card .original-price {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: line-through;
  margin-left: 6px;
}

.product-card .seller-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Banner区域 */
.banner-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 24px;
  color: white;
  text-align: center;
}

.banner-section h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.banner-section p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* 商品详情页 */
.product-detail {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.product-detail .product-images img {
  max-width: 100%;
  border-radius: 8px;
}

.product-detail .product-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.product-detail .product-price {
  font-size: 2rem;
  color: var(--danger);
  font-weight: 700;
}

.product-detail .product-desc {
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 20px 0;
  padding: 16px;
  background: var(--bg-light);
  border-radius: 8px;
}

/* 卖家信息卡片 */
.seller-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.seller-card .seller-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

/* 留言区 */
.message-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.message-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.message-item:last-child {
  border-bottom: none;
}

.message-item .message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.message-item .message-content {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.message-item .message-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 登录/注册页 */
.auth-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.auth-card h3 {
  text-align: center;
  margin-bottom: 30px;
  font-weight: 600;
}

.auth-card .form-control {
  border-radius: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
}

.auth-card .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24,144,255,0.1);
}

.auth-card .btn-primary {
  border-radius: 8px;
  padding: 10px;
  font-weight: 600;
  width: 100%;
}

/* 个人中心 */
.profile-card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
}

/* 订单列表 */
.order-card {
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.order-card .order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.order-card .order-no {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 页脚 */
.footer {
  background: #2c3e50;
  color: #bdc3c7;
  padding: 30px 0;
  margin-top: auto;
}

.footer a {
  color: #ecf0f1;
  text-decoration: none;
}

.footer a:hover {
  color: white;
}

/* 分页 */
.pagination .page-link {
  border-radius: 6px;
  margin: 0 3px;
  color: var(--primary);
}

.pagination .page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* 徽章 */
.badge {
  font-weight: 500;
  padding: 4px 10px;
}

/* 按钮 */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  border-radius: 8px;
}

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

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

/* 响应式 */
@media (max-width: 768px) {
  .banner-section {
    padding: 24px 16px;
  }
  .banner-section h2 {
    font-size: 1.4rem;
  }
  .product-card .card-img-top {
    height: 150px;
  }
  .auth-card {
    padding: 24px;
    margin: 16px;
  }
  .product-detail {
    padding: 16px;
  }
}

/* 加载动画 */
.loading-spinner {
  display: flex;
  justify-content: center;
  padding: 40px;
}

.loading-spinner::after {
  content: '';
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast通知 */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
}

/* ==================== Hero区域 ==================== */
.hero-section {
  position: relative;
  overflow: hidden;
  margin: 0 -15px 30px;
  padding: 0 15px;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* 粒子动画 */
.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  animation: float-particle 8s ease-in-out infinite;
}

.particle-1 { width: 80px; height: 80px; top: 10%; left: 5%; animation-delay: 0s; }
.particle-2 { width: 40px; height: 40px; top: 60%; left: 15%; animation-delay: 1s; }
.particle-3 { width: 60px; height: 60px; top: 20%; left: 70%; animation-delay: 2s; }
.particle-4 { width: 30px; height: 30px; top: 70%; left: 80%; animation-delay: 3s; }
.particle-5 { width: 50px; height: 50px; top: 40%; left: 50%; animation-delay: 4s; }
.particle-6 { width: 20px; height: 20px; top: 80%; left: 40%; animation-delay: 5s; }

@keyframes float-particle {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.15; }
  50% { transform: translateY(-30px) scale(1.1); opacity: 0.25; }
}

/* Hero内容 */
.hero-content {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 16px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.text-gradient {
  background: linear-gradient(135deg, #ffd700, #ffaa00, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 480px;
}

/* Hero按钮 */
.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.btn-hero-primary {
  background: #fff;
  color: #764ba2;
  border: none;
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
  color: #764ba2;
  background: #fff;
}

.btn-hero-outline {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.btn-hero-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
  transform: translateY(-2px);
}

/* Hero统计数据 */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  display: inline;
}

.stat-suffix {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffd700;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
}

/* Hero右侧视觉 */
.hero-visual {
  position: relative;
  height: 380px;
}

.hero-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  animation: pulse-circle 3s ease-in-out infinite;
}

@keyframes pulse-circle {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.05); opacity: 0.8; }
}

.floating-card {
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  animation: float-card 4s ease-in-out infinite;
  z-index: 2;
}

.floating-card i {
  font-size: 1.4rem;
  color: #764ba2;
}

.floating-card span {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.card-1 { top: 5%; left: 10%; animation-delay: 0s; }
.card-2 { top: 15%; right: 5%; animation-delay: 0.5s; }
.card-3 { bottom: 25%; left: 5%; animation-delay: 1s; }
.card-4 { bottom: 5%; right: 15%; animation-delay: 1.5s; }

@keyframes float-card {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* 快捷分类 */
.category-quick {
  padding: 0 15px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: #fff;
  border-radius: 16px;
  text-decoration: none;
  color: #333;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid #f0f0f0;
}

.cat-card i {
  font-size: 1.6rem;
  color: #764ba2;
  transition: all 0.3s ease;
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(118, 75, 162, 0.15);
  border-color: #764ba2;
  color: #764ba2;
}

.cat-card:hover i {
  transform: scale(1.15);
}

/* Hero响应式 */
@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .hero-desc { font-size: 0.95rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; text-align: center; }
  .hero-stats { gap: 16px; }
  .stat-number { font-size: 1.4rem; }
  .hero-section { margin: 0 -10px 20px; }
  .category-quick { padding: 0 10px; }
  .cat-card { padding: 14px 8px; }
  .cat-card i { font-size: 1.3rem; }
}
