
:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-hover: 0 10px 25px rgba(0,0,0,0.1);
}

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

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Header */
header {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: #fff;
  padding: 2rem 1rem 3rem;
  text-align: center;
}
header h1 { font-size: 2rem; margin-bottom: 0.3rem; letter-spacing: -0.02em; }
header p { opacity: 0.9; font-size: 1rem; }
header .search-box {
  max-width: 500px;
  margin: 1.2rem auto 0;
  position: relative;
}
header .search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.8rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  outline: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
header .search-box::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 50%;
}
header .search-box::after {
  content: '';
  position: absolute;
  left: 2.1rem;
  top: 60%;
  width: 2px;
  height: 8px;
  background: rgba(255,255,255,0.7);
  transform: rotate(-45deg);
}

/* Nav */
nav {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
nav .container {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
nav a {
  padding: 0.8rem 1.2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
nav a:hover, nav a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  text-decoration: none;
}

/* Ad slots */
.ad-slot {
  background: #f1f5f9;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.8rem;
  margin: 1.5rem 0;
  text-align: center;
}
.ad-slot-sidebar { min-height: 250px; margin: 0; }

/* Category Section */
.category-section { margin: 2rem 0; }
.category-section h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

/* Tool Cards Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.tool-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.tool-card .tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  font-weight: 700;
  color: #fff;
}
.tool-card h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.tool-card h3 a { color: var(--text); }
.tool-card h3 a:hover { color: var(--primary); text-decoration: none; }
.tool-card p { font-size: 0.85rem; color: var(--text-secondary); }
.tool-card .tag {
  display: inline-block;
  background: #eef2ff;
  color: var(--primary);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Main layout with sidebar */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  margin: 2rem 0;
}
@media (max-width: 768px) {
  .main-layout { grid-template-columns: 1fr; }
  header h1 { font-size: 1.5rem; }
}

/* Content pages */
.content-page {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.content-page h1 { font-size: 1.6rem; margin-bottom: 1rem; }
.content-page h2 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; }
.content-page p { margin-bottom: 0.8rem; color: #475569; }
.content-page ul { margin: 0.5rem 0 1rem 1.5rem; color: #475569; }
.content-page ul li { margin-bottom: 0.3rem; }

/* Footer */
footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 2rem 1rem;
  margin-top: 3rem;
  text-align: center;
  font-size: 0.85rem;
}
footer a { color: #cbd5e1; }
footer a:hover { color: #fff; }
footer .footer-links { margin-bottom: 0.8rem; }
footer .footer-links a { margin: 0 0.5rem; }

