/* ============================================
   首页优化布局样式
   - 精简Hero
   - 侧边栏搜索+分类
   - 统一卡片样式
   ============================================ */

/* ===== 精简Hero区域 ===== */
.hero--compact {
  padding: 28px 0 24px;
  min-height: auto;
}

.hero--compact .hero__content {
  position: relative;
  z-index: 2;
}

.hero--compact h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

.hero--compact .hero__desc {
  font-size: 15px;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 16px;
}

/* Hero区搜索框 */
.hero-search {
  max-width: 600px;
  margin: 0 auto;
}

.hero-search input {
  width: 100%;
  padding: 12px 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.hero-search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 4px 24px rgba(15, 157, 144, 0.25);
}

.hero-search input::placeholder {
  color: var(--ink-soft);
}

/* 移除原有快速链接 */
.hero--compact .quick-links {
  display: none;
}

/* ===== 侧边栏优化 ===== */
/* 使用原有styles.css的样式，不额外添加padding和gap */

/* 分类导航容器 - 继承原有样式，减小间距 */
.category-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-nav--tools {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 4px;
}

/* 分类组 - 减小间距 */
.category-group h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding-left: 10px;
}

.category-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* 分类链接 - 减小padding */
.cat-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.2s;
}

.cat-link:hover {
  background: #f0f7fa;
  color: var(--brand);
}

.cat-link.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: white;
}

/* 特色分类颜色 */
.cat-prompts:hover,
.cat-prompts.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.cat-tutorials:hover,
.cat-tutorials.active {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

.cat-news:hover,
.cat-news.active {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
}

/* ===== 分类导航 ===== */
.category-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 工具分类容器 */
.category-nav--tools {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* 原有分类按钮样式兼容 */
.category-sidebar__group,
.category-sidebar button {
  width: 100%;
  text-align: left;
}

.category-sidebar button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s;
}

.category-sidebar button:hover {
  background: #f0f7fa;
}

.category-sidebar button.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: white;
}

.category-sidebar__icon {
  font-size: 16px;
}

.category-sidebar__parent {
  width: 100%;
  justify-content: space-between;
}

.category-sidebar__caret {
  margin-left: auto;
  font-size: 18px;
  transition: transform 0.2s;
}

.category-sidebar__group.is-open .category-sidebar__caret {
  transform: rotate(180deg);
}

.category-sidebar__sublist {
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-sidebar__child {
  font-size: 13px;
  color: var(--ink-soft);
}

.category-group h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-left: 12px;
}

.category-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.cat-link:hover {
  background: #f0f7fa;
  color: var(--brand);
}

.cat-link.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(15, 157, 144, 0.3);
}

/* 特色分类特殊样式 */
.cat-prompts:hover,
.cat-prompts.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.cat-tutorials:hover,
.cat-tutorials.active {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

.cat-news:hover,
.cat-news.active {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
}

/* ===== 统一卡片网格 ===== */
.cards-area {
  min-height: 500px;
}

/* 提示词卡片样式 */
.prompt-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.25s ease;
  height: 100%;
}

.prompt-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
}

.prompt-card__icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.prompt-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 8px;
  line-height: 1.4;
}

.prompt-card p {
  font-size: 13px;
  color: #b45309;
  line-height: 1.5;
  flex: 1;
}

.prompt-card__tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  background: rgba(245, 158, 11, 0.15);
  border-radius: 20px;
  font-size: 12px;
  color: #b45309;
  margin-top: 12px;
}

/* 教程卡片样式 */
.tutorial-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1px solid #c4b5fd;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.25s ease;
  height: 100%;
}

.tutorial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(139, 92, 246, 0.2);
  border-color: #8b5cf6;
}

.tutorial-card__cover {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  position: relative;
}

.tutorial-card__level {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.tutorial-card__level.beginner { color: #059669; }
.tutorial-card__level.intermediate { color: #d97706; }
.tutorial-card__level.advanced { color: #dc2626; }

.tutorial-card__content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tutorial-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: #5b21b6;
  margin-bottom: 8px;
  line-height: 1.4;
}

.tutorial-card p {
  font-size: 13px;
  color: #7c3aed;
  line-height: 1.5;
  flex: 1;
}

/* 资讯卡片样式 */
.news-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #7dd3fc;
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.25s ease;
  height: 100%;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.2);
  border-color: #0ea5e9;
}

.news-card__date {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  background: #0ea5e9;
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.news-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: #0c4a6e;
  line-height: 1.5;
  flex: 1;
}

.news-card__source {
  font-size: 12px;
  color: #0369a1;
  margin-top: 12px;
}

/* ===== 分类区块标题 ===== */
.category-block__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.category-block__title h2 {
  font-size: 20px;
  font-weight: 700;
}

.category-block__title .badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* 分类标题链接样式 - 与 badge 协调 */
.category-block__title a {
  text-decoration: none;
  color: inherit;
}

.category-block__title a h2 {
  color: #1f2937;
  transition: color 0.2s ease;
}

.category-block__title a:hover h2 {
  color: #92400e;
}

.badge-prompts { background: #fef3c7; color: #92400e; }
.badge-tutorials { background: #ede9fe; color: #5b21b6; }
.badge-news { background: #e0f2fe; color: #0c4a6e; }

/* ===== 工具子分类样式 ===== */
.tool-subcategory {
  margin-bottom: 40px;
}

.tool-subcategory:last-child {
  margin-bottom: 0;
}

.tool-subcategory .category-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.tool-subcategory .category-head h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

/* 标准工具卡片样式 */
.site-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.site-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--brand);
}

.site-card .card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.site-card .site-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.site-card .site-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.site-card .site-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 响应式优化 ===== */
@media (max-width: 768px) {
  .hero--compact {
    padding: 32px 0 24px;
  }
  
  .hero--compact h1 {
    font-size: 28px;
  }
  
  .sidebar-search {
    position: relative;
    top: 0;
  }
}
