* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f8f9fa;
  --card: #ffffff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --border: #e5e7eb;
  --success: #10b981;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--primary); }

/* Hero */
.hero {
  text-align: center;
  padding: 64px 24px 48px;
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero p {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 32px;
}

/* Tool Grid */
.tools-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  cursor: pointer;
}

.tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.tool-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tool-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

/* Tool Page */
.tool-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.tool-page h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.tool-page .subtitle {
  color: var(--muted);
  margin-bottom: 32px;
  font-size: 16px;
}

.tool-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.tool-container textarea,
.tool-container input[type="text"],
.tool-container input[type="number"],
.tool-container input[type="date"],
.tool-container select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: var(--bg);
}

.tool-container textarea:focus,
.tool-container input:focus,
.tool-container select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.tool-container textarea {
  min-height: 160px;
  resize: vertical;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 14px;
  line-height: 1.6;
}

.tool-result {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 15px;
}

.tool-result .stat {
  display: inline-block;
  margin-right: 24px;
  font-weight: 600;
  color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover { background: var(--primary-hover); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: rgba(79, 70, 229, 0.05);
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-group .btn { padding: 8px 16px; font-size: 13px; }

.options-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.options-row label {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.options-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.options-row input[type="range"] {
  width: 120px;
  accent-color: var(--primary);
}

/* Content section */
.tool-content {
  margin-top: 40px;
}

.tool-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}

.tool-content p, .tool-content li {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 12px;
}

.tool-content ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.tool-content li { margin-bottom: 8px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 16px; }
  .tools-grid { grid-template-columns: 1fr; }
  .tool-container { padding: 20px; }
  .btn-group { flex-direction: column; }
  .btn-group .btn { width: 100%; justify-content: center; }
}

/* Copy notification */
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.3s ease;
  z-index: 999;
}

.copy-toast.show {
  transform: translateX(-50%) translateY(0);
}
