/* ============================================================
 * Social Hub 专属样式
 * ============================================================ */

/* ---- 工作台 ---- */
.dash-hello { margin-bottom: 14px; }
.dash-hello .dh-hi { font-size: 20px; font-weight: 800; color: var(--text-heading); }
.dash-hello .dh-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.act-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.act-card { position: relative; display: block; padding: 14px 16px; background: #fff; border: 1px solid var(--border-light); border-left: 3px solid var(--primary); border-radius: 12px; text-decoration: none; transition: .15s; }
.act-card:hover { box-shadow: 0 4px 14px rgba(79,70,229,.10); transform: translateY(-1px); }
.act-card .ac-v { font-size: 24px; font-weight: 800; color: var(--text-heading); line-height: 1.1; }
.act-card .ac-l { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.act-card .ac-go { position: absolute; right: 12px; top: 14px; font-size: 11px; color: var(--primary); opacity: 0; transition: .15s; }
.act-card:hover .ac-go { opacity: 1; }
.act-card.a-blue { border-left-color: #2563EB; }
.act-card.a-orange { border-left-color: #EA580C; }
.act-card.a-green { border-left-color: #059669; }
.act-card.a-gray { border-left-color: #94A3B8; }
.act-card.zero { opacity: .65; }
.ov-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ov-chip { display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 13px; background: #fff; border: 1px solid var(--border-light); border-radius: 20px; font-size: 12.5px; color: var(--text-muted); text-decoration: none; }
.ov-chip b { color: var(--text-heading); font-size: 14px; }
.ov-chip:hover { border-color: var(--primary); }
.dash-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .act-grid { grid-template-columns: 1fr 1fr; } .dash-2col { grid-template-columns: 1fr; } }

/* ---- 卡片列表（内容库 / 文案稿） ---- */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.tp-card, .ps-card { margin: 0; }
.tp-head, .ps-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tp-title, .ps-title { font-size: 15px; color: var(--text-heading); }
.tp-meta, .ps-meta { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tp-sum { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.6; }
.ps-cap { font-size: 13px; color: var(--text-body); margin-top: 6px; line-height: 1.6; white-space: pre-wrap; }
.tp-foot, .ps-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; flex-wrap: wrap; }
.tp-acts { display: inline-flex; align-items: center; gap: 6px; }

/* ---- 素材库网格 ---- */
.as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.as-card { background: #fff; border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden; }
.as-thumb { aspect-ratio: 1/1; background-size: cover; background-position: center; background-color: #F1F5F9; cursor: zoom-in; }
.as-info { padding: 8px 10px; display: flex; align-items: center; gap: 6px; }
.as-name { font-size: 12px; color: var(--text-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.as-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.as-thumb.blank { background-image: linear-gradient(135deg, #EEF2FF, #F8FAFC); }

/* ---- 排期 ---- */
.cal-day { margin-bottom: 10px; }
.cal-day.is-today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-subtle); }
.cal-dh { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cal-dh b { font-size: 14px; color: var(--text-heading); }

/* ---- 帮助 ---- */
.help-steps { margin: 8px 0 0; padding-left: 22px; line-height: 2; font-size: 13.5px; color: var(--text-body); }

/* ---- 表单整行字段 ---- */
label.full { display: block; margin-top: 12px; font-weight: 600; font-size: 13px; color: var(--text-body); }
label.full input, label.full textarea, label.full select { display: block; width: 100%; margin-top: 5px; font-weight: 400; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; }
.inline-check input { width: auto; }

/* ---- 状态胶囊兜底（浅色，自成体系） ---- */
.st { display: inline-block; font-size: 11px; padding: 2px 10px; border-radius: 20px; font-weight: 600; white-space: nowrap; }
.st.gray { background: #F1F5F9; color: #64748B; }
.st.blue { background: #DBEAFE; color: #1D4ED8; }
.st.orange { background: #FFEDD5; color: #C2410C; }
.st.green { background: #D1FAE5; color: #047857; }
.st.red { background: #FEE2E2; color: #B91C1C; }
.st.slate { background: #E2E8F0; color: #475569; }

/* ---- 移动端微调 ---- */
@media (max-width: 600px) {
  .act-grid { grid-template-columns: 1fr 1fr; }
  .as-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .tp-foot, .ps-foot { align-items: flex-start; }
}


/* ---- AI 生成选题预览 ---- */
.ai-tp-list { max-height: 52vh; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.ai-tp-item { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.ai-tp-item:hover { border-color: var(--primary); }
.ai-tp-item input { margin-top: 3px; flex: 0 0 auto; }
.ai-tp-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ai-tp-body b { font-size: 14px; }
.ai-tp-body .muted { font-size: 12px; }
.ai-tp-sum { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }

/* ---- 知识库（知识卡） ---- */
.kb-card { margin: 0; }
.kb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.kb-title { font-size: 15px; color: var(--text-heading); }
.kb-meta { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.kb-sum { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.6; white-space: pre-wrap; }
.kb-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.kb-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; flex-wrap: wrap; }
.kb-acts { display: inline-flex; align-items: center; gap: 6px; }


/* ============================================================
 * 移动端自适应 —— Social Hub 自有组件
 * （骨架 style.css 的适配针对旧组件；下面这几块是新组件自己的）
 * ============================================================ */

/* ---- 1. 工具栏 ----
   坑：搜索框 .mat-pick 是 flex:1 1 240px（横向时 240px 是宽度）。
   ≤900px 时 .toolbar 变 flex-direction:column，这 240px 就变成“高度”，
   框内 input 只有 46px → 下方凭空多出约 194px 空白。 */
@media (max-width: 900px) {
  .toolbar > .mat-pick,
  .toolbar > .mat-pick.sb-pick { flex: 0 0 auto; }

  /* 有搜索框的工具栏：搜索占整行，下拉与按钮两列并排（原来每项各占一行、一屏被吃掉半屏） */
  .toolbar:has(> .mat-pick) { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .toolbar:has(> .mat-pick) > .mat-pick { flex: 1 1 100%; }
  .toolbar:has(> .mat-pick) > select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .toolbar:has(> .mat-pick) > .btn { flex: 1 1 calc(50% - 4px); }
}

/* ---- 2. 列表行（工作台：最近要发布 / 待处理选题 / 最近动态） ----
   原来 .mr-main 硬限 max-width:42%，手机上英文标题只露几个词就被省略号截掉 */
@media (max-width: 600px) {
  .mini-row { flex-wrap: wrap; row-gap: 4px; padding: 9px 2px; }
  .mini-row .mr-main { max-width: 100%; flex: 1 1 100%; white-space: normal; }
  .mini-row .mr-txt { flex: 1 1 100%; white-space: normal; }
  .mini-row .mr-due { margin-left: auto; }

  /* ---- 3. 卡片头 / 底：窄屏改上下两行，按钮触控区加大 ---- */
  .kb-head, .tp-head, .ps-head { flex-direction: column; align-items: stretch; gap: 6px; }
  .kb-foot, .tp-foot, .ps-foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .kb-acts, .tp-acts, .ps-acts { width: 100%; flex-wrap: wrap; gap: 6px; }
  .kb-acts > .btn, .tp-acts > .btn, .ps-acts > .btn,
  .kb-acts > .btn-link, .tp-acts > .btn-link, .ps-acts > .btn-link {
    flex: 1 1 calc(50% - 3px); justify-content: center; min-height: 40px; padding: 8px 12px; margin: 0;
  }
  .kb-acts > .mini-btn, .tp-acts > .mini-btn, .ps-acts > .mini-btn { min-width: 40px; min-height: 40px; }

  /* ---- 4. 素材卡：卡内删除按钮点击区 ---- */
  .as-info { gap: 8px; }
  .as-info .mini-btn { min-width: 38px; min-height: 38px; }

  /* ---- 5. 顶栏：窄屏只留角色胶囊，把空间让给页面标题 ---- */
  .head-user .hu-name { display: none; }
}

/* ===== 专题（系列策划） ===== */
.hint-bar { display:flex; align-items:center; gap:8px; padding:10px 14px; margin-bottom:14px;
  background:var(--bg-soft,#F8FAFC); border:1px solid var(--border-light,#E2E8F0); border-radius:10px;
  font-size:13px; color:var(--text-muted,#64748B); line-height:1.5; }
.hint-bar .ic { flex:0 0 auto; color:var(--brand,#4F46E5); }

.sr-card .sr-head { display:flex; align-items:center; gap:10px; justify-content:space-between; flex-wrap:wrap; }
.sr-name { font-size:15px; }
.sr-meta { display:flex; gap:6px; align-items:center; }
.sr-line { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-top:6px; font-size:12.5px; }
.sr-goal { margin-top:8px; font-size:12.5px; color:var(--text-muted,#64748B); }
.tp-tag { background:#EEF2FF; color:#4338CA; border-radius:999px; padding:1px 9px; font-size:12px; white-space:nowrap; }
.sr-bar { height:6px; border-radius:999px; background:#EEF2FF; overflow:hidden; margin-top:10px; }
.sr-bar.big { height:8px; }
.sr-bar i { display:block; height:100%; background:linear-gradient(90deg,#6366F1,#8B5CF6); border-radius:999px; transition:width .3s; }
.sr-foot { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:10px; flex-wrap:wrap; }

.sr-stat { display:flex; gap:18px; flex-wrap:wrap; margin-top:12px; font-size:13px; color:var(--text-muted,#64748B); }
.sr-stat b { color:var(--text-heading,#0F172A); font-size:15px; }

.sr-items { display:flex; flex-direction:column; gap:8px; }
.sr-item { display:flex; gap:12px; align-items:flex-start; padding:10px 12px; border:1px solid var(--border-light,#E2E8F0); border-radius:10px; background:#fff; }
.sr-item.is-done { background:#F8FCFA; border-color:#BBF7D0; }
.sr-i-no { flex:0 0 26px; height:26px; border-radius:50%; background:#EEF2FF; color:#4338CA;
  display:flex; align-items:center; justify-content:center; font-size:12.5px; font-weight:600; }
.sr-item.is-done .sr-i-no { background:#DCFCE7; color:#15803D; }
.sr-i-main { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:3px; }
.sr-i-title { font-size:14px; }
.sr-i-angle { font-size:12.5px; color:var(--text-muted,#64748B); }
.sr-i-meta { display:flex; gap:6px; align-items:center; flex-wrap:wrap; font-size:12px; margin-top:2px; }
.sr-i-acts { display:flex; gap:6px; flex-wrap:wrap; flex:0 0 auto; }

.sp-row { display:flex; gap:10px; align-items:flex-start; padding:10px; border:1px solid #E2E8F0; border-radius:10px; margin-bottom:8px; }
.sp-no { flex:0 0 22px; text-align:center; font-weight:600; color:#4338CA; font-size:13px; padding-top:8px; }
.sp-fields { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:6px; }
.sp-fields input, .sp-fields textarea { width:100%; box-sizing:border-box; }

@media (max-width:600px) {
  .sr-i-acts { width:100%; }
  .sr-foot { flex-direction:column; align-items:flex-start; }
  .sr-stat { gap:12px; }
}

/* 修正：篇目行窄屏折行，避免操作按钮把标题挤成逐字竖排 */
.sr-item { flex-wrap:wrap; }
.sr-i-main { flex:1 1 200px; }
.sr-i-title { line-height:1.45; }
.sr-i-acts { margin-left:auto; }
@media (max-width:600px) {
  .sr-foot .tp-acts { width:100%; }
  .sr-i-acts .btn { flex:0 0 auto; }
}

/* ===== 工作台 · 我的主题卡片 ===== */
.dsr-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(262px, 1fr)); gap:12px; }
.dsr { display:block; padding:14px 16px; border:1px solid #E2E8F0; border-radius:12px; background:#fff;
  text-decoration:none; color:inherit; transition:border-color .15s, box-shadow .15s, transform .15s; }
.dsr:hover { border-color:#C7D2FE; box-shadow:0 2px 10px rgba(79,70,229,.08); transform:translateY(-1px); }
.dsr-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.dsr-name { font-size:14.5px; }
.dsr-meta { display:flex; align-items:center; gap:8px; margin-top:6px; font-size:12px; flex-wrap:wrap; }
.dsr-meta .muted { display:inline-flex; align-items:center; gap:4px; }
.dsr-bar { height:6px; border-radius:999px; background:#EEF2FF; overflow:hidden; margin:10px 0 8px; }
.dsr-bar i { display:block; height:100%; border-radius:999px; min-width:3px;
  background:linear-gradient(90deg,#6366F1,#8B5CF6); transition:width .3s; }
.dsr-foot { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; flex-wrap:wrap; }
.dsr-next { font-weight:600; white-space:nowrap; }
.dsr-next.warn { color:#B45309; }
.dsr-next.blue { color:#1D4ED8; }
.dsr-next.ok { color:#15803D; }
@media (max-width:600px) { .dsr-grid { grid-template-columns:1fr; } }

/* ===== 主题工作台 · 篇目与文案（行=篇目，列=各平台文案 / 档期 / 操作） ===== */
.pw { border:1px solid #E2E8F0; border-radius:12px; overflow:hidden; }
.pw-hd, .pw-row { display:grid; gap:10px; align-items:center;
  grid-template-columns:38px minmax(150px,1.25fr) minmax(160px,2fr) 64px 118px; }
.pw-hd { padding:9px 14px; background:#F8FAFC; font-size:12px; font-weight:600;
  color:var(--text-muted,#64748B); border-bottom:1px solid #E2E8F0; }
.pw-row { padding:11px 14px; border-bottom:1px solid #F1F5F9; }
.pw-row:last-child { border-bottom:none; }
.pw-row:hover { background:#FCFCFF; }
.pw-row.is-done { background:#F8FCFA; }
.pw-no { font-size:12.5px; font-weight:600; color:#4338CA; text-align:center; }
.pw-t { display:flex; flex-direction:column; gap:2px; min-width:0; }
.pw-t b { font-size:13.5px; line-height:1.45; }
.pw-angle { font-size:12px; color:var(--text-muted,#64748B); }
.pw-p { display:flex; flex-wrap:wrap; gap:5px; align-items:center; }
.pc { display:inline-flex; align-items:center; font-size:11.5px; padding:2px 8px; border-radius:999px;
  text-decoration:none; background:#F1F5F9; color:#475569; white-space:nowrap; }
.pc:hover { filter:brightness(.95); }
.pc.gray { background:#F1F5F9; color:#475569; }
.pc.blue { background:#DBEAFE; color:#1D4ED8; }
.pc.green { background:#DCFCE7; color:#15803D; }
.pc.orange { background:#FFEDD5; color:#C2410C; }
.pc-add { background:#EEF2FF; color:#4338CA; border:1px dashed #C7D2FE; }
.pw-d { font-size:12.5px; color:#334155; }
.pw-a { display:flex; gap:5px; justify-content:flex-end; }
@media (max-width:760px) {
  .pw-hd { display:none; }
  .pw-row { grid-template-columns:24px 1fr; row-gap:6px;
    grid-template-areas:"no t" ". p" ". d" ". a"; align-items:start; }
  .pw-no { grid-area:no; padding-top:2px; }
  .pw-t { grid-area:t; }
  .pw-p { grid-area:p; }
  .pw-d { grid-area:d; }
  .pw-a { grid-area:a; justify-content:flex-start; margin-top:2px; }
}

/* ============================================================
 * 侧栏二级子项（文案池 · 按平台分区）
 * ============================================================ */
.nav-sub { display: block; margin: 0 0 3px; }
.nav-item.nav-sub-item {
  padding: 7px 12px 7px 30px; font-size: 12.5px; gap: 8px;
  color: var(--side-text-muted, #94A3B8);
}
.nav-dot {
  width: 5px; height: 5px; border-radius: 50%; flex: 0 0 auto;
  background: currentColor; opacity: .4; transition: all .15s;
}
.nav-item.nav-sub-item:hover { color: var(--text-heading); }
.nav-item.nav-sub-item:hover .nav-dot { opacity: 1; }
.nav-item.nav-sub-item.active { background: var(--side-active-bg); color: var(--side-active-text); font-weight: 600; }
.nav-item.nav-sub-item.active .nav-dot { opacity: 1; background: var(--primary); }
/* 父项在「已进入某个平台」时的观感：不加底色，仅提亮 */
.nav-item.nav-parent.open { color: var(--text-heading); }
.nav-item.nav-parent.open .nav-ic { color: var(--primary); }
/* 条数角标 */
.nav-cnt { margin-left: auto; font-size: 11px; opacity: .5; font-variant-numeric: tabular-nums; }
.nav-cnt:empty { display: none; }
.nav-item.active .nav-cnt { opacity: .9; }
.nav-item.nav-sub-item .nav-cnt { font-size: 10.5px; }
@media (max-width: 820px) {
  .nav-item.nav-sub-item { padding: 6px 11px 6px 28px; font-size: 12px; }
}

/* ============================================================
 * PC / 平板(≥601px) 按钮高度统一
 * 起因：紧凑化规则把 input/select 降到 34px，而 .btn 只用 padding 撑高，
 *   纯图标按钮(如文案卡片的删除, 27px)比带文字按钮(31px)矮 4px，
 *   工具栏按钮(31px)也比同排下拉(34px)矮。移动端有 min-height:44px，故仅 PC 发作。
 * ============================================================ */
@media (min-width: 601px) {
  .btn { min-height: 32px; }          /* 图标按钮 / 文字按钮 等高 */
  .toolbar .btn { min-height: 34px; } /* 工具栏按钮对齐同排 input/select 的 34px */
}
