/* ============================================================
   媒资创作平台 · Web 端全站 UX 优化覆盖层
   ------------------------------------------------------------
   说明：
   1. 本文件由所有「导航配置=展示」的用户页面统一引入，位于各页
      内联 <style> 之后、menu.js 动态顶栏样式之前加载；
   2. 只做「安全增强」：表单基线、提示词编辑区、交互反馈、
      滚动条、表格兜底；顶栏样式与响应式的权威来源是 menu.js；
   3. 设计基线与小程序端 v2 UX 对齐：主色 #4361ee、正文 ≥14px、
      提示词输入 ≥15px/行高1.7/最小高度120px。
   ============================================================ */

:root {
  --ux-primary: #4361ee;
  --ux-primary-weak: rgba(67, 97, 238, .08);
  --ux-focus-ring: rgba(67, 97, 238, .35);
}

/* ---------- 1. 键盘可达性：统一焦点描边 ---------- */
.form-control:focus-visible,
.form-select:focus-visible,
.btn:focus-visible,
.unified-nav-item:focus-visible,
.nav-item-has-sub > a:focus-visible,
.nav-sub-item:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ux-focus-ring);
  outline-offset: 1px;
}

/* ---------- 2. 表单控件基线（可输入区域不小于舒适值） ---------- */
.form-control,
.form-select {
  min-height: 42px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

textarea.form-control {
  min-height: 120px;
  line-height: 1.65;
  resize: vertical;
}

.form-control-sm,
.form-select-sm {
  min-height: 34px;
}

/* 占位符可读性 */
.form-control::placeholder,
.form-select::placeholder,
textarea::placeholder {
  color: #9aa4b2;
  opacity: 1;
}

/* ---------- 3. 提示词编辑区统一基线 ----------
   覆盖各创作页 contenteditable / textarea 输入区：
   字号 ≥15px、行高 1.7、聚焦高亮一致。
   （.prompt-input 使用 !important 覆盖源码中的较小内联定义） */
.prompt-input {
  font-size: .95rem !important;
  line-height: 1.7 !important;
  min-height: 140px !important;
  max-height: 320px !important;
  padding: 10px 12px !important;
}

.prompt-editor {
  font-size: .95rem;
  line-height: 1.8;
  padding: 10px 12px;
}

.md-editor-textarea,
.text-prompt-textarea,
.md-editor-expand-textarea {
  line-height: 1.7;
}

.md-editor-textarea:focus,
.text-prompt-textarea:focus,
.meta-contenteditable:focus,
.prompt-editor:focus {
  box-shadow: 0 0 0 3px var(--ux-primary-weak);
}

/* ---------- 4. 交互反馈 ---------- */
.btn {
  transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}

.btn:not(:disabled):not(.btn-sm):not(.btn-xs):hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(67, 97, 238, .25);
}

/* 列表/筛选按钮组：统一状态色过渡 */
.filter-status-btn,
.filter-type-btn {
  transition: all .15s ease;
}

/* ---------- 5. 顶栏增强（仅追加属性，顶栏完整样式见 menu.js） ---------- */
.unified-topbar {
  box-shadow: 0 1px 12px rgba(15, 23, 42, .06);
}

.nav-submenu {
  max-height: calc(100vh - 76px);
  overflow-y: auto;
}

/* ---------- 6. 滚动条美化 ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #c7d0e0;
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #a8b4cc;
  background-clip: content-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- 7. 表格兜底 ---------- */
.table-responsive {
  -webkit-overflow-scrolling: touch;
}

.table thead th {
  white-space: nowrap;
}

/* ---------- 8. 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
