/* =========================
   品野AI - 全局样式
========================= */

:root {
  --bg: #F7F8FA;
  --white: #FFFFFF;
  --text: #18202A;
  --text-secondary: #7E8791;
  --border: #E5E9ED;
  --light-gray: #F1F3F5;
  --accent: #4F6EF7;
  --accent-light: #EEF0FF;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(20,30,40,0.04);
  --shadow: 0 4px 16px rgba(20,30,40,0.06);
  --shadow-lg: 0 12px 40px rgba(20,30,40,0.08);
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
}

/* =========================
   顶部导航
========================= */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247,248,250,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: 1200px;
  margin: auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.logo-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--text);
  color: var(--white);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
}

.nav nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav nav a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.nav nav a:hover {
  color: var(--text);
}

/* 移动端导航 - 桌面端隐藏 */
.mobile-nav {
  display: none;
}

.nav-search {
  position: relative;
  margin-left: 8px;
}

.nav-search input {
  width: 180px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--white);
  font-size: 13px;
  outline: none;
  transition: all var(--transition);
}

.nav-search input:focus {
  width: 220px;
  border-color: #c0c8d2;
}

/* 用户状态 */
.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
}
.nav-login-btn {
  padding: 6px 16px;
  background: var(--accent);
  color: #FFF;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition);
}
.nav-login-btn:hover {
  background: #3B5DE7;
}
.nav-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
}
.nav-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--light-gray);
  flex-shrink: 0;
}
.nav-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nav-user-avatar .avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 14px;
}
.nav-points {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--light-gray);
  padding: 3px 8px;
  border-radius: 6px;
}

/* 收藏按钮 */
.tool-fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.tool-fav-btn:hover {
  border-color: #F5A623;
  color: #F5A623;
}
.tool-fav-btn.favorited {
  border-color: #F5A623;
  background: #FFFDF5;
  color: #F5A623;
}

/* 汉堡菜单 */
.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
}

/* =========================
   页脚
========================= */

.footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 40px 20px 30px;
  text-align: center;
}

.footer-content {
  max-width: 900px;
  margin: auto;
}

.footer-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.footer-desc {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 16px;
}

.footer-info {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.8;
}

/* =========================
   页面容器
========================= */

.page-container {
  width: 100%;
  max-width: 1200px;
  margin: auto;
  padding: 40px 20px 80px;
}

/* =========================
   Hero
========================= */

.hero {
  text-align: center;
  padding: 60px 20px 50px;
  max-width: 700px;
  margin: auto;
}

.hero h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.2;
}

.hero h1 span {
  color: var(--accent);
}

.hero p {
  margin-top: 12px;
  font-size: 16px;
  color: var(--text-secondary);
}

.hero-search {
  margin-top: 28px;
  position: relative;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.hero-search input {
  width: 100%;
  height: 48px;
  padding: 0 48px 0 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--white);
  font-size: 15px;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.hero-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.hero-search .search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-secondary);
  pointer-events: none;
}

.hero-tags {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags a {
  padding: 5px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.hero-tags a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* =========================
   区块标题
========================= */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.section-more {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.section-more:hover {
  color: var(--text);
}

/* =========================
   工具卡片网格
========================= */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  cursor: pointer;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #d0d6de;
}

.tool-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light-gray);
  border-radius: 10px;
  font-size: 20px;
  margin-bottom: 12px;
}

.tool-card-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.tool-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  flex: 1;
}

.tool-card-link {
  margin-top: 10px;
  font-size: 12px;
  color: var(--accent);
}

/* =========================
   分类区块
========================= */

.category-section {
  margin-bottom: 48px;
}

/* =========================
   AI专区
========================= */

.ai-section {
  margin-bottom: 48px;
}

.ai-banner {
  background: linear-gradient(135deg, #f0f3ff 0%, #f8f9fc 100%);
  border: 1px solid #e0e5f5;
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}

.ai-banner h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.ai-banner p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.ai-banner .ai-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

/* =========================
   公告
========================= */

.announcement-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.announcement-bar .ann-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.announcement-bar .ann-text {
  color: var(--text-secondary);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* =========================
   搜索下拉
========================= */

.search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
  z-index: 200;
}

.search-results.show {
  display: block;
}

.search-result-item {
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
}

.search-result-item:hover {
  background: var(--light-gray);
}

.search-result-item .sr-name {
  font-weight: 600;
}

.search-result-item .sr-cat {
  font-size: 11px;
  color: var(--text-secondary);
  margin-left: 8px;
}

/* =========================
   响应式
========================= */

@media (max-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .nav nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-search input {
    width: 140px;
  }

  .nav-search input:focus {
    width: 160px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mobile-nav {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    flex-direction: column;
    gap: 12px;
    z-index: 99;
  }

  .mobile-nav.open {
    display: flex;
  }

  .mobile-nav a {
    font-size: 15px;
    padding: 8px 0;
  }
}

@media (max-width: 480px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 40px 20px 30px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero-search input {
    height: 42px;
    font-size: 14px;
  }

  .page-container {
    padding: 24px 16px 60px;
  }

  .nav-search {
    display: none;
  }
}