/* ============================================================
   成员页样式 members.css
   ============================================================ */

/* ---------- 页面标题区 ---------- */
.page-head {
  padding: calc(var(--header-h) + 62px) 0 34px;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.page-head::after {
  content: "";
  position: absolute;
  right: -100px; top: -140px;
  width: 420px; height: 420px;
  border: 1px solid rgba(63,199,221,.12);
  transform: rotate(45deg);
  pointer-events: none;
}
.breadcrumb {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--text-3);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent); }
.page-head h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: 2.5px;
}
.page-head h1 .accent { color: var(--accent); }
.page-head p { margin-top: 12px; color: var(--text-2); font-size: 15px; max-width: 620px; }

/* ---------- 工具栏：搜索 / 筛选 / 排序 ---------- */
.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  background: rgba(10, 15, 20, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

/* ---------- 手机端：往下滑自动折叠工具栏（2026-09-29 新增） ----------
   顶部导航（Logo + 汉堡菜单）不受影响，始终常驻；
   往下滚时把筛选按钮 / 排序 / 结果行收起来，把屏幕让给成员卡片，往上滚自动展开。 */
@media (max-width: 900px) {
  .toolbar { transition: padding .25s ease; }
  .toolbar .chips,
  .toolbar .sort-wrap,
  .toolbar .result-line {
    max-height: 260px;
    overflow: hidden;
    transition: max-height .32s ease, opacity .24s ease, margin .24s ease;
  }
  .toolbar.collapsed { padding: 10px 0; }
  .toolbar.collapsed .chips,
  .toolbar.collapsed .sort-wrap,
  .toolbar.collapsed .result-line {
    max-height: 0;
    opacity: 0;
    margin: 0;
    pointer-events: none;
  }
}
.search-box {
  position: relative;
  flex: 1 1 240px;
  min-width: 200px;
}
.search-box svg {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-3);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.search-box input::placeholder { color: var(--text-3); }
.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.search-clear {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: none;
  border-radius: 4px;
}
.search-clear:hover { color: var(--text); background: rgba(122,168,198,.1); }
.search-box.has-value .search-clear { display: block; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 2 1 320px;
}
.chips::-webkit-scrollbar { height: 4px; }
.chips::-webkit-scrollbar-track { background: transparent; }
.chips::-webkit-scrollbar-thumb { background: rgba(63,199,221,.35); border-radius: 2px; }
.chips { scrollbar-width: thin; scrollbar-color: rgba(63,199,221,.35) transparent; }
.chip {
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.active {
  color: #06222a;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.chip .chip-count {
  font-family: var(--mono);
  font-size: 11px;
  margin-left: 6px;
  opacity: .75;
}

.sort-wrap { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.sort-wrap label { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.sort-wrap select {
  height: 40px;
  padding: 0 34px 0 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
}

.result-line {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-3);
  letter-spacing: 1px;
}
.result-line b { color: var(--accent); font-weight: 600; }

/* ---------- 成员分类说明（v1.2 新增，位于筛选标签下方、成员卡片上方） ---------- */
.group-legend-section { padding: 26px 0 0; }
.group-legend {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 0 20px;
}
.group-legend > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  cursor: pointer;
  list-style: none;
  margin: 0 -20px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text);
}
.group-legend > summary::-webkit-details-marker { display: none; }
.group-legend > summary::before {
  content: "▍";
  color: var(--accent);
}
.group-legend > summary:hover { color: var(--accent); }
.group-legend .legend-hint {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .5px;
  color: var(--text-3);
}
.legend-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px 26px;
  margin: 4px 0 0;
  padding: 14px 0 4px;
  border-top: 1px dashed var(--line);
}
.legend-item {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  align-items: baseline;
  min-width: 0;
}
.legend-item dt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 56px;
  padding: 2px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
}
.legend-item .legend-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}
.legend-item dd {
  flex: 1 1 200px;
  margin: 0;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.legend-note {
  margin: 10px 0 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-3);
}
.legend-note b { color: var(--accent); font-weight: 600; }

/* ---------- 成员卡片网格 ---------- */
.members-section { padding: 34px 0 80px; }
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(262px, 1fr));
  gap: 20px;
}

.member-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 22px 20px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  /* 一次性入场动画（无 fill，结束后不影响 hover transform） */
  animation: card-in .45s var(--ease);
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.member-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity .25s;
}
.member-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
}
.member-card:hover::before { opacity: .9; }

/* 推荐角标 */
.star-badge {
  position: absolute;
  top: 12px; left: 12px;
  color: var(--warn);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  display: none;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.star-badge svg { width: 12px; height: 12px; flex: none; }
.member-card.is-featured .star-badge { display: inline-flex; }

/* 头像：Bilibili 入口（交互规范：点击头像 = 打开 B 站主页） */
.avatar-frame {
  position: relative;
  width: 108px; height: 108px;
  margin-bottom: 18px;
}
.avatar-link, .avatar-static {
  display: block;
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--line-strong);
  background: var(--bg-2);
}
.avatar-link { position: relative; }
.avatar-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .28s var(--ease);
}
.avatar-link:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim), 0 0 20px rgba(63,199,221,.35);
}
.avatar-link:hover img { transform: scale(1.08); }
/* 外链小角标：提示头像可点击 */
.ext-badge {
  position: absolute;
  right: -2px; bottom: -2px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #06222a;
}
.ext-badge svg { width: 13px; height: 13px; }

.member-card h3 { font-size: 17px; letter-spacing: .8px; }
.role-line {
  margin: 6px 0 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 1.2px;
  color: var(--accent);
}
.role-line .sep { color: var(--text-3); margin: 0 7px; }
.role-line .grp { color: var(--text-3); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 14px;
}
.tag-list li {
  font-size: 11.5px;
  color: var(--text-2);
  border: 1px solid var(--line);
  background: rgba(122,168,198,.04);
  border-radius: 3px;
  padding: 2px 9px;
}
.member-desc {
  font-size: 13px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  margin-top: auto;
  padding-top: 16px;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.demo-flag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--warn);
  border: 1px solid rgba(242,162,58,.35);
  border-radius: 3px;
  padding: 2px 7px;
}

/* ---------- 状态：加载 / 错误 / 空结果 ---------- */
.state-box {
  grid-column: 1 / -1;
  text-align: center;
  padding: 90px 20px;
  color: var(--text-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.state-box .state-icon {
  width: 44px; height: 44px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.state-box.loading .state-icon { border-top-color: var(--accent); animation: spin 1s linear infinite; }
.state-box h3 { font-size: 16px; margin-bottom: 8px; color: var(--text); }
.state-box p { font-size: 14px; color: var(--text-3); }
.state-box .btn { margin-top: 20px; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .toolbar-inner { flex-direction: column; align-items: stretch; }
  .search-box, .chips, .sort-wrap {
    flex: none;
    width: 100%;
    min-width: 0;
  }
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .sort-wrap { justify-content: space-between; }
  .sort-wrap select { flex: 1; }
  .member-grid { grid-template-columns: 1fr; gap: 16px; }
  .group-legend { padding: 0 14px; }
  .group-legend > summary { margin: 0 -14px; padding: 14px; }
  .legend-list { grid-template-columns: 1fr; }
  .legend-item { display: block; }
  .legend-item dt { display: inline-flex; margin-bottom: 4px; }
  .legend-item dd { font-size: 13px; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .member-grid { grid-template-columns: repeat(2, 1fr); }
}
