/* =========================================================
   Z-Library 搜索块：标签页 + 宽搜索框 + 搜索设置 + 分享
   ========================================================= */

.zl-search {
  width: 100%;
  margin: 18px auto 0;
  text-align: left;
}

/* ---------- 标签页 ---------- */
.search-tabs {
  display: flex;
  gap: 4px;
  padding-left: 24px;
}
.search-tab {
  padding: 8px 16px;
  background: #26282C;
  border: 1px solid #3A3D42;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  color: #8C8C8C;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}
.search-tab:hover { color: #FAFAFA; }
.search-tab.active {
  color: #FAFAFA;
  font-weight: 500;
  background: #1E1F22;
  border-color: #3A3D42;
  border-bottom: 1px solid #1E1F22;
  margin-bottom: -1px;
}

/* ---------- 输入框 ---------- */
.search-field {
  display: flex;
  height: 62px;
  background: #1E1F22;
  border: 1px solid #3A3D42;
}
.search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 24px;
  background: transparent;
  border: none;
  outline: none;
  color: #FAFAFA;
  font-size: 17px;
}
.search-field input::placeholder { color: #8C8C8C; }
.search-field button {
  width: 150px;
  flex-shrink: 0;
  background: #2B2D31;
  border: none;
  border-left: 1px solid #3A3D42;
  color: #FAFAFA;
  font-size: 17px;
  cursor: pointer;
  transition: background-color .15s ease;
}
.search-field button:hover { background: #3A3D42; }

/* ---------- 下方工具行 ---------- */
.search-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.search-settings-wrap { position: relative; }
.search-settings {
  padding: 0 0 2px;
  background: none;
  border: none;
  border-bottom: 1px dotted #8C8C8C;
  color: #8C8C8C;
  font-size: 14px;
  cursor: pointer;
}
.search-settings:hover { color: #FAFAFA; border-bottom-color: #FAFAFA; }
.search-settings-panel {
  position: absolute;
  top: 30px;
  left: 0;
  z-index: 60;
  width: 252px;
  padding: 12px;
  background: #2B2D31;
  border: 1px solid #3A3D42;
  border-radius: 6px;
  box-shadow: 0 16px 24px rgba(0, 0, 0, .3);
}
.search-settings-panel[hidden] { display: none; }
.search-settings-panel .opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  color: #FAFAFA;
  font-size: 13px;
  cursor: pointer;
}
.search-settings-panel .opt input { accent-color: #49AFD0; }
.opt-clear {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  background: #1E1F22;
  border: 1px solid #3A3D42;
  border-radius: 4px;
  color: #BFBFBF;
  font-size: 13px;
  cursor: pointer;
}
.opt-clear:hover { border-color: #49AFD0; color: #FAFAFA; }

/* ---------- 分享 ---------- */
.share-row {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #BFBFBF;
  font-size: 14px;
}
.share-row > span { margin-right: 6px; }
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 3px;
  color: #fff;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
}
.share-btn:hover { filter: brightness(1.12); color: #fff; }
.share-btn.fb { background: #4267B2; }
.share-btn.tw { background: #1DA1F2; }
.share-btn.wa { background: #25D366; }
.share-btn.tg { background: #229ED9; }
.share-btn.li { background: #0A66C2; }
.share-btn.mail { background: #8B6B5D; }
.share-btn.link { background: #4DB8D4; }

/* ---------- 复制提示 ---------- */
.zl-search-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 2100;
  padding: 9px 18px;
  background: #2B2D31;
  border: 1px solid #3A3D42;
  border-radius: 4px;
  color: #FAFAFA;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.zl-search-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 亮色 ---------- */
html[data-theme="light"] .search-tab {
  background: #F4F7F9;
  border-color: #D9D9D9;
  color: #8C8C8C;
}
html[data-theme="light"] .search-tab:hover { color: #2B2D31; }
html[data-theme="light"] .search-tab.active {
  background: #FFFFFF;
  border-color: #D9D9D9;
  border-bottom-color: #FFFFFF;
  color: #2B2D31;
}
html[data-theme="light"] .search-field {
  background: #FFFFFF;
  border-color: #D9D9D9;
}
html[data-theme="light"] .search-field input { color: #2B2D31; }
html[data-theme="light"] .search-field button {
  background: #F4F7F9;
  border-left-color: #D9D9D9;
  color: #2B2D31;
}
html[data-theme="light"] .search-field button:hover { background: #E9EEF1; }
html[data-theme="light"] .search-settings { color: #595959; border-bottom-color: #8C8C8C; }
html[data-theme="light"] .search-settings:hover { color: #2B2D31; border-bottom-color: #2B2D31; }
html[data-theme="light"] .search-settings-panel { background: #FFFFFF; border-color: #D9D9D9; }
html[data-theme="light"] .search-settings-panel .opt { color: #2B2D31; }
html[data-theme="light"] .opt-clear {
  background: #F4F7F9;
  border-color: #D9D9D9;
  color: #595959;
}
html[data-theme="light"] .opt-clear:hover { border-color: #1E7FA0; color: #2B2D31; }
html[data-theme="light"] .share-row { color: #595959; }
html[data-theme="light"] .zl-search-toast {
  background: #FFFFFF;
  border-color: #D9D9D9;
  color: #2B2D31;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .zl-search { margin-top: 14px; }
  .search-tabs { padding-left: 10px; }
  .search-tab { padding: 7px 12px; font-size: 13px; }
  .search-field { height: 52px; }
  .search-field input { padding: 0 14px; font-size: 15px; }
  .search-field button { width: 88px; font-size: 15px; }
  .search-meta { align-items: flex-start; }
  .share-row { flex-wrap: wrap; }
  .share-row > span { width: 100%; margin: 0 0 2px; }
  .search-settings-panel { width: 236px; }
}
@media (max-width: 520px) {
  .share-row > span { display: none; }
  .share-btn { width: 26px; height: 26px; font-size: 14px; }
  .search-field button { width: 76px; }
}
