/* ============================================================
   攻略宝 AIGEO 公共样式
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --primary-light: #e6f4ff;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --text: #1a1a1a;
  --text-secondary: #666;
  --text-light: #999;
  --border: #e8e8e8;
  --bg: #f5f7fa;
  --bg-card: #fff;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ============================================================
   顶部导航
   ============================================================ */
.header {
  background: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  height: 60px;
  gap: 24px;
}
.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.logo span { color: var(--text); font-weight: 400; font-size: 14px; margin-left: 4px; }

.city-switch {
  position: relative;
  cursor: pointer;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: var(--radius);
  background: var(--bg);
  transition: background .2s;
}
.city-switch:hover { background: var(--primary-light); }
.city-switch .icon { margin-right: 4px; }
.city-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 8px;
  display: none;
  min-width: 320px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 200;
}
.city-switch:hover .city-dropdown { display: block; }
.city-dropdown a {
  display: inline-block;
  padding: 4px 10px;
  margin: 2px;
  border-radius: 4px;
  font-size: 13px;
}
.city-dropdown a:hover, .city-dropdown a.active { background: var(--primary); color: #fff; }

.nav-menu { display: flex; gap: 4px; flex: 1; }
.nav-menu a {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 500;
  transition: all .2s;
}
.nav-menu a:hover, .nav-menu a.active { background: var(--primary-light); color: var(--primary); }

.header-actions { display: flex; gap: 8px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: var(--bg); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }

/* ============================================================
   横幅搜索区
   ============================================================ */
.banner {
  background: linear-gradient(135deg, #1677ff 0%, #4096ff 50%, #69b1ff 100%);
  color: #fff;
  padding: 48px 0;
  text-align: center;
}
.banner h1 { font-size: 32px; margin-bottom: 8px; font-weight: 700; }
.banner p { font-size: 16px; opacity: .9; margin-bottom: 28px; }
.search-box {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 24px;
  font-size: 15px;
  color: var(--text);
}
.search-box button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0 28px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 500;
}
.search-box button:hover { background: var(--primary-dark); }
.search-tags { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.search-tags a {
  background: rgba(255,255,255,.2);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
}
.search-tags a:hover { background: rgba(255,255,255,.35); }

/* ============================================================
   四大功能卡片
   ============================================================ */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: -32px auto 0;
  position: relative;
  z-index: 10;
}
.feature-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all .3s;
  cursor: pointer;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.feature-card .icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 12px;
}
.feature-card h3 { font-size: 16px; margin-bottom: 4px; }
.feature-card p { font-size: 12px; color: var(--text-light); }
.fc-1 .icon { background: #e6f4ff; color: #1677ff; }
.fc-2 .icon { background: #f6ffed; color: #52c41a; }
.fc-3 .icon { background: #fff7e6; color: #fa8c16; }
.fc-4 .icon { background: #fff0f6; color: #eb2f96; }

/* ============================================================
   内容区块
   ============================================================ */
.section { margin: 32px 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-size: 20px; font-weight: 700; }
.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: middle;
}
.section-more { color: var(--text-light); font-size: 13px; }
.section-more:hover { color: var(--primary); }

/* 资讯列表 */
.article-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.article-item {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.article-item:hover { box-shadow: var(--shadow-hover); }
.article-item .cover {
  width: 120px;
  height: 80px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}
.article-item .info { flex: 1; min-width: 0; }
.article-item h3 { font-size: 15px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-item .summary { font-size: 12px; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-item .meta { font-size: 12px; color: var(--text-light); margin-top: 6px; display: flex; gap: 12px; }

/* 商家推荐 */
.shop-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.shop-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all .2s;
}
.shop-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.shop-card .cover { width: 100%; height: 120px; object-fit: cover; background: var(--bg); }
.shop-card .body { padding: 12px; }
.shop-card h3 { font-size: 15px; margin-bottom: 4px; }
.shop-card .tags { display: flex; gap: 4px; margin-bottom: 6px; }
.shop-card .tag { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--primary-light); color: var(--primary); }
.shop-card .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-light); }
.shop-card .score { color: #fa8c16; font-weight: 600; }

/* ============================================================
   悬浮 AI 助手
   ============================================================ */
.ai-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1677ff, #4096ff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(22,119,255,.4);
  z-index: 999;
  transition: transform .2s;
}
.ai-fab:hover { transform: scale(1.1); }

.ai-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 380px;
  max-height: 520px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  display: none;
  flex-direction: column;
  z-index: 999;
  overflow: hidden;
}
.ai-panel.show { display: flex; }
.ai-panel-header {
  background: linear-gradient(135deg, #1677ff, #4096ff);
  color: #fff;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ai-panel-header h3 { font-size: 16px; }
.ai-panel-close { cursor: pointer; font-size: 20px; }
.ai-panel-body { flex: 1; overflow-y: auto; padding: 16px; }
.ai-msg { margin-bottom: 12px; }
.ai-msg-bot { text-align: left; }
.ai-msg-user { text-align: right; }
.ai-msg-bubble {
  display: inline-block;
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  text-align: left;
  white-space: pre-wrap;
}
.ai-msg-bot .ai-msg-bubble { background: var(--bg); color: var(--text); }
.ai-msg-user .ai-msg-bubble { background: var(--primary); color: #fff; }
.ai-panel-input { padding: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.ai-panel-input input { flex: 1; border: 1px solid var(--border); border-radius: 20px; padding: 8px 16px; outline: none; }
.ai-panel-input button { background: var(--primary); color: #fff; border: none; border-radius: 20px; padding: 0 16px; cursor: pointer; }
.ai-quick-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }
.ai-quick-tags span { font-size: 12px; padding: 4px 10px; border-radius: 12px; background: var(--primary-light); color: var(--primary); cursor: pointer; }

/* ============================================================
   页脚
   ============================================================ */
.footer {
  background: #1a1a2e;
  color: #999;
  padding: 32px 0;
  margin-top: 48px;
  text-align: center;
  font-size: 13px;
}
.footer a { color: #ccc; margin: 0 8px; }
.footer .icp { margin-top: 8px; font-size: 12px; }

/* ============================================================
   骨架屏 / 加载占位
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card { height: 120px; }
.skeleton-text { height: 16px; margin-bottom: 8px; }
.skeleton-title { height: 18px; width: 70%; margin-bottom: 12px; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 8px 0; gap: 8px; }
  .nav-menu { order: 3; width: 100%; overflow-x: auto; gap: 0; }
  .nav-menu a { padding: 6px 10px; white-space: nowrap; font-size: 13px; }
  .banner { padding: 32px 0; }
  .banner h1 { font-size: 22px; }
  .feature-cards { grid-template-columns: repeat(2, 1fr); margin-top: -24px; }
  .article-list { grid-template-columns: 1fr; }
  .shop-list { grid-template-columns: repeat(2, 1fr); }
  .ai-panel { width: calc(100% - 32px); right: 16px; bottom: 80px; }
  .container { padding: 0 12px; }
}
