:root {
  --bg: #ffffff;
  --ink: #111827;
  --muted: #4b5563;
  --line: #e5e7eb;
  --surface: #ffffff;
  --soft: #fff1f2;
  --accent: #f43f5e;
  --accent-ink: #ffffff;
  --promo-ink: #881337;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 6px 24px rgba(17, 24, 39, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.65 var(--font);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  text-decoration: underline;
}

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

button,
input {
  font: inherit;
}

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

.header-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(120%) blur(8px);
}

.header-inner {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 10px 16px;
  min-width: 0;
}

.header-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 20px;
  align-items: center;
  min-width: 0;
}

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

.nav-cats {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  padding: 4px 0 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}

.nav-cats::-webkit-scrollbar {
  height: 4px;
}

.nav-cats::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}

.nav-link {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
}

.nav-link.is-active {
  color: var(--accent-ink);
  background: var(--accent);
}

.lang-switch {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  font-size: 13px;
}

.lang-switch .lang {
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--muted);
  line-height: 1.35;
  white-space: nowrap;
}

.lang-switch .lang.on {
  color: var(--accent-ink);
  background: var(--accent);
  text-decoration: none;
}

.nav-search {
  width: min(100%, 420px);
  min-width: 0;
  margin-top: 4px;
}

.search-input {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  color: var(--ink);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.4;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, .18);
}

.site-main {
  width: min(1200px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 28px 16px 40px;
}

.hero {
  margin-bottom: 16px;
}

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

.site-subtitle {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 16px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  min-width: 0;
  margin-top: 18px;
}

.deal-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 240px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card-cover {
  display: block;
  aspect-ratio: 16 / 9;
  margin-bottom: 10px;
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 6px);
  background: #f8fafc;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 22px;
}

.cat-badge {
  display: inline-block;
  max-width: 100%;
  padding: 2px 8px;
  overflow-wrap: anywhere;
  border-radius: 999px;
  color: #111827;
  background: hsl(var(--h, 0), 78%, 88%);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.src.small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.card-title {
  min-width: 0;
  margin: 8px 0 6px;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.35;
}

.card-title a {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.card-summary {
  display: -webkit-box;
  min-height: 2.6em;
  margin: 0 0 10px;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: #374151;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  margin-top: auto;
}

.card-date {
  color: var(--muted);
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  padding: 8px 14px;
  overflow-wrap: anywhere;
  border: none;
  border-radius: 999px;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.btn:hover {
  text-decoration: none;
  filter: saturate(110%);
}

.btn.ghost {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
}

.promo-card {
  border: none;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), #be123c);
}

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

.promo-card .card-summary {
  overflow-wrap: anywhere;
  color: #ffffff;
}

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

.promo-label {
  display: inline-block;
  max-width: 100%;
  padding: 2px 8px;
  overflow-wrap: anywhere;
  border-radius: 999px;
  color: var(--accent-ink);
  background: rgba(255, 255, 255, .25);
  font-size: 12px;
  font-weight: 700;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

.pager-link {
  color: var(--accent);
  font-weight: 600;
}

.pager-info {
  color: var(--muted);
  font-size: 14px;
}

.article {
  max-width: 760px;
  min-width: 0;
  margin: 0 auto;
  padding: 10px 0;
}

.article-head {
  margin-bottom: 10px;
}

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

.article-meta {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 14px;
}

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

.article-cover {
  margin: 18px 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.article-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.article-body {
  margin-top: 10px;
  overflow-wrap: anywhere;
}

.article-body img {
  border-radius: 8px;
}

.article-body iframe,
.article-body video,
.article-body table {
  max-width: 100%;
}

.article-source {
  margin-top: 20px;
}

.related-block {
  max-width: 760px;
  min-width: 0;
  margin: 28px auto 0;
}

.related-title {
  margin: 0 0 10px;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.related-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-list li {
  padding: 6px 0;
  overflow-wrap: anywhere;
}

.related-list a {
  color: var(--ink);
}

.site-footer {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 20px 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-left: auto;
}

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

.footer-links a:hover {
  color: var(--ink);
  text-decoration: none;
}

.copyright {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.float-contact {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 10px 30px rgba(244, 63, 94, .35);
}

.float-contact:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.empty {
  padding: 18px 0;
  overflow-wrap: anywhere;
}

.not-found {
  text-align: center;
}

@media (max-width: 600px) {
  .header-inner {
    padding: 10px 16px;
  }

  .header-top {
    gap: 8px 10px;
  }

  .site-brand {
    max-width: 100%;
    font-size: 17px;
  }

  .lang-switch {
    max-width: 46vw;
  }

  .nav-cats {
    margin-top: 7px;
    padding: 5px 0 7px;
  }

  .nav-link {
    padding: 6px 8px;
    font-size: 14px;
  }

  .nav-search {
    width: 100%;
    margin-top: 2px;
  }

  .site-main {
    padding: 24px 16px 36px;
  }

  .site-title {
    font-size: 24px;
  }

  .article-title {
    font-size: 24px;
  }

  .card-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .deal-card {
    min-height: 0;
  }

  .footer-links {
    margin-left: 0;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b0f14;
    --surface: #0f141a;
    --ink: #e5e7eb;
    --muted: #b4becb;
    --line: #1f2937;
    --shadow: 0 8px 26px rgba(0, 0, 0, .4);
  }

  .cat-badge {
    color: #111827;
    background: hsl(var(--h, 0), 70%, 82%);
  }

  .card-summary,
  .article-lead {
    color: #cbd5e1;
  }

  .related-list a {
    color: var(--ink);
  }

  .footer-links a:hover {
    color: var(--ink);
  }

  .promo-card .card-summary {
    color: #ffffff;
  }
}
