/* =============================================================================
   分享模块样式 [2026-11-03]
   -----------------------------------------------------------------------------
   全部类名以 .cx-share- 开头，和现有主题零冲突。
   配色只用自己的四个分类色，其余（背景、文字、边框）全部吃主题变量，
   所以深色 / 浅色 / 液态玻璃三套皮肤下都自动跟着变。
   ============================================================================= */

/* ---------- 容器 ---------- */
.cx-share-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 22px 26px 0;
}
.cx-share-view[hidden] { display: none !important; }

.cx-share-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
}
.cx-share-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--text-1);
}
.cx-share-sub {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-3);
}

.cx-share-tools { display: flex; align-items: center; gap: 10px; }

.cx-share-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border-glass);
  color: var(--text-3);
  transition: border-color .18s ease, background .18s ease;
}
.cx-share-search:focus-within { border-color: rgba(245, 158, 11, .5); }
.cx-share-search input {
  width: 190px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--text-1);
}
.cx-share-search input::placeholder { color: var(--text-3); }

.cx-share-sort {
  height: 38px;
  padding: 0 10px;
  border-radius: 13px;
  border: 1px solid var(--border-glass);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.cx-share-publish {
  height: 38px;
  padding: 0 18px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(160deg, #fde68a, #fbbf24 46%, #f59e0b);
  color: #1b1206;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 22px -8px rgba(245, 158, 11, .8), inset 0 1px 0 rgba(255, 252, 226, .7);
  transition: transform .16s ease, box-shadow .2s ease, filter .2s ease;
}
.cx-share-publish:hover { filter: brightness(1.06); box-shadow: 0 0 28px -6px rgba(245, 158, 11, .95); }
.cx-share-publish:active { transform: scale(.985); }

/* ---------- 分类标签 ---------- */
.cx-share-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--border-line, rgba(148, 163, 184, .16));
}
.cx-share-tab {
  height: 32px;
  padding: 0 15px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.cx-share-tab:hover { background: var(--surface-2); color: var(--text-2); }
.cx-share-tab.on {
  background: linear-gradient(158deg, rgba(245, 158, 11, .26), rgba(180, 83, 9, .12));
  border-color: rgba(251, 191, 36, .55);
  color: #b45309;
}
[data-theme='dark'] .cx-share-tab.on { color: #fde9b8; }
.cx-share-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
}

/* ---------- 卡片网格 ---------- */
.cx-share-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 2px 26px;
}
.cx-share-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 14px;
}

.cx-share-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 15px 16px 13px;
  border-radius: 18px;
  background: var(--surface-1, rgba(255, 255, 255, .5));
  border: 1px solid var(--border-glass);
  cursor: pointer;
  outline: none;
  transition: transform .2s cubic-bezier(.22, 1, .36, 1), box-shadow .22s ease, border-color .2s ease;
  position: relative;
  overflow: hidden;
}
.cx-share-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(158deg, rgba(255, 255, 255, .16), transparent 42%);
}
.cx-share-card:hover,
.cx-share-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(251, 191, 36, .42);
  box-shadow: 0 18px 38px -22px rgba(30, 41, 59, .5), 0 0 0 1px rgba(251, 191, 36, .18);
}

.cx-share-card-top {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-3);
}
.cx-share-kind {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.7;
}
.cx-share-kind.k-sw { background: rgba(96, 165, 250, .16); color: #3b82f6; border: 1px solid rgba(96, 165, 250, .3); }
.cx-share-kind.k-doc { background: rgba(52, 211, 153, .14); color: #059669; border: 1px solid rgba(52, 211, 153, .3); }
.cx-share-kind.k-site { background: rgba(167, 139, 250, .16); color: #7c3aed; border: 1px solid rgba(167, 139, 250, .32); }
.cx-share-kind.k-other { background: rgba(148, 163, 184, .16); color: #64748b; border: 1px solid rgba(148, 163, 184, .3); }
[data-theme='dark'] .cx-share-kind.k-sw { color: #93c5fd; }
[data-theme='dark'] .cx-share-kind.k-doc { color: #6ee7b7; }
[data-theme='dark'] .cx-share-kind.k-site { color: #c4b5fd; }
[data-theme='dark'] .cx-share-kind.k-other { color: #cbd5e1; }

.cx-share-src { margin-left: auto; opacity: .8; }
.cx-share-badge {
  padding: 1px 7px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 600;
}
.cx-share-badge.b-pending { background: rgba(251, 191, 36, .18); color: #b45309; border: 1px solid rgba(251, 191, 36, .4); }
.cx-share-badge.b-rejected { background: rgba(248, 113, 113, .16); color: #b91c1c; border: 1px solid rgba(248, 113, 113, .35); }
[data-theme='dark'] .cx-share-badge.b-pending { color: #fcd34d; }
[data-theme='dark'] .cx-share-badge.b-rejected { color: #fca5a5; }

.cx-share-card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cx-share-card-sum {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cx-share-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.cx-share-tag {
  padding: 1px 7px;
  border-radius: 7px;
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border-glass);
}

.cx-share-card-foot {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--border-line, rgba(148, 163, 184, .14));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-3);
}
.cx-share-author { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-share-stats { display: flex; gap: 9px; flex: none; }
.cx-share-stats .liked { color: #f43f5e; }

.cx-share-more {
  grid-column: 1 / -1;
  height: 44px;
  margin-top: 4px;
  border-radius: 14px;
  border: 1px dashed var(--border-glass);
  background: transparent;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
}
.cx-share-more:hover { background: var(--surface-2); color: var(--text-2); }

.cx-share-empty {
  grid-column: 1 / -1;
  padding: 64px 20px;
  text-align: center;
  font-size: 14px;
  line-height: 2.1;
  color: var(--text-2);
}
.cx-share-empty span { font-size: 12.5px; color: var(--text-3); }

/* ---------- 弹窗 ---------- */
.cx-share-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 9, 18, .58);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: cxShFade .16s ease;
}
@keyframes cxShFade { from { opacity: 0 } to { opacity: 1 } }
body.cx-share-lock { overflow: hidden; }

.cx-share-dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 24px 26px 22px;
  border-radius: 22px;
  background: var(--surface-1, #fff);
  border: 1px solid var(--border-glass);
  box-shadow: 0 30px 80px -30px rgba(4, 8, 18, .7), 0 0 0 1px rgba(255, 255, 255, .06) inset;
  animation: cxShPop .2s cubic-bezier(.22, 1, .36, 1);
}
[data-theme='dark'] .cx-share-dialog {
  background: #111a2b;
  border-color: rgba(148, 180, 220, .18);
}
.cx-share-dialog.wide { width: min(580px, 100%); }
@keyframes cxShPop { from { transform: translateY(8px) scale(.985); opacity: 0 } to { transform: none; opacity: 1 } }

.cx-share-x {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.cx-share-x:hover { background: var(--surface-2); color: var(--text-1); }

/* 详情 */
.cx-share-dt-head { display: flex; align-items: center; gap: 10px; padding-right: 40px; }
.cx-share-dt-meta { font-size: 12px; color: var(--text-3); }
.cx-share-dt-title {
  margin: 14px 0 8px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-1);
}
.cx-share-dt-sum {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-2);
  white-space: pre-wrap;
}
.cx-share-dt-url {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border-glass);
  font-size: 12px;
  color: var(--text-3);
  word-break: break-all;
}
.cx-share-dt-stats { margin: 10px 0 16px; font-size: 12px; color: var(--text-3); }
.cx-share-dt-acts { display: flex; flex-wrap: wrap; gap: 10px; }

.cx-share-note {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 12.5px;
  line-height: 1.7;
}
.cx-share-note.w-pending { background: rgba(251, 191, 36, .13); border: 1px solid rgba(251, 191, 36, .35); color: #92400e; }
.cx-share-note.w-reject { background: rgba(248, 113, 113, .12); border: 1px solid rgba(248, 113, 113, .32); color: #991b1b; }
[data-theme='dark'] .cx-share-note.w-pending { color: #fcd34d; }
[data-theme='dark'] .cx-share-note.w-reject { color: #fca5a5; }

/* 按钮 */
.cx-share-btn {
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform .16s ease, filter .18s ease, background .18s ease;
}
.cx-share-btn:hover { filter: brightness(1.06); }
.cx-share-btn:active { transform: scale(.985); }
.cx-share-btn.primary {
  border: none;
  background: linear-gradient(160deg, #fde68a, #fbbf24 46%, #f59e0b);
  color: #1b1206;
  font-weight: 600;
  box-shadow: 0 0 22px -8px rgba(245, 158, 11, .8);
}
.cx-share-btn.ghost { background: transparent; }
.cx-share-btn.ghost:hover { background: var(--surface-2); }
.cx-share-btn.ghost.liked { color: #f43f5e; border-color: rgba(244, 63, 94, .4); }
.cx-share-btn.danger { color: #dc2626; border-color: rgba(220, 38, 38, .3); }
.cx-share-btn.danger:hover { background: rgba(220, 38, 38, .08); }
.cx-share-btn:disabled { opacity: .6; cursor: not-allowed; }

/* 发布表单 */
.cx-share-cp h2 { margin: 0 0 6px; font-size: 18px; font-weight: 700; color: var(--text-1); }
.cx-share-cp-hint {
  margin: 0 0 18px;
  font-size: 12px;
  line-height: 1.75;
  color: var(--text-3);
}
.cx-share-picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.cx-share-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.cx-share-pick:hover { background: var(--surface-2); }
.cx-share-pick.on {
  border-color: rgba(251, 191, 36, .65);
  background: rgba(251, 191, 36, .12);
  color: var(--text-1);
}
.pk-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 15px;
}
.pk-ico.k-sw { background: rgba(96, 165, 250, .18); color: #3b82f6; }
.pk-ico.k-doc { background: rgba(52, 211, 153, .16); color: #059669; }
.pk-ico.k-site { background: rgba(167, 139, 250, .18); color: #7c3aed; }
.pk-ico.k-other { background: rgba(148, 163, 184, .18); color: #64748b; }

.cx-share-field { display: block; margin-bottom: 13px; }
.cx-share-field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-3);
}
.cx-share-field > span i { font-style: normal; opacity: .75; }
.cx-share-field > span i:only-of-type { color: #dc2626; }
.cx-share-field input[type='text'],
.cx-share-field input:not([type]),
.cx-share-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid var(--border-glass);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color .18s ease;
}
.cx-share-field input:focus,
.cx-share-field textarea:focus { border-color: rgba(245, 158, 11, .55); }
.cx-share-field input::placeholder,
.cx-share-field textarea::placeholder { color: var(--text-3); }

.cx-share-drop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px dashed var(--border-glass);
  background: var(--surface-2);
}
.cx-share-drop-btn {
  height: 30px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--border-glass);
  background: var(--surface-1, #fff);
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  flex: none;
}
.cx-share-drop-btn:hover { border-color: rgba(245, 158, 11, .5); color: var(--text-1); }
.cx-share-drop-name {
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cx-share-drop-name.has { color: #059669; }

.cx-share-acts {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .cx-share-view { padding: 16px 14px 0; }
  .cx-share-head { align-items: stretch; }
  .cx-share-tools { width: 100%; flex-wrap: wrap; }
  .cx-share-search { flex: 1; }
  .cx-share-search input { width: 100%; }
  .cx-share-grid { grid-template-columns: 1fr; }
  .cx-share-dialog { padding: 20px 18px 18px; }
  .cx-share-picks { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .cx-share-pick { font-size: 11.5px; padding: 8px 4px; }
}

/* [2026-11-03] 顶栏去掉大标题后：搜索靠左、排序与发布靠右 */
.cx-share-head {
  align-items: center;
  padding-bottom: 14px;
}
.cx-share-tools { width: 100%; gap: 10px; }
.cx-share-search {
  flex: 1 1 240px;
  max-width: 420px;
  margin-right: auto;
}
.cx-share-search input { width: 100%; }

/* =============================================================================
   [2026-11-03 v117] 深色可读性修正
   -----------------------------------------------------------------------------
   截图发现三个问题：
     1. 卡片太透，文字压在后景玻璃柱上几乎读不出来 → 卡片要"实"成一块小玻璃
     2. 分享页没有面板遮挡，星云整个铺开，比主界面更抢眼 → 进分享页时压暗背景
     3. 发布弹窗的"提交审核"被弹窗底部裁掉，要滚动才看得到 → 按钮吸底
   ============================================================================= */

/* 1. 卡片：深色下加深 + 背景模糊，隔开后景 */
[data-theme='dark'] .cx-share-card {
  background: rgba(10, 18, 34, .60);
  -webkit-backdrop-filter: blur(16px) saturate(138%);
  backdrop-filter: blur(16px) saturate(138%);
  border-color: rgba(150, 182, 222, .16);
  min-height: 148px;
}
[data-theme='dark'] .cx-share-card:hover,
[data-theme='dark'] .cx-share-card:focus-visible {
  background: rgba(16, 27, 48, .72);
  border-color: rgba(251, 191, 36, .40);
}
[data-theme='dark'] .cx-share-card-title { color: #eaf2ff; }
[data-theme='dark'] .cx-share-card-sum { color: rgba(198, 214, 236, .74); }
[data-theme='dark'] .cx-share-card-foot {
  border-top-color: rgba(150, 182, 222, .16);
  color: rgba(186, 204, 226, .72);
}
[data-theme='dark'] .cx-share-tag {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(150, 182, 222, .18);
  color: rgba(200, 216, 238, .80);
}

/* 2. 进分享页时把背景压暗，让卡片成为主体 */
body.cx-share-mode .cx-liquid-bg {
  filter: brightness(.46) saturate(.82) contrast(1.06);
  transition: filter .3s ease;
}
/* 浅色皮肤下也一样：淡彩化 */
body.cx-share-mode .cx-liquid-bg[style] { filter: none; }

/* 3. 发布弹窗：按钮吸底，滚不滚动都在 */
.cx-share-dialog.wide { width: min(560px, 100%); }
.cx-share-acts {
  position: sticky;
  bottom: -22px;
  margin: 16px -26px -22px;
  padding: 14px 26px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 26%);
  border-radius: 0 0 22px 22px;
  z-index: 2;
}
[data-theme='dark'] .cx-share-acts {
  background: linear-gradient(180deg, rgba(17, 26, 43, 0) 0%, #111a2b 26%);
}

/* 4. 深色下弹窗与表单的对比 */
[data-theme='dark'] .cx-share-field input[type='text'],
[data-theme='dark'] .cx-share-field input:not([type]),
[data-theme='dark'] .cx-share-field textarea {
  background: rgba(8, 14, 26, .72);
  border-color: rgba(150, 182, 222, .20);
  color: #eaf2ff;
}
[data-theme='dark'] .cx-share-field input::placeholder,
[data-theme='dark'] .cx-share-field textarea::placeholder { color: rgba(170, 190, 216, .48); }
[data-theme='dark'] .cx-share-drop {
  background: rgba(8, 14, 26, .72);
  border-color: rgba(150, 182, 222, .22);
}
[data-theme='dark'] .cx-share-drop-btn {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(150, 182, 222, .24);
  color: #dbe7f6;
}
[data-theme='dark'] .cx-share-pick {
  border-color: rgba(150, 182, 222, .18);
  color: rgba(206, 220, 240, .84);
}
[data-theme='dark'] .cx-share-pick:hover { background: rgba(255, 255, 255, .05); }
[data-theme='dark'] .cx-share-pick.on {
  border-color: rgba(251, 191, 36, .62);
  background: rgba(245, 158, 11, .14);
  color: #fde9b8;
}
[data-theme='dark'] .cx-share-search,
[data-theme='dark'] .cx-share-sort {
  background: rgba(10, 18, 34, .58);
  border-color: rgba(150, 182, 222, .18);
  color: #dbe7f6;
}
[data-theme='dark'] .cx-share-search input { color: #eaf2ff; }
[data-theme='dark'] .cx-share-dt-title { color: #eaf2ff; }
[data-theme='dark'] .cx-share-dt-sum { color: rgba(200, 216, 238, .82); }
[data-theme='dark'] .cx-share-dt-url {
  background: rgba(8, 14, 26, .6);
  border-color: rgba(150, 182, 222, .18);
  color: rgba(186, 204, 226, .74);
}
[data-theme='dark'] .cx-share-btn.ghost { color: #dbe7f6; }
[data-theme='dark'] .cx-share-btn.ghost:hover { background: rgba(255, 255, 255, .07); }
[data-theme='dark'] .cx-share-tabs { border-bottom-color: rgba(150, 182, 222, .14); }
[data-theme='dark'] .cx-share-tab { color: rgba(186, 204, 226, .70); }
[data-theme='dark'] .cx-share-tab:hover { background: rgba(255, 255, 255, .06); color: #dbe7f6; }
[data-theme='dark'] .cx-share-count { color: rgba(178, 196, 220, .64); }
