/* ============================================================
   appearance.css — 外观页：外观选择器 + 配色主题选择器
   ============================================================ */

/* 小节标题 */
.sec-title {
  font-size: 12px;
  color: var(--muted);
  margin: 14px 0 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sec-title:first-child {
  margin-top: 0;
}

/* ---------- 手柄外观选择（缩略图卡片） ---------- */
.appear-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.appear-chip {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  transition: 0.15s;
}

.appear-chip:hover {
  border-color: var(--accent);
}

.appear-chip.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.appear-chip svg {
  width: 100%;
  height: auto;
}

.appear-chip .nm {
  font-size: 11px;
  color: var(--muted);
}

.appear-chip.active .nm {
  color: var(--accent);
}

/* ---------- 主题选择（色板卡片） ---------- */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}

.theme-chip {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  transition: 0.15s;
}

.theme-chip:hover {
  border-color: var(--accent);
}

.theme-chip.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.theme-chip .swatch {
  width: 100%;
  height: 22px;
  border-radius: 5px;
  display: flex;
  overflow: hidden;
}

.theme-chip .swatch i {
  flex: 1;
  display: block;
}

.theme-chip .nm {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.theme-chip.active .nm {
  color: var(--accent);
}

/* 自定义主题：用虚边和小圆点做区分，和内置主题一眼能分开 */
.theme-chip.custom {
  border-style: dashed;
}

.theme-chip {
  position: relative;
}

.theme-chip .chip-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  line-height: 1;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  display: none;
}

.theme-chip.custom:hover .chip-remove,
.theme-chip .chip-remove:focus-visible {
  display: block;
}

.theme-chip .chip-remove:hover {
  border-color: #f85149;
  color: #f85149;
}

/* 末尾的"新建自定义主题"入口 */
.theme-chip-add {
  border-style: dashed;
  justify-content: center;
  min-height: 62px;
}

.theme-chip-add .plus {
  font-size: 18px;
  color: var(--muted);
  line-height: 1;
}

.theme-chip-add:hover .plus {
  color: var(--accent);
}

/* ============================================================
   自定义主题编辑器
   ============================================================ */

.color-group-title {
  margin-top: 12px;
  margin-bottom: 4px;
}

.color-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-bottom: 4px;
}

.color-field {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.color-field-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-field input[type="color"] {
  flex: 0 0 34px;
  width: 34px;
  height: 24px;
  padding: 1px;
}

.color-field .color-field-hex {
  flex: 0 0 78px;
  width: 78px;
  padding: 3px 6px;
  font-size: 11px;
  font-family: Consolas, "Courier New", monospace;
  text-transform: lowercase;
}

.color-field-hint {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--accent);
}
