/* ===== 全局样式 ===== */
body {
  font-family: sans-serif;
  padding: 0;
  background: #f9f9f9;
}

/* ===== 外层容器container左边对齐 ===== */
.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 10px;
  box-sizing: border-box;
}

/* ===== 外层容器 ===== */
/* .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px;
  box-sizing: border-box;
} */

/* ===== 顶部冻结区域 ===== */
#topControlsWrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #f9f9f9;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #e0e0e0;
  border-bottom: none;
  position: relative; /* 绝对定位的参考容器 */
}

/* ===== 顶部控制区（冻结） ===== */
#topControls {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-bottom: 5px;
  background: #f9f9f9;
  background-color: #f9f9f9;
  border-bottom: 1px solid #e0e0e0;
  border-bottom: none; /* 去掉底部灰线 */
  box-shadow: none;    /* 如果有阴影也去掉 */
}

/* 搜索框占满宽度，和 Mod 卡片左对齐 */
#topControls input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  font-size: 16px;
}

/* 搜索框和 Mod 管理器左边线对齐 */
#topControls input {
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}




/* 缩略图 */
.thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 8px;
}

/* ===== 标题 + 收藏 ===== */
.mod-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

/* ===== mod卡片 ===== */
.mod-card h3 {
  font-size: 14px;
  margin: 4px 4px;
  text-align: left;
  flex: 1;
}

/* ===== 卡片部分 ===== */
.mod-card {
  
  /* width: 145px;
  flex: 0 0 145px; */

  background: white;
  border-radius: 8px;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.15);
  padding: 8px;
  display: flex;
  flex-direction: column;
  cursor:pointer;
}

/* ===== 文本 ===== */
.mod-card p {
  font-size: 13px;
  margin:1px 0;

  /* white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; */
}

/* ===== 英文名 ===== */
.mod-card h3 {
  font-size: 13px;
  line-height: 1.3;
  margin: 4px 0;
  
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 中文名 ===== */
.mod-cn {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* ===== 作者 ===== */
.mod-author {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}




/* 收藏按钮 */
.fav-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.fav-btn:hover {
  transform: scale(1.1);
}

.mod-desc {
  color: #555;
}

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  background: #eee;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  margin-right: 4px;
}

.tag-chip {
  display: inline-block;
  background-color: #e0e0e0;
  color: #333;
  padding: 5px 10px;
  border-radius: 15px;
  margin: 5px 5px 5px 0;
  cursor: pointer;
  font-size: 12px;
}

.tag-chip:hover {
  background-color: #b0b0b0;
}

.tag-chip.active {
  background-color: #ED974F;
  color: white;
}

/* ===== Nexus 链接 ===== */
.nexus-link {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 8px;
  background-color: #ED974F;
  color: white;
  border-radius: 12px;
  text-decoration: none;
  font-size: 12px;
}

.nexus-link:hover {
  opacity: 0.9;
}



/* ===== 收藏列表 ===== */
.fav-item {
  padding: 10px;
  margin: 6px auto;
  max-width: 400px;
  background: white;
  border-radius: 6px;
  box-shadow: 1px 1px 4px rgba(0,0,0,0.1);
  font-size: 14px;
}

.menu-btn {
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;

  color: #ED974F;              /* 橙色 */
  -webkit-tap-highlight-color: transparent; /* 干掉手机蓝色 */
}

.menu-btn:focus,
.menu-btn:active {
  color: #ED974F;
  outline: none;
}

.menu-btn {
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
}



/* ===== 遮罩 ===== */
#drawerMask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 200;
  display: none;
}

/* ===== 侧边栏 ===== */
.side-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: #f5f5f7;
  box-shadow: 2px 0 12px rgba(0,0,0,0.15);
  padding: 20px 16px;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 250;
}

.side-drawer.open {
  transform: translateX(0);
}

.side-drawer h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

/* ===== 收藏列表（Apple 风格） ===== */
.fav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fav-list li {
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  gap: 8px;
}

.fav-list li:hover {
  background: rgba(0,0,0,0.06);
}

.fav-index {
  color: #999;
  width: 20px;
  text-align: right;
}

.fav-title {
  flex: 1;
}

/* ========= 侧边栏遮罩 ========= */
#drawerMask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.3);
  display: none;
  z-index: 15;
}

/* ========= 侧边栏容器 ========= */
#sideDrawer {
  position: fixed;
  top: 0;
  left: -300px; /* 初始隐藏在左侧 */
  width: 280px;
  height: 100vh;
  background-color: #fff;
  box-shadow: 2px 0 8px rgba(0,0,0,0.15);
  border-right: 1px solid #eee;
  transition: left 0.3s ease;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#sideDrawer.open {
  left: 0;
}

/* ========= 侧边栏标题 ========= */
#sideDrawer h2 {
  margin: 0 15px 5px 15px;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
}

/* ========= 收藏列表 ========= */
#favoriteList {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1; /* 占满剩余高度 */
  overflow-y: auto; /* 支持滚动 */
}

#favoriteList li {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  font-size: 15px;
  border-bottom: 1px solid #f1f1f1;
  cursor: pointer;
  transition: background-color 0.15s ease;
  word-break: break-word; /* 自动换行 */
  white-space: normal;    /* 允许换行 */
}



#favoriteList li:hover {
  background-color: #f5f5f7;
}

.fav-index {
  font-weight: 500;
  color: #888;
  width: 28px;          /* 固定宽度，足够容纳 1~99 */
  text-align: right;    /* 右对齐序号 */
  margin-right: 8px;
  flex-shrink: 0;       /* 不收缩 */
}

.fav-title {
  flex: 1;
  white-space: normal;     /* 允许换行 */
  overflow: visible;       /* 不隐藏溢出 */
  text-overflow: unset;    /* 不显示省略号 */
  word-break: break-word;  /* 单词过长自动换行 */
}



/* 关闭按钮修改。关键：让 X 定位在侧边栏内部 */
.side-drawer {
  position: relative;   
}

#drawerCloseBtn {
  position: absolute;
  top: 20px;
  right: 12px;

  width: 32px;
  height: 32px;
  padding: 0;

  border: none;
  border-radius: 8px;
  background: transparent;

  font-size: 16px;
  line-height: 32px;
  text-align: center;

  color: #333;
  cursor: pointer;

  transition: background-color 0.2s ease, color 0.2s ease;
}

#drawerCloseBtn:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: #000;
}

.side-drawer h3 {
  padding-right: 40px;
}

.side-drawer h3 {
  margin-top: 0;
  padding: 12px 40px 12px 3px;
  border-bottom: 1px solid #eee;
}

.nexus-btn {
  background-color: #ED974F; /* 橙色 */
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 8px;
  transition:  0.2s;
}

.nexus-btn:hover {
  background-color: #f2954f;
}



/* 外层容器固定顶部 */
#topControlsWrapper {
  position: sticky;
  top: 0px; /* 距离上面白边 */
  z-index: 1000;
  background: #f9f9f9;
  padding-top: 5px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

/*标签部分隐藏*/
.tags {
  display: none;
}

.nexus-link-text {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.nexus-link-text:hover {
  color: #ED974F;
  text-decoration: underline;
}


/* 顶部第一行：菜单 + 标题 */
.top-row {
  display: flex;
  align-items: center;
  display: flex; align-items: center;
}



.top-row h1 {
  margin: 0 0 0 10px; /* 与菜单间距 */
  font-size: 20px;
  margin: 0 0 0 10px;
}

/* 顶部第二行：搜索框 */
#topControls {
  margin-top: 8px;
}

/* 顶部第二行：搜索框 */
#topControls input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  font-size: 16px;
  border: 1px solid #2a2929;
  border-radius: 6px;
  outline: none;
}

/* 点击 / 聚焦时的橙色效果 */
#search:focus,
#search:focus-visible {
  border-color: #ff8c00;
  box-shadow: 0 1px 6px rgba(255, 140, 0, 0.35);
}


/* 缩略图 */
.thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 8px;
}

/* ===== 收藏按钮 + 标题 ===== */
.mod-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}



.fav-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}



/* ===== 描述 ===== */
.mod-desc {
  color: #555;
  font-size: 12px;
  line-height: 1.3;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* ===== 描述 ===== */
.mod-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; /* 显示两行 */
  overflow: hidden;
  text-overflow: ellipsis;
}



/* 标签 */
.tag {
  display: inline-block;
  background: #eee;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  margin-right: 4px;
}

.tag-chip {
  display: inline-block;
  background-color: #e0e0e0;
  color: #333;
  padding: 5px 10px;
  border-radius: 15px;
  margin: 5px 5px 5px 0;
  cursor: pointer;
  font-size: 12px;
}

.tag-chip.active {
  background-color: #ED974F;
  color: white;
}


.mod-tags {
  overflow-x: auto;
  scrollbar-width: thin;     /* Firefox */
}

.mod-tags::-webkit-scrollbar {
  height: 1px;               /* Chrome / Edge */
}

.mod-tags::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.25);
  border-radius: 1px;
}

#modContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;/* 左对齐 */
  /* justify-content: space-between; 左右均分剩余空间 */
  padding-top: 0px; /* 卡片距离顶部白边距离避开顶部 */
  min-height: calc(100vh - 120px); /* 最小高度 */
  height: calc(100vh - 200px); /* sticky 高度 120px */
  overflow-y: auto;
  align-content: flex-start;     /* 多行对齐，不拉满容器 */
  margin-top: 10px;
  padding-bottom: 110px;
}


.mod-card {
  /* flex: 0 0 calc((100% - 10px - 20px) / 2); 100% - gap - padding*2 */
  flex: 0 0 calc(50% - 5px); /* 50% - gap/2 */
  width: calc((100% - 10px - 20px) / 2);
  box-sizing: border-box;
}


/* @media (min-width: 1025px) {
  #modContainer .mod-card {
    width: 188px;  /* 原始卡片宽度 */
    /* flex: 0 0 188px;
    box-sizing: border-box;
  }
} */ 

/* iPad 竖屏 768px 以上 */
@media (min-width: 768px) {
  .mod-card {
    flex: 1 1 calc(33.333% - 10px);
    max-width: calc(33.333% - 10px);
  }
}

/* 13寸笔记本 1024px 以上 */
@media (min-width: 1024px) {
  .mod-card {
    flex: 1 1 calc(16.666% - 10px); /* 6列 */
    max-width: calc(16.666% - 10px);
  }
}

/* 大屏 1440px 以上 */
@media (min-width: 1440px) {
  .mod-card {
    flex: 1 1 calc(14.285% - 10px); /* 7列 */
    max-width: calc(14.285% - 10px);
  }
}

/* 超大屏 1600px 以上 */
@media (min-width: 1600px) {
  .mod-card {
    flex: 1 1 calc(12.5% - 10px); /* 8列 */
    max-width: calc(12.5% - 10px);
  }
}


/* 手机 2列，每行最后一个去掉右边间距 */
.mod-card:nth-child(2n) {
  margin-right: 0;
}

/* iPad 3列，每行最后一个去掉右边间距 */
@media (min-width: 768px) {
  .mod-card:nth-child(3n) {
    margin-right: 0;
  }
}

/* 13寸笔记本 6列 */
@media (min-width: 1024px) {
  .mod-card:nth-child(6n) {
    margin-right: 0;
  }
}

/* 大屏 7列 */
@media (min-width: 1440px) {
  .mod-card:nth-child(7n) {
    margin-right: 0;
  }
}

/* 超大屏 8列 */
@media (min-width: 1600px) {
  .mod-card:nth-child(8n) {
    margin-right: 0;
  }
}


/* 统一重置 sticky 顶部容器内部间距 */
#topControlsWrapper {
  padding-top: 10px;      /* 顶部内边距 */
  padding-bottom: 0px;    /* 去掉底部多余空白 */
  border-bottom: 1px solid #e0e0e0; /* 灰线 */
}

/* 标签栏 */
@media(max-width: 768px) {
  #tagContainer {
    max-height: 50px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* 平滑滚动 */
    white-space: nowrap;

    margin-top: 0;      /* 去掉上方额外空白 */
    margin-bottom: 4px; /* tags 和灰线间距 */

    display: flex;      /* 👈 加这个 */
    flex-wrap: nowrap;  /* 👈 明确禁止换行 */
  }

  #tagContainer .tag-chip {
    display: inline-block;
    margin-right: 5px;
  }

  /* 隐藏滚动条箭头 */
  #tagContainer ::-webkit-scrollbar-button {
    display: none;
  }

  /* topControls 与 tags 的间距 */
  #topControls {
    margin-bottom: 4px; /* 搜索框和 tags 间距 */
    background: #ffffff;
  }
  #tagContainer .tag-chip {
    display: inline-block;
    margin-right: 5px;
  }

}


@media(min-width: 769px) {
  /* ===== 标签栏 ===== */
  #tagContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    max-height: 150px;          /* 两行高度（非常关键） */
    overflow: hidden;
    transition: max-height 0.25s ease;
    margin-bottom: 4px;
  }

  /* 展开状态 */
  #tagContainer.expanded {
    max-height: 1000px;        /* 足够大即可 */
  }

  /* 标签 */
  #tagContainer .tag-chip {
    line-height: 20px;
    margin-bottom: 4px;
  }
}

#sideDrawer h3,
#drawerCloseBtn {
  margin-left: 25px; /* 和 side-drawer 内边距一致 */
}


html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  overflow: hidden;
  scrollbar-gutter: stable;
}


/* ===== tags：横向滚动但无箭头 ===== */
#tags {
  overflow-x: auto;
  scrollbar-width: none;
}

#tags::-webkit-scrollbar {
  height: 0;
}

#tags::-webkit-scrollbar-button {
  display: none;
}

/* ===== 卡片区：纵向滚动但无箭头 ===== */
#modContainer {
  scrollbar-width: none;
}

#modContainer::-webkit-scrollbar {
  width: 0;
}

#modContainer::-webkit-scrollbar-button {
  display: none;
}

.drawer-header {
  cursor: pointer;
  padding: 8px 12px;
  font-weight: bold;
  border-bottom: 1px solid #eee;
}

.drawer-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.drawer-arrow {
  font-size: 30px;
  transition: transform 0.2s ease;
}


.kr-link {
  margin-left: 6px;
  padding: 2px 6px;
  background: #4caf50;
  color: white;
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
}



.drawer-item a {
  font-weight: 500;
  text-decoration: none;
}

.drawer-item {
  display: flex;
  align-items: center;
  justify-content: space-between; 
  padding: 5px 5px;
  font-size: 15px;
  border-bottom: 1px solid #f1f1f1;
  cursor: pointer;
  transition: background-color 0.15s ease;
  margin: 0;
}

.kr-link {
  margin-left: 8px;
  padding: 4px 6px;
  background: #4caf50;
  color: white;
  border-radius: 6px;
  font-weight: bold;
  font-size: 13px;
  text-decoration: none;
  flex-shrink: 0;   /* ⭐ 防止被挤 */
}

.nav-item {
  justify-content: flex-start; /* ✅ 和收藏左半边一致 */
}

.drawer-item:hover {
  background-color: #f5f5f7;
}

/* 左侧文本 */
.drawer-item .item-title {
  flex: 1;
  font-size: 15px;        /* ✅ 与 fav-title 完全一致 */
  font-weight: 400;
  line-height: 1.4;
  word-break: break-word;
  white-space: normal;
}

.nav-desc {
  font-size: 12px;
  color: #666;
}
.drawer-list {
  max-height: 600px;   /* 和收藏一致即可 */
  overflow-y: auto; /* 支持滚动 */
}

/* 可选：滚动条更细一点（WebKit） */
.drawer-list::-webkit-scrollbar {
  width: 6px;
}

.drawer-list::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
}

#krList,
#navList {
  margin: 0;
  padding: 5px;
  list-style: none;
}

#navList a {
  color: #333;
  text-decoration: none;
}

#navList a:visited {
  color: #333;
}

#navList a:hover {
  color: #333;     /* Apple 蓝 / 或你喜欢的色 */
  text-decoration: underline;
}

#navList a:active {
  opacity: 0.7;
}
