/* ── 素材库 ── */

.mat-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.mat-item:hover { background: var(--bg-gray); }
.mat-item:last-child { border-bottom: none; }

.mat-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.mat-preview {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
  max-height: 40px;
  overflow: hidden;
}

/* ── 拆解台素材面板 ── */

.dis-mat-item {
  position: relative;
  padding: 10px 12px;
  margin-bottom: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.dis-mat-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(2px);
}

.dis-mat-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.15);
}

.dis-mat-item .mat-del-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 4px;
  background: rgba(229, 57, 53, 0.1);
  color: var(--danger);
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.dis-mat-item:hover .mat-del-btn {
  opacity: 1;
}

.dis-mat-item .mat-del-btn:hover {
  background: rgba(229, 57, 53, 0.2);
}

/* ── 结果区域滑入 ── */

@keyframes slideDown {
  from { opacity: 0; max-height: 0; margin-top: 0; }
  to   { opacity: 1; max-height: 2000px; margin-top: 12px; }
}

.result-area.visible,
#dis-result.visible,
#dis-layers.visible {
  display: block;
  animation: slideDown 0.35s ease-out;
}

/* ── 加载按钮动画 ── */

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-loading {
  position: relative;
  
}

.btn-loading::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

/* ── 模式切换动画 ── */

.mode-switch {
  transition: all 0.25s ease;
}

.mode-switch label {
  transition: all 0.2s ease;
}

.mode-switch label:hover {
  transform: translateY(-1px);
}


/* ── 卡片 hover 微交互 ── */

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.card:hover {
  box-shadow: 0 3px 12px rgba(0,0,0,0.07);
}

/* ── Stat 数数字跳变动画 ── */

.stat-card .num {
  transition: all 0.3s ease;
}

.stat-card:hover .num {
  transform: scale(1.05);
}

/* ── 表单聚焦微交互 ── */

input[type="text"]:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

/* ── 按钮点击波纹 ── */

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

/* ── 取消滚动条跳动 ── */

html {
  scroll-behavior: smooth;
}

/* ── 响应式：拆解台双栏 ── */

@media (max-width: 900px) {
  #page-disassemble > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* ══════════════════════════════════════════════
   灵魂阁 — 高级质感优化
   ══════════════════════════════════════════════ */

/* ── 灵魂卡片 hover 微交互 ── */

.soul-card.card {
  border-left: 3px solid var(--primary);
  border-radius: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
  cursor: pointer;
}

.soul-card.card:last-child {
  border-bottom: none;
}

.soul-card.card:hover {
  background: var(--primary-light);
  transform: translateX(2px);
}