/* 多平台运营视图：沿用现有卡片、按钮、表单与 badge 体系 */
.social-root { min-width: 0; }
.social-root:has(.sync-fab) { padding-bottom: 84px; }
.sync-fab {
  position: fixed; right: 30px; bottom: 30px; z-index: 30;
  width: 56px; height: 56px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 600; letter-spacing: .5px;
  box-shadow: 0 10px 24px rgba(99,102,241,.32);
  cursor: pointer;
  transition: transform .16s, box-shadow .16s, background .16s;
}
.sync-fab:hover { background: var(--brand-2); transform: translateY(-1px); box-shadow: 0 14px 28px rgba(99,102,241,.38); }
.sync-fab:disabled { opacity: .6; cursor: default; transform: none; }
.social-root button, .social-root input, .social-root select, .social-root textarea { max-width: 100%; }
.social-root .stack { gap: 14px; }
.social-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.social-toolbar > div:first-child { min-width: 0; }
.social-kpis { margin-bottom: 18px; }
.social-text-link { color: var(--brand); text-decoration: none; cursor: pointer; word-break: break-word; }
.social-text-link:hover { text-decoration: underline; }
.social-field-empty { padding: 18px; border: 1px dashed var(--line); border-radius: 9px; background: #fbfbfd; color: var(--muted); font-size: 12px; line-height: 1.7; }
.social-field-empty.large { min-height: 120px; display: flex; align-items: center; justify-content: center; text-align: center; }
.social-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--muted); font-size: 11px; }
.social-divider::before, .social-divider::after { content: ""; height: 1px; flex: 1; background: var(--line-soft); }
.social-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.social-form-actions > span:first-child { margin-right: auto; font-size: 11.5px; }
.social-card-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.social-query-chip { align-self: flex-end; height: 34px; padding: 0 11px; border: 1px solid #d8dcff; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-size: 11.5px; cursor: pointer; }
.social-query-chip span { margin-left: 5px; font-size: 15px; }
.social-cell-sub { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.6; }

/* 筛选 */
.social-filter-wrap { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); background: #fcfcfe; }
.social-filter-item { display: flex; flex-direction: column; gap: 5px; min-width: 132px; }
.social-filter-item > span { color: var(--muted); font-size: 10.5px; }
.social-filter-item .input { height: 34px; font-size: 12px; background: #fff; }
.social-keyword { display: flex; gap: 7px; align-items: center; min-width: 250px; flex: 1; }
.social-keyword .input { height: 34px; min-width: 160px; font-size: 12px; }
.social-keyword .btn { flex: 0 0 auto; }

/* 平台设置 */
.platform-tabs { display: inline-flex; gap: 4px; margin-bottom: 14px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.platform-tab { padding: 7px 18px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-size: 13px; cursor: pointer; }
.platform-tab:hover { color: var(--text); }
.platform-tab.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.social-settings-grid.single { grid-template-columns: minmax(0, 1fr); }

/* 数据概览 */
.social-toolbar-right { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.ov-platform-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.ov-platform-card { min-width: 0; }
.ov-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ov-metrics > div { padding: 10px 11px; border: 1px solid var(--line-soft); border-radius: 9px; background: #fafaff; }
.ov-metrics span { display: block; margin-bottom: 4px; font-size: 10.5px; color: var(--muted); }
.ov-metrics strong { font-size: 15px; font-weight: 700; letter-spacing: .2px; color: var(--text); }
.ov-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line-soft); font-size: 11.5px; color: var(--muted); }
.ov-foot b { font-weight: 600; color: var(--text-2); }
.ov-columns { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; margin-bottom: 16px; }
.ov-trend { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.ov-bar-item { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.ov-bar { width: 100%; max-width: 26px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #7c74f0, #5b52e8); opacity: .85; }
.ov-bar-item > span { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.ov-lead-row { display: grid; grid-template-columns: 66px minmax(0, 1fr) 58px; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12px; }
.ov-lead-row:last-child { border-bottom: 0; }
.ov-lead-row > span { color: var(--text-2); }
.ov-lead-row strong { text-align: right; font-size: 12px; color: var(--text-2); }
.ov-lead-track { height: 7px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.ov-lead-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #7c74f0, #a89ffb); }

@media (max-width: 1100px) {
  .ov-platform-grid, .ov-columns { grid-template-columns: 1fr; }
}

/* 账号 */
.social-account-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; align-items: start; }
.social-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.social-account-card { padding: 16px; min-width: 0; }
.social-account-head { display: flex; align-items: center; gap: 10px; }
.social-platform-mark { width: 38px; height: 38px; flex: 0 0 38px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-size: 15px; font-weight: 700; }
.social-platform-mark.douyin { background: #eef0f4; color: #171b26; }
.social-platform-mark.shipinhao { background: #e9f8ef; color: #149654; }
.social-platform-mark.xiaohongshu { background: #fdeeee; color: #d83a3a; }
.social-account-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.social-account-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.social-account-title span { color: var(--muted); font-size: 11px; }
.social-account-id { display: flex; flex-direction: column; gap: 5px; margin: 14px 0 10px; padding: 9px 10px; border-radius: 8px; background: #f7f8fb; }
.social-account-id span { color: var(--muted); font-size: 10.5px; }
.social-account-id code { color: var(--text-2); font-size: 11.5px; word-break: break-all; }
.social-manual-note { margin-bottom: 10px; color: var(--warn); font-size: 10.5px; line-height: 1.6; }
.social-capability-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.social-capability { padding: 8px; border: 1px solid var(--line-soft); border-radius: 8px; background: #fafbfc; }
.social-capability span, .social-capability strong { display: block; }
.social-capability span { color: var(--muted); font-size: 10px; }
.social-capability strong { margin-top: 4px; color: var(--muted); font-size: 10.5px; font-weight: 600; }
.social-capability.api { border-color: #dcefe3; background: #f5fcf7; }
.social-capability.api strong { color: var(--success); }
.social-capability.assisted { border-color: #e3e5f7; background: #f8f8ff; }
.social-capability.assisted strong { color: var(--brand); }
.social-account-meta { display: flex; flex-direction: column; gap: 4px; margin: 11px 0; color: var(--muted); font-size: 10.5px; }
.social-inline-edit { display: flex; gap: 7px; margin-bottom: 11px; }
.social-inline-edit .input { height: 30px; min-width: 0; font-size: 11.5px; }
.social-inline-edit .btn { flex: 0 0 auto; }
.social-add-account { position: sticky; top: 16px; }
.social-add-account form .field { margin-bottom: 13px; }
.social-oauth-buttons { display: grid; grid-template-columns: 1fr; gap: 8px; }

/* 分发创建 */
.social-composer { overflow: hidden; }
.social-idem { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.social-composer-grid { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(340px, 1.1fr); gap: 22px; }
.social-account-options { max-height: 286px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding-right: 3px; }
.social-account-option { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; transition: border-color .15s, background .15s; }
.social-account-option:hover { border-color: #cfd3e4; }
.social-account-option.selected { border-color: #c8cdfc; background: #f8f8ff; }
.social-account-option input { flex: 0 0 auto; accent-color: var(--brand); }
.social-account-option-main { flex: 1; min-width: 0; }
.social-account-option-main strong, .social-account-option-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-account-option-main strong { font-size: 12.5px; }
.social-account-option-main small { margin-top: 4px; color: var(--muted); font-size: 10.5px; }
.social-copy-editor { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.social-platform-copy { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fcfcfe; }
.social-platform-copy legend { padding: 0 7px; color: var(--brand); font-size: 12.5px; font-weight: 650; }
.social-platform-copy .field + .field { margin-top: 11px; }
.social-platform-copy .input { font-size: 12.5px; }
.social-composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line-soft); }
.social-composer-foot > span { font-size: 11.5px; }

/* 分发任务 */
.social-task-list { padding: 14px; display: flex; flex-direction: column; gap: 12px; background: #f8f9fc; }
.social-task-list-card { overflow: hidden; }
.social-task-list > .empty { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.social-task-card { padding: 16px; box-shadow: none; }
.social-task-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.social-task-title { margin-bottom: 6px; font-size: 14px; font-weight: 650; line-height: 1.5; }
.social-task-info { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1fr; gap: 12px; margin: 14px 0; padding: 11px 12px; border-radius: 9px; background: #f8f9fb; }
.social-task-info > div { min-width: 0; }
.social-task-info span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.social-task-info strong, .social-task-info code, .social-task-info a { font-size: 11.5px; font-weight: 500; word-break: break-all; }
.social-task-error { margin: 10px 0 12px; }
.social-expanded-form { margin-top: 14px; padding: 14px; border: 1px solid #dfe2f5; border-radius: 10px; background: #fafaff; }
.social-expanded-form > .field + .field, .social-expanded-form > .form-grid + .field { margin-top: 11px; }
.social-expanded-form .form-grid { margin-top: 11px; }

/* 指标与互动 */
.social-metric-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.social-metric-kpis .kpi-value { font-size: 22px; }
.social-null-value { color: var(--muted); font-size: 16px !important; letter-spacing: 0; }
.social-metric-editor { margin-bottom: 16px; border-color: #d9ddfb; }
.social-metric-form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.social-metric-form-grid .input { padding: 0 8px; }
.social-insights-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr); gap: 16px; margin-bottom: 16px; }
.social-trend { display: flex; flex-direction: column; gap: 10px; }
.social-trend-row { display: grid; grid-template-columns: 80px minmax(80px, 1fr) 70px; gap: 10px; align-items: center; font-size: 11px; }
.social-trend-row > span { color: var(--muted); }
.social-trend-row > strong { text-align: right; font-size: 11px; }
.social-trend-track { height: 8px; border-radius: 8px; background: #eef0f6; overflow: hidden; }
.social-trend-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-2), var(--brand)); }
.social-content-card { overflow: hidden; }
.social-published-pending { margin-top: 16px; }
.social-pending-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.social-pending-row:last-child { border-bottom: 0; }
.social-pending-row strong, .social-pending-row span { display: block; }
.social-pending-row strong { font-size: 12.5px; }
.social-pending-row span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.social-interaction-list { display: flex; flex-direction: column; }
.social-interaction-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.social-interaction-row:last-child { border-bottom: 0; }
.social-interaction-main { flex: 1; min-width: 0; }
.social-interaction-top { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.social-interaction-top strong { font-size: 12.5px; }
.social-interaction-top > span:last-child { font-size: 11px; }
.social-interaction-main p { margin: 10px 0; color: var(--text-2); font-size: 13px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.social-interaction-attribution { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 11px; }
.social-interaction-action { flex: 0 0 auto; }

/* 表格与线索 */
.social-table-wrap { width: 100%; overflow-x: auto; }
.social-table { min-width: 900px; }
.social-table th { background: #fbfbfd; white-space: nowrap; }
.social-table td { vertical-align: top; line-height: 1.55; }
.social-table td strong { font-size: 12px; }
.social-table tbody tr:last-child td { border-bottom: 0; }
.social-leads-table { min-width: 1300px; }
.social-leads-table th:nth-child(1) { min-width: 100px; }
.social-leads-table th:nth-child(2), .social-leads-table th:nth-child(3) { min-width: 112px; }
.social-leads-table th:nth-child(4) { min-width: 210px; }
.social-leads-table th:nth-child(5) { min-width: 190px; }
.social-leads-table th:nth-child(8) { min-width: 190px; }
.social-lead-content { max-width: 280px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.social-lead-status { height: 32px !important; min-width: 94px; padding: 0 7px !important; font-size: 11.5px !important; }
.social-note-editor { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.social-note-editor textarea { min-height: 54px; font-size: 11.5px; }
.social-lead-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 设置增强 */
.social-settings-section { margin-top: 20px; }
.social-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.social-settings-heading h2 { margin: 0; font-size: 17px; }
.social-settings-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.social-public-alert { margin-bottom: 14px; }
.social-public-alert code { word-break: break-all; }
.social-settings-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.social-platform-config { overflow: hidden; }
.social-json-input { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 11.5px !important; tab-size: 2; }
.social-address-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.social-address-list > div { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: #f8f9fb; }
.social-address-list span { color: var(--muted); font-size: 11px; }
.social-address-list code { color: var(--text-2); font-size: 11px; word-break: break-all; }
.social-sync-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; padding: 10px 0 0; border-top: 1px dashed var(--line); color: var(--muted); font-size: 11px; }
.social-sync-error { color: var(--danger); word-break: break-word; }

@media (max-width: 1380px) {
  .social-account-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .social-account-grid { grid-template-columns: 1fr; }
  .social-metric-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .social-task-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .social-account-layout { grid-template-columns: 1fr; }
  .social-add-account { position: static; }
  .social-oauth-buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .social-composer-grid { grid-template-columns: 1fr; }
  .social-metric-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .social-insights-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .social-toolbar, .social-settings-heading, .social-composer-foot { align-items: stretch; flex-direction: column; }
  .social-toolbar .btn, .social-settings-heading .btn, .social-composer-foot .btn { align-self: flex-start; }
  .social-filter-wrap { align-items: stretch; }
  .social-filter-item { flex: 1 1 140px; }
  .social-keyword { flex-basis: 100%; min-width: 0; }
  .social-kpis, .social-lead-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .social-metric-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .social-idem { max-width: 48%; }
  .social-interaction-row { flex-direction: column; gap: 12px; }
  .social-interaction-action { align-self: flex-start; }
  .social-metric-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .social-address-list > div { grid-template-columns: 1fr auto; }
  .social-address-list > div > span { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .social-account-grid, .social-kpis, .social-lead-kpis, .social-metric-kpis { grid-template-columns: 1fr; }
  .ov-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-trend { gap: 4px; }
  .social-capability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .social-oauth-buttons, .social-metric-form-grid { grid-template-columns: 1fr; }
  .social-task-info { grid-template-columns: 1fr; }
  .social-task-head { flex-direction: column; }
  .social-card-actions .btn { flex: 1 1 auto; }
  .social-composer-grid { display: block; }
  .social-copy-editor { margin-top: 18px; }
  .social-trend-row { grid-template-columns: 72px minmax(60px, 1fr) 60px; gap: 7px; }
  .social-form-actions { align-items: flex-start; flex-wrap: wrap; }
}

/* 账号接入：扫码授权弹层、凭证表单与类型徽标 */
.social-type-badge { white-space: nowrap; }
.social-auth-block h3 { margin: 0 0 10px; font-size: 12.5px; font-weight: 600; }
.social-auth-block .field { margin-bottom: 12px; }
.social-block-note { margin: 8px 0 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
.social-credential-form .field { margin-bottom: 11px; }
.social-credential-form .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.social-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; }
.social-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .58); }
.social-modal-card {
  position: relative; z-index: 1; width: min(420px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--card);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}
.social-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.social-modal-head h2 { margin: 0; font-size: 15px; }
.social-qr {
  display: flex; align-items: center; justify-content: center; padding: 12px; margin: 4px 0 12px;
  background: #fff; border: 1px solid var(--line-soft); border-radius: 12px;
}
.social-qr svg { display: block; width: 100%; max-width: 260px; height: auto; }
.social-qr-placeholder { padding: 58px 12px; font-size: 12px; color: var(--muted); }
.social-auth-status { margin-bottom: 12px; font-size: 12px; color: var(--muted); text-align: center; }
.social-auth-status.authorized { color: #0f9d58; }
.social-auth-status.failed { color: #d93025; }
.social-auth-status.expired { color: #b26a00; }
.social-modal-card .social-address-list { margin-bottom: 12px; }
@media (max-width: 760px) {
  .social-credential-form .form-grid { grid-template-columns: 1fr; }
  .social-modal { padding: 12px; }
  .social-modal-card { width: 100%; }
}
