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

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: #f5f7fa;
  color: #333;
  display: flex;
  min-height: 100vh;
}

/* Left Sidebar */
.sidebar {
  width: 220px;
  background: #fff;
  border-right: 1px solid #eee;
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 200;
  padding-top: 0;
}

.sidebar-logo {
  display: none;
  text-align: center;
  padding: 16px 0 8px;
}

.sidebar-logo a {
  font-size: 22px;
  font-weight: bold;
  color: #4a6cf7;
  text-decoration: none;
}

.sidebar-logo a:hover {
  color: #3b5de7;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  padding: 16px 20px 10px;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  text-decoration: none;
  color: #666;
  font-size: 13px;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  background: #f0f4ff;
  color: #4a6cf7;
  border-left-color: #4a6cf7;
}

.sidebar-nav li a .count {
  font-size: 11px;
  color: #bbb;
  background: #f5f5f5;
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-nav li a:hover .count,
.sidebar-nav li a.active .count {
  background: #e0e7ff;
  color: #4a6cf7;
}

/* Main Content */
.main-content {
  margin-left: 220px;
  margin-top: 56px;
  flex: 1;
  min-height: 100vh;
}

/* Header */
.header {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  height: 56px;
}

.header-inner {
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.logo {
  font-size: 22px;
  font-weight: bold;
  color: #4a6cf7;
  text-decoration: none;
  position: absolute;
  left: 110px;
  transform: translateX(-50%);
}

.logo:hover {
  color: #3b5de7;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 20px;
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
}

.header-links a {
  font-size: 13px;
  color: #666;
  text-decoration: none;
  transition: color 0.3s;
}

.header-links a:hover {
  color: #4a6cf7;
}

/* 三点菜单按钮 */
.more-btn {
  display: none;
  width: 40px;
  height: 40px;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  flex-shrink: 0;
}

.more-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 25px;
  height: 25px;
}

.more-icon span {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #777;
}

/* 右侧滑出面板 */
.more-panel {
  position: fixed;
  top: 0;
  right: -220px;
  width: 220px;
  height: 100%;
  background: #fff;
  z-index: 250;
  transition: right 0.3s ease;
  padding-top: 80px;
}

.more-panel.open {
  right: 0;
}

.more-panel a {
  display: block;
  padding: 20px 30px;
  font-size: 16px;
  color: #333;
  text-decoration: none;
  transition: color 0.3s;
}

.more-panel a:hover {
  color: #4a6cf7;
}

/* 右侧面板遮罩 */
.more-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 240;
}

.more-overlay.show {
  display: block;
}

/* Page Title */
.page-title {
  max-width: 1200px;
  margin: 30px auto 20px;
  padding: 0 20px;
}

.page-title h1 {
  font-size: 24px;
  color: #333;
  font-weight: 600;
}

.page-title p {
  font-size: 14px;
  color: #999;
  margin-top: 8px;
}

/* Card Grid */
.card-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(74, 108, 247, 0.15);
}

.card-img-wrapper {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
}

.card-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  display: block;
}

.card-body {
  padding: 14px 16px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title a {
  text-decoration: none;
  color: #333;
  transition: color 0.3s;
}

.card-title a:hover {
  color: #4a6cf7;
}

.card-desc {
  font-size: 12px;
  color: #999;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer */
.footer {
  background: #fff;
  text-align: center;
  padding: 15px 20px;
  color: #999;
  font-size: 13px;
  border-top: 1px solid #eee;
}

.footer a {
  color: #4a6cf7;
  text-decoration: none;
}

/* Hamburger Menu Button */
.nav-btn {
  display: none;
  width: 40px;
  height: 40px;
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  flex-shrink: 0;
}

.nav-icon {
  display: inline-block;
  position: relative;
  width: 25px;
  height: 2px;
  background-color: #777;
  transition-property: background-color, transform;
  transition-duration: 300ms;
}

.nav-icon::before,
.nav-icon::after {
  content: '';
  display: block;
  width: 25px;
  height: 2px;
  position: absolute;
  background: #777;
  transition-property: margin, transform;
  transition-duration: 300ms;
}

.nav-icon::before {
  margin-top: -8px;
}

.nav-icon::after {
  margin-top: 8px;
}

.nav-active .nav-icon {
  background: transparent;
}

.nav-active .nav-icon::before {
  margin-top: 0;
  transform: rotate(45deg);
}

.nav-active .nav-icon::after {
  margin-top: 0;
  transform: rotate(-45deg);
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 150;
}

/* Responsive */
@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-title h1 {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  .logo {
    left: 50%;
  }

  .sidebar-logo {
    display: none;
  }

  .sidebar {
    left: -220px;
    top: 56px;
    transition: left 0.3s ease;
    z-index: 200;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-overlay {
    display: block;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
  }

  .nav-btn {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .card-img-wrapper {
    height: 120px;
  }

  .header-inner {
    padding-left: 60px;
  }

  .header-links {
    display: none;
  }

  .more-btn {
    display: block;
  }
}

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

  .card-img-wrapper {
    height: 140px;
  }

  .page-title {
    margin-top: 20px;
  }

  .page-title h1 {
    font-size: 18px;
  }

  .header-inner {
    padding: 10px 15px 10px 55px;
  }
}
