:root{
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #6b7280;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --card: #ffffff;
  --panel-bg: #f9fafb;
  --border: #e5e7eb;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-lg: rgba(0, 0, 0, 0.15);
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
@media (prefers-color-scheme: dark){
  :root{
    --bg: #0f0f0f;
    --fg: #e5e5e5;
    --muted: #a1a1aa;
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --card: #1a1a1a;
    --panel-bg: #171717;
    --border: #262626;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.4);
    --gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  }
}
*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
}
.container{ max-width: 1200px; margin: 0 auto; padding: 24px; }
.site-header{ 
  background: var(--gradient);
  border-bottom: none;
  padding: 32px 0;
  position: relative;
  overflow: hidden;
}
.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}
.site-header .container {
  position: relative;
  z-index: 1;
}
.site-title{ 
  margin: 0; 
  color: white; 
  font-size: 2.5rem; 
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.site-subtitle{ 
  margin: 8px 0 0; 
  color: rgba(255, 255, 255, 0.9); 
  font-size: 1.1rem;
}
.site-footer{ 
  border-top: 1px solid var(--border); 
  margin-top: 64px; 
  background: var(--card);
  padding: 24px 0;
}

.section-title{ 
  margin: 32px 0 24px; 
  font-size: 1.8rem; 
  font-weight: 600;
  color: var(--fg);
}
.tool-grid{ 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
  gap: 24px; 
}
.tool-card{
  display: block; 
  text-decoration: none; 
  color: inherit; 
  background: var(--card); 
  padding: 24px; 
  border: 1px solid var(--border); 
  border-radius: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow);
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.tool-card:hover{ 
  transform: translateY(-4px); 
  box-shadow: 0 8px 32px var(--shadow-lg);
  border-color: var(--accent);
}
.tool-card:hover::before {
  transform: scaleX(1);
}
.tool-card h3{ 
  margin: 0 0 12px; 
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
}
.tool-card p{ 
  margin: 0 0 16px; 
  color: var(--muted); 
  line-height: 1.5;
}
.tool-link{ 
  color: var(--accent); 
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tool-link:hover {
  color: var(--accent-hover);
}

textarea.editor{
  width: 100%; 
  padding: 16px; 
  border-radius: 12px; 
  border: 2px solid var(--border); 
  background: var(--panel-bg); 
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s ease;
}
textarea.editor:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

button{
  appearance: none; 
  border: 2px solid var(--accent); 
  background: var(--accent); 
  color: white; 
  padding: 12px 20px; 
  border-radius: 8px; 
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}
button:hover{ 
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}
button:active {
  transform: translateY(0);
}
.back-link{ 
  color: rgba(255, 255, 255, 0.9); 
  text-decoration: none; 
  font-weight: 500;
  transition: color 0.2s ease;
}
.back-link:hover {
  color: white;
}
.error{ 
  color: #ef4444; 
  white-space: pre-wrap; 
  background: rgba(239, 68, 68, 0.1);
  padding: 12px;
  border-radius: 8px;
  border-left: 4px solid #ef4444;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }
  
  .site-title {
    font-size: 2rem;
  }
  
  .site-subtitle {
    font-size: 1rem;
  }
  
  .tool-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .tool-card {
    padding: 20px;
  }
  
  .section-title {
    font-size: 1.5rem;
    margin: 24px 0 16px;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 24px 0;
  }
  
  .site-title {
    font-size: 1.75rem;
  }
  
  .tool-card {
    padding: 16px;
  }
  
  button {
    padding: 10px 16px;
    font-size: 14px;
  }
}

