:root {
  --primary-color: #ea580c;
  --primary-hover: #c2410c;
  --text-main: #1e293b;
  --text-sub: #64748b;
  --text-muted: #94a3b8;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --container-width: 1280px;
}

body {
  background-color: var(--bg-body);
}

.topbar {
  min-height: 70px;
  padding: 0 max(24px, calc((100vw - var(--container-width)) / 2 + 24px));
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: none;
}

.brand {
  color: #0f172a;
  font-size: 20px;
  font-weight: 800;
}

.legacy-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legacy-logo-img {
  display: block;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 6px rgba(234, 88, 12, 0.16);
}

.legacy-logo-text {
  display: grid;
  gap: 2px;
}

.legacy-logo-text strong {
  color: #0f172a;
  font-size: 18px;
  line-height: 1;
}

.legacy-logo-text small {
  color: var(--primary-color);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.nav {
  gap: 5px;
}

.nav a {
  padding: 8px 15px;
  border-radius: 99px;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
}

.nav a:hover,
.nav a.active {
  background: #eff6ff;
  color: #2563eb;
}

.session {
  gap: 16px;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-text {
  padding: 6px 12px;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
  transition: color 0.2s;
}

.btn-text:hover {
  color: var(--text-main);
}

.btn-outline {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-outline:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.btn-download {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #ea580c, #c2410c);
  color: #fff;
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.25);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(234, 88, 12, 0.35);
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 99px;
  background: #f1f5f9;
  cursor: pointer;
  transition: background 0.2s;
}

.user-profile-btn:hover {
  background: #e2e8f0;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  font-size: 12px;
  font-weight: 800;
}

.user-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.legacy-nav-username {
  max-width: 150px;
  overflow: hidden;
  padding-right: 8px;
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legacy-logout {
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.legacy-logout:hover {
  background: #fef2f2;
  color: #ef4444;
}

.main {
  width: 100%;
  margin: 0;
  padding: 0 0 56px;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.hero-wrapper {
  margin-top: 24px;
  margin-bottom: 40px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 20px 24px;
  border-radius: var(--radius-xl);
  background-color: #1e293b;
  box-shadow: var(--shadow-lg);
  color: #fff;
  text-align: center;
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 1px, transparent 1px 18px);
  opacity: 0.3;
  filter: grayscale(100%);
  mix-blend-mode: overlay;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, #0f172a, rgba(234, 88, 12, 0.2));
  opacity: 0.9;
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
}

.hero-title {
  margin: 0 0 16px;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-desc {
  margin: 0 0 40px;
  color: #cbd5e0;
  font-size: 18px;
  font-weight: 300;
}

.search-container {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 16px;
  border-radius: 10px;
  background: #fff;
}

.search-input {
  width: 100%;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 500;
}

.search-btn {
  height: 52px;
  margin-left: 8px;
  padding: 0 28px;
  border: 0;
  border-radius: 10px;
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.4);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.search-btn:hover {
  background: var(--primary-hover);
}

.hot-keys {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  color: #94a3b8;
  font-size: 13px;
}

.hot-key-item {
  padding-bottom: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
}

.hot-key-item:hover {
  border-bottom-color: var(--primary-color);
  color: var(--primary-color);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.94fr) minmax(384px, 1fr);
  gap: 26px;
  align-items: start;
}

.home-carousel {
  margin: 0 0 28px;
}

.home-sidebar-carousel {
  margin-bottom: 20px;
}

.home-sidebar-carousel .home-carousel-viewport,
.home-sidebar-carousel .home-carousel-slide .home-carousel-backdrop,
.home-sidebar-carousel .home-carousel-slide .home-carousel-image {
  min-height: 210px;
}

.home-sidebar-carousel .home-carousel-copy {
  left: 18px;
  bottom: 16px;
  max-width: calc(100% - 36px);
  gap: 4px;
}

.home-sidebar-carousel .home-carousel-copy strong {
  font-size: 16px;
}

.home-sidebar-carousel .home-carousel-copy small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 11px;
}

.home-sidebar-carousel .home-carousel-nav {
  width: 28px;
  height: 28px;
}

.home-sidebar-carousel .home-carousel-nav::before {
  font-size: 23px;
}

.home-sidebar-carousel .home-carousel-prev { left: 8px; }
.home-sidebar-carousel .home-carousel-next { right: 8px; }

.home-sidebar-carousel .home-carousel-dots {
  right: 14px;
  bottom: 10px;
}

.home-carousel-viewport {
  position: relative;
  min-height: 224px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  background: #172033;
  box-shadow: var(--shadow-md);
}

.home-carousel-slide {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;
}

.home-carousel-slide.active {
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
}

.home-carousel-slide .home-carousel-backdrop {
  position: absolute;
  inset: -18px;
  display: none;
  width: 100%;
  height: 100%;
  min-height: 224px;
  object-fit: cover;
  filter: blur(16px) saturate(.88);
  opacity: .72;
  transform: scale(1.08);
}

.home-carousel-slide .home-carousel-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 224px;
  object-fit: cover;
  object-position: center;
}

.home-carousel-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(90deg, rgba(15, 23, 42, .68) 0%, rgba(15, 23, 42, .22) 42%, rgba(15, 23, 42, .04) 72%, transparent 100%);
}

.home-carousel-copy {
  position: absolute;
  z-index: 2;
  left: 26px;
  bottom: 24px;
  display: grid;
  max-width: min(70%, 520px);
  gap: 6px;
  color: #fff;
}

.home-carousel-kicker {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(234, 88, 12, .9);
  font-size: 11px;
  font-weight: 800;
}

.home-carousel-copy strong {
  font-size: 22px;
  line-height: 1.28;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

.home-carousel-copy small {
  color: rgba(255, 255, 255, .86);
  font-size: 13px;
  line-height: 1.55;
}

.home-carousel-nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  background: rgba(15, 23, 42, .34);
  color: #fff;
  cursor: pointer;
  font-size: 0;
  line-height: 1;
  opacity: 0;
  transform: translateY(-50%);
  transition: background .18s ease, opacity .18s ease;
}

.home-carousel-nav::before {
  display: block;
  font-size: 29px;
  font-weight: 400;
  line-height: .78;
  transform: translateY(-1px);
}

.home-carousel-prev::before { content: "\2039"; }
.home-carousel-next::before { content: "\203A"; }

.home-carousel:hover .home-carousel-nav,
.home-carousel:focus-within .home-carousel-nav {
  opacity: 1;
}

.home-carousel-nav:hover {
  background: rgba(234, 88, 12, .9);
}

.home-carousel-prev { left: 14px; }
.home-carousel-next { right: 14px; }

.home-carousel-dots {
  position: absolute;
  z-index: 3;
  right: 22px;
  bottom: 16px;
  display: flex;
  gap: 7px;
}

.home-carousel-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .58);
  cursor: pointer;
  transition: width .18s ease, background .18s ease;
}

.home-carousel-dots button.active {
  width: 20px;
  border-radius: 99px;
  background: #fff;
}

@media (max-width: 760px) {
  .home-carousel {
    margin-bottom: 18px;
  }

  .home-carousel-viewport,
  .home-carousel-slide .home-carousel-backdrop,
  .home-carousel-slide .home-carousel-image {
    min-height: 176px;
  }

  .home-carousel-copy {
    left: 18px;
    bottom: 18px;
    max-width: calc(100% - 72px);
  }

  .home-carousel-copy strong {
    font-size: 17px;
  }

  .home-carousel-copy small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 11.5px;
  }

  .home-carousel-nav {
    display: none;
  }

  .home-carousel-dots {
    right: 16px;
    bottom: 12px;
  }
}

.home-resources-section {
  margin-bottom: 40px;
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--text-main);
  font-size: 22px;
  font-weight: 800;
}

.section-bar {
  width: 6px;
  height: 24px;
  border-radius: 99px;
  background: linear-gradient(to bottom, #f97316, #d97706);
}

.section-bar-blue {
  background: linear-gradient(to bottom, #3b82f6, #06b6d4);
}

.section-bar-brown {
  background: linear-gradient(to bottom, #b45309, #ad7d7d);
}

.section-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 700;
}

.section-link:hover {
  color: var(--primary-color);
}

.home-news-block {
  margin-bottom: 40px;
}

.std-card {
  position: relative;
  display: flex;
  gap: 20px;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 8px 16px 8px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: #fff;
  cursor: pointer;
  transition: all 0.3s;
}

.std-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary-color);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.3s;
}

.std-card:hover {
  transform: translateY(-3px);
  border-color: #fed7aa;
  box-shadow: var(--shadow-lg);
}

.std-card:hover::before {
  opacity: 1;
  transform: translateX(0);
}

.std-img-box {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  width: 120px;
  height: 90px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #f1f5f9;
}

.std-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.std-cover-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
}

.std-img-placeholder {
  display: grid;
  position: relative;
  z-index: 0;
  place-items: center;
  background: linear-gradient(135deg, #f1f5f9, #fff7ed);
  color: #92400e;
  font-size: 22px;
  font-weight: 900;
}

.std-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.95);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.std-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.std-title {
  margin: 0 0 6px;
  color: var(--text-main);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.std-card:hover .std-title {
  color: var(--primary-color);
}

.std-code {
  margin-bottom: 12px;
  color: var(--text-sub);
  font-family: monospace;
  font-size: 15px;
  font-weight: 600;
}

.std-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.std-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 130px;
  overflow: hidden;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-def {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #2563eb;
}

.std-arrow {
  display: flex;
  align-items: center;
  color: #cbd5e0;
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.news-item {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 118px;
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.news-tone-1 .news-title,
.news-tone-4 .news-title {
  color: #15803d;
}

.news-tone-2 .news-title,
.news-tone-3 .news-title {
  color: #e11d48;
}

.news-item:hover {
  border-color: #bae6fd;
  box-shadow: var(--shadow-md);
}

.news-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 11px;
}

.news-cat {
  padding: 3px 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--text-sub);
  font-weight: 700;
}

.news-item:hover .news-cat {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #2563eb;
}

.news-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 10px;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.news-item:hover .news-title {
  color: #2563eb;
}

.hot-card {
  padding: 20px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.hot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bg-body);
}

.hot-title {
  margin: 0;
  color: var(--text-main);
  font-size: 18px;
  font-weight: 800;
}

.hot-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.rank-num {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.rank-high {
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  font-size: 20px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
}

.rank-1 {
  background-image: linear-gradient(to bottom right, #facc15, #ea580c);
}

.rank-2 {
  background-image: linear-gradient(to bottom right, #cbd5e1, #64748b);
}

.rank-3 {
  background-image: linear-gradient(to bottom right, #fdba74, #b45309);
}

.rank-norm {
  color: #cbd5e0;
  font-size: 13px;
  font-weight: 700;
}

.hot-content {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.8);
  transition: all 0.2s;
}

.hot-item:hover .hot-content {
  border-color: var(--border-color);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.hot-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hot-name {
  max-width: 240px;
  overflow: hidden;
  margin-bottom: 2px;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-item:hover .hot-name {
  color: var(--primary-color);
}

.hot-code-sm {
  color: var(--text-muted);
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
}

.hot-views {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: fit-content;
  margin-top: 2px;
  padding: 1px 5px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
}

.dl-card {
  position: relative;
  overflow: hidden;
  margin-top: 32px;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: linear-gradient(to bottom right, #0f172a, #1e293b);
  box-shadow: var(--shadow-lg);
  color: #fff;
  cursor: pointer;
}

.dl-blob-1 {
  position: absolute;
  top: -40px;
  right: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(234, 88, 12, 0.3);
  filter: blur(40px);
}

.dl-card > div[style*="position"] {
  min-width: 0;
  max-width: 100%;
}

.dl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 20px;
  padding: 12px 0;
  border: 0;
  border-radius: 10px;
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.dl-btn:hover {
  background: var(--primary-hover);
}

.empty {
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--text-muted);
}

.alert {
  margin-bottom: 18px;
}

.suggestions {
  top: calc(100% + 12px);
  right: 0;
  color: var(--text-main);
}

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

  .container {
    padding: 0 20px;
  }

  .right-col {
    width: 100%;
  }

  .home-sidebar-carousel .home-carousel-viewport,
  .home-sidebar-carousel .home-carousel-slide .home-carousel-backdrop,
  .home-sidebar-carousel .home-carousel-slide .home-carousel-image {
    min-height: 260px;
  }

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

  .dl-card {
    display: none;
  }
}

@media (max-width: 768px) {
  .topbar {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 8px 12px;
  }

  .nav {
    display: none;
  }

  .legacy-brand {
    min-width: 0;
    gap: 8px;
  }

  .legacy-logo-img {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .legacy-logo-text {
    min-width: 0;
    overflow: hidden;
  }

  .legacy-logo-text strong {
    font-size: 15px;
  }

  .legacy-logo-text small {
    font-size: 10px;
    letter-spacing: .4px;
  }

  .header-actions {
    gap: 0;
    margin-left: 0;
  }

  .header-actions [data-legacy-guest-actions] {
    display: none !important;
  }

  .btn-download {
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 12px;
    white-space: nowrap;
  }

  .btn-download svg {
    display: none;
  }

  .container {
    padding: 0 12px;
  }

  .hero-card {
    padding: 40px 20px;
    border-radius: 24px;
  }

  .hero-title {
    margin-bottom: 12px;
    font-size: 28px;
  }

  .hero-desc {
    margin-bottom: 24px;
    font-size: 14px;
  }

  .search-container {
    padding: 6px;
    border-radius: 12px;
  }

  .search-input-wrapper {
    height: 44px;
    padding: 0 12px;
  }

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

  .search-btn {
    height: 44px;
    padding: 0 20px;
    font-size: 14px;
  }

  .hot-keys {
    gap: 8px 12px;
  }

  .section-header {
    margin-bottom: 16px;
  }

  .section-title {
    font-size: 18px;
  }

  .std-card {
    gap: 12px;
    padding: 12px;
  }

  .std-img-box {
    width: 100px;
    height: 75px;
    aspect-ratio: auto;
    border-radius: 8px;
  }

  .std-title {
    margin-bottom: 4px;
    font-size: 15px;
    line-height: 1.4;
  }

  .std-code {
    margin-bottom: 6px;
    font-size: 12px;
  }

  .std-meta {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .news-item {
    padding: 16px;
  }

  .hot-list {
    grid-template-columns: 1fr;
  }

  .hot-card {
    padding: 16px;
  }
}

@media (max-width: 340px) {
  .topbar {
    gap: 8px;
    padding: 8px 10px;
  }

  .legacy-logo-img {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .legacy-logo-text strong {
    font-size: 14px;
  }

  .legacy-logo-text small {
    display: none;
  }

  .btn-download {
    padding: 8px 9px;
  }
}

@media (max-width: 560px) {
  body {
    background: #f2f3f7;
  }

  .container {
    padding: 0 10px;
  }

  .hero-wrapper {
    margin-top: 6px;
    margin-bottom: 10px;
  }

  .hero-card {
    padding: 16px 12px 13px;
    border-radius: 14px;
  }

  .hero-title {
    margin-bottom: 5px;
    font-size: 20px;
    line-height: 1.28;
  }

  .hero-desc {
    margin-bottom: 10px;
    font-size: 12px;
  }

  .search-container {
    display: grid;
    box-sizing: border-box;
    grid-template-columns: 1fr 72px;
    gap: 8px;
    width: 100%;
    max-width: none;
    padding: 5px;
    border-radius: 10px;
  }

  .search-input-wrapper {
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    border-radius: 8px;
  }

  .search-input {
    font-size: 13px;
  }

  .search-btn {
    width: 72px;
    height: 40px;
    padding: 0;
    border-radius: 8px;
    font-size: 13px;
  }

  .hot-keys {
    justify-content: flex-start;
    overflow: hidden;
    flex-wrap: nowrap;
    gap: 6px;
    max-height: 23px;
    margin-top: 9px;
    padding-bottom: 0;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .hot-keys::-webkit-scrollbar {
    display: none;
  }

  .hot-key-item {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 22px;
    padding: 0 2px 1px;
    white-space: nowrap;
  }

  .hot-key-item:nth-of-type(n+4) {
    display: none;
  }

  .main-grid {
    gap: 10px;
  }

  .section-header {
    margin: 14px 0 8px;
  }

  .section-title {
    font-size: 16px;
  }

  .home-resources-section > .section-header:first-child .section-link {
    display: none;
  }

  .std-list {
    gap: 8px;
  }

  .std-card {
    gap: 8px;
    min-height: 82px;
    margin-bottom: 9px;
    padding: 8px;
    border-radius: 10px;
  }

  .std-img-box {
    width: 64px;
    height: 48px;
    border-radius: 6px;
  }

  .std-badge {
    display: none;
  }

  .std-title {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 2px;
    font-size: 13px;
    line-height: 1.32;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .std-code {
    margin-bottom: 4px;
    font-size: 11px;
  }

  .std-meta {
    gap: 4px 6px;
    font-size: 10px;
    line-height: 1.25;
  }

  .std-tag {
    max-width: 116px;
    padding: 2px 6px;
    font-size: 10px;
  }

  .std-arrow {
    width: 14px;
    flex-shrink: 0;
  }

  .std-arrow svg {
    width: 16px;
    height: 16px;
  }

  .right-col {
    display: none;
  }

  .hot-list {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 4px;
  }

  .hot-card {
    flex: 0 0 82%;
    padding: 12px;
    border-radius: 12px;
  }

  .news-grid {
    gap: 8px;
  }

  .news-item {
    min-height: 94px;
    padding: 10px;
    border-radius: 10px;
  }

  .news-header {
    margin-bottom: 8px;
  }

  .news-title {
    margin-bottom: 0;
    font-size: 13px;
    line-height: 1.35;
  }

  .home-news-block {
    margin-bottom: 14px;
  }
}

@media (max-width: 560px) {
  .hero-card {
    min-height: 0;
  }

  .hero-content {
    gap: 0;
  }

  .hero-desc {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .search-container {
    grid-template-columns: minmax(0, 1fr) 64px;
  }

  .search-input-wrapper {
    height: 38px;
  }

  .search-input-wrapper svg {
    width: 16px;
    height: 16px;
    margin-right: 8px !important;
  }

  .search-btn {
    width: 64px;
    height: 38px;
  }

  .news-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .news-item {
    min-height: auto;
    padding: 9px 10px;
  }

  .news-header {
    margin-bottom: 5px;
  }

  .news-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .std-card {
    grid-template-columns: 58px minmax(0, 1fr) 12px;
    min-height: 74px;
  }

  .std-img-box {
    width: 58px;
    height: 44px;
  }

  .std-meta span {
    min-width: 0;
  }

  .std-meta span:not(.std-tag) {
    color: #64748b;
  }

  .main-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .right-col {
    display: block;
    order: -1;
    width: 100%;
  }

  .right-col .hot-card {
    display: none;
  }

  .home-sidebar-carousel {
    margin: 0 0 16px;
  }

  .home-sidebar-carousel .home-carousel-viewport,
  .home-sidebar-carousel .home-carousel-slide .home-carousel-backdrop,
  .home-sidebar-carousel .home-carousel-slide .home-carousel-image {
    min-height: 186px;
  }

  .home-sidebar-carousel .home-carousel-copy {
    left: 14px;
    bottom: 14px;
    max-width: calc(100% - 28px);
  }

  .home-sidebar-carousel .home-carousel-copy strong {
    font-size: 15px;
  }

  .home-sidebar-carousel .home-carousel-copy small {
    display: none;
  }
}
