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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: #475569;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  background: #eff6ff;
  color: #2563eb;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  flex: 1;
}

.page-header {
  text-align: center;
  padding: 40px 0 30px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}

.page-header p {
  font-size: 16px;
  color: #64748b;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px 0 40px;
}

.tool-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 28px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.tool-card:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
  transform: translateY(-2px);
}

.tool-icon {
  width: 48px;
  height: 48px;
  background: #eff6ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.tool-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #0f172a;
}

.tool-card p {
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

.tool-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  padding: 20px 0 40px;
  align-items: start;
}

.tool-main {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 32px;
}

.tool-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  margin-bottom: 8px;
}

textarea,
input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s;
}

textarea:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #2563eb;
}

textarea {
  min-height: 180px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  gap: 6px;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

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

.result-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
  min-height: 100px;
  font-family: "Menlo", "Monaco", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.result-box img {
  display: block;
  margin: 0 auto;
}

.ads-container {
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ads-sidebar {
  min-height: 250px;
}

.footer {
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding: 30px 20px;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  font-size: 14px;
  color: #64748b;
}

.footer-links {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.footer-links a {
  color: #64748b;
  text-decoration: none;
}

.footer-links a:hover {
  color: #2563eb;
}

.content-page {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 40px;
  max-width: 800px;
  margin: 20px auto 40px;
}

.content-page h1 {
  font-size: 28px;
  margin-bottom: 20px;
  color: #0f172a;
}

.content-page h2 {
  font-size: 20px;
  margin: 30px 0 12px;
  color: #1e293b;
}

.content-page p {
  margin-bottom: 12px;
  color: #475569;
}

.content-page ul {
  margin-left: 20px;
  margin-bottom: 16px;
}

.content-page li {
  margin-bottom: 6px;
  color: #475569;
}

@media (max-width: 900px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }

  .tool-sidebar {
    order: -1;
    flex-direction: row;
    overflow-x: auto;
  }

  .ads-sidebar {
    min-height: 90px;
    min-width: 300px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .nav-links {
    display: none;
  }

  .page-header {
    padding: 24px 0 20px;
  }

  .tool-main {
    padding: 20px;
  }

  .content-page {
    padding: 24px;
  }
}

