/* ===== 悬浮球文章目录 ===== */
.toc-ball {
  position: fixed; bottom: 24px; right: 24px; z-index: 900;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none;
  box-shadow: 0 4px 18px rgba(139,92,246,0.35);
  transition: transform .2s, box-shadow .2s;
}
.toc-ball:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(139,92,246,0.45); }
.toc-ball.hidden { display: none; }

.toc-panel {
  position: fixed; bottom: 80px; right: 24px; z-index: 899;
  background: var(--acrylic-bar, rgba(20,16,36,0.85));
  border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
  min-width: 200px; max-width: 280px; max-height: 55vh;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  opacity: 0; transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toc-panel::-webkit-scrollbar { display: none; }
.toc-panel.active { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.toc-panel-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.toc-item {
  display: block; font-size: 13px; color: var(--text-secondary);
  padding: 5px 0; cursor: pointer; text-decoration: none;
  border: none; background: none; width: 100%; text-align: left;
  transition: color .15s; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toc-item:hover { color: var(--brand); }
.toc-item.toc-h2 { padding-left: 10px; font-size: 12px; }
.toc-item.toc-h3 { padding-left: 22px; font-size: 12px; }

/* ===== 调色板 ===== */
.color-toggle-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 6px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--acrylic-bar);
  cursor: pointer; transition: border-color .15s, background .15s;
  color: var(--text-secondary); font-size: 12px;
}
.color-toggle-btn:hover, .color-toggle-btn.active { border-color: var(--brand); }
.color-dot {
  width: 16px; height: 16px; border-radius: 50%; display: inline-block;
  transition: background .2s;
}
.color-popover {
  position: fixed; bottom: 120px; left: 280px; z-index: 50;
  background: var(--acrylic-bar); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  display: flex; flex-wrap: wrap; gap: 8px; max-width: 280px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}
.color-popover.active { opacity: 1; pointer-events: auto; transform: translateY(0); }
.color-swatch {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  transition: transform .15s, border-color .15s;
  flex-shrink: 0; position: relative;
}
.color-swatch:hover { transform: scale(1.2); }
.color-swatch.active { border-color: var(--text); box-shadow: 0 0 6px rgba(255,255,255,0.3); }
.color-swatch-custom {
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--border); color: var(--text-secondary);
  font-size: 16px; font-weight: 700; line-height: 1;
}
.color-swatch-custom input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
/* 移动端面板靠左 */
@media (max-width: 768px) {
  .color-popover { left: 12px; bottom: 120px; }
  .toc-ball { bottom: 14px; right: 14px; width: 40px; height: 40px; }
}

/* ===== 链接社交媒体卡片 ===== */
.link-card {
  display: flex; gap: 0; margin: 16px 0; border-radius: 10px;
  border: 1px solid var(--border); overflow: hidden;
  background: var(--acrylic-bar); text-decoration: none;
  color: var(--text);
  transition: border-color .15s;
  max-width: 520px;
  font-size: 13px; line-height: 1.5;
}
.link-card:hover { border-color: var(--brand); }
.link-card-body {
  flex: 1; min-width: 0; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; line-height: 1.5;
}
.link-card-domain {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.link-card-favicon { width: 14px; height: 14px; border-radius: 2px; flex-shrink: 0; }
.link-card-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.4; word-break: break-word;
}
.link-card-desc {
  font-size: 12px; color: var(--text-secondary); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-card-img {
  width: 140px; flex-shrink: 0; min-height: 100px;
  background-color: var(--surface);
  background-position: center; background-size: cover; background-repeat: no-repeat;
  border-left: 1px solid var(--border);
}
@media (max-width: 480px) {
  .link-card { flex-direction: column; font-size: 12px; }
  .link-card-img { width: 100%; height: 140px; border-left: none; border-top: 1px solid var(--border); }
}
