:root {
  --bg: #0f1117;
  --surface: #1a1c25;
  --surface-hover: #22242e;
  --border: #2a2d3a;
  --text: #e4e4e7;
  --text-muted: #9ca3af;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --success: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent-hover);
}

/* Navigation */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(26, 28, 37, 0.85);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-brand span {
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-links {
  display: flex;
  gap: 0.25rem;
}
.nav-links a {
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--surface-hover);
}

/* Main content */
.main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
  width: 100%;
}

/* Hero section */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

/* Home sections */
.home-section {
  margin-bottom: 3.5rem;
}
.home-section:last-child {
  margin-bottom: 0;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.section-icon {
  font-size: 2rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}
.section-header > div > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.15rem 0 0;
}
.section-link {
  margin-left: auto;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.section-link:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-hover);
}
.section-footer {
  text-align: center;
  margin-top: 1.5rem;
}
.view-all-btn {
  display: inline-block;
  padding: 0.65rem 1.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}
.view-all-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-hover);
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* Tool cards grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.tool-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 32px var(--accent-glow);
  transform: translateY(-2px);
}
.tool-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
}
.tool-card h3 a {
  color: var(--text);
}
.tool-card h3 a:hover {
  color: var(--accent-hover);
}
.tool-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}
.tool-card .arrow {
  margin-top: auto;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.25s;
}
.tool-card:hover .arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Page header */
.page-header {
  margin-bottom: 2.5rem;
}
.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-header p {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Tool page styles */
.tool-stack {
  display: grid;
  gap: 1.5rem;
}

.tool-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.tool-widget {
  margin: 0;
}

.tool-container input,
.tool-container textarea,
.tool-container select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 0.75rem;
}
.tool-container input:focus,
.tool-container textarea:focus,
.tool-container select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.tool-container input::placeholder,
.tool-container textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}
.tool-container textarea {
  min-height: 150px;
  resize: vertical;
}

.tool-container button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.tool-container button:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px var(--accent-glow);
}
.tool-container button:active {
  transform: scale(0.97);
}

.tool-container #result {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 600;
  min-height: 3rem;
  display: flex;
  align-items: center;
}

.tool-article h2:first-child {
  margin-top: 0;
}

.tool-steps {
  margin-bottom: 1.5rem;
}

.tool-steps li {
  margin-bottom: 0.5rem;
}

.tool-faqs {
  display: grid;
  gap: 0.85rem;
}

.tool-faq {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
}

.tool-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

.tool-faq summary::-webkit-details-marker {
  display: none;
}

.tool-faq summary::after {
  content: "+";
  float: right;
  color: var(--accent);
}

.tool-faq[open] summary::after {
  content: "-";
}

.tool-faq[open] summary {
  margin-bottom: 0.75rem;
}

.tool-faq-answer > :last-child {
  margin-bottom: 0;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.breadcrumb a {
  color: var(--text-muted);
}
.breadcrumb a:hover {
  color: var(--accent);
}
.breadcrumb .sep {
  margin: 0 0.5rem;
  opacity: 0.5;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Articles grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.article-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 32px var(--accent-glow);
  transform: translateY(-2px);
}
.article-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}
.article-card .article-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.7;
}
.article-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}
.article-card .arrow {
  margin-top: auto;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.25s;
}
.article-card:hover .arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Article page */
.article-header {
  margin-bottom: 2rem;
}
.article-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.article-header .article-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.75rem;
}
.article-header .article-description {
  color: var(--text-muted);
  font-size: 1.05rem;
}
.article-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  line-height: 1.8;
}
.article-body h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
}
.article-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
}
.article-body p {
  margin-bottom: 1rem;
  color: var(--text);
}
.article-body code {
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}
.article-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}
.article-body pre code {
  background: none;
  padding: 0;
}
.article-body ul, .article-body ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}
.article-body li {
  margin-bottom: 0.35rem;
}

/* Responsive */
@media (max-width: 640px) {
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .main { padding: 2rem 1rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .articles-grid { grid-template-columns: 1fr; }
  .tool-container { padding: 1.25rem; }
  .article-body { padding: 1.25rem; }
  .section-header {
    flex-wrap: wrap;
  }
  .section-link {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
}
