:root {
  --bg: #0b1018;
  --panel: #111827;
  --panel-2: #1f2937;
  --line: #334155;
  --text: #e5e7eb;
  --muted: #94a3b8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% -10%, #164e63 0%, transparent 36%),
    radial-gradient(circle at 100% 0%, #0f172a 0%, transparent 45%),
    var(--bg);
  font-family: "Segoe UI", "PingFang SC", sans-serif;
}

.wrap {
  width: min(1180px, 96vw);
  margin: 24px auto 36px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 120px 140px auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  position: sticky;
  top: 12px;
  backdrop-filter: blur(8px);
  z-index: 10;
}

.toolbar input,
.toolbar select,
.toolbar button {
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 0 10px;
}

.toolbar button {
  cursor: pointer;
  background: linear-gradient(135deg, #0f766e, #155e75);
  border-color: #0e7490;
  font-weight: 600;
}

.meta {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
}

.thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #0f172a;
}

.card-body {
  padding: 10px;
}

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

.intro {
  margin: 0;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.card-link {
  color: inherit;
  text-decoration: none;
}

.list-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-row-link {
  color: inherit;
  text-decoration: none;
}

.list-row {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
}

.list-main-link {
  color: inherit;
  text-decoration: none;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
}

.list-topline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.list-author {
  flex: 0 0 auto;
  color: #a5f3fc;
  font-size: 12px;
}

.list-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-content {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row.has-code .list-main-link {
  padding-right: 106px;
}

.list-code-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 26px;
  line-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #0e7490;
  color: #cffafe;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  background: linear-gradient(135deg, #0f766e, #155e75);
}

.list-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  background: #0f172a;
}

.list-body {
  min-width: 0;
}

.pager {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.pager button {
  min-width: 92px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

.pager button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
}

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

  .list-row {
    padding: 8px;
  }

  .list-main-link {
    grid-template-columns: 54px 1fr;
    gap: 10px;
  }

  .list-row.has-code .list-main-link {
    padding-right: 0;
  }

  .list-code-btn {
    position: static;
    display: inline-block;
    margin-top: 8px;
  }

  .list-thumb {
    width: 54px;
    height: 54px;
  }
}
