:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-tag: #f1f5f9;
  --bg-tag-hover: #e2e8f0;
  --bg-icon: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-brand: #2563eb;
  --text-brand-hover: #1d4ed8;
  --border-color: #e2e8f0;
  --border-card: #e2e8f0;
  --border-card-hover: #cbd5e1;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
  --shadow-card-hover: 0 10px 20px -4px rgba(37, 99, 235, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --radius-lg: 16px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --radius-pill: 9999px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-main);
  min-height: 100vh;
  padding: 24px 16px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: transparent;
}

/* Header & Navigation */
.nav-bar {
  background: #ffffff;
  padding: 12px 24px;
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-back-link {
  color: var(--text-brand);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s ease;
}

.nav-back-link:hover {
  transform: translateX(-2px);
  color: var(--text-brand-hover);
}

.nav-lang-badge {
  color: var(--text-brand);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid #93c5fd;
  background-color: #eff6ff;
}

.header {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 50%, #eff6ff 100%);
  padding: 36px 28px 28px 28px;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #eff6ff;
  color: var(--text-brand);
  border: 1px solid #dbeafe;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.header h1 span {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header .subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto;
}

/* Content Area */
.content {
  padding: 0;
}

.section-header {
  margin-bottom: 20px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--text-brand);
  border-radius: 2px;
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* Tool Card */
.tool-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

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

.tool-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.tool-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: var(--bg-icon);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 1px solid #dbeafe;
}

.tool-title-link {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.tool-title-link:hover {
  color: var(--text-brand);
}

/* Card Tags */
.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tag {
  background-color: var(--bg-tag);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
}

.tag:hover {
  background-color: var(--bg-tag-hover);
}

.tag-accent {
  background-color: #eff6ff;
  color: #1d4ed8;
  border-color: #dbeafe;
}

/* Card Description */
.tool-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
  flex-grow: 1;
}

/* Card Footer */
.tool-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.open-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-brand);
  text-decoration: none;
  transition: all 0.2s ease;
}

.open-link-btn:hover {
  color: var(--text-brand-hover);
  transform: translateX(3px);
}

/* Ad Card */
.ad-card {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: 0;
}

.ad-card:empty,
.ad-card:has(ins[data-ad-status="unfilled"]),
ins.adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
}

/* Footer */
.footer {
  text-align: center;
  padding: 20px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 12px;
}

.footer-link {
  color: var(--text-brand);
  text-decoration: none;
  font-weight: 500;
}

.footer-link:hover {
  text-decoration: underline;
}

.copyright {
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 12px 10px;
  }

  .header {
    padding: 28px 18px 22px 18px;
    margin-bottom: 20px;
  }

  .header h1 {
    font-size: 1.85rem;
  }

  .tools-grid {
    gap: 14px;
  }

  .tool-card {
    padding: 16px 18px;
    border-radius: 12px;
  }

  .nav-bar {
    padding: 10px 18px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.65rem;
  }

  .header .subtitle {
    font-size: 0.9rem;
  }

  .tool-card {
    padding: 14px 16px;
  }
}
