/* =========================================================
 * 知识库广场样式（plaza.css）
 * ========================================================= */

.plaza-wrap { max-width: 1180px; margin: 0 auto; padding: 16px 24px 60px; }

/* ---------- 头图 ---------- */
.plaza-hero { text-align: center; padding: 8px 0 2px; }
.plaza-hero h1 { margin: 0; line-height: 1.35; }
.plaza-hero h1 {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 30px; font-weight: 900; letter-spacing: 2px;
  background: linear-gradient(90deg, #ff006e, #8338ec, #00b4d8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.plaza-hero p { color: #8a94a6; font-size: 13.5px; margin-top: 8px; }

/* ---------- 工具条 ---------- */
.plaza-toolbar { display: flex; align-items: center; margin: 22px 0 18px; }
.plaza-tabs { display: flex; gap: 8px; }
.plaza-tab {
  border: 1.5px solid #eceef5; background: #fff; color: #6b7280;
  padding: 7px 22px; border-radius: 20px; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all .18s;
}
.plaza-tab:hover { border-color: #ffb38a; color: #ff006e; }
.plaza-tab.active {
  background: linear-gradient(135deg, #ff006e, #ff8f5e); border-color: transparent; color: #fff;
  box-shadow: 0 6px 18px -8px rgba(255, 0, 110, .55);
}
.plaza-toolbar .kn-btn { margin-left: auto; }

/* ---------- 分类快捷筛选 ---------- */
.plaza-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.plaza-cat {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1.5px solid #eceef5; background: #fff; color: #6b7280;
  padding: 7px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  font-family: inherit; transition: all .18s;
}
.plaza-cat:hover { border-color: #ffb38a; color: #ff006e; }
.plaza-cat.active {
  background: var(--cc, #ff006e); border-color: transparent; color: #fff;
  box-shadow: 0 10px 22px -14px var(--cc, #ff006e);
}
.plaza-cat-ico { font-size: 13px; line-height: 1; }
.plaza-cat-n {
  background: rgba(15, 23, 42, .06); color: inherit; border-radius: 999px;
  padding: 1px 7px; font-size: 11px; font-weight: 800;
}
.plaza-cat.active .plaza-cat-n { background: rgba(255, 255, 255, .26); }

/* ---------- 分类分组 ---------- */
.plaza-groups { display: block; }
.plaza-group { margin-bottom: 34px; }
.plaza-group:last-child { margin-bottom: 0; }
.plaza-group-head {
  display: flex; align-items: center; gap: 9px;
  margin: 2px 0 14px; padding-bottom: 10px; border-bottom: 1px dashed #f0e9e2;
}
.plaza-group-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.plaza-group-ico { font-size: 17px; line-height: 1; }
.plaza-group-name { font-size: 17px; font-weight: 800; color: #2b2f44; letter-spacing: .4px; }
.plaza-group-count {
  background: #fff2e9; color: #ff006e; font-size: 11px; font-weight: 800;
  padding: 2px 9px; border-radius: 999px;
}
.plaza-group-desc { color: #a5abbd; font-size: 12px; }
.plaza-group-toggle {
  margin-left: auto; border: none; background: transparent; cursor: pointer;
  color: #a5abbd; font-size: 12px; font-weight: 700; font-family: inherit;
  padding: 4px 8px; border-radius: 8px; transition: all .18s;
}
.plaza-group-toggle:hover { color: #ff006e; background: #fff7f2; }
.plaza-group-body {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px;
}

/* ---------- 卡片网格 ---------- */
.plaza-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px;
}
.plaza-card {
  background: #fff; border-radius: 18px; padding: 20px 22px 16px;
  border: 1px solid #f0e9e2; box-shadow: 0 10px 30px -18px rgba(40, 30, 20, .25);
  transition: transform .2s, box-shadow .2s; position: relative; overflow: hidden;
  cursor: pointer;
}
.plaza-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--pc, #ff006e);
}
.plaza-card:hover { transform: translateY(-4px); box-shadow: 0 22px 44px -20px rgba(40, 30, 20, .35); }

.plaza-card-top { display: flex; align-items: center; }
.plaza-ico {
  width: 46px; height: 46px; border-radius: 14px; background: #f7f4ef;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.plaza-vis {
  margin-left: auto; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.plaza-vis.v1 { background: #e7fbf2; color: #06a96e; }
.plaza-vis.v2 { background: #eef0f6; color: #6b7280; }
.plaza-vis.v3 { background: #fff2e8; color: #e2711d; }
.plaza-vis.v4 { background: #e8f1ff; color: #2563eb; }

.plaza-name {
  margin: 14px 0 6px; font-size: 17px; font-weight: 800; color: #2b2f44;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plaza-desc {
  color: #8a94a6; font-size: 12.5px; line-height: 1.7; height: 42px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.plaza-meta {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px;
  color: #a5abbd; font-size: 11.5px;
}
.plaza-actions { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #f0e9e2; display: flex; gap: 8px; }

.plaza-empty { grid-column: 1 / -1; text-align: center; padding: 70px 20px; color: #a5abbd; }
.plaza-empty-ico { font-size: 44px; margin-bottom: 12px; }
.plaza-loading { grid-column: 1 / -1; text-align: center; padding: 60px; color: #a5abbd; }

/* ---------- 新建 / 编辑弹窗 ---------- */
.plaza-mask {
  position: fixed; inset: 0; background: rgba(20, 22, 38, .5); z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.plaza-mask.show { display: flex; }
.plaza-modal {
  background: #fff; border-radius: 18px; width: 520px; max-width: 100%; max-height: 92vh; overflow: auto;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .4); animation: plazaPop .22s ease;
}
@keyframes plazaPop { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.plaza-modal-head { padding: 16px 20px; border-bottom: 1px solid #f0e9e2; display: flex; align-items: center; }
.plaza-modal-head h3 { font-size: 16px; font-weight: 800; color: #2b2f44; }
.plaza-modal-close { margin-left: auto; cursor: pointer; color: #a5abbd; font-size: 18px; }
.plaza-modal-body { padding: 18px 20px 6px; }
.plaza-modal-foot { padding: 14px 20px; border-top: 1px solid #f0e9e2; display: flex; justify-content: flex-end; gap: 10px; }

.plaza-form-item { margin-bottom: 14px; }
.plaza-form-item > label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 6px; font-weight: 700; }
.plaza-form-item > label i { color: #ff006e; font-style: normal; }
.plaza-input {
  width: 100%; height: 38px; border: 1.5px solid #e5e7f0; border-radius: 10px;
  padding: 0 12px; font-size: 13px; color: #2b2f44; outline: none; background: #fff;
}
.plaza-input:focus { border-color: #ff8f5e; box-shadow: 0 0 0 3px rgba(255, 0, 110, .12); }
.plaza-form-row { display: flex; gap: 12px; }
.plaza-form-row .plaza-form-item { flex: 1; }

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
  .plaza-wrap { padding: 16px 14px 40px; }
  .plaza-hero h1 { font-size: 24px; }
  .plaza-toolbar { flex-wrap: wrap; gap: 10px; }
  .plaza-toolbar .kn-btn { margin-left: 0; }
  .plaza-grid { grid-template-columns: 1fr; }
  .plaza-cats { gap: 6px; margin-bottom: 18px; }
  .plaza-cat { padding: 6px 12px; font-size: 12px; }
  .plaza-group { margin-bottom: 26px; }
  .plaza-group-name { font-size: 15.5px; }
  .plaza-group-desc { display: none; }
  .plaza-group-body { grid-template-columns: 1fr; }
}

/* =========================================================
   v2.0 广场改造：双Tab横幅 / 搜索 / 二级筛选 / 三类卡片 /
   联动标签 / 悬浮预览 / 收藏 / 机构申请授权
   ========================================================= */

.plaza-hero-sub { color: #8a94a6; font-size: 13px; margin-top: 8px; }

/* ---------- ① 双 Tab 横幅（机构授权默认） ---------- */
.plaza-banner {
  background: linear-gradient(135deg, #fffaf0, #fffdf8);
  border: 1px solid #f5e3c8; border-radius: 16px;
  padding: 0; margin: 4px 0 14px; overflow: hidden;
}
.pb-tabs { display: flex; gap: 0; border-bottom: 1px solid #f5e3c8; background: #fff8ec; }
.pb-tab {
  border: none; background: transparent; cursor: pointer; font-family: inherit;
  font-size: 13.5px; font-weight: 800; color: #a29880; padding: 11px 22px;
  border-bottom: 2.5px solid transparent;
}
.pb-tab:hover { color: #ff006e; }
.pb-tab.on { color: #ff006e; border-bottom-color: #ff006e; background: #fff; }
.pb-pane { display: none; align-items: center; gap: 16px; padding: 15px 20px; flex-wrap: wrap; }
.pb-pane.on { display: flex; }
.pb-pane-org { background: linear-gradient(135deg, #fff7ee, #fffdf8); }
.pb-pane-vip { background: linear-gradient(135deg, #fffaf0, #fffef9); }
.pb-txt { flex: 1 1 380px; min-width: 0; }
.pb-txt b { display: block; font-size: 15px; color: #7a4a12; margin-bottom: 4px; }
.pb-pane-vip .pb-txt b { color: #a07314; }
.pb-txt span { font-size: 12.5px; color: #a29880; line-height: 1.7; }
.pb-btn {
  display: inline-block; border: none; cursor: pointer; font-family: inherit;
  font-size: 13.5px; font-weight: 800; color: #fff; text-decoration: none;
  padding: 10px 24px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 6px 16px -6px rgba(255, 0, 110, .5);
  transition: transform .16s;
}
.pb-btn:hover { transform: translateY(-2px); }
.pb-btn-org { background: linear-gradient(135deg, #ff8a4d, #ff006e); }
.pb-btn-vip { background: linear-gradient(135deg, #f0b13c, #d99a1f); }

/* ---------- ② 全局搜索 ---------- */
.plaza-searchbar { margin: 0 0 4px; }
.plaza-search-box {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid #eceef5; border-radius: 14px;
  padding: 4px 14px 4px 6px; transition: border-color .18s, box-shadow .18s;
}
.plaza-search-box:focus-within { border-color: #ff8f5e; box-shadow: 0 0 0 4px rgba(255, 0, 110, .1); }
.plaza-search-ico { font-size: 16px; padding: 0 4px 0 8px; }
.plaza-search-box input {
  flex: 1; border: none; outline: none; height: 40px; font-size: 14px; color: #2b2f44;
  background: transparent; font-family: inherit; min-width: 0;
}
.plaza-search-box input::placeholder { color: #b6bccd; }
.plaza-search-clear {
  border: none; background: #f2f3f8; color: #8a94a6; cursor: pointer;
  width: 24px; height: 24px; border-radius: 50%; font-size: 12px; flex: 0 0 auto;
}
.plaza-search-clear:hover { background: #ffe9dd; color: #ff006e; }

/* ---------- ③ 二级筛选面板 ---------- */
.plaza-adv-toggle {
  margin-left: auto; border: 1.5px solid #eceef5; background: #fff; color: #6b7280;
  padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.plaza-adv-toggle:hover { border-color: #ffb38a; color: #ff006e; }
.plaza-toolbar .kn-btn { margin-left: 0; }
.plaza-adv {
  background: #fff; border: 1px solid #f0e9e2; border-radius: 14px;
  padding: 14px 18px; margin: -6px 0 14px;
}
.plaza-adv-row { display: flex; align-items: baseline; gap: 12px; padding: 6px 0; flex-wrap: wrap; }
.plaza-adv-label { flex: 0 0 64px; font-size: 12px; font-weight: 800; color: #8a94a6; }
.plaza-adv-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.plaza-chip {
  border: 1px solid #eceef5; background: #fafbfd; color: #6b7280; cursor: pointer;
  font-size: 12px; font-weight: 700; padding: 5px 14px; border-radius: 999px; font-family: inherit;
  transition: all .15s;
}
.plaza-chip:hover { color: #ff006e; border-color: #ffc9a3; }
.plaza-chip.on {
  background: linear-gradient(135deg, #ff8a4d, #ff006e); border-color: transparent; color: #fff;
  box-shadow: 0 4px 10px -4px rgba(255, 0, 110, .5);
}

/* ---------- ④ 快捷直达标签 ---------- */
.plaza-quicktags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -8px 0 20px; }
.plaza-quicktip { font-size: 12px; color: #a5abbd; }
.plaza-quicktag {
  border: 1px dashed #ffd0b0; background: #fff7f2; color: #ff006e; cursor: pointer;
  font-size: 12px; font-weight: 700; padding: 5px 14px; border-radius: 999px; font-family: inherit;
  transition: all .15s;
}
.plaza-quicktag:hover { background: #ffe9dd; border-style: solid; transform: translateY(-1px); }

/* ---------- ⑤ 三类卡片标识 ---------- */
.plaza-card.card-official { border-color: #ffd9c0; background: linear-gradient(180deg, #fffaf3, #fff); }
.plaza-card.card-org { border-color: #c9dcff; background: linear-gradient(180deg, #f7faff, #fff); }
.plaza-top-tags { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 70%; }
/* 覆盖 pay.css v1 的绝对定位价格角标：来源/权限标签走正常文档流，暖浅色系 */
.plaza-top-tags .plaza-card-tag {
  position: static; backdrop-filter: none;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; line-height: 1.5;
  color: #6b7280; background: #f2f3f8;
}
.plaza-top-tags .plaza-card-tag.tag-official { background: #fff1e8; color: #ff006e; }
.plaza-top-tags .plaza-card-tag.tag-org { background: #e8f1ff; color: #2f6fd6; }
.plaza-top-tags .plaza-card-tag.tag-user { background: #fdf6dd; color: #b8860b; }
.plaza-top-tags .plaza-card-tag.tag-pwd { background: #f2f3f8; color: #6b7280; }
.plaza-top-tags .plaza-card-tag.tag-member { background: #e8f7ef; color: #0d9668; }
.plaza-top-tags .plaza-card-tag.tag-vip { background: #fdf3d9; color: #d4a017; }
.plaza-top-tags .plaza-card-tag.tag-paid { background: #f0eaff; color: #7a5af5; }
.plaza-top-tags .plaza-card-tag.tag-class { background: #e6f6fb; color: #1d8fb8; }

/* ---------- ⑥ 维度标签 / 联动标签 ---------- */
.plaza-dims { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.plaza-dim { font-size: 11px; font-weight: 700; padding: 2.5px 10px; border-radius: 999px; }
.dim-aud { background: #e8f3ff; color: #3a7bd5; }
.dim-stage { background: #eeeaff; color: #7a5af5; }
.dim-stage.dim-hot { background: #fdecec; color: #d43c3c; }
.dim-type { background: #e6fbf4; color: #05b38a; }
.dim-csphigh { background: #fff1e8; color: #ff006e; border: 1px dashed #ffb38a; }
.dim-audit { background: #fdf6dd; color: #b8860b; }
.plaza-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.plaza-linktag {
  font-size: 11.5px; font-weight: 700; color: #2f6fd6; text-decoration: none;
  background: #f3f8ff; border: 1px solid #d8e6ff; padding: 3px 11px; border-radius: 999px;
  transition: all .15s;
}
.plaza-linktag:hover { background: #e8f1ff; transform: translateY(-1px); }

/* ---------- ⑦ 收藏按钮 ---------- */
.plaza-fav {
  position: absolute; right: 14px; bottom: 14px; z-index: 3;
  border: none; background: transparent; cursor: pointer; font-family: inherit;
  font-size: 19px; color: #c9cede; line-height: 1; padding: 4px;
  transition: transform .15s, color .15s;
}
.plaza-fav:hover { color: #f0b13c; transform: scale(1.2); }
.plaza-fav.on { color: #f0b13c; }

/* ---------- ⑧ 操作区差异化 ---------- */
.plaza-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-right: 30px; }
.plaza-orgapply {
  font-size: 12.5px; font-weight: 700; color: #2f6fd6; text-decoration: none;
  border: 1px solid #c9dcff; background: #f3f8ff; padding: 6px 14px; border-radius: 999px;
}
.plaza-orgapply:hover { background: #e8f1ff; }
.plaza-buy-btn {
  border: none; cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, #ff8a4d, #ff006e); color: #fff;
  font-size: 12.5px; font-weight: 800; padding: 8px 18px; border-radius: 999px;
  box-shadow: 0 6px 14px -6px rgba(255, 0, 110, .55);
}
.plaza-buy-btn.vip { background: linear-gradient(135deg, #f0b13c, #d99a1f); box-shadow: 0 6px 14px -6px rgba(217, 154, 31, .55); }
/* 覆盖 pay.css v1 的整行按钮（width:100% / margin-top），操作区按钮内联排布 */
.plaza-actions .plaza-buy-btn { width: auto; margin-top: 0; display: inline-block; }

/* ---------- ⑨ 悬浮预览弹层 ---------- */
.plaza-pop {
  position: absolute; z-index: 900; width: 300px; max-width: calc(100vw - 24px);
  background: #fff; border: 1px solid #f0e9e2; border-radius: 14px;
  box-shadow: 0 24px 54px -18px rgba(40, 30, 20, .4); padding: 14px 16px;
  animation: plazaPop .18s ease;
}
.pop-head { font-size: 13.5px; color: #2b2f44; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed #f0e9e2; }
.pop-toc ul { list-style: none; margin: 0; padding: 0; max-height: 150px; overflow: auto; }
.pop-toc li { font-size: 12px; color: #6b7280; padding: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-toc li.pop-dir { font-weight: 700; color: #2b2f44; }
.pop-empty { font-size: 12px; color: #a5abbd; margin: 4px 0; }
.pop-code {
  margin-top: 8px; background: #f7f4ef; border: 1px solid #eee5d8; border-radius: 10px;
  padding: 8px 10px; font-size: 11px; line-height: 1.6; color: #4a5568;
  max-height: 130px; overflow: auto; white-space: pre; font-family: Consolas, Monaco, monospace;
}
.pop-lock { margin-top: 8px; font-size: 12px; color: #b8860b; background: #fdf6dd; border-radius: 8px; padding: 7px 10px; }

/* ---------- ⑩ 移动端补强 ---------- */
@media (max-width: 900px) {
  .plaza-pop { display: none !important; }   /* 小屏不弹悬浮预览，点卡片直接进 */
}
@media (max-width: 640px) {
  .pb-pane { padding: 13px 14px; }
  .pb-btn { width: 100%; text-align: center; }
  .plaza-adv-label { flex-basis: 100%; }
  .plaza-adv-toggle { padding: 7px 13px; }
  .plaza-fav { font-size: 22px; right: 12px; bottom: 12px; }
  .plaza-actions .kn-btn { padding: 9px 18px; font-size: 13px; }  /* 操作按钮放大 */
  .plaza-quicktags { gap: 6px; }
  .plaza-quicktag { padding: 6px 13px; }
}
