/* ui-theme-switcher.css — 控制台外观切换器（风格预设选择）样式
 * 全部用 var(--...) 令牌，自动适配暗/浅色。 */

/* ── 顶部栏齿轮按钮 ── */
.ts-gear-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-left: 10px;
  border: 1px solid rgba(255,255,255,0.14); border-radius: 9px;
  background: rgba(255,255,255,0.06); color: #fff; cursor: pointer;
  font-size: 16px; line-height: 1; transition: all .18s cubic-bezier(.34,1.56,.64,1);
}
.ts-gear-btn:hover { background: rgba(255,255,255,0.16); transform: rotate(35deg); }
.ts-gear-btn.active { background: var(--accent); border-color: var(--accent); }

/* ── 弹层 / 内嵌面板通用 ── */
.ts-panel {
  width: 360px; max-height: 70vh; overflow-y: auto;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 16px; color: var(--text-primary);
}
.ts-panel.ts-popover {
  position: fixed; top: 64px; right: 18px; z-index: 9999;
  animation: ts-pop .22s cubic-bezier(.34,1.56,.64,1);
}
@keyframes ts-pop { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }

.ts-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ts-title { font-size: 15px; font-weight: 700; }
.ts-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ts-close { border: none; background: transparent; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.ts-close:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ── 预设网格 ── */
.ts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ts-item {
  position: relative; border: 2px solid var(--border); border-radius: 12px;
  padding: 10px; cursor: pointer; background: var(--bg-card);
  transition: border-color .18s, transform .18s cubic-bezier(.34,1.56,.64,1);
}
.ts-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.ts-item.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.ts-swatch { height: 38px; border-radius: 8px; margin-bottom: 8px; display: flex; overflow: hidden; border: 1px solid var(--border-light); }
.ts-swatch i { flex: 1; }
.ts-name { font-size: 13px; font-weight: 700; }
.ts-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.ts-src { display: inline-block; margin-top: 6px; font-size: 10px; padding: 1px 7px; border-radius: 99px;
  background: var(--purple-bg); color: var(--accent-text); }
.ts-check { position: absolute; top: 6px; right: 8px; color: var(--accent); font-size: 14px; display: none; }
.ts-item.active .ts-check { display: block; }

/* ── 密度切换 ── */
.ts-density { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.ts-density-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.ts-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.ts-seg button {
  border: none; background: transparent; color: var(--text-secondary);
  font-size: 12px; padding: 6px 14px; cursor: pointer; transition: all .15s;
}
.ts-seg button.active { background: var(--accent); color: #fff; }
.ts-seg button:not(.active):hover { background: var(--bg-hover); }

/* ── 内嵌面板（模块模式）宽度自适应 ── */
.ts-inline { width: 100%; max-width: 760px; box-shadow: none; animation: none; position: relative; top: auto; right: auto; }
.ts-inline .ts-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* ═══ 分组（13 套风格分「融合新款 / 经典预设」两段展示）═══ */
.ts-grouphead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: 14px 0 8px; padding-bottom: 6px;
  border-bottom: 1px dashed var(--border-light);
  position: sticky; top: -16px; z-index: 2;
  background: var(--bg-secondary);
}
.ts-grouphead:first-of-type { margin-top: 4px; }
.ts-gname { font-size: 12px; font-weight: 700; color: var(--text-primary); letter-spacing: .3px; }
.ts-gname::before {
  content: ""; display: inline-block; width: 4px; height: 11px; border-radius: 2px;
  background: var(--accent); margin-right: 7px; vertical-align: -1px;
}
.ts-gnote { font-size: 10.5px; color: var(--text-muted); }

/* 推荐角标（放在左上，避开右上角的 ✓ 选中标记）*/
.ts-rec {
  position: absolute; top: 6px; left: 8px; z-index: 1;
  font-size: 10px; padding: 1px 7px; border-radius: 99px;
  background: var(--accent); color: #fff; font-weight: 600;
}

/* 弹层里 13 张卡较长：标题吸顶，滚动更从容 */
.ts-panel.ts-popover .ts-head {
  position: sticky; top: -16px; z-index: 3;
  background: var(--bg-secondary); padding-bottom: 10px;
  margin-bottom: 4px; border-bottom: 1px solid var(--border-light);
}
