/* ========== 0. Product Sans 字体 ========== */
@font-face {
  font-family: "Product Sans";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: local("Product Sans Light"), local("ProductSans-Light"),
       url("/assets/fonts/ProductSans-Light.woff2") format("woff2"),
       url("/assets/fonts/ProductSans-Light.woff") format("woff");
}
@font-face {
  font-family: "Product Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Product Sans"), local("ProductSans-Regular"),
       url("/assets/fonts/ProductSans-Regular.woff2") format("woff2"),
       url("/assets/fonts/ProductSans-Regular.woff") format("woff");
}
@font-face {
  font-family: "Product Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local("Product Sans Medium"), local("ProductSans-Medium"),
       url("/assets/fonts/ProductSans-Medium.woff2") format("woff2"),
       url("/assets/fonts/ProductSans-Medium.woff") format("woff");
}
@font-face {
  font-family: "Product Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local("Product Sans Bold"), local("ProductSans-Bold"),
       url("/assets/fonts/ProductSans-Bold.woff2") format("woff2"),
       url("/assets/fonts/ProductSans-Bold.woff") format("woff");
}

/* ========== 1. 全局变量与配色（首页 & 频道页共用） ========== */

:root {
  --google-primary: #0b57d0;
  --google-primary-hover: #0842a0;
  --google-text: #1f1f1f;
  --google-text-secondary: #444746;
  --google-bg: #ffffff;
  --google-sidebar-bg: #f0f4f9;
  --chat-bg: #f2f2f2;
  --border-color: #e0e3e7;

  --input-bg: #f0f4f9;
  --input-bg-focus: #ffffff;
  --input-radius: 28px;

  --sidebar-width: 250px;
  --sidebar-mini-width: 4.6rem;

  --transition-speed: 0.3s;
  --ease-out: cubic-bezier(0.25, 0.8, 0.25, 1);
  --ease-curve: cubic-bezier(0.2, 0.0, 0, 1.0);
  
  --google-surface: #f9fafb;
}

/* 夜间模式变量 */
.dark-mode:root,
.dark-mode {
  --google-primary: #a8c7fa;
  --google-primary-hover: #d3e3fd;
  --google-text: #e3e3e3;
  --google-text-secondary: #c4c7c5;
  --google-bg: #1e1f20;
  --google-sidebar-bg: #1e1f20;
  --chat-bg: #282a2c;
  --border-color: #444746;

  --input-bg: #303134;
  --input-bg-focus: #1e1f20;

  --google-surface: #202124;
}

/* 缁熶竴绂佹妯悜婊氬姩鏉� */
html,
body,
.wrapper {
  overflow-x: hidden;
}

/* 全站字体 */
body {
  font-family: "Product Sans", "Google Sans", "Roboto",
               -apple-system, BlinkMacSystemFont, "Segoe UI",
               sans-serif !important;
  background-color: var(--google-bg) !important;
  color: var(--google-text) !important;
  transition: background-color 0.3s, color 0.3s;
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(128,128,128,0.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,0.4); }
.dark-mode ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

.wrapper {
  background-color: var(--google-bg) !important;
  transition: margin-left var(--transition-speed) var(--ease-out);
  /* min-height: auto !important; */
  height: auto !important;
}

.content-wrapper {
  background-color: var(--google-bg) !important;
  transition: margin-left var(--transition-speed) var(--ease-out);
   /* min-height: auto !important; */
  height: auto !important;
}

/* 覆盖AdminLTE的默认样式，防止footer被拉上去 */
.main-footer {
  /* margin-left: 0 !important; */
  position: relative !important;
  z-index: 1;
}

/* ========== 2. 顶部导航 / 左侧栏（首页 & 频道页共用） ========== */

.main-sidebar,
.main-sidebar .sidebar {
  overflow-x: hidden;
}

.sidebar-collapse .nav-sidebar .nav-item.has-treeview > .nav-link .right,
.sidebar-mini.sidebar-collapse .nav-sidebar .nav-item.has-treeview > .nav-link .right {
  display: none !important;
}

.brand-search-btn {
  color: var(--google-text-secondary) !important;
}
.brand-search-btn:hover,
.brand-search-btn:focus {
  color: var(--google-text) !important;
  text-decoration: none;
}

.main-header {
  background-color: transparent !important;
  border-bottom: 1px solid transparent !important;
  box-shadow: none !important;
  height: 60px;
}
.main-header .nav-link {
  color: var(--google-text-secondary) !important;
  transition: color 0.2s;
}
.main-header .nav-link:hover {
  color: var(--google-text) !important;
}

.main-sidebar {
  background-color: var(--google-sidebar-bg) !important;
  border-right: 1px solid var(--border-color);
  box-shadow: none !important;
}

.brand-link {
  height: 60px;
  border-bottom: 1px solid transparent !important;
  color: var(--google-text) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.nav-sidebar .nav-item .nav-link {
  color: var(--google-text);
  border-radius: 0 50px 50px 0;
  margin-right: 10px;
  padding: 10px 1rem;
  transition: all 0.2s;
}
.nav-sidebar .nav-item .nav-link.active {
  background-color: rgba(11, 87, 208, 0.12) !important;
  color: var(--google-primary) !important;
  font-weight: 500;
}
.dark-mode .nav-sidebar .nav-item .nav-link.active {
  background-color: rgba(168, 199, 250, 0.12) !important;
}
.nav-sidebar .nav-item .nav-link:hover:not(.active) {
  background-color: rgba(0,0,0,0.04) !important;
}
.dark-mode .nav-sidebar .nav-item .nav-link:hover:not(.active) {
  background-color: rgba(255,255,255,0.04) !important;
}
/* hover 棰滆壊 */
.nav-sidebar .nav-item .nav-link:hover:not(.active),
.nav-sidebar .nav-item .nav-link:focus:not(.active) {
  background-color: rgba(0,0,0,0.04) !important;
  color: var(--google-text) !important;
}
.dark-mode .nav-sidebar .nav-item .nav-link:hover:not(.active),
.dark-mode .nav-sidebar .nav-item .nav-link:focus:not(.active) {
  background-color: rgba(255,255,255,0.04) !important;
  color: var(--google-text) !important;
}

/* 鍥炬爣璺熼殢鏂囧瓧棰滆壊 */
.nav-sidebar .nav-item .nav-link:hover .nav-icon,
.nav-sidebar .nav-item .nav-link:hover .right {
  color: inherit !important;
}

.sidebar-custom {
  border-top: 1px solid var(--border-color) !important;
  padding: 1rem;
}

/* ========== 3. 右侧设置抽屉：顶到底 + 只遮罩不推内容 ========== */

/* 抽屉外观配色 */
.control-sidebar,
.control-sidebar-dark,
.control-sidebar-light {
  background-color: var(--google-sidebar-bg) !important;
  border-left: 1px solid var(--border-color);
}

/* 从视口顶部贴到视口底部（解决“上不着天下不着地”） */
.layout-fixed .control-sidebar,
.control-sidebar {
  top: 0 !important;
  bottom: 0 !important;
  height: 100vh !important;
  padding-top: 60px; /* 留出导航条高度，内容不被挡住 */
}

/* 夜间模式背景 */
.dark-mode .control-sidebar,
.dark-mode .control-sidebar-dark,
.dark-mode .control-sidebar-light {
  background-color: #202124 !important;
}

/* 关闭 AdminLTE 默认的 push 行为，改成纯 overlay */
.control-sidebar-slide-open .content-wrapper,
.control-sidebar-slide-open .main-header,
.control-sidebar-slide-open .main-footer {
  margin-right: 0 !important;
}

/* ========== 4. 首页 & 频道共用：中间 Chat 输入框 ========== */

.home-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-shell {
  width: 100%;
  max-width: 640px;
  text-align: center;
}

.home-logo {
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: -0.6px;
  margin-bottom: 24px;
  user-select: none;
}

/* 输入框容器（首页 + 频道共用） */
.home-input-wrapper {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

/* 输入框本体 */
.chat-input-box {
  background-color: var(--input-bg);
  border-radius: var(--input-radius);
  border: 1px solid transparent;
  display: flex;
  align-items: flex-end;
  padding: 6px;
  transition: background-color 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.chat-input-box:focus-within {
  background-color: var(--input-bg-focus);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  border-color: rgba(0,0,0,0.05);
}
.dark-mode .chat-input-box:focus-within {
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.chat-input-main {
  flex: 1;
  padding: 10px 0 6px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 60px;
}

.chat-input-text {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--google-text);
  max-height: 200px;
  font-family: inherit;
}
.chat-input-text::placeholder {
  color: var(--google-text-secondary);
  opacity: 0.6;
}

.chat-input-footer {
  margin-top: 8px;
  display: flex;
  align-items: center;
}

.chat-input-actions {
  display: flex;
  align-items: center;
  padding-bottom: 4px;
  padding-right: 8px;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--google-text-secondary);
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-curve);
}
.icon-btn i { font-size: 1.1rem; }

.icon-btn:not(.send-btn):hover {
  background-color: rgba(0,0,0,0.06);
  color: var(--google-text);
}
.dark-mode .icon-btn:not(.send-btn):hover {
  background-color: rgba(255,255,255,0.08);
}

.plus-btn {
  background-color: transparent;
  width: 34px;
  height: 34px;
}

.send-btn {
  display: none;
  color: var(--google-text-secondary);
  opacity: 0.5;
  pointer-events: none;
}
.chat-input-box.has-content .send-btn {
  display: flex;
  background-color: var(--google-primary);
  color: #fff;
  opacity: 1;
  pointer-events: auto;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.dark-mode .chat-input-box.has-content .send-btn {
  color: #00335c;
}
.chat-input-box.has-content .send-btn:hover {
  transform: scale(1.05);
}

.close-btn {
  display: none;
  font-size: 0.9rem;
}
.chat-input-box.has-content .close-btn {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* 输入框下方预览词 */
.chat-input-preview {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--google-text-secondary);

  background-color: var(--google-bg);
  border-radius: 18px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);

  padding: 0 16px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-2px);
  pointer-events: none;
  margin-top: 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  transition:
    max-height 0.18s ease-out,
    opacity 0.18s ease-out,
    transform 0.18s ease-out,
    margin-top 0.18s ease-out,
    padding-top 0.18s ease-out,
    padding-bottom 0.18s ease-out;
}

.chat-input-box.has-content + .chat-input-preview {
  max-height: 176px;
  opacity: 1;
  transform: translateY(0);
  padding-top: 8px;
  padding-bottom: 8px;
  pointer-events: auto;
  margin-top: 4px;
}

.preview-item {
  padding: 4px 0;
  cursor: pointer;
}
.preview-item + .preview-item {
  border-top: 1px solid rgba(0,0,0,0.04);
}
.dark-mode .preview-item + .preview-item {
  border-top: 1px solid rgba(255,255,255,0.06);
}
.preview-item:hover {
  color: var(--google-text);
  background-color: rgba(0,0,0,0.03);
}
.dark-mode .preview-item:hover {
  background-color: rgba(255,255,255,0.06);
}

/* 首页中间布局：与频道一致的顶部 padding */
.content-wrapper .home-container {
  min-height: auto !important;
  display: flex;
  justify-content: center;
  padding: 40px 12px 12px;
}

/* 确保content-wrapper不会导致页面高度异常 */
.content-wrapper {
  /* min-height: auto !important; */
  height: auto !important;
  padding-bottom: 0 !important;
}

.content-wrapper .content {
  /* min-height: auto !important; */
  height: auto !important;
  padding-bottom: 0 !important;
}

/* 防止AdminLTE JS动态设置高度 */
body.layout-fixed .content-wrapper,
body.fixed .content-wrapper {
  /* min-height: auto !important; */
  height: auto !important;
  padding-top: 0 !important;
}

/* ========== 5. 搜索弹窗（首页 & 频道可共用） ========== */

.history-search-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.history-search-modal.open {
  display: flex;
  opacity: 1;
}
.history-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}
.history-search-dialog {
  position: relative;
  z-index: 2;
  width: 500px;
  max-width: 90%;
  background-color: var(--google-bg);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.2);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
  border: 1px solid var(--border-color);
}
.history-search-modal.open .history-search-dialog {
  transform: scale(1);
}
.history-search-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}
.history-search-body {
  padding: 20px;
}
#history-search-input {
  background-color: var(--input-bg);
  border: 1px solid transparent;
  color: var(--google-text);
  border-radius: 8px;
  padding: 12px;
}
#history-search-input:focus {
  background-color: var(--google-bg);
  border-color: var(--google-primary);
  box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

/* ========== 6. 产品卡片（首页热榜 + 频道卡片共用） ========== */

.product-nav-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.product-card {
  background-color: var(--chat-bg);
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  transition:
    border-color 0.15s var(--ease-curve),
    background-color 0.15s var(--ease-curve);
  text-decoration: none;
  color: inherit;
}

/* 排行榜卡片：在首页热榜里占满一整行 */
.rank-card {
  grid-column: 1 / -1;
}

.dark-mode .product-card {
  border-color: rgba(255,255,255,0.08);
  background-color: #202123;
}

.product-card:hover {
  border-color: rgba(11,87,208,0.2);
}
.dark-mode .product-card:hover {
  border-color: rgba(168,199,250,0.2);
  background-color: #232427;
}

.product-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  margin-right: 10px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #4f46e5, #22c55e);
  color: #ffffff;
}

.dark-mode .product-icon {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1);
}

.product-meta {
  min-width: 0;
  flex: 1;
}

.product-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--google-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-desc {
  font-size: 0.78rem;
  color: var(--google-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

/* 排行榜右侧：评论 + Like（仅首页热榜用） */
.rank-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.rank-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-size: 0.7rem;
  color: var(--google-text-secondary);
}
.rank-action i {
  font-size: 1.1rem;
  line-height: 1;
  margin-bottom: 2px;
}
.rank-action span {
  line-height: 1;
}
.dark-mode .rank-action {
  border-color: rgba(255,255,255,0.12);
}

/* 响应式列数 */
@media (max-width: 1200px) {
  .product-nav-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 992px) {
  .product-nav-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .product-nav-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .product-nav-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* ========== 7. 首页专用：热榜容器 + 热议话题 + Footer ========== */

/* 热榜外层区域（今日/昨日/本周/本月） */
.product-nav-section {
  width: 100%;
  padding: 64px 120px 48px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  background-color: var(--google-bg);
}
@media (max-width: 992px) {
  .product-nav-section {
    padding: 16px 24px 32px
  }
}
@media (max-width: 576px) {
  .product-nav-section {
    padding: 12px 12px 24px;
  }
}

/* 热榜顶部标题 + Tab */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--google-text);
  margin: 0;
}
.section-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tab-pill {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 4px 12px;
  font-size: 0.85rem;
  background: transparent;
  color: var(--google-text-secondary);
  cursor: pointer;
  outline: none;
}
.tab-pill:hover {
  background-color: rgba(0,0,0,0.04);
}
.dark-mode .tab-pill:hover {
  background-color: rgba(255,255,255,0.06);
}
.tab-pill.active {
  background-color: rgba(11,87,208,0.08);
  color: var(--google-primary);
  border-color: rgba(11,87,208,0.16);
}
.dark-mode .tab-pill.active {
  background-color: rgba(168,199,250,0.12);
  border-color: rgba(168,199,250,0.1);
  color: var(--google-primary);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}
.product-nav { width: 100%; }

/* 热议话题区块 */
.hot-topics-section {
  width: 100%;
  padding: 24px 120px 32px;
  box-sizing: border-box;
  border-top: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
  background-color: var(--google-bg);
}
.hot-topics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.hot-topics-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--google-text);
}
.hot-topics-more {
  font-size: 0.85rem;
  color: var(--google-primary);
  text-decoration: none;
  white-space: nowrap;
}
.hot-topics-more:hover {
  text-decoration: underline;
}
.hot-topics-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.topic-chip {
  border-radius: 999px;
  padding: 6px 18px;
  border: 1px solid var(--border-color);
  background-color: var(--chat-bg);
  font-size: 0.9rem;
  color: var(--google-text);
  white-space: nowrap;
}
.dark-mode .topic-chip {
  border-color: rgba(255,255,255,0.12);
}
@media (max-width: 992px) {
  .hot-topics-section {
    padding: 20px 24px 28px;
  }
}
@media (max-width: 576px) {
  .hot-topics-section {
    padding: 16px 16px 24px;
  }
}

/* 页脚：与二级域名内页统一 */
.google-footer {
  background-color: var(--google-bg);
  border-top: 1px solid var(--border-color);
  padding: 24px 120px 16px;
  color: var(--google-text-secondary);
  font-size: 0.85rem;
}
.footer-main {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 64px;
  margin-bottom: 16px;
}
.footer-column {
  min-width: 150px;
}
.footer-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--google-text);
}
.footer-link {
  display: block;
  margin-bottom: 4px;
  color: var(--google-text-secondary);
  text-decoration: none;
}
.footer-link:hover {
  color: var(--google-primary);
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 0.8rem;
}
.dark-mode .footer-bottom {
  border-top-color: rgba(255,255,255,0.06);
}
@media (max-width: 992px) {
  .google-footer {
    padding: 20px 24px 16px;
  }
}
@media (max-width: 576px) {
  .google-footer {
    padding: 16px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ========== 8. 频道页专用（AI 对话软件等二级域名） ========== */

.channel-main {
  width: 100%;
  /* 与首页 product-nav-section 保持相似左右留白 */
  padding: 32px 120px 40px;
  box-sizing: border-box;
}
@media (max-width: 992px) {
  .channel-main {
    padding: 16px 24px 32px;
  }
}
@media (max-width: 576px) {
  .channel-main {
    padding: 12px 12px 24px;
  }
}

.channel-header {
  margin-bottom: 16px;
}
.channel-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--google-text);
}
.channel-desc {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: var(--google-text-secondary);
}
.channel-search-hint {
  margin: 2px 0 8px;
  font-size: 0.85rem;
  color: var(--google-text-secondary);
}

.channel-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-pill {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 4px 12px;
  font-size: 0.85rem;
  background: transparent;
  color: var(--google-text-secondary);
}
.category-pill i {
  font-size: 0.9rem;
}
.category-pill:hover {
  background-color: rgba(0,0,0,0.04);
}
.dark-mode .category-pill:hover {
  background-color: rgba(255,255,255,0.06);
}
.category-pill.active {
  background-color: rgba(11,87,208,0.08);
  color: var(--google-primary);
  border-color: rgba(11,87,208,0.16);
}
.dark-mode .category-pill.active {
  background-color: rgba(168,199,250,0.12);
  border-color: rgba(168,199,250,0.1);
  color: var(--google-primary);
}

/* 频道卡片容器：直接用 product-nav-grid */
.channel-grid {
  margin-top: 8px;
}

/* 空状态文案 */
.channel-empty {
  padding: 32px 0;
  text-align: center;
  font-size: 0.9rem;
}

/* 保证卡片可点击区域外观 */
.channel-link-card {
  cursor: pointer;
}


/* ========== 9. 工具下拉（工具按钮） ========== */

.tools-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* PC & 移动统一向下展开 */
.tools-dropdown {
  position: absolute;
  top: 42px;           /* 工具按钮下方 */
  bottom: auto;
  right: 0;
  min-width: 140px;
  max-width: 180px;
  padding: 6px;
  border-radius: 18px;
  background: var(--google-surface, #f9fafb);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: none;
  z-index: 100;
}

.tools-dropdown.open {
  display: block;
}

.tools-dropdown-inner {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  overflow: hidden;
}

/* 工具项 */
.tools-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.tools-item + .tools-item {
  border-top: 0px solid rgba(148, 163, 184, 0.18);
}
.tools-item:hover {
  background: rgba(15, 23, 42, 0.04);
}

/* 图标样式 */
.tools-icon {
  font-size: 17px;
}
.tools-fa-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
}

/* label 文本 */
.tools-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--google-text, #111827);
}

/* 文字与图标颜色，跟随主题文字色 */
.tools-item,
.tools-item i,
.tools-icon,
.tools-label {
  color: var(--google-text);
}
.dark-mode .tools-item,
.dark-mode .tools-item i,
.dark-mode .tools-icon,
.dark-mode .tools-label {
  color: var(--google-text);
}

/* 夜间模式下工具弹层背景 */
.dark-mode .tools-dropdown {
  background: var(--google-surface, #202124);
  border-color: rgba(255,255,255,0.12);
}
.dark-mode .tools-dropdown-inner {
  background: #202124;
}
.dark-mode .tools-item:hover {
  background: rgba(255,255,255,0.06);
}

/* 移动端：宽度稍微放大一点，但仍较窄 */
@media (max-width: 768px) {
  .tools-dropdown {
    max-width: min(200px, 80vw);
  }
}