/**
 * 工作区统一布局（聊天同款：左侧菜单 + 右侧内容）
 * 用于：收藏、网盘，以及后续同类页面
 *
 * 资源约定（性能）：
 * - 页面走 layout/center 的 IM 轻量模式（meta_im + require-im）
 * - 只用 bootstrap / font-awesome / layer / 本文件 + favorite.css
 * - 不要再引入 frontend.min.css、moment、bootstrap-table 等后台大包
 *
 * 结构约定：
 * <div class="ws-app" id="...">
 *   <aside class="ws-side">...</aside>
 *   <section class="ws-main">
 *     <div class="ws-toolbar">...</div>
 *     <div class="ws-body">...</div>
 *   </section>
 * </div>
 */

.ws-app {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #f0f2f5;
  overflow: hidden;
}

.ws-side {
  width: 260px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.ws-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.ws-side-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #111;
  line-height: 1.3;
}

.ws-side-head .btn-link {
  padding: 4px 8px;
  color: #576b95;
}

.ws-side-tip {
  margin: 0;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.45;
  color: #999;
  border-bottom: 1px solid #f5f5f5;
  flex-shrink: 0;
}

.ws-side-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.ws-side-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  -webkit-overflow-scrolling: touch;
}

.ws-side-scroll > .ws-side-nav,
.ws-side-nav--static {
  flex: none;
  overflow: visible;
}

.ws-side-section {
  padding: 4px 0 8px;
  border-top: 1px solid #f0f0f0;
}

.ws-side-section-title {
  padding: 8px 16px 4px;
  font-size: 12px;
  color: #999;
  font-weight: 500;
}

.ws-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.ws-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  color: #333;
  font-size: 14px;
  margin-bottom: 2px;
  line-height: 1.3;
}

.ws-nav-item:hover {
  background: #f5f5f5;
}

.ws-nav-item.is-active {
  background: #e8f5e9;
  color: #2e7d32;
}

.ws-nav-item > i:first-child,
.ws-nav-item .ws-nav-icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.85;
}

.ws-nav-item .ws-nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-nav-item .ws-nav-count {
  margin-left: auto;
  font-size: 12px;
  color: #999;
  flex-shrink: 0;
}

.ws-nav-item .ws-nav-actions {
  display: none;
  gap: 2px;
  flex-shrink: 0;
}

.ws-nav-item:hover .ws-nav-actions {
  display: flex;
}

.ws-nav-item .ws-nav-actions .btn {
  padding: 0 4px;
  color: #999;
  line-height: 1;
}

.ws-nav-section {
  margin: 10px 8px 6px;
  font-size: 12px;
  color: #999;
}

.ws-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f5f6f8;
  overflow: hidden;
}

.ws-toolbar {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ws-toolbar-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #222;
  margin-right: 4px;
}

.ws-search {
  position: relative;
  flex: 1;
  min-width: 140px;
  max-width: 280px;
}

.ws-search i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  pointer-events: none;
}

.ws-search input {
  padding-left: 30px;
  height: 34px;
  border-radius: 6px;
}

.ws-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ws-type-tab {
  border: 0;
  background: #f0f0f0;
  color: #555;
  border-radius: 14px;
  padding: 5px 12px;
  font-size: 13px;
  line-height: 1.2;
}

.ws-type-tab.is-active {
  background: #07c160;
  color: #fff;
}

.ws-btn-primary {
  background: #07c160;
  border-color: #07c160;
  color: #fff;
  border-radius: 6px;
  white-space: nowrap;
}

.ws-btn-primary:hover,
.ws-btn-primary:focus {
  background: #06ad56;
  border-color: #06ad56;
  color: #fff;
}

.ws-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px 24px;
  -webkit-overflow-scrolling: touch;
}

.ws-body-more {
  text-align: center;
  padding: 4px 0 12px;
}

.ws-empty {
  text-align: center;
  color: #999;
  padding: 64px 20px;
  font-size: 14px;
  line-height: 1.6;
}

.ws-empty i {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.7;
}

@media (max-width: 768px) {
  .ws-app {
    flex-direction: column;
  }

  .ws-side {
    width: 100%;
    max-height: 42%;
    border-right: 0;
    border-bottom: 1px solid #e8e8e8;
  }

  .ws-main {
    flex: 1;
    min-height: 0;
  }

  .ws-toolbar .ws-btn-primary {
    width: 100%;
  }

  .ws-search {
    max-width: none;
    width: 100%;
    flex: 1 1 100%;
  }
}
