:root {
  --bg: #0b0f19;
  --fg: #e5e7eb;
  --muted: #aeb8c7;
  --line: #263044;
  --panel: #111827;
  --accent: #7c3aed;
  --accent-ink: #ffffff;
  --accent-2: #a855f7;
  --soft: rgba(124, 58, 237, 0.18);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--font);
}

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

a:hover {
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

img {
  max-width: 100%;
}

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

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

.mast {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 25, 0.94);
  backdrop-filter: blur(8px);
}

.mast-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  justify-self: center;
  min-width: 0;
  margin: 0;
  color: var(--fg);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.3px;
  overflow-wrap: anywhere;
}

.logo a {
  color: var(--fg);
  text-decoration: none;
}

.tools {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.search input {
  width: 220px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: var(--panel);
  color: var(--fg);
  font-size: 14px;
}

.search input::placeholder {
  color: var(--muted);
}

.search.big {
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: 8px;
}

.search.big input {
  width: min(560px, 100%);
}

.search button {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
}

.search button:hover,
.btn:hover {
  background: var(--accent-2);
  text-decoration: none;
}

.langs {
  display: flex;
  max-width: 100%;
  gap: 4px;
  flex-wrap: wrap;
}

.langs a {
  padding: 4px 6px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.langs a.on {
  background: var(--accent);
  color: var(--accent-ink);
}

.theme {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--fg);
  cursor: pointer;
}

.theme:hover {
  border-color: var(--accent);
}

.rss {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--fg);
  font-size: 13px;
  white-space: nowrap;
}

.rss:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.catnav {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 25, 0.98);
}

.catnav-inner {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-top: 10px;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

.catnav a {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.catnav a.on,
.catnav a:hover {
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
}

.main {
  min-width: 0;
  padding: 20px 0 40px;
}

.topic {
  max-width: 70ch;
  margin-top: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  text-align: center;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: start;
  gap: 20px;
  margin-top: 14px;
  margin-bottom: 8px;
}

.lead,
.kickers,
.card,
.card-body {
  min-width: 0;
}

.kickers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kicker {
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.kicker:last-child {
  border-bottom: 0;
}

.k-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

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

.k-title {
  margin: 4px 0;
  font-size: 15px;
  line-height: 1.35;
}

.k-title a {
  color: var(--fg);
}

.k-summary {
  margin: 0;
  color: var(--fg);
  font-size: 13px;
  opacity: 0.9;
}

.clamp-1,
.clamp-2 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.clamp-1 {
  -webkit-line-clamp: 1;
}

.clamp-2 {
  -webkit-line-clamp: 2;
}

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.card .media {
  display: block;
}

.cover {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  background: #111827;
}

.cover.lg,
.cover.sm {
  aspect-ratio: 16 / 9;
}

.cover.mini {
  aspect-ratio: 4 / 3;
}

.ph {
  display: grid;
  width: 100%;
  place-items: end start;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.ph-lg,
.ph-sm {
  aspect-ratio: 16 / 9;
}

.ph-mini {
  aspect-ratio: 4 / 3;
}

.ph-label {
  max-width: calc(100% - 20px);
  margin: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: #ffffff;
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

.card-lg .title {
  margin: 6px 0 8px;
  font-size: 22px;
  line-height: 1.35;
}

.card-sm .title,
.card-mini .title {
  margin: 4px 0 6px;
  font-size: 16px;
  line-height: 1.4;
}

.card .title a {
  color: var(--fg);
}

.summary {
  color: var(--fg);
  opacity: 0.9;
}

.meta {
  margin: 6px 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

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

.sections {
  display: grid;
  gap: 24px;
  margin-top: 24px;
  margin-bottom: 8px;
}

.sec {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.sec-title {
  min-width: 0;
  margin: 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.sec-title a {
  color: var(--fg);
}

.sec-more {
  padding: 2px 8px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 18px;
}

.sec-more:hover {
  background: var(--panel);
  color: var(--fg);
  text-decoration: none;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  gap: 16px;
}

.promo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  margin-bottom: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.promo-text {
  max-width: 70ch;
  margin: 0;
  overflow-wrap: anywhere;
}

.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  letter-spacing: 0.2px;
  text-align: center;
}

.crumbs {
  margin-top: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

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

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

.list-tools {
  margin-top: 10px;
  margin-bottom: 0;
}

.list .cards {
  margin-top: 10px;
}

.article {
  margin-top: 8px;
}

.article-head .meta {
  margin: 6px 0 8px;
}

.lede {
  color: var(--fg);
  font-size: 18px;
  opacity: 0.9;
}

.article-body,
.standard-body {
  max-width: 78ch;
  margin-top: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.article-body img,
.standard-body img {
  height: auto;
  max-width: 100%;
}

.article-body h2,
.article-body h3,
.standard-body h2,
.standard-body h3 {
  margin-top: 1.2em;
}

.source-link {
  max-width: 78ch;
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  overflow-wrap: anywhere;
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
}

.tags a {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--fg);
  font-size: 13px;
}

.tags a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.related {
  margin-top: 18px;
  margin-bottom: 6px;
}

.related .cards {
  margin-top: 10px;
}

.standard-page {
  margin-top: 8px;
}

.standard-body {
  margin-bottom: 20px;
}

.sent {
  max-width: 78ch;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--fg);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  color: var(--muted);
}

.pager a {
  max-width: 45%;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--fg);
  overflow-wrap: anywhere;
}

.pager a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.sitefoot {
  margin-top: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  background: rgba(11, 15, 25, 0.94);
}

.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 10px;
}

.foot-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.contact {
  color: var(--muted);
  overflow-wrap: anywhere;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --fg: #1f2328;
    --muted: #586174;
    --line: #d9dee8;
    --panel: #f8fafc;
    --soft: rgba(124, 58, 237, 0.1);
  }

  .mast,
  .sitefoot {
    background: rgba(255, 255, 255, 0.94);
  }

  .catnav {
    background: rgba(255, 255, 255, 0.98);
  }
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #1f2328;
  --muted: #586174;
  --line: #d9dee8;
  --panel: #f8fafc;
  --soft: rgba(124, 58, 237, 0.1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f19;
  --fg: #e5e7eb;
  --muted: #aeb8c7;
  --line: #263044;
  --panel: #111827;
  --soft: rgba(124, 58, 237, 0.18);
}

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .logo {
    justify-self: start;
  }

  .search input {
    width: min(54vw, 320px);
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .foot-right {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .mast-top {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .logo {
    justify-self: start;
  }

  .tools {
    width: 100%;
    justify-content: flex-start;
  }

  .search {
    flex: 1 1 150px;
    min-width: 0;
  }

  .search input {
    width: 100%;
    max-width: none;
  }

  .search.big {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .search.big input {
    flex: 1 1 180px;
  }

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

  .page-title {
    font-size: 22px;
  }

  .card-lg .title {
    font-size: 20px;
  }

  .promo {
    align-items: stretch;
    flex-direction: column;
  }

  .promo .btn {
    width: 100%;
  }
}
