/* CSS Variables */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(20, 20, 30, 0.85);
  --bg-card-hover: rgba(30, 30, 45, 0.95);
  --text-primary: #e8e8f0;
  --text-secondary: #8888a0;
  --text-muted: #555568;
  --accent: #00d4aa;
  --accent-soft: rgba(0, 212, 170, 0.15);
  --accent-glow: rgba(0, 212, 170, 0.4);
  --border: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 212, 170, 0.5);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}
.bg-container { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-image { width: 100%; height: 100%; object-fit: cover; opacity: 0.3; transition: opacity var(--transition); }
.bg-gradient { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 212, 170, 0.15), transparent), radial-gradient(ellipse 60% 40% at 80% 100%, rgba(99, 102, 241, 0.1), transparent), linear-gradient(180deg, transparent 0%, var(--bg-primary) 100%); }
.bg-noise { position: absolute; inset: 0; opacity: 0.03; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E"); }
.header { position: fixed; top: 20px; right: 20px; z-index: 100; display: flex; gap: 10px; padding: 0; margin: 0; background: none; backdrop-filter: none; }
.user-area { display: flex; align-items: center; gap: 10px; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 50px; cursor: pointer; transition: all var(--transition); backdrop-filter: blur(12px); }
.user-btn:hover { background: var(--bg-card-hover); border-color: var(--border-active); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 600; color: var(--accent); overflow: hidden; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-size: 0.875rem; font-weight: 500; color: var(--text-primary); }
.login-btn { padding: 10px 24px; background: linear-gradient(135deg, var(--accent), #00b894); color: var(--bg-primary); border: none; border-radius: 50px; font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all var(--transition); box-shadow: 0 4px 20px var(--accent-glow); }
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 28px var(--accent-glow); }
.icon-btn { width: 44px; height: 44px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: all var(--transition); backdrop-filter: blur(12px); font-size: 1rem; }
.icon-btn:hover { background: var(--bg-card-hover); color: var(--accent); transform: translateY(-2px); }

/* ===== 页面标题 - 可拖动 ===== */
.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 36px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  display: block;
  position: relative;
  user-select: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  transition: box-shadow 0.25s ease, opacity 0.25s ease;
}

.main-container.free-layout .page-title {
  position: absolute;
  z-index: 10;
  margin-bottom: 0;
  left: 50%;
  top: 15%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.main-container.free-layout .page-title.dragging {
  opacity: 0.9;
  z-index: 100;
  box-shadow: 0 0 0 2px var(--border-active), var(--shadow-lg);
  outline: 2px solid var(--border-active);
  border-radius: var(--radius-sm);
}

/* 标题拖拽手柄 */
.page-title > .drag-handle {
  position: absolute;
  top: 50%;
  left: -35px;
  transform: translateY(-50%);
  width: 26px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: grab;
  color: var(--text-muted);
  font-size: 0.8rem;
  z-index: 100;
  backdrop-filter: blur(12px);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  user-select: none;
}

.main-container.free-layout .page-title > .drag-handle {
  display: flex;
}

.page-title > .drag-handle:hover {
  color: var(--accent);
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

.page-title > .drag-handle:active {
  cursor: grabbing;
}

.search-box { width: 100%; max-width: 680px; position: relative; z-index: 10; display: block; }
.search-input-wrapper { position: relative; display: flex; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(20px); transition: all var(--transition); overflow: hidden; }
.search-input-wrapper:focus-within { border-color: var(--border-active); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-lg); }
.search-input { flex: 1; padding: 18px 24px; background: transparent; border: none; outline: none; font-size: 1rem; color: var(--text-primary); font-family: inherit; }
.search-input::placeholder { color: var(--text-muted); }
.search-submit { padding: 0 28px; background: linear-gradient(135deg, var(--accent), #00b894); border: none; color: var(--bg-primary); font-size: 1rem; font-weight: 600; cursor: pointer; transition: all var(--transition); display: flex; align-items: center; gap: 8px; }
.engine-tabs { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; justify-content: center; min-height: 44px; width: 100%; }
.engine-tab { display: flex; align-items: center; gap: 8px; padding: 10px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 50px; cursor: pointer; transition: all var(--transition); backdrop-filter: blur(12px); font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
.engine-tab:hover { background: var(--bg-card-hover); color: var(--text-primary); transform: translateY(-2px); }
.engine-tab.active { background: var(--accent-soft); border-color: var(--border-active); color: var(--accent); }
.quick-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 40px; justify-content: center; min-height: 50px; width: 100%; }
.quick-link { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition); backdrop-filter: blur(12px); text-decoration: none; color: var(--text-primary); font-size: 0.9rem; }
.quick-link:hover { background: var(--bg-card-hover); border-color: var(--border-active); transform: translateY(-3px); box-shadow: var(--shadow); }
.engine-tabs:empty::before, .quick-links:empty::before { content: '加载中...'; color: var(--text-muted); font-size: 0.9rem; padding: 10px; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 2000; opacity: 0; visibility: hidden; transition: all 0.3s ease; padding: 20px; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 480px; max-height: 90vh; overflow: hidden; transform: translateY(20px) scale(0.95); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: var(--shadow-lg); }
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 24px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 1.25rem; font-weight: 600; }
.btn-close { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: 50%; cursor: pointer; color: var(--text-secondary); transition: all var(--transition); }
.btn-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.modal-body { padding: 24px; overflow-y: auto; max-height: calc(90vh - 140px); }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.form-input { width: 100%; padding: 14px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 1rem; font-family: inherit; transition: all var(--transition); }
.form-input:focus { outline: none; border-color: var(--border-active); box-shadow: 0 0 0 4px var(--accent-soft); }
.form-btn { width: 100%; padding: 16px; background: linear-gradient(135deg, var(--accent), #00b894); border: none; border-radius: var(--radius-sm); color: var(--bg-primary); font-size: 1rem; font-weight: 600; cursor: pointer; transition: all var(--transition); margin-top: 8px; }
.form-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.form-link { display: block; text-align: center; margin-top: 16px; color: var(--accent); font-size: 0.875rem; text-decoration: none; cursor: pointer; }
.login-tip { margin-top: 20px; padding: 14px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.login-tip-title { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.login-tip-row { display: flex; align-items: flex-start; gap: 10px; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; line-height: 1.5; }
.login-tip-row:last-child { margin-bottom: 0; }
.login-tip-row b { color: var(--text-primary); }
.tip-icon { font-size: 0.9rem; margin-top: 2px; }
.settings-panel { position: fixed; top: 0; right: -380px; width: 360px; height: 100vh; background: var(--bg-secondary); border-left: 1px solid var(--border); z-index: 1001; transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5); }
.settings-panel.active { right: 0; }
.settings-header { display: flex; justify-content: space-between; align-items: center; padding: 24px; border-bottom: 1px solid var(--border); }
.settings-title { font-size: 1.25rem; font-weight: 600; }
.settings-content { flex: 1; overflow-y: auto; padding: 24px; }
.settings-section { margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.settings-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.95rem; font-weight: 600;
  color: var(--text-secondary); padding: 14px 18px; margin: 0;
  background: var(--bg-card); cursor: pointer; user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.settings-section-title:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.settings-section-title i { font-size: 0.7rem; transition: transform 0.2s ease; color: var(--text-muted); }
.settings-section.collapsed .settings-section-title i { transform: rotate(-90deg); }
.settings-section-body { padding: 16px; display: none; }
.settings-section:not(.collapsed) .settings-section-body { display: block; }
.engine-list, .link-list { display: flex; flex-direction: column; gap: 10px; }
.engine-item, .link-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: grab; transition: all var(--transition); }
.engine-item:hover, .link-item:hover { background: var(--bg-card-hover); }

/* 设置面板中的拖拽手柄 - 用于排序 */
.engine-item .drag-handle,
.link-item .drag-handle {
  color: var(--text-muted);
  cursor: grab;
  position: static;
  width: auto;
  height: auto;
  left: auto;
  top: auto;
  transform: none;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-info { flex: 1; min-width: 0; }
.item-name { font-weight: 500; font-size: 0.9rem; }
.item-url { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-actions { display: flex; gap: 8px; }
.action-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; color: var(--text-secondary); transition: all var(--transition); }
.action-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.action-btn.delete:hover { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); color: #ef4444; }
.add-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; background: var(--accent-soft); border: 1px dashed var(--border-active); border-radius: var(--radius-sm); color: var(--accent); font-weight: 500; cursor: pointer; transition: all var(--transition); margin-top: 12px; }
.add-btn:hover { background: rgba(0, 212, 170, 0.2); }
.image-preview { margin-top: 16px; border-radius: var(--radius-sm); overflow: hidden; position: relative; height: 160px; background: var(--bg-card); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-preview .remove-btn { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; background: rgba(0, 0, 0, 0.6); border: none; border-radius: 50%; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0.8; transition: opacity 0.2s; }
.image-preview .remove-btn:hover { opacity: 1; }
.avatar-preview-container { width: 100px; height: 100px; margin: 0 auto 20px; border-radius: 50%; overflow: hidden; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; background: var(--bg-card); }
.avatar-preview-container img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload-btns { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }
.btn-small { padding: 8px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary); font-size: 0.8rem; cursor: pointer; transition: all 0.2s; }
.btn-small:hover { background: var(--bg-card-hover); border-color: var(--accent); }
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 12px; }
.toast { padding: 14px 20px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.875rem; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; animation: slideIn 0.3s ease; }
.toast.success { border-color: var(--accent); }
.toast.error { border-color: #ef4444; }
@keyframes slideIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@media (max-width: 768px) {
  .main-container { padding: 16px; }
  .header { gap: 8px; top: 16px; right: 16px; }
  .page-title { font-size: 2rem; }
  .settings-panel { width: 100%; right: -100%; }
  .modal { max-width: calc(100% - 32px); }
  .layout-section > .drag-handle,
  .page-title > .drag-handle { display: none !important; }
  .layout-toolbar { display: none !important; }
  .main-container.free-layout .layout-section { position: relative !important; left: auto !important; top: auto !important; transform: none !important; }
  .main-container.free-layout .page-title { position: absolute !important; left: 50% !important; top: 22% !important; transform: translate(-50%, -50%) !important; }
}

/* ===== 主容器 ===== */
.main-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.main-container.free-layout {
  display: block;
  min-height: 100vh;
}

/* ===== 布局区块 ===== */
.layout-section {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.25s ease, opacity 0.25s ease;
  user-select: none;
}

.layout-section * {
  user-select: none;
}

/* 但输入框需要可以选中 */
.layout-section input,
.layout-section textarea {
  user-select: text;
}

#section_search { margin-top: 33vh; }
#section_links { margin-top: 30px; }

/* 自由布局模式 */
.main-container.free-layout .layout-section {
  max-width: 680px;
  position: absolute;
  z-index: 10;
  cursor: default;
  margin-top: 0;
}

.main-container.free-layout #section_search {
  margin-top: 0;
}

.main-container.free-layout #section_links {
  margin-top: 0;
}

.main-container.free-layout .layout-section.dragging {
  opacity: 0.9;
  z-index: 100;
  border-radius: var(--radius);
  box-shadow: 0 0 0 2px var(--border-active), var(--shadow-lg);
  background: rgba(0, 212, 170, 0.05);
}

/* ===== 主页面的布局区块拖拽手柄 ===== */
.layout-section > .drag-handle {
  position: absolute;
  top: 50%;
  left: -40px;
  transform: translateY(-50%);
  width: 30px;
  height: 48px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: grab;
  color: var(--text-muted);
  font-size: 0.85rem;
  z-index: 100;
  backdrop-filter: blur(12px);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  user-select: none;
}

.main-container.free-layout .layout-section > .drag-handle {
  display: flex;
}

.layout-section > .drag-handle:hover {
  color: var(--accent);
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

.layout-section > .drag-handle:active {
  cursor: grabbing;
}

/* ===== 标题拖拽区块 ===== */
.layout-section#section_title {
  display: block;
  width: 100%;
  position: static;
  text-align: center;
}

/* ===== 布局编辑模式 ===== */
.main-container.layout-editing .layout-section {
  cursor: grab;
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  transition: outline 0.2s ease, box-shadow 0.2s ease;
  border-radius: var(--radius);
}

.main-container.layout-editing .layout-section:hover {
  outline-color: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.main-container.layout-editing .layout-section.dragging {
  cursor: grabbing;
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft), var(--shadow-lg);
  z-index: 200;
  opacity: 0.95;
}

/* ===== 链接图标行（模态框） ===== */
.link-icon-row { display: flex; align-items: center; gap: 12px; }
.link-icon-preview {
  width: 42px; height: 42px; min-width: 42px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 1.1rem;
  overflow: hidden;
}
.link-icon-preview img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

/* ===== 图标选择器网格 ===== */
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 160px;
  overflow-y: auto;
}
.icon-picker-grid i {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  font-size: 1.1rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.icon-picker-grid i:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1);
}

/* ===== 快捷链接图片图标 ===== */
.quick-link .link-img-icon {
  width: 22px; height: 22px; object-fit: contain;
  flex-shrink: 0;
}

/* 布局编辑提示条 */
.layout-edit-banner {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: 50px;
  padding: 10px 24px;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  backdrop-filter: blur(20px);
  z-index: 500;
  box-shadow: 0 4px 20px rgba(0, 212, 170, 0.2);
  display: flex;
  align-items: center;
  animation: bannerSlideIn 0.3s ease;
}

@keyframes bannerSlideIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}


.layout-edit-hint {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius);
  padding: 16px 24px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(20px);
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  text-align: center;
  max-width: 320px;
}

/* ===== 设置面板 - 布局位置列表 ===== */
.layout-pos-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.layout-pos-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.layout-pos-item:hover {
  background: var(--bg-card-hover);
}

.layout-pos-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.layout-pos-info {
  flex: 1;
  min-width: 0;
}

.layout-pos-info .item-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.layout-pos-info .item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== 开关按钮 ===== */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-soft);
  border-color: var(--border-active);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--accent);
}