﻿:root {
  --bg: #f2f3f5;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #8a919f;
  --line: #e7e9ee;
  --red: #ff3b30;
  --blue: #2f7cf6;
  --yellow: #ffe899;
  --shadow: 0 1px 2px rgba(31, 35, 41, 0.04), 0 8px 24px rgba(31, 35, 41, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 8px rgba(31, 35, 41, 0.04);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 126px;
  font-size: 20px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(135deg, #ff493f, #ff6a54);
  color: #fff;
  font-weight: 900;
}

.main-nav {
  display: none;
  align-items: center;
  gap: 26px;
  overflow-x: auto;
  color: #646a73;
  font-size: 14px;
  white-space: nowrap;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar,
.category-tabs::-webkit-scrollbar {
  display: none;
}

.main-nav a {
  flex: none;
}

.main-nav a:hover,
.main-nav .is-active,
.main-nav .is-strong {
  color: var(--text);
  font-weight: 700;
}

.nav-separator {
  width: 1px;
  height: 16px;
  background: #d8dbe2;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-actions button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #667085;
  font-size: 22px;
}

.sub-nav-wrap {
  position: sticky;
  top: 64px;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 249, 0.94);
  backdrop-filter: blur(14px);
}

.category-tabs {
  display: flex;
  gap: 18px;
  max-width: 1420px;
  margin: 0 auto;
  padding: 17px 32px;
  overflow-x: auto;
  color: #9aa1ad;
  font-size: 14px;
  white-space: nowrap;
}

.category-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  border: 0;
  background: transparent;
  color: inherit;
}

.category-tabs button span {
  font-size: 12px;
}

.category-tabs button:hover,
.category-tabs button.is-active {
  color: var(--text);
  font-weight: 700;
}

.detail-layout {
  display: grid;
  grid-template-columns: 210px minmax(520px, 1fr) 320px;
  gap: 31px;
  max-width: 1420px;
  margin: 0 auto;
  padding: 32px 32px 60px;
}

.left-rail,
.right-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-card,
.feed-main,
.ad-card {
  border-radius: 4px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.side-card {
  padding: 22px 20px;
}

.side-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.source-list,
.recommend-list {
  display: grid;
  gap: 2px;
}

.source-link,
.recommend-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 14px;
  text-align: left;
}

.source-link:hover,
.source-link.is-active,
.recommend-list button:hover {
  color: var(--blue);
}

.source-link.is-active::after {
  content: "›";
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
}

.mini-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.mini-pager button {
  border: 0;
  background: transparent;
  color: #64748b;
}

.mini-pager button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.feed-main {
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.feed-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 100px;
  padding: 20px;
  border-radius: 5px 5px 0 0;
  background: radial-gradient(circle at 78% 30%, rgba(255, 255, 255, 0.16), transparent 22%), linear-gradient(135deg, #16191f, #3b3f48 48%, #191c22);
  color: #fff;
}

.feed-icon {
  display: grid;
  flex: none;
  width: 60px;
  height: 60px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}

.feed-title-block {
  min-width: 0;
  flex: 1;
}

.feed-title-block h1 {
  overflow: hidden;
  margin: 0 0 9px;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-title-block p {
  margin: 0;
  color: #cbd5e1;
  font-size: 14px;
}

.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.feed-tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 54px;
}

.feed-tabs button {
  align-self: stretch;
  border: 0;
  border-bottom: 4px solid transparent;
  background: transparent;
  color: #1f2937;
  font-size: 14px;
}

.feed-tabs button.is-active {
  border-bottom-color: var(--red);
}

.item-list {
  display: grid;
  background: #fff;
}

.rss-item-card {
  display: grid;
  grid-template-columns: 48px 100px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 22px;
  min-height: 85px;
  padding: 10px 28px;
  border-bottom: 1px solid #eef0f3;
  background: #fff;
  cursor: pointer;
}

.rss-item-card:hover {
  background: #fafbfc;
}

.item-rank {
  color: #8a919f;
  font-size: 15px;
  text-align: center;
}

.item-rank.is-hot {
  color: var(--red);
  font-weight: 700;
}

.item-thumb {
  overflow: hidden;
  width: 100px;
  height: 64px;
  border-radius: 6px;
  background: #eef2f7;
}

.item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-thumb-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
  color: var(--blue);
  font-size: 28px;
  font-weight: 900;
}

.item-body {
  min-width: 0;
}

.item-body h2 {
  overflow: hidden;
  margin: 0 0 4px;
  color: #020617;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-body p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 3px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.item-body small {
  color: #8a919f;
  font-size: 13px;
}

.item-arrow {
  color: #c7ccd4;
  font-size: 34px;
}

.loading-card {
  padding: 46px 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  line-height: 1.8;
  text-align: center;
}

.error-card strong {
  display: block;
  color: #111827;
  font-size: 18px;
}

.error-card p {
  margin: 10px auto;
  max-width: 560px;
}

.error-card small {
  display: block;
  margin-bottom: 14px;
}

.error-card a {
  color: var(--blue);
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 10px;
  border-radius: 0 0 5px 5px;
  background: #fff;
}

.pager-button,
.page-numbers button,
.page-numbers .ellipsis {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #5f6673;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-numbers .ellipsis {
  display: inline-grid;
  place-items: center;
  border-color: transparent;
  background: transparent;
}

.page-numbers button.is-active,
.pager-button:hover:not(:disabled),
.page-numbers button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.pager-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.right-rail {
  gap: 15px;
}

.ad-card {
  min-height: 135px;
  padding: 24px;
  overflow: hidden;
  color: #172033;
  font-size: 18px;
  line-height: 1.8;
}

.ad-card strong {
  font-size: 22px;
}

.ad-yellow {
  background: repeating-linear-gradient(135deg, #fff8d6 0 18px, #fff2b3 18px 36px);
}

.ad-blue {
  background: linear-gradient(135deg, #d8ecff, #73c7f7);
}

.ad-white {
  background: linear-gradient(135deg, #fff, #e8f0ff);
  border: 1px solid #e3e8f4;
}

.sponsor-link {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid #d8dbe2;
  color: var(--blue);
  font-size: 14px;
}

.detail-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.detail-drawer.is-open {
  display: block;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(760px, 92vw);
  height: 100%;
  overflow-y: auto;
  padding: 42px 48px;
  background: #fff;
  box-shadow: -20px 0 60px rgba(15, 23, 42, 0.18);
}

.drawer-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: 26px;
}

.detail-source {
  margin: 0 0 12px;
  color: var(--blue);
  font-weight: 700;
}

.drawer-panel h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.25;
}

.detail-meta {
  margin-bottom: 26px;
  color: var(--muted);
}

.detail-content {
  color: #111827;
  font-size: 16px;
  line-height: 1.85;
}

.detail-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.detail-content pre,
.detail-content code {
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-link {
  display: inline-flex;
  margin-top: 30px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
}

@media (max-width: 1180px) {
  .detail-layout {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .right-rail {
    display: none;
  }
}

@media (max-width: 840px) {
  .site-header {
    grid-template-columns: 1fr auto;
    height: 64px;
    padding: 12px 18px;
  }

  .sub-nav-wrap {
    top: 64px;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .left-rail {
    order: 2;
  }

  .feed-main {
    order: 1;
  }

  .rss-item-card {
    grid-template-columns: 34px 74px minmax(0, 1fr) 18px;
    gap: 12px;
    padding: 10px 14px;
  }

  .item-thumb {
    width: 74px;
    height: 52px;
  }

  .feed-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Index node card page */
.page-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 36px 48px;
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  margin-bottom: 18px;
}

.board-head h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.board-head h1 small {
  color: var(--blue);
  font-size: 14px;
  font-weight: 500;
}

.board-tools {
  display: flex;
  align-items: center;
  gap: 22px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(360px, 38vw);
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box span {
  flex: none;
  width: 16px;
  color: #667085;
  font-size: 18px;
  line-height: 1;
  text-align: center;
}

.sort-tabs {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #b3b8c2;
  font-size: 14px;
  white-space: nowrap;
}

.sort-tabs button {
  border: 0;
  background: transparent;
  color: #606773;
}

.sort-tabs button.is-active {
  color: var(--red);
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.node-card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.node-card-link {
  display: block;
  flex: 1;
}

.node-item-list {
  display: grid;
  gap: 6px;
  margin: 12px 14px;
  padding: 0;
  list-style: none;
}

.node-item-link {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 7px;
  min-height: 44px;
  padding: 6px 0;
}

.node-item-link:hover p {
  color: var(--blue);
}

.node-item-link span {
  grid-row: 1 / 3;
  color: #9aa1ad;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.node-item-link p {
  overflow: hidden;
  margin: 0;
  color: #121826;
  font-size: 14px;
  line-height: 1.42;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-item-link small {
  overflow: hidden;
  color: #8a919f;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-item-placeholder {
  min-height: 168px;
  padding: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.node-card[data-category="ai"] .node-icon,
.node-card[data-category="ai"] .node-label {
  background: #e9f2ff;
  color: var(--blue);
}

.node-card[data-category="tech-team"] .node-icon,
.node-card[data-category="tech-team"] .node-label {
  background: #fff0ed;
  color: #e5483b;
}

.node-card[data-category="frontend"] .node-icon,
.node-card[data-category="frontend"] .node-label {
  background: #eff8ff;
  color: #0b7fab;
}

.node-card[data-category="product"] .node-icon,
.node-card[data-category="product"] .node-label {
  background: #fff7e6;
  color: #d46b08;
}

.node-card[data-category="cloud"] .node-icon,
.node-card[data-category="cloud"] .node-label {
  background: #ecfdf3;
  color: #20a779;
}

.node-card[data-category="open-source"] .node-icon,
.node-card[data-category="open-source"] .node-label {
  background: #f4f0ff;
  color: #7a4dd8;
}

.node-card[data-category="business"] .node-icon,
.node-card[data-category="business"] .node-label {
  background: #fff1f3;
  color: #d92d20;
}

.node-card[data-category="general"] .node-icon,
.node-card[data-category="general"] .node-label {
  background: #f1f3f7;
  color: #667085;
}

.node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin: 0 14px;
  border-bottom: 1px solid var(--line);
}

.node-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 17px;
  font-weight: 800;
}

.node-brand a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-brand a:hover {
  color: var(--blue);
}

.node-icon {
  display: grid;
  flex: none;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 900;
}

.node-label {
  flex: none;
  max-width: 86px;
  overflow: hidden;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-lines {
  display: grid;
  gap: 9px;
  flex: 1;
  margin: 15px 14px 10px;
  padding: 0;
  list-style: none;
}

.node-lines li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  min-width: 0;
}

.node-lines li span {
  color: #9aa1ad;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.node-lines li:first-child span {
  color: var(--red);
}

.node-lines li:nth-child(2) span {
  color: #ff9f0a;
}

.node-lines li:nth-child(3) span {
  color: #f5c400;
}

.node-lines p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #121826;
  font-size: 15px;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.node-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 14px;
  padding: 10px 0 13px;
  border-top: 1px solid var(--line);
  color: #707785;
  font-size: 13px;
}

.node-foot > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.favorite-button,
.more-button {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  font-size: 20px;
  line-height: 1;
}

.more-button {
  font-size: 18px;
  letter-spacing: 1px;
}

.favorite-button:hover,
.favorite-button.is-favorite,
.more-button:hover {
  color: var(--blue);
  background: #f4f7ff;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 72px 24px;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1260px) {
  .node-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .board-head,
  .board-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .node-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .node-grid {
    grid-template-columns: 1fr;
  }
}
