/* ==========================================================================
   SearchDesk 全站 UI 细节增强层（searchdesk-polish.css）
   日期：2026-09-20
   原则：
   1. 纯增强 —— 只补充动效、悬浮反馈、焦点、滚动条等细节，不改任何布局、
      字号体系、配色（沿用现有蓝白体系 #3366ff / #315ee8 / #1f6feb）。
   2. 零功能侵入 —— 不增删 DOM、不改 display/position/宽高，不影响 JS 逻辑。
   3. 最后加载 —— 本文件在各页面原有样式之后引入，仅在同优先级下做细节收尾。
   覆盖范围：SEO 前台工作台、文章管理后台、客户门户、前台引导页。
   ========================================================================== */

/* ---------- 1. 全局基础质感 ---------- */

/* 文字选中态：品牌蓝淡染，替代系统默认高亮 */
::selection { background: rgba(51, 102, 255, .18); color: inherit; }

/* 正文抗锯齿，让中文小字号更干净 */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }

/* 数字表格化：统计数字、分值等宽对齐，看板更整齐 */
.stat strong, .result-meta, .library-item-time { font-variant-numeric: tabular-nums; }

/* 全局细滚动条（Firefox） */
* { scrollbar-width: thin; scrollbar-color: rgba(123, 135, 152, .42) transparent; }

/* 全局细滚动条（WebKit / Chromium）：贴边、悬浮加深 */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(123, 135, 152, .34);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(123, 135, 152, .58); border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }

/* 键盘可达性：按钮 / 链接 / 导航类控件统一焦点环（输入框已有自定义光晕，不重复） */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
.nav-item:focus-visible,
.nav-btn:focus-visible,
.library-tab:focus-visible,
.site-data-tab:focus-visible {
  outline: 2px solid rgba(79, 117, 255, .65);
  outline-offset: 2px;
}

/* ---------- 2. 按钮体系：统一过渡曲线 + 悬浮/按压反馈 ---------- */

.btn, .ghost, .btn-primary, .btn-secondary, .btn-ghost, .btn-sm,
.top-mini-btn, .login-btn, .library-tab, .site-data-tab,
.published-url-copy, .preview-copy-btn, .preview-translate-btn, .chip button {
  transition: background-color .18s ease, border-color .18s ease, color .18s ease,
              box-shadow .22s ease, filter .18s ease,
              transform .18s cubic-bezier(.2, .8, .2, 1);
}

/* 主按钮：悬浮轻微上浮 + 投影加深；按压回落（不覆盖 disabled） */
.btn:not(:disabled):hover,
.btn-primary:not(:disabled):hover,
.login-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(51, 102, 255, .28);
}
.btn:not(:disabled):active,
.btn-primary:not(:disabled):active,
.login-btn:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(51, 102, 255, .20);
}

/* 次按钮 / 幽灵按钮：悬浮淡蓝底 + 描边加深 */
.ghost:not(:disabled):hover,
.btn-ghost:not(:disabled):hover,
.btn-secondary:not(:disabled):hover,
.top-mini-btn:not(:disabled):hover,
.published-url-copy:not(:disabled):hover,
.preview-copy-btn:not(:disabled):hover,
.preview-translate-btn:not(:disabled):hover {
  background: #f4f7ff;
  border-color: #c3d1f7;
  color: #315de8;
}

/* 标签页按钮：未选中态悬浮提示 */
.library-tab:not(.active):hover,
.site-data-tab:not(.active):hover {
  border-color: #c3d1f7;
  color: #315de8;
  background: #f7faff;
}

/* ---------- 3. 侧边导航：滑动反馈 + 选中态品牌指示条 ---------- */

/* SEO 前台（深色侧栏） */
.sidebar .nav-item {
  position: relative;
  transition: background-color .18s ease, color .18s ease, box-shadow .2s ease,
              transform .18s cubic-bezier(.2, .8, .2, 1);
}
.sidebar .nav-item:hover { transform: translateX(2px); }
.sidebar .nav-item.active { box-shadow: inset 3px 0 0 0 #547cff; }

/* 文章后台（浅色侧栏，图标方块随动） */
.shell .nav button {
  transition: background-color .18s ease, color .18s ease, box-shadow .2s ease,
              transform .18s cubic-bezier(.2, .8, .2, 1);
}
.shell .nav button .nav-icon {
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.shell .nav button:hover .nav-icon { border-color: #c9d6f8; color: #315ee8; background: #f5f8ff; }
.shell .nav button.active .nav-icon {
  background: var(--blue, #315ee8);
  border-color: var(--blue, #315ee8);
  color: #fff;
}

/* 客户门户（浅蓝选中体系） */
.nav-btn { transition: background-color .18s ease, color .18s ease, box-shadow .2s ease,
              transform .18s cubic-bezier(.2, .8, .2, 1); }
.nav-btn:not(.active):hover { background: #f4f8ff; color: #0e61c9; transform: translateX(2px); }
.nav-btn.active { box-shadow: inset 3px 0 0 0 #1f6feb; }

/* ---------- 4. 卡片 / 列表项：边框过渡更顺滑 ---------- */

.card, .stat, .site-data-card, .agnes-settings-card, .table-card, .chip {
  transition: box-shadow .24s ease, border-color .2s ease, background-color .2s ease;
}
.item, .library-item, .sd-row {
  transition: box-shadow .24s ease, border-color .2s ease, background-color .2s ease,
              transform .2s cubic-bezier(.2, .8, .2, 1);
}
.item:hover { border-color: #d4defa; }

/* ---------- 5. 表单控件：悬浮描边加深，焦点保持原有光晕 ---------- */

.input, textarea, select {
  transition: border-color .18s ease, box-shadow .22s ease, background-color .18s ease;
}
.input:hover:not(:focus), textarea:hover:not(:focus), select:hover:not(:focus) {
  border-color: #c6d2ea;
}

/* ---------- 6. 弹窗 / 遮罩：进场动效（display 切换时自动触发） ---------- */

@keyframes sd-polish-fade { from { opacity: 0; } }
@keyframes sd-polish-pop {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
}
@keyframes sd-polish-rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes sd-polish-step { from { opacity: 0; transform: translateY(10px); } }

.modal-backdrop, .editor-mask { animation: sd-polish-fade .22s ease both; }
.modal, .editor-dialog { animation: sd-polish-pop .3s cubic-bezier(.2, .9, .3, 1.06) both; }

/* ---------- 7. 登录页 / 引导页：卡片入场 ---------- */

.admin-auth-card, .portal-login-card { animation: sd-polish-rise .5s cubic-bezier(.2, .8, .2, 1) both; }

/* 客户门户 onboarding 步骤切换 */
.step.active { animation: sd-polish-step .38s cubic-bezier(.2, .8, .2, 1) both; }

/* 前台引导页（landing） */
.wrap .card { animation: sd-polish-rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.wrap a {
  transition: border-color .18s ease, box-shadow .22s ease,
              transform .18s cubic-bezier(.2, .8, .2, 1);
}
.wrap a:hover {
  border-color: #b9c8ff;
  box-shadow: 0 12px 32px rgba(51, 102, 255, .12);
  transform: translateY(-1px);
}

/* ---------- 8. 进度条：生成中微光扫过 ---------- */

@keyframes sd-polish-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
.progress span { position: relative; overflow: hidden; }
.progress span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: translateX(-100%);
  animation: sd-polish-shimmer 2.2s ease-in-out infinite;
}

/* ---------- 9. 表格：行悬浮反馈 ---------- */

.site-data-table tbody tr, .table-wrap tbody tr { transition: background-color .15s ease; }
.site-data-table tbody tr:hover, .table-wrap tbody tr:hover { background: #f7faff; }

/* ---------- 10. 动效减负：尊重系统「减弱动态效果」设置 ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
   候选题库字号对齐 20260923
   需求：候选题库里的标题/正文太小看不清。
   基准：本页「文章分类组合」里的分类按钮（页面上显示为「场景类」那排）
        .taxonomy-choice-btn 在原样式表里写的是
            font:600 11px/1.25 inherit
        但 `inherit` 不能作为 font-family，整条 font 简写被浏览器判为无效，
        实际落到 <button> 的 UA 默认字号 = 13.3333px（实测）。
        因此基准取 13.3333px，而不是样式表里写着的 11px。
   规则：正文（概述）= 13.3333px ；标题 = 基准 + 3px = 16.3333px
   只覆盖 font-size，不动行高 / 布局 / 颜色 / 结构 / 其它任何样式。
   删除本段即整体回退。
   ============================================================ */
:root{--topic-body-font:13.3333px}
.topic-library-card .topic-language-block b{font-size:calc(var(--topic-body-font) + 3px)}
.topic-language-en b{font-size:calc(var(--topic-body-font) + 3px)!important}
.topic-language-summary{font-size:var(--topic-body-font)}


/* ============================================================
   [portal-md-single-pane] 客户门户 · 文章编辑器（编辑 Markdown）
   2026-09-23
   把「左编辑 + 右实时渲染」的双栏改成单栏纯 Markdown 编辑：
   直接在 Markdown 原文上改，不再并排渲染。
   只覆盖 3 条布局规则，不动字号 / 颜色 / 工具栏 / 其他任何样式。
   删掉本段 + 恢复 index.html 里被移除的 LIVE PREVIEW 面板即整体回退。
   用 #articleEditorModal 前缀提升特异性，稳赢 client-portal.css 的原规则。
   ============================================================ */
#articleEditorModal .markdown-editor-split{grid-template-columns:1fr}
#articleEditorModal .markdown-source-pane{border-right:0;border-bottom:0}
#articleEditorModal .markdown-preview-pane{display:none}


/* ============================================================
   [client-login-credential] SEO 管理台 · 客户登录凭据展示
   2026-09-23
   客户账号密码创建完成后：隐藏创建表单（#clientLoginFormBox），
   改为固定展示 登录地址 / 登录账号 / 登录密码，可一键复制。
   只加新类名，不动 admin.css 任何原有规则；删除本段即回退样式。
   ⚠️ 类名必须用 cred-pwd-* 这种唯一前缀：admin.css 里有通用的
      `.empty{padding:70px 20px 86px;text-align:center}`，曾用 .empty 导致行高被撑到 196px。
   ============================================================ */
#clientLoginSettingsCard [hidden]{display:none!important}
#clientLoginSettingsCard .client-login-cred{display:grid;gap:9px;margin:2px 0 4px}
#clientLoginSettingsCard .client-login-cred-row{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid #e6eaf1;border-radius:10px;background:#fafbfe}
#clientLoginSettingsCard .client-login-cred-label{flex:0 0 88px;font-size:10px;font-weight:800;color:#8a94a6;letter-spacing:.03em}
#clientLoginSettingsCard .client-login-cred-value{flex:1 1 auto;min-width:0;display:block;padding:0;text-align:left;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;line-height:1.5;color:#2f3d53;word-break:break-all}
#clientLoginSettingsCard .client-login-cred-value.cred-pwd-plain{color:#0f5132;font-weight:700}
#clientLoginSettingsCard .client-login-cred-value.cred-pwd-missing{color:#a9b2bf;font-family:inherit;font-weight:400}
#clientLoginSettingsCard .client-login-cred-row button{flex:0 0 auto;padding:7px 10px;font-size:10px}
#clientLoginSettingsCard .client-login-cred-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:2px;font-size:10px;color:#8b95a7}
#clientLoginSettingsCard .client-login-cred-reset{border:0;background:none;padding:0;color:#8b95a7;font-size:10px;text-decoration:underline;cursor:pointer}
#clientLoginSettingsCard .client-login-cred-reset:hover{color:#b64b4b}
@media (max-width:760px){
  #clientLoginSettingsCard .client-login-cred-row{flex-wrap:wrap}
  #clientLoginSettingsCard .client-login-cred-label{flex:0 0 100%}
  #clientLoginSettingsCard .client-login-cred-value{flex:1 1 100%}
}


/* ============================================================
   [library-publish-status] SEO 管理台 · 内容管理发布状态
   2026-09-23
   蓝色「客户审核通过」徽标 + 「等待发布」按钮（点击切换为已发布）。
   删除本段即回退样式（功能仍在，只是没有这些标记）。
   ============================================================ */
.library-item .client-approved-badge{display:inline-block;padding:3px 11px;border-radius:999px;font-size:12.5px;font-weight:800;line-height:1.6;color:#fff;border:1px solid #1c4fd8;background:#2f5fe0}
.library-item .site-published-badge{display:inline-block;padding:3px 11px;border-radius:999px;font-size:12.5px;font-weight:800;line-height:1.6;color:#0e6b46;border:1px solid #9ed9bc;background:#eaf8f1}
.library-item .site-publish-btn{margin-left:6px;padding:4px 13px;border:1px solid #2f5fe0;border-radius:999px;background:#fff;color:#1c4fd8;font-size:12px;font-weight:800;cursor:pointer}
.library-item .site-publish-btn:hover{background:#eef3ff;border-color:#9ab4f5}
.library-item .site-publish-btn:disabled{opacity:.6;cursor:default}


/* ============================================================
   [library-item-blue-frame] 内容管理 · 文章条目整体蓝色框
   2026-09-23
   用户要求：整篇文章用非常明显的蓝色框包住，条目里的文字同步放大。
   只覆盖 .library-item 及其子元素的排版/字号，不动 admin.css 任何原规则。
   删除本段即回退（会回到原来的细分割线样式）。
   ============================================================ */
#libraryGroups .library-items{gap:0}
#libraryGroups .library-item{
  padding:16px 18px 16px 46px;
  margin:0 0 12px;
  border:2px solid #2f5fe0;
  border-radius:12px;
  background:#f2f7ff;
  box-shadow:0 2px 12px rgba(47,95,224,.13);
}
#libraryGroups .library-item:last-child{border-bottom:2px solid #2f5fe0;margin-bottom:0}
#libraryGroups .library-item:hover{border-color:#1c4fd8;background:#eaf2ff;box-shadow:0 5px 18px rgba(28,79,216,.2)}
#libraryGroups .library-item.published{border-color:#2f5fe0;background:#f2f7ff}
#libraryGroups .library-item.published h4{color:#17398f}
#libraryGroups .library-item.selected-for-publish{border-color:#1c4fd8;background:#e6efff;box-shadow:0 0 0 3px rgba(28,79,216,.16)}
/* 条目内文字整体放大 */
#libraryGroups .library-item h4{font-size:16.5px;line-height:1.5}
#libraryGroups .library-item-time{font-size:12.5px}
#libraryGroups .library-item-meta{font-size:12.5px;gap:12px}
#libraryGroups .library-item-meta a{font-size:12.5px}
#libraryGroups .library-content-types{font-size:12.5px;gap:14px}


/* ============================================================
   [library-item-rejected] 内容管理 · 客户拒绝的文章整条变红
   2026-09-23
   客户在客户端点「拒绝通过」后，这里整条变红色并显示「拒绝」。
   删除本段即回退样式（状态数据仍在）。
   ============================================================ */
#libraryGroups .library-item.rejected{border-color:#d64545;background:#fdf4f4;box-shadow:0 2px 12px rgba(214,69,69,.16)}
#libraryGroups .library-item.rejected:hover{border-color:#c03434;background:#fbeaea;box-shadow:0 5px 18px rgba(214,69,69,.22)}
#libraryGroups .library-item.rejected h4{color:#a32b2b}
.library-item .client-rejected-badge{display:inline-block;padding:3px 11px;border-radius:999px;font-size:12.5px;font-weight:800;line-height:1.6;color:#fff;border:1px solid #d64545;background:#d64545}
.library-item .site-rejected-text{font-size:12.5px;font-weight:800;color:#b93a3a}

/* [portal-perf] 客户前台「提升最快」关键词：长词单行省略，避免把列表撑高 */
#perfKeywordList .kw-row > span:first-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
/* [portal-perf] 客户前台 SEO 图表：数据为空时不显示孤立网格 */
[data-portal-chart]:empty{min-height:120px}
