:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.mt-24 { margin-top: 24px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #f1f5f9;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 5px;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--text);
  text-decoration: none;
}

.nav-links { display: flex; gap: 20px; flex-wrap: wrap; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.94rem;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.btn-sm { padding: 6px 12px; font-size: 0.85rem; margin-top: 10px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: #fff; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.hero { padding: 52px 0 60px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 34px;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 14px;
}

h1 { margin: 0 0 14px; font-size: 2.3rem; line-height: 1.18; letter-spacing: -0.02em; }
h2 { margin: 0 0 10px; font-size: 1.7rem; letter-spacing: -0.015em; }
h3 { margin: 0 0 8px; font-size: 1.1rem; }
.lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 22px; }
.muted { color: var(--muted); font-size: 0.92rem; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.mini-tool { padding: 20px; }
.mini-tool-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.mini-tool-head a { color: var(--accent); text-decoration: none; font-size: 0.85rem; }

.mini-preview-stage {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 28px;
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.demo-card {
  background: #fff;
  padding: 18px 24px;
  min-width: 220px;
  text-align: center;
  border: 1px solid #e2e8f0;
}
.demo-card strong { display: block; margin-bottom: 4px; }
.demo-card span { font-size: 0.85rem; color: var(--muted); }
.mini-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}
.mini-controls input { width: 100%; margin-top: 4px; }

.code-box {
  margin: 0;
  padding: 13px 15px;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
  overflow-x: auto;
  line-height: 1.5;
}

.section { padding: 56px 0; }
.section-alt { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 28px; }
.section-head p { color: var(--muted); margin: 0; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.nav-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.nav-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.nav-card h3 { margin: 12px 0 6px; }
.nav-card p { margin: 0 0 14px; color: var(--muted); font-size: 0.9rem; flex: 1; }
.card-link { color: var(--accent); font-size: 0.88rem; font-weight: 600; }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.article-card { overflow: hidden; }
.article-thumb img { width: 100%; height: auto; display: block; border-bottom: 1px solid var(--border); }
.article-body { padding: 20px; }
.article-meta { font-size: 0.83rem; color: var(--muted); margin-bottom: 8px; }
.article-body h3 a { color: var(--text); text-decoration: none; }
.article-body h3 a:hover { color: var(--accent); }
.article-body p { margin: 8px 0 0; color: var(--muted); font-size: 0.93rem; }

.page-head { padding: 40px 0 24px; background: #fff; border-bottom: 1px solid var(--border); }
.breadcrumbs { font-size: 0.86rem; color: var(--muted); margin-bottom: 10px; }
.breadcrumbs a { color: var(--accent); text-decoration: none; }

.tool-stack { display: grid; gap: 24px; }
.tool-panel { padding: 24px; }
.tool-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  align-items: start;
  margin-top: 16px;
}
.tool-controls { display: grid; gap: 12px; font-size: 0.9rem; color: var(--muted); }
.tool-controls input[type="range"] { width: 100%; }
.color-pair { display: flex; gap: 16px; }
.color-pair input { display: block; margin-top: 6px; width: 64px; height: 36px; border: 1px solid var(--border); border-radius: 6px; }

.preview-stage {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 38px 20px;
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.shadow-box {
  background: #fff;
  padding: 24px 32px;
  font-weight: 600;
  border: 1px solid #e2e8f0;
}
.grad-stage {
  height: 150px;
  border-radius: 12px;
  margin-bottom: 14px;
}
.converter-grid {
  display: grid;
  grid-template-columns: 120px repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--muted);
}
.converter-grid input[type="text"] {
  width: 100%;
  margin-top: 6px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, monospace;
}
.converter-grid input[type="color"] {
  display: block;
  margin-top: 6px;
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.flex-controls {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.flex-controls select, .feedback-row select {
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.fx-stage {
  min-height: 170px;
  padding: 16px;
  border-radius: 12px;
  background: #f1f5f9;
  display: flex;
  margin-bottom: 14px;
}
.fx-item {
  min-width: 56px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-align: center;
}
.fx-item.tall { padding-top: 28px; padding-bottom: 28px; }

.article-page { padding: 40px 0 56px; }
.article-container { max-width: 780px; }
.article-hero-img { width: 100%; height: auto; border-radius: 12px; margin: 18px 0 24px; border: 1px solid var(--border); display: block; }
.article-container h2 { margin-top: 28px; font-size: 1.35rem; }
.article-container ul { color: var(--muted); padding-left: 20px; }

.feedback-box {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
  align-items: center;
}
.feedback-row { display: flex; gap: 10px; flex-wrap: wrap; }
.feedback-row input {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.feedback-status { margin-top: 8px; font-size: 0.86rem; }

.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  background: #fff;
  font-size: 0.9rem;
  color: var(--muted);
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

@media (max-width: 960px) {
  .hero-grid, .cards-grid, .articles-grid, .tool-grid, .feedback-box, .converter-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 12px; font-size: 0.88rem; }
  h1 { font-size: 1.85rem; }
}
