:root {
  --page: #edf3fa;
  --panel: #ffffff;
  --card: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --line: #e8edf4;
  --green: #12b981;
  --blue: #4b8df7;
  --blue-dark: #2f6dde;
  --tag-green-bg: #d9f9e9;
  --tag-green: #047857;
  --tag-blue-bg: #dbeafe;
  --tag-blue: #1d4ed8;
  --tag-purple-bg: #f0ddff;
  --tag-purple: #7e22ce;
  --tag-orange-bg: #fff0ce;
  --tag-orange: #b45309;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Segoe UI",
    system-ui,
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input {
  font: inherit;
}

.site-wrap {
  width: min(1720px, calc(100% - 96px));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid rgba(232, 237, 244, 0.85);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr 260px;
  gap: 28px;
  align-items: center;
  min-height: 78px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark,
.section-icon {
  display: grid;
  grid-template-columns: repeat(2, 10px);
  gap: 5px;
  align-content: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--green);
}

.brand-mark span,
.section-icon span {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: currentColor;
}

.brand-text strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}

.brand-text small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.main-nav a {
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 14px;
}

.main-nav a:hover {
  background: #f4f7fb;
  color: var(--text);
}

.search-form {
  display: flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
  overflow: hidden;
}

.search-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 12px;
  color: var(--text);
}

.search-form button {
  position: relative;
  width: 44px;
  height: 42px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.search-form button::before {
  content: "";
  position: absolute;
  inset: 13px;
  border: 2px solid #64748b;
  border-radius: 50%;
}

.search-form button::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 11px;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: #64748b;
  transform: rotate(45deg);
}

.top-ad-slot {
  padding-top: 18px;
}

.top-ad-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 88px;
  border: 1px dashed #c7d4e5;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 14px 18px;
  color: #64748b;
  text-align: center;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.top-ad-inner span {
  border-radius: 999px;
  background: rgba(18, 185, 129, 0.1);
  padding: 4px 10px;
  color: #047857;
  font-size: 13px;
  font-weight: 700;
}

.top-ad-inner strong {
  color: #1f2937;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.site-main {
  padding: 24px 0 48px;
}

.software-board {
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 30px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  color: var(--green);
}

.section-title p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.section-title h1 {
  margin: 0;
  color: var(--green);
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
}

.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -8px 0 24px;
}

.filter-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  color: var(--muted);
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip.is-active {
  border-color: rgba(18, 185, 129, 0.35);
  background: rgba(18, 185, 129, 0.1);
  color: #047857;
}

.software-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.software-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 286px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 20px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.software-card:hover {
  border-color: #d8e2ee;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.software-card[hidden] {
  display: none;
}

.software-card.is-top {
  border-color: rgba(18, 185, 129, 0.35);
}

.card-topline {
  display: block;
  margin-bottom: 12px;
}

.card-topline h2 {
  display: -webkit-box;
  min-height: 52px;
  margin: 0;
  color: #030712;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-topline h2 a:hover {
  color: var(--blue-dark);
}

.tag-list,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.tag-list {
  margin-top: 10px;
  overflow: hidden;
}

.tag-list .card-tag:nth-child(n + 6) {
  display: none;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 5px;
  background: var(--tag-green-bg);
  padding: 0 8px;
  color: var(--tag-green);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.card-tag:nth-child(2n) {
  background: var(--tag-orange-bg);
  color: var(--tag-orange);
}

.card-tag:nth-child(3n) {
  background: var(--tag-blue-bg);
  color: var(--tag-blue);
}

.card-tag:nth-child(4n) {
  background: var(--tag-purple-bg);
  color: var(--tag-purple);
}

.card-tag.hot {
  background: var(--tag-orange-bg);
  color: var(--tag-orange);
}

.card-intro {
  display: -webkit-box;
  flex: 1;
  min-height: 72px;
  max-height: 72px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 15px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-intro p {
  margin: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: #64748b;
  font-size: 13px;
}

.card-meta a:hover {
  color: var(--blue-dark);
}

.download-link,
.detail-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  line-height: 1;
}

.download-link:hover,
.detail-button:hover {
  background: var(--blue-dark);
}

.download-link.read-link {
  background: var(--green);
}

.download-link.read-link:hover {
  background: #059669;
}

.download-icon {
  position: relative;
  width: 16px;
  height: 16px;
}

.read-icon {
  position: relative;
  width: 16px;
  height: 16px;
}

.read-icon::before {
  content: "";
  position: absolute;
  inset: 2px 3px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.read-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 5px;
  width: 5px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor;
}

.download-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 2px;
  width: 2px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
}

.download-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 7px;
  width: 10px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(0);
}

.empty-tip {
  border: 1px dashed var(--line);
  border-radius: 8px;
  margin: 22px 0 0;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.pagebar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
}

.page-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.page-number:hover,
.page-number.is-current {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.friend-links {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  font-size: 14px;
}

.friend-links strong {
  color: var(--text);
  font-size: 15px;
}

.friend-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.friend-link-list a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 0 10px;
  color: #475569;
}

.friend-link-list a:hover {
  border-color: #cbd5e1;
  background: #fff;
  color: var(--blue-dark);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  min-height: 78px;
  align-items: center;
  font-size: 14px;
}

.footer-inner p {
  margin: 0;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
}

.detail-main,
.page-card,
.side-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.detail-main {
  padding: 30px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.back-link:hover {
  color: var(--blue-dark);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: var(--blue-dark);
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 26px;
}

.detail-kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.detail-head h1,
.page-head h1,
.not-found h1 {
  margin: 0 0 12px;
  font-size: 36px;
  line-height: 1.18;
  letter-spacing: 0;
}

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

.detail-desc p {
  margin: 0;
}

.content-section {
  padding-top: 28px;
}

.content-section h2,
.side-card h2 {
  margin: 0 0 16px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.article-content {
  color: #263244;
}

.article-content h2,
.article-content h3 {
  margin-top: 28px;
  line-height: 1.3;
  letter-spacing: 0;
}

.article-content p {
  margin: 0 0 14px;
}

.article-content a {
  color: var(--blue-dark);
  font-weight: 700;
}

.article-content ul,
.article-content ol {
  padding-left: 22px;
}

.detail-side {
  display: grid;
  align-content: start;
  gap: 18px;
}

.side-card {
  padding: 22px;
}

.info-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.info-list div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.info-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.info-list dt {
  color: var(--muted);
  font-size: 13px;
}

.info-list dd {
  margin: 0;
  font-weight: 700;
}

.side-note {
  border-radius: 8px;
  margin: 18px 0 0;
  background: #f6f8fb;
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
}

.side-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.side-download,
.side-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 6px;
  font-weight: 700;
}

.side-download {
  background: var(--blue);
  color: #fff;
}

.side-download:hover {
  background: var(--blue-dark);
}

.side-secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.side-secondary:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

code {
  border-radius: 5px;
  background: #eef3f8;
  padding: 2px 6px;
  color: #334155;
  font-family: Consolas, "Cascadia Code", monospace;
  font-size: 0.9em;
  word-break: break-all;
}

.detail-tags {
  justify-content: flex-start;
}

.page-layout {
  padding-bottom: 20px;
}

.page-card {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 30px;
}

.page-head {
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 20px;
}

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

.not-found .detail-button {
  width: auto;
  margin-top: 12px;
  padding: 0 24px;
}

@media (max-width: 1180px) {
  .site-wrap {
    width: min(100% - 48px, 1720px);
  }

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

  .detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .header-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    min-height: 0;
    padding: 14px 0 12px;
  }

  .brand {
    justify-content: center;
  }

  .main-nav {
    order: 3;
    width: calc(100% + 24px);
    margin: 0 -12px;
    padding: 6px 12px 4px;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid rgba(232, 237, 244, 0.8);
    border-bottom: 1px solid rgba(232, 237, 244, 0.8);
    scroll-padding: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .main-nav a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    padding: 0 12px;
    color: #334155;
    white-space: nowrap;
  }

  .search-form {
    width: min(420px, 100%);
    max-width: none;
    margin: 0 auto;
  }

  .top-ad-inner {
    min-height: 78px;
  }

  .software-board {
    padding: 22px;
  }

  .software-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .detail-head {
    grid-template-columns: 1fr;
  }

  .detail-button {
    width: auto;
    justify-self: start;
    padding: 0 18px;
  }
}

@media (max-width: 560px) {
  .site-wrap {
    width: min(100% - 24px, 1720px);
  }

  .site-main {
    padding-top: 14px;
  }

  .top-ad-slot {
    padding-top: 12px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    grid-template-columns: repeat(2, 9px);
    gap: 4px;
  }

  .brand-mark span {
    width: 9px;
    height: 9px;
  }

  .brand-text strong {
    font-size: 18px;
  }

  .brand-text small {
    font-size: 11px;
  }

  .main-nav {
    width: calc(100% + 18px);
    margin: 0 -9px;
    padding-inline: 9px;
  }

  .main-nav a {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .search-form {
    min-height: 38px;
  }

  .search-form button {
    height: 38px;
  }

  .top-ad-inner {
    flex-direction: column;
    gap: 6px;
    min-height: 74px;
    text-align: center;
  }

  .top-ad-inner strong {
    font-size: 16px;
  }

  .software-board,
  .detail-main,
  .page-card {
    border-radius: 10px;
    padding: 16px;
  }

  .section-title h1 {
    font-size: 22px;
  }

  .software-card {
    min-height: 0;
    padding: 16px;
  }

  .tag-list {
    justify-content: flex-start;
  }

  .card-topline h2 {
    font-size: 19px;
    line-height: 1.28;
  }

  .card-intro {
    font-size: 14px;
  }

  .card-meta {
    gap: 8px;
    font-size: 12px;
  }

  .detail-head h1,
  .page-head h1,
  .not-found h1 {
    font-size: 28px;
  }

  .friend-links {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px 0;
  }

  .friend-link-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .friend-link-list::-webkit-scrollbar {
    display: none;
  }

  .friend-link-list a {
    flex: 0 0 auto;
    min-height: 32px;
    white-space: nowrap;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 18px 0;
  }
}
