/*! ============================================================
 * theme-cards.css · 主题管理页卡片化（图2 视觉目标）
 *
 * 由 include.php 通过官方钩子 Filter_Plugin_Admin_Header 注入，
 * 版本号取文件自身 mtime（backend_modern_version），改完无需强刷。
 *
 * 【作用域收口】全部规则以 body.admin-ThemeMng 开头。
 *   admin2 主页面的 body class 是 admin-{$action}，主题管理页即
 *   body.admin-ThemeMng；其它后台页、登录页、旧后台壳一条都不命中。
 *   模板 DOM 用独立的 .tc-* 前缀，不复用 .postlist/.tr/.theme-* 契约，
 *   因此 backend-modern.css 的列表基线与 override.css 的表格规则零冲突。
 *
 * 【设计令牌】版式沿用 override.css（--color-* / --radius-* / --shadow-*），
 *   只引入一个局部品类强调色 --tc-accent（取自设计稿的蓝紫），
 *   不新造第二套设计语言。若需与全站主色完全统一，把
 *   --tc-accent 改成 var(--color-primary) 即可，其余规则无需改动。
 * ============================================================ */

body.admin-ThemeMng {
  --tc-accent: #5b4cf2;
  --tc-accent-strong: #4a3cdb;
  --tc-accent-soft: rgba(91, 76, 242, 0.10);
}

body.admin-ThemeMng.night {
  --tc-accent: #8b83ff;
  --tc-accent-strong: #a098ff;
  --tc-accent-soft: rgba(139, 131, 255, 0.16);
}

/* ---------- 页头：紫色小图标 + 分隔线，面包屑保留（后台导航一致性） ---------- */
body.admin-ThemeMng .content .title {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-input);
}

body.admin-ThemeMng .content .title h2 > span:first-child {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-left: 32px;
  font-size: 22px;
}

body.admin-ThemeMng .content .title h2 > span:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--tc-accent);
}

body.admin-ThemeMng .content .title h2 > span:first-child::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 9px;
  box-sizing: border-box;
  border: 1.5px solid #fff;
  border-top-width: 3.5px;
  border-radius: 2px;
}

body.admin-ThemeMng .pagecrumb {
  margin-bottom: 6px;
}

/* ---------- 卡片网格 ---------- */
body.admin-ThemeMng .tc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
  max-width: 980px;
}

body.admin-ThemeMng .tc-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

body.admin-ThemeMng .tc-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

body.admin-ThemeMng .tc-card.is-current {
  border-color: var(--tc-accent);
  box-shadow: 0 0 0 1px var(--tc-accent), var(--shadow-card);
}

body.admin-ThemeMng .tc-card.is-current:hover {
  border-color: var(--tc-accent);
  box-shadow: 0 0 0 1px var(--tc-accent), var(--shadow-card-hover);
}

/* ---------- 卡片头：图标 / 名称 / 当前徽章 ---------- */
body.admin-ThemeMng .tc-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 26px;
  margin-bottom: 14px;
}

body.admin-ThemeMng .tc-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--tc-accent-soft);
}

body.admin-ThemeMng .tc-icon::before {
  content: "";
  display: block;
  width: 11px;
  height: 9px;
  box-sizing: border-box;
  border: 1.5px solid var(--tc-accent);
  border-top-width: 3px;
  border-radius: 2px;
}

body.admin-ThemeMng .tc-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--tc-accent);
}

body.admin-ThemeMng .tc-title small {
  margin-left: 7px;
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-muted);
}

body.admin-ThemeMng .tc-badge {
  flex: 0 0 auto;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  background: var(--tc-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

/* ---------- 预览图 ---------- */
body.admin-ThemeMng .tc-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  margin-bottom: 13px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-muted);
}

body.admin-ThemeMng .tc-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* 描述不占位（完整内容仍在卡片的 title 属性里，hover 可查看） */

/* ---------- 作者 ---------- */
body.admin-ThemeMng .tc-author {
  min-height: 20px;
  margin-bottom: 14px;
  font-size: 12px;
  line-height: 20px;
  color: var(--color-text-muted);
}

body.admin-ThemeMng .tc-author a {
  color: var(--color-text-muted);
}

body.admin-ThemeMng .tc-author a:hover {
  color: var(--tc-accent);
}

/* ---------- 底部：样式下拉 + 启用按钮 ---------- */
body.admin-ThemeMng .tc-foot {
  margin-top: auto;
}

body.admin-ThemeMng .tc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* common.js 会把 select 隐藏并在其后插入 .nice-select，
   两者都要收进同一套尺寸，否则下拉会独占一行或溢出卡片。 */
body.admin-ThemeMng .tc-actions > select,
body.admin-ThemeMng .tc-actions > .nice-select {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  height: 36px;
  margin: 0;
  padding-left: 12px;
  padding-right: 26px;
  box-sizing: border-box;
  border: 1px solid var(--color-border-input);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 400;
  line-height: 34px;
  text-align: left;
}

body.admin-ThemeMng .tc-actions > .nice-select .current {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.admin-ThemeMng .tc-actions .button {
  flex: 0 0 auto;
  height: 36px;
  min-width: 84px;
  margin: 0;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}

body.admin-ThemeMng .tc-actions .button.tc-primary {
  border-color: var(--tc-accent);
  background: var(--tc-accent);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(91, 76, 242, 0.45);
}

body.admin-ThemeMng .tc-actions .button.tc-primary:hover {
  border-color: var(--tc-accent-strong);
  background: var(--tc-accent-strong);
}

/* 当前主题：徽章已表达状态，按钮弱化为不可点的浅色态 */
body.admin-ThemeMng .tc-actions .button.disabled,
body.admin-ThemeMng .tc-actions .button:disabled {
  min-width: 84px;
  height: 36px;
  border-color: transparent;
  background: var(--tc-accent-soft);
  color: var(--tc-accent);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
  cursor: default;
}

/* ---------- 响应式 ---------- */
@media screen and (max-width: 820px) {
  body.admin-ThemeMng .tc-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media screen and (max-width: 640px) {

  body.admin-ThemeMng .content .title h2 > span:first-child {
    font-size: 20px;
  }

  body.admin-ThemeMng .tc-preview {
    aspect-ratio: 16 / 9;
  }
}
