:root {
  --bg: #ffffff;
  --ink: #1f2328;
  --muted: #5f6875;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --soft: #f8fafc;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Segoe UI Emoji", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 var(--font);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a:hover { text-decoration: underline; }

button,
input {
  font: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.header-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(150%) blur(6px);
}

.header-inner {
  min-height: 60px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(180px, 240px) auto;
  align-items: center;
  gap: 14px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  min-width: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.nav-cats {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
}

.nav-cats a,
.lang-switch a {
  color: var(--muted);
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.4;
}

.nav-cats a {
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.nav-cats a.is-active {
  color: var(--ink);
  border-color: var(--accent);
  font-weight: 700;
}

.site-search {
  min-width: 0;
  width: 100%;
}

.site-search input {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 7px 12px;
  border: 1px solid #b8c0cc;
  border-radius: 999px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  background: #fff;
}

.site-search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-switch {
  display: none;
}

.site-menu {
  display: block;
  position: relative;
  min-width: 0;
}

.menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #b8c0cc;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
  white-space: nowrap;
}

.menu-button::-webkit-details-marker { display: none; }

.menu-icon {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1100;
  width: min(310px, calc(100vw - 40px));
  max-height: calc(100vh - 84px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 30px rgba(31, 35, 40, .14);
}

.menu-section {
  display: grid;
  gap: 2px;
}

.menu-section + .menu-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.menu-section a {
  display: block;
  padding: 7px 8px;
  border-radius: 7px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.menu-section a:hover,
.menu-section a.is-active {
  color: var(--accent);
  background: var(--soft);
  text-decoration: none;
}

.menu-languages strong {
  display: block;
  padding: 0 8px 5px;
  color: var(--muted);
  font-size: 13px;
}

.menu-languages a.is-current {
  color: var(--accent);
  font-weight: 700;
}

.main-area {
  padding: 22px 0 28px;
}

.page-title {
  margin: 8px 0 14px;
  font-size: 28px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.section-title {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 16px;
  letter-spacing: .02em;
}

.site-intro {
  max-width: 760px;
  margin: -4px 0 22px;
}

.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  align-items: stretch;
}

.tool-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 170px;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.tool-card::before {
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent);
  content: "";
}

.card-title {
  margin: 2px 0 2px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.card-title a {
  color: var(--ink);
  text-decoration: none;
}

.card-title a:hover { text-decoration: underline; }

.card-summary {
  min-height: 2.6em;
  margin: 0;
  color: var(--ink);
  opacity: .9;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid #c5ccd6;
  border-radius: 999px;
  color: #46515f;
  background: var(--soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.card-meta a { color: #46515f; }

.card-meta time { white-space: nowrap; }

.promo-card {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.promo-card .card-title a,
.promo-card .card-summary {
  color: var(--accent-ink);
}

.promo-card .card-summary { opacity: .96; }

.btn {
  display: inline-block;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.btn:hover {
  opacity: .92;
  text-decoration: none;
}

.btn--invert {
  color: var(--accent);
  background: var(--accent-ink);
}

.article {
  max-width: 760px;
  margin: 0 auto;
  overflow-wrap: anywhere;
}

.post-head {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.post-title {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.post-lead {
  margin: 6px 0 10px;
  color: #374151;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.post-body { margin-top: 12px; }

.post-body :where(p, ul, ol) {
  margin: 0 0 1em;
}

.post-body :where(h2, h3) {
  margin: 1.2em 0 .6em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.post-body :where(pre, code) {
  max-width: 100%;
  overflow-x: auto;
}

.post-source {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 14px;
}

.related {
  margin-top: 28px;
}

.related h2 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 16px;
}

.related ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  font-size: 14px;
}

.pager a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pager .info {
  flex: 0 0 auto;
  color: var(--muted);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 24px 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 20px 0;
  color: var(--muted);
  font-size: 14px;
}

.site-footer a { color: #46515f; }

.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 12px;
}

@media (max-width: 1080px) {
  .header-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .site-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .nav-cats {
    grid-column: 2;
    grid-row: 1;
  }

  .site-menu {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .nav-cats {
    display: none;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .site-menu {
    grid-column: 2;
    grid-row: 1;
  }

  .site-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 600px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .site-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .site-menu {
    grid-column: 2;
    grid-row: 1;
  }

  .page-title { font-size: 26px; }
  .post-title { font-size: 28px; }

  .footer-links {
    display: flex;
    margin: 8px 0 0;
  }
}

@media (max-width: 380px) {
  .container {
    padding-right: 16px;
    padding-left: 16px;
  }

  .menu-button {
    padding-right: 8px;
    padding-left: 8px;
  }

  .menu-button span:last-child {
    font-size: 13px;
  }

  .menu-panel {
    width: min(290px, calc(100vw - 32px));
  }
}

@media (min-width: 1080px) {
  .page-title { font-size: 32px; }
}
