/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background: #f5f7fa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

img {
  max-width: 100%;
}

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

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

/* ===== Header ===== */
.site-header {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: #1a73e8;
}

.logo-icon {
  font-size: 28px;
}

.main-nav {
  display: flex;
  gap: 24px;
}

.main-nav a {
  font-size: 15px;
  color: #555;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #555;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  background: #f0f2f5;
  padding: 10px 0;
  font-size: 13px;
  border-bottom: 1px solid #e8edf3;
}

.breadcrumb .container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: #1a73e8;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  margin: 0 8px;
  color: #bbb;
  font-size: 16px;
}

.breadcrumb-current {
  color: #666;
}

/* ===== Category More Link ===== */
.cat-section-more {
  text-align: right;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.cat-load-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 18px;
  font-size: 13px;
  border: 1px solid #1a73e8;
  border-radius: 20px;
  background: transparent;
  color: #1a73e8;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.cat-load-more:hover {
  background: #1a73e8;
  color: #fff;
}

.cat-more-link {
  font-size: 13px;
  color: #1a73e8;
  transition: color .2s;
}

.cat-more-link:hover {
  color: #1558b0;
  text-decoration: underline;
}

/* ===== Main ===== */
.site-main {
  flex: 1;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  text-align: center;
  padding: 80px 20px 60px;
}

.hero-sm {
  padding: 50px 20px 40px;
}

.hero-title {
  font-size: 36px;
  margin-bottom: 12px;
  font-weight: 800;
}

.hero-desc {
  font-size: 18px;
  opacity: .9;
  margin-bottom: 30px;
}

.search-form {
  display: flex;
  max-width: 560px;
  margin: 0 auto 24px;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}

.search-input {
  flex: 1;
  padding: 14px 24px;
  border: none;
  font-size: 16px;
  outline: none;
}

.search-btn {
  padding: 14px 32px;
  background: #ff6b6b;
  color: #fff;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.search-btn:hover {
  background: #ee5a5a;
}

.quick-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.quick-link {
  display: inline-block;
  padding: 8px 20px;
  background: rgba(255,255,255,.15);
  border-radius: 20px;
  font-size: 14px;
  color: #fff;
  transition: background .2s;
}

.quick-link:hover {
  background: rgba(255,255,255,.25);
}

/* ===== Section ===== */
.section {
  padding: 60px 0;
}

.section-alt {
  background: #fff;
}

.section-title {
  font-size: 28px;
  text-align: center;
  margin-bottom: 40px;
  color: #222;
}

/* ===== Navigation Cards ===== */
.cat-section {
  margin-bottom: 48px;
}

.cat-title {
  font-size: 22px;
  color: #1a73e8;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e8edf3;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.nav-card {
  position: relative;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 12px 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform .2s, box-shadow .2s;
  text-align: center;
}

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

.nav-card-icon {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.nav-card-img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: contain;
}

.nav-card-emoji {
  display: none;
  font-size: 32px;
  line-height: 1;
}

.nav-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  pointer-events: none;
}

.nav-card-desc {
  font-size: 12px;
  color: #999;
  line-height: 1.3;
  pointer-events: none;
}

.nav-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity .2s;
}

.nav-card:hover .nav-card-actions {
  opacity: 1;
}

.nav-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s, color .2s;
  user-select: none;
}

.nav-card-detail {
  background: #e8f0fe;
  color: #1a73e8;
}

.nav-card-detail:hover {
  background: #d2e3fc;
}

.nav-card-link {
  background: #e8f5e9;
  color: #2e7d32;
}

.nav-card-link:hover {
  background: #c8e6c9;
}

/* ===== Quotes ===== */
.quote-slider {
  text-align: center;
  min-height: 80px;
}

.quote-item {
  display: none;
}

.quote-item.active {
  display: block;
}

.quote-text {
  font-size: 24px;
  color: #555;
  font-style: italic;
  line-height: 1.8;
}

.quote-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.quote-btn {
  display: inline-block;
  padding: 10px 32px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  cursor: pointer;
  transition: background .2s;
  text-align: center;
}

.quote-btn:hover {
  background: #1558b0;
}

.quote-btn-secondary {
  background: transparent;
  border: 1px solid #1a73e8;
  color: #1a73e8;
}

.quote-btn-secondary:hover {
  background: #e8f0fe;
  color: #1558b0;
}

/* ===== Jokes ===== */
.jokes-list {
  max-width: 720px;
  margin: 0 auto;
}

.joke-card {
  background: #fff;
  border-left: 4px solid #ff6b6b;
  padding: 16px 20px;
  margin-bottom: 16px;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  font-size: 15px;
  line-height: 1.7;
  color: #444;
}

/* ===== Search Results ===== */
.result-count {
  text-align: center;
  margin-bottom: 24px;
  color: #666;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  font-size: 18px;
  color: #666;
}

.no-results a {
  color: #1a73e8;
  text-decoration: underline;
}

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.contact-card {
  text-align: center;
  padding: 40px 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.contact-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

.contact-card h3 {
  margin-bottom: 8px;
  color: #333;
}

.contact-card a {
  color: #1a73e8;
}

/* ===== Site Detail Page ===== */
.site-detail {
  text-align: center;
  padding: 40px 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.site-detail-icon {
  font-size: 64px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
}

.site-detail-img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: contain;
}

.site-detail-name {
  font-size: 28px;
  color: #222;
  margin-bottom: 12px;
}

.site-detail-desc {
  font-size: 16px;
  color: #555;
  line-height: 1.8;
  max-width: 600px;
  margin: 0 auto 20px;
}

.site-detail-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  font-size: 14px;
  color: #666;
}

.site-detail-meta a {
  color: #1a73e8;
}

.site-detail-meta a:hover {
  text-decoration: underline;
}

.site-detail-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-badge {
  display: inline-block;
  padding: 2px 10px;
  background: #e8f0fe;
  color: #1a73e8;
  border-radius: 10px;
  font-size: 12px;
}

.tag-badge:hover {
  background: #d2e3fc;
}

.site-detail-btn {
  display: inline-block;
  padding: 14px 40px;
  background: #1a73e8;
  color: #fff;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  transition: background .2s, transform .2s;
}

.site-detail-btn:hover {
  background: #1558b0;
  transform: translateY(-2px);
}

.site-related {
  margin-top: 48px;
}

.site-related-title {
  font-size: 20px;
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

/* ===== AI Description List ===== */
.ai-desc-list {
  max-width: 800px;
  margin: 0 auto;
}

.ai-desc-item {
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  transition: box-shadow .2s;
}

.ai-desc-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.ai-desc-name {
  font-size: 18px;
  margin-bottom: 8px;
}

.ai-desc-name a {
  color: #1a73e8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-list-img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: contain;
}

.ai-desc-name a:hover {
  text-decoration: underline;
}

.ai-desc-text {
  font-size: 14px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 10px;
}

.ai-desc-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ===== Content List (Quotes & Jokes) ===== */
.content-list {
  max-width: 720px;
  margin: 0 auto;
}

.content-card {
  padding: 20px 24px;
  margin-bottom: 16px;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}

.content-card-quote {
  background: linear-gradient(135deg, #fefcf3, #f8f4e8);
  border-left: 4px solid #f6c23e;
}

.content-card-joke {
  background: #fff;
  border-left: 4px solid #ff6b6b;
}

.content-text {
  font-size: 16px;
  line-height: 1.8;
  color: #444;
}

.content-card-quote .content-text {
  font-style: italic;
  font-size: 18px;
  color: #555;
}

.content-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 13px;
}

.content-id {
  color: #bbb;
}

.content-related {
  color: #1a73e8;
}

.content-related:hover {
  text-decoration: underline;
}

/* ===== Friend Links ===== */
.friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.friend-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  text-align: center;
  transition: transform .2s, box-shadow .2s;
}

.friend-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

.friend-name {
  font-size: 16px;
  color: #1a73e8;
}

.friend-desc {
  font-size: 13px;
  color: #999;
}

/* ===== Legal Pages ===== */
.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.legal-text h3 {
  margin: 28px 0 12px;
  color: #222;
  font-size: 18px;
}

.legal-text p {
  color: #555;
  line-height: 1.8;
  margin-bottom: 8px;
}

.legal-text a {
  color: #1a73e8;
  text-decoration: underline;
}

/* ===== Footer ===== */
.site-footer {
  background: #222;
  color: #aaa;
  padding: 40px 0 24px;
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
}

.footer-links a {
  color: #ccc;
  font-size: 14px;
  transition: color .2s;
}

.footer-links a:hover {
  color: #fff;
}

.footer-copy p {
  font-size: 13px;
  margin: 4px 0;
}

.footer-copy a {
  color: #aaa;
}

.footer-copy a:hover {
  color: #fff;
}

/* ===== AI Navigation Layout ===== */

.section-hot {
  background: linear-gradient(135deg, #fff8e1, #fff3cd);
  padding: 32px 0;
}

.hot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.hot-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
}

.hot-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}

.hot-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hot-card-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
}

.hot-card-emoji {
  font-size: 28px;
  line-height: 1;
}

.hot-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hot-card-desc {
  display: none;
}

/* 主布局 */
.ai-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.ai-sidebar {
  flex-shrink: 0;
  width: 220px;
  position: sticky;
  top: 80px;
}

.ai-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.ai-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: #555;
  transition: background .15s, color .15s;
  font-size: 14px;
}

.ai-menu-item:hover {
  background: #f0f4ff;
  color: #1a73e8;
}

.ai-menu-item.active {
  background: #1a73e8;
  color: #fff;
  font-weight: 600;
}

.ai-menu-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.ai-menu-label {
  flex: 1;
}

.ai-menu-count {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(0,0,0,.08);
  color: inherit;
}

.ai-menu-item.active .ai-menu-count {
  background: rgba(255,255,255,.25);
  color: #fff;
}

/* 内容区域 */
.ai-content {
  flex: 1;
  min-width: 0;
}

.ai-tab-panel {
  display: none;
}

.ai-tab-panel.active {
  display: block;
  animation: aiFadeIn .3s ease;
}

@keyframes aiFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-panel-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
}

.ai-panel-title {
  font-size: 22px;
  color: #222;
}

.ai-panel-count {
  font-size: 14px;
  color: #999;
}

/* AI 描述列表（在面板内自适应宽度） */
.ai-tab-panel .ai-desc-list {
  max-width: 100%;
  margin-top: 32px;
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102,126,234,.35);
  transition: opacity .3s, transform .3s, visibility .3s;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102,126,234,.45);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-title {
    font-size: 26px;
  }

  .hero {
    padding: 60px 16px 40px;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    gap: 0;
  }

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

  .main-nav a {
    padding: 12px 0;
    border-bottom: none;
  }

  .menu-toggle {
    display: block;
  }

  .cat-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
  }

  .ai-layout {
    flex-direction: column;
  }

  .ai-sidebar {
    width: 100%;
    position: static;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ai-menu {
    flex-direction: row;
    flex-wrap: nowrap;
    padding: 6px;
    gap: 2px;
  }

  .ai-menu-item {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 13px;
  }

  .ai-menu-count {
    display: none;
  }

  .hot-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .quote-text {
    font-size: 18px;
  }

  .section {
    padding: 40px 0;
  }
}

@media (max-width: 480px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-form {
    flex-direction: column;
    border-radius: 12px;
  }

  .search-btn {
    border-radius: 0;
  }
}
