/* ================================
   CSS 复选框生成器 - 自定义样式
   ================================ */

:root {
  --bg: #FAFAF9;
  --bg-alt: #F5F5F4;
  --surface: #FFFFFF;
  --border: #E7E5E4;
  --border-strong: #D6D3D1;
  --text: #1E293B;
  --text-secondary: #52525B;
  --text-muted: #71717A;
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: rgba(79, 70, 229, 0.08);
  --secondary: #F97316;
  --accent: #EC4899;
  --success: #059669;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.toast {
  position: fixed; top: 24px; right: 24px;
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 100px;
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  z-index: 1000;
  transform: translateX(calc(100% + 40px));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.toast.show { transform: translateX(0); }
.toast-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; }

.page { max-width: 960px; margin: 0 auto; padding: 0 32px; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #A5B4FC; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #4F46E5; }

::selection { background: rgba(79, 70, 229, 0.2); color: #1E293B; }

.tool-section { padding: 32px 0; }

.checkbox-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.controls-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.controls-title {
  font-size: 16px; font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.type-tabs {
  display: flex; gap: 0;
  margin-bottom: 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px;
}

.type-tab {
  flex: 1;
  padding: 8px 12px;
  background: transparent; border: none;
  border-radius: 100px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.type-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-weight: 600;
}
.type-tab:hover:not(.active) { color: var(--text-secondary); }

.slider-group { margin-bottom: 18px; }
.slider-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  margin-bottom: 6px;
}
.slider-label span {
  font-family: 'SF Mono', monospace; font-size: 12px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px; border-radius: 6px;
}

.slider {
  width: 100%; height: 6px;
  -webkit-appearance: none; appearance: none;
  background: var(--border); border-radius: 3px;
  outline: none; cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--primary); border-radius: 50%;
  box-shadow: 0 2px 6px rgba(79,70,229,0.3);
  cursor: pointer;
}

.color-picker {
  width: 100%; height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.preview-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.preview-area {
  min-height: 360px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt);
  padding: 30px;
}

.preview-group {
  display: flex; flex-direction: column; gap: 20px;
}

.code-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.panel-title {
  font-size: 15px; font-weight: 700; color: var(--text);
}

.css-output {
  padding: 20px;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  font-size: 14px; line-height: 1.7;
  color: var(--text); white-space: pre;
  margin: 0; overflow-x: auto;
}

.btn-copy {
  padding: 6px 16px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 100px;
  font-family: inherit; font-size: 12px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  transition: all 0.15s ease; white-space: nowrap;
}
.btn-copy:hover { background: var(--primary-light); border-color: rgba(79,70,229,0.25); color: var(--primary); }

.guide-section {
  margin-top: 24px; margin-bottom: 64px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.guide-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 14px 20px;
  background: none; border: none; cursor: pointer;
  transition: background 0.15s ease;
}
.guide-toggle:hover { background: var(--bg-alt); }
.guide-toggle-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: #1E293B;
}
.guide-toggle.open .toggle-arrow { transform: rotate(180deg); }
.toggle-arrow { transition: transform 0.2s ease; color: var(--text-muted); }
.guide-list { padding: 0 20px 20px; }
.guide-list.hidden { display: none; }
.guide-item { padding: 16px 0; border-top: 1px solid var(--border); }
.guide-item:first-child { border-top: 1px solid var(--border); }
.guide-item-title {
  font-size: 14px; font-weight: 600; color: #1E293B; margin-bottom: 6px;
}
.guide-item-body {
  font-size: 13px; color: var(--text-secondary); line-height: 1.8;
}

@media (max-width: 768px) {
  .page { padding: 0 16px; }
  .checkbox-layout { grid-template-columns: 1fr; }
  .preview-area { min-height: 260px; }
}
