/**
 * 天偌装修平台 - 首页样式
 * Uses design-system.css tokens
 */

/* =============================================
   Hero Banner
   ============================================= */
.hero {
  background: linear-gradient(135deg, var(--dark) 0%, #0d1b33 50%, #132744 100%);
  padding: 80px 0 70px; text-align: center; color: var(--white);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 70%, rgba(224,123,57,.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 30%, rgba(15,52,96,.3) 0%, transparent 50%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
  font-size: 2.4rem; font-weight: 800; color: var(--white); line-height: 1.3;
  margin-bottom: var(--space-md);
}
.hero h1 span { color: var(--primary-light); }
.hero p {
  font-size: 1.1rem; color: rgba(255,255,255,.7);
  max-width: 560px; margin: 0 auto var(--space-xl);
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .btn-primary { padding: 14px 32px; font-size: 1rem; }
.hero .btn-outline { border-color: rgba(255,255,255,.3); color: var(--white); }
.hero .btn-outline:hover { background: rgba(255,255,255,.1); }

/* =============================================
   Quick Stats Row
   ============================================= */
.quick-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg);
  margin-top: -30px; position: relative; z-index: 2;
}
.quick-stat {
  background: var(--white); border-radius: var(--radius-lg);
  padding: var(--space-lg); text-align: center;
  box-shadow: var(--shadow); border: 1px solid var(--border-light);
  transition: var(--transition);
}
.quick-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.quick-stat .stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-sm); font-size: 1.3rem;
}
.quick-stat .stat-icon.orange { background: var(--primary-bg); color: var(--primary); }
.quick-stat .stat-icon.blue { background: var(--info-bg); color: var(--info); }
.quick-stat .stat-icon.green { background: var(--success-bg); color: var(--success); }
.quick-stat .stat-icon.gold { background: #fefce8; color: var(--gold); }
.quick-stat .stat-num { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.quick-stat .stat-label { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }

/* =============================================
   Category Tabs
   ============================================= */
.cat-tabs {
  display: flex; gap: 4px; justify-content: center; flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}
.cat-tab {
  padding: 8px 20px; border-radius: var(--radius-full); font-size: .9rem;
  font-weight: 600; color: var(--text-secondary); background: var(--white);
  border: 1.5px solid var(--border); cursor: pointer; transition: var(--transition-fast);
}
.cat-tab:hover { border-color: var(--primary); color: var(--primary); }
.cat-tab.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* =============================================
   Provider Cards
   ============================================= */
.provider-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-lg);
}
.provider-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  padding: var(--space-lg); transition: var(--transition);
  cursor: pointer; display: flex; gap: var(--space-md);
}
.provider-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.provider-avatar {
  width: 64px; height: 64px; border-radius: var(--radius);
  object-fit: cover; flex-shrink: 0; background: var(--bg-page);
}
.provider-info { flex: 1; min-width: 0; }
.provider-name {
  font-weight: 700; font-size: 1rem; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.provider-verified { color: var(--primary); font-size: .8rem; }
.provider-category { font-size: .8rem; color: var(--text-muted); margin: 2px 0 4px; }
.provider-rating { font-size: .8rem; color: var(--gold); }
.provider-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: var(--space-sm); }
.provider-tags .tag { font-size: .72rem; }

/* =============================================
   Case / Team Cards
   ============================================= */
.case-grid, .team-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}
.case-card {
  background: var(--white); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light); transition: var(--transition);
  cursor: pointer;
}
.case-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.case-img {
  width: 100%; height: 200px; object-fit: cover;
  background: linear-gradient(135deg, var(--bg-page), var(--border-light));
}
.case-body { padding: var(--space-md); }
.case-title { font-weight: 700; font-size: .95rem; margin-bottom: 4px; }
.case-meta { font-size: .8rem; color: var(--text-muted); display: flex; gap: var(--space-md); }

.team-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: var(--space-lg); text-align: center;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  transition: var(--transition);
}
.team-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.team-avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  margin: 0 auto var(--space-sm); border: 3px solid var(--primary-bg);
}
.team-name { font-weight: 700; font-size: .95rem; }
.team-role { font-size: .8rem; color: var(--text-muted); margin: 2px 0 var(--space-sm); }
.team-stats { display: flex; justify-content: center; gap: var(--space-lg); font-size: .8rem; color: var(--text-secondary); }

/* =============================================
   News Cards
   ============================================= */
.news-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}
.news-card {
  background: var(--white); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light); transition: var(--transition);
  cursor: pointer;
}
.news-card:hover { box-shadow: var(--shadow); }
.news-card .news-img {
  width: 100%; height: 160px; object-fit: cover;
  background: linear-gradient(135deg, #e8e6e3, #d4d2cf);
}
.news-card .news-body { padding: var(--space-md); }
.news-card .news-title {
  font-weight: 700; font-size: .95rem; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 6px;
}
.news-card .news-excerpt {
  font-size: .82rem; color: var(--text-muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card .news-footer {
  padding: var(--space-sm) var(--space-md); border-top: 1px solid var(--border-light);
  font-size: .78rem; color: var(--text-muted);
  display: flex; align-items: center; gap: var(--space-md);
}

/* =============================================
   Community Posts
   ============================================= */
.community-list {
  display: flex; flex-direction: column; gap: var(--space-sm);
}
.community-post {
  background: var(--white); border-radius: var(--radius);
  padding: var(--space-md); display: flex; align-items: center; gap: var(--space-md);
  box-shadow: var(--shadow-xs); border: 1px solid var(--border-light);
  transition: var(--transition); cursor: pointer;
}
.community-post:hover { background: var(--bg-hover); }
.community-post .post-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 700;
}
.community-post .post-content { flex: 1; min-width: 0; }
.community-post .post-title { font-weight: 600; font-size: .9rem; }
.community-post .post-meta { font-size: .75rem; color: var(--text-muted); }
.community-post .post-stats {
  display: flex; gap: var(--space-md); font-size: .78rem; color: var(--text-muted);
  flex-shrink: 0;
}
.community-post .post-stats span { display: flex; align-items: center; gap: 3px; }

/* =============================================
   Provider Detail Modal
   ============================================= */
.provider-detail { padding: 0; }
.provider-detail-header {
  background: linear-gradient(135deg, var(--dark), #0d1b33);
  padding: var(--space-xl); text-align: center; color: var(--white);
}
.provider-detail-header .provider-logo {
  width: 80px; height: 80px; border-radius: var(--radius-lg);
  object-fit: cover; margin: 0 auto var(--space-md);
  border: 3px solid rgba(255,255,255,.2);
}
.provider-detail-header h2 { color: var(--white); font-size: 1.2rem; }
.provider-detail-body { padding: var(--space-lg); }
.provider-detail-body .detail-row {
  display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid var(--border-light); font-size: .9rem;
}
.provider-detail-body .detail-label { color: var(--text-muted); }
.provider-detail-body .detail-value { font-weight: 500; }

/* =============================================
   Sidebar Layout
   ============================================= */
.layout-sidebar {
  display: grid; grid-template-columns: 320px 1fr; gap: var(--space-lg);
  align-items: start;
}
.sidebar-nav {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  overflow: hidden;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; font-size: .9rem; font-weight: 500;
  color: var(--text-secondary); border-bottom: 1px solid var(--border-light);
  transition: var(--transition-fast);
}
.sidebar-nav a:last-child { border-bottom: none; }
.sidebar-nav a:hover, .sidebar-nav a.active {
  color: var(--primary); background: var(--primary-bg);
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
  .hero { padding: 60px 0 50px; }
  .hero h1 { font-size: 1.6rem; }
  .hero p { font-size: .95rem; }
  .quick-stats { grid-template-columns: repeat(2, 1fr); }
  .provider-grid { grid-template-columns: 1fr; }
  .case-grid, .team-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .layout-sidebar { grid-template-columns: 1fr; }
}

/* =============================================
   Nav Dropdown (homepage specific)
   ============================================= */
.nav-dropdown { position: relative; }
.dropdown-trigger { cursor: pointer; }
.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border-light);
  min-width: 160px; padding: 6px; z-index: 200;
}
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block; padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: .85rem; color: var(--text-secondary); transition: var(--transition-fast);
}
.dropdown-menu a:hover { background: var(--primary-bg); color: var(--primary); }

/* =============================================
   Loading State
   ============================================= */
.loading {
  text-align: center; padding: var(--space-xl); color: var(--text-muted);
  font-size: .9rem;
}
.loading::after {
  content: ''; display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .6s linear infinite;
  margin-left: 8px; vertical-align: middle;
}

/* =============================================
   Legacy hamburger (for nav toggle)
   ============================================= */
.hamburger { display: none; }
@media (max-width: 640px) {
  .hamburger { display: block; background: none; border: none; font-size: 1.4rem; cursor: pointer; }
}

/* =============================================
   Legacy header (backward compat for user-center/contract/budget)
   ============================================= */
.header {
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  position: sticky; top: 0; z-index: 100;
}
.header .container {
  display: flex; justify-content: space-between; align-items: center;
  height: 60px;
}
.header .logo {
  font-size: 1.2rem; font-weight: 800; color: var(--primary);
  text-decoration: none;
}
.header .nav {
  display: flex; align-items: center; gap: 4px;
}
.header .nav a {
  text-decoration: none; color: var(--text-secondary);
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 500; transition: var(--transition-fast);
}
.header .nav a:hover, .header .nav a.active {
  color: var(--primary); background: var(--primary-bg);
}
