/* ═══════════════════════════════════════════════════════════════════
   MDMS 对 ChatDLM 前端的覆盖补丁 (v2.0.9.25)
   ═══════════════════════════════════════════════════════════════════

   职责:
   - 禁用态 sidebar 菜单项视觉
   - MDMS 特有组件 (文章卡片列表 / 笔记列表等)
   - 不动 index.css 原样文件, 所有定制走本文件

   加载顺序: index.css → font-fix.css → mdms-overrides.css
   ═══════════════════════════════════════════════════════════════════ */

/* 禁用态 sidebar 菜单项 */
.nav-item.disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: auto; /* 保留 hover 显示 tooltip */
}
.nav-item.disabled:hover {
  background: transparent !important;
  color: inherit !important;
}

/* a 标签伪装成 ChatDLM 的 div 菜单项 */
a.nav-item {
  text-decoration: none;
  color: inherit;
}
a.nav-item:hover {
  text-decoration: none;
}

/* ═══ 页面主区通用容器 ═══
   v3.0.0-alpha.5: 删左右 padding 40 (原导致内容真实宽 800-80=720, 跟首页 .home-feed 不一致).
   现 padding 32 0, 内容真实宽 = max-width (默认 1280, 单页 inline 改 800).
   首页 .home-feed 跟这个 1:1 对齐, 视觉宪法 800 不跳跃. */
.site-page {
  padding: 32px 0;
  max-width: 1280px;
  margin: 0 auto;
}
.site-page h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ae-text-1);
  margin-bottom: 8px;
}
.site-page .page-sub {
  font-size: 0.875rem;
  color: var(--ae-text-3);
  margin-bottom: 24px;
}

/* 笔记 / 技能卡片列表 */
.mdms-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.mdms-list-item {
  background: var(--ae-glass-bg);
  border: 1px solid var(--ae-glass-border);
  border-radius: var(--ae-radius-m);
  padding: 16px 20px;
  transition: all var(--ae-transition);
  text-decoration: none;
  color: var(--ae-text-1);
  display: block;
}
.mdms-list-item:hover {
  background: var(--ae-glass-bg-hover);
  border-color: var(--ae-glass-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--ae-shadow-card-hover);
  text-decoration: none;
}
.mdms-list-item .item-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ae-text-1);
  margin-bottom: 6px;
}
.mdms-list-item .item-desc {
  font-size: 0.8125rem;
  color: var(--ae-text-2);
  line-height: 1.5;
  margin-bottom: 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.mdms-list-item .item-meta {
  font-size: 0.75rem;
  color: var(--ae-text-3);
  display: flex;
  gap: 12px;
}
.mdms-list-item .item-meta .item-scope {
  background: var(--ae-accent-soft);
  color: var(--ae-accent);
  padding: 1px 8px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* 空状态 */
.mdms-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--ae-text-3);
}
.mdms-empty i {
  font-size: 3rem;
  opacity: .3;
  display: block;
  margin-bottom: 16px;
}
.mdms-empty h3 {
  font-size: 1.125rem;
  color: var(--ae-text-2);
  margin-bottom: 8px;
  font-weight: 600;
}
.mdms-empty p {
  font-size: 0.875rem;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}
.mdms-empty a {
  color: var(--ae-accent);
  text-decoration: none;
}
.mdms-empty a:hover {
  text-decoration: underline;
}

/* 操作栏 */
.site-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
}
.site-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--ae-radius-s);
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--ae-accent);
  color: #fff;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--ae-transition);
}
.site-btn:hover {
  background: var(--ae-accent);
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--ae-accent-glow);
  text-decoration: none;
  color: #fff;
}
.site-btn-ghost {
  background: transparent;
  border: 1px solid var(--ae-glass-border);
  color: var(--ae-text-2);
}
.site-btn-ghost:hover {
  background: var(--ae-glass-bg-hover);
  color: var(--ae-text-1);
  box-shadow: none;
}

/* 登录提示 */
.login-required {
  text-align: center;
  padding: 80px 20px;
  color: var(--ae-text-2);
}
.login-required i {
  font-size: 3rem;
  opacity: .3;
  display: block;
  margin-bottom: 16px;
}
.login-required a {
  color: var(--ae-accent);
  text-decoration: none;
}

/* ═══ v2.0.9.27 User Zone Skeleton ═══ */
/* 静态/动态页共用 header, 内容由 user-zone.js 填充. 首屏占位防 layout shift. */
.user-zone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.user-zone-skeleton {
  display: inline-block;
  width: 88px;
  height: 28px;
  border-radius: var(--ae-radius-s);
  background: var(--ae-glass-bg);
  opacity: .4;
  animation: userZonePulse 1.2s ease-in-out infinite;
}
@keyframes userZonePulse {
  0%, 100% { opacity: .25; }
  50% { opacity: .55; }
}
/* JS 初始化后立即隐藏 skeleton (innerHTML 替换时 skeleton 就被删了, 此规则冗余防御) */
.user-zone[data-zone-init="1"] .user-zone-skeleton { display: none; }
