/* ChatGPT 中文指南 — 玻璃拟态 · 蓝白配色 */
:root {
  --bg: #f3f7ff;
  --ink: #0d1b3a;
  --ink-2: #3a4a6b;
  --ink-3: #6b7a99;
  --line: rgba(120, 150, 210, 0.22);
  --blue-50: #eef4ff;
  --blue-100: #dce8ff;
  --blue-300: #8fb4ff;
  --blue-500: #3b6cf6;
  --blue-600: #2453e0;
  --blue-700: #1a3fb4;
  --navy: #0f2a6b;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --shadow: 0 1px 1px rgba(16, 42, 107, 0.04), 0 8px 24px -8px rgba(30, 64, 175, 0.16);
  --shadow-hover: 0 2px 2px rgba(16, 42, 107, 0.05), 0 18px 40px -12px rgba(30, 64, 175, 0.28);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Inter", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; border-radius: 8px; }

/* ---------- 背景：柔和蓝色光斑 ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 10% -10%, #dfe9ff 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #e3f0ff 0%, transparent 55%),
    linear-gradient(180deg, #f6f9ff 0%, #eef3fd 100%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.orb-a { width: 520px; height: 520px; left: -120px; top: 120px; background: #9cc0ff; animation: drift 26s var(--ease) infinite alternate; }
.orb-b { width: 460px; height: 460px; right: -80px; top: -60px; background: #b9d8ff; animation: drift 32s var(--ease) infinite alternate-reverse; }
.orb-c { width: 380px; height: 380px; left: 45%; bottom: -160px; background: #c8d6ff; animation: drift 38s var(--ease) infinite alternate; }
@keyframes drift { to { transform: translate3d(60px, -40px, 0) scale(1.08); } }

/* ---------- 玻璃材质 ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .9);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 12px; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  max-width: 1320px; margin: 12px auto 0; padding: 10px 14px 10px 18px;
  border-radius: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(135deg, #5b8cff, #1a3fb4);
  box-shadow: 0 4px 12px -2px rgba(36, 83, 224, .5), inset 0 1px 0 rgba(255,255,255,.4);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 8px 7px 9px 8px;
  border: solid #fff; border-width: 0 0 3px 3px; transform: rotate(-45deg) translate(1px, -1px);
  border-radius: 1px;
}
.search {
  flex: 1; max-width: 560px; margin-inline: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px; height: 42px; border-radius: 13px;
  background: rgba(255, 255, 255, .7); border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.search:focus-within { background: #fff; border-color: var(--blue-300); box-shadow: 0 0 0 4px rgba(59, 108, 246, .12); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
kbd {
  font-family: var(--mono); font-size: 12px; color: var(--ink-3);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; background: #fff;
}
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a {
  position: relative; padding: 8px 14px; border-radius: 11px; font-size: 15px; color: var(--ink-2);
  transition: background .2s, color .2s;
}
.topnav a:hover { background: rgba(255, 255, 255, .7); color: var(--ink); }
.topnav a[aria-current="page"] { background: #fff; color: var(--blue-600); font-weight: 600; box-shadow: 0 1px 3px rgba(30, 64, 175, .12); }
.live-dot {
  position: absolute; top: 8px; right: 6px; width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 2.4s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.gh-link { display: inline-flex; align-items: center; gap: 6px; }
.gh-link svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Hero ---------- */
main { max-width: 1320px; margin: 0 auto; padding: 0 20px; outline: none; }
.hero { padding: 64px 4px 36px; }
.eyebrow {
  display: inline-block; margin: 0 0 18px; padding: 5px 12px; border-radius: 999px;
  font-size: 13px; color: var(--blue-700); background: rgba(255, 255, 255, .65); border: 1px solid var(--glass-edge);
}
.hero h1 {
  margin: 0; font-size: clamp(34px, 5.4vw, 60px); line-height: 1.12; letter-spacing: -.02em; font-weight: 800;
  color: var(--navy);
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #2453e0 0%, #4f8bff 55%, #1a3fb4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { margin: 16px 0 0; max-width: 640px; font-size: 18px; color: var(--ink-2); }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 0; }
.stats div {
  min-width: 132px; padding: 12px 18px; border-radius: 16px;
  background: rgba(255, 255, 255, .55); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.stats dt { font-size: 13px; color: var(--ink-3); }
.stats dd { margin: 2px 0 0; font-size: 26px; font-weight: 750; color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ---------- 主体布局 ---------- */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 40px; }
.sidebar {
  position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow: auto;
  padding: 14px 10px; border-radius: var(--radius); scrollbar-width: thin;
}
.side-group { margin-bottom: 8px; }
.side-group h3 { margin: 10px 10px 4px; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--ink-3); }
.side-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: 10px; font-size: 14.5px; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.side-link:hover { background: rgba(255, 255, 255, .75); color: var(--ink); }
.side-link[aria-current="page"] { background: #fff; color: var(--blue-600); font-weight: 600; box-shadow: 0 1px 3px rgba(30, 64, 175, .1); }
.side-link .n { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.side-link.hot .n { color: #16a34a; }
.side-link.new::after {
  content: "NEW"; margin-left: auto; margin-right: 4px; font-size: 10px; font-weight: 700; letter-spacing: .04em;
  color: var(--blue-600); background: var(--blue-100); padding: 0 5px; border-radius: 5px;
}
.side-link.new .n { order: 2; }

/* ---------- 内容区头部 ---------- */
.content-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; }
.content-head h2 { margin: 0; font-size: 26px; letter-spacing: -.01em; color: var(--navy); }
.content-head p { margin: 4px 0 0; max-width: 760px; color: var(--ink-2); font-size: 15px; }
.content-head .source { font-size: 13px; color: var(--blue-600); white-space: nowrap; }
.content-head .source:hover { text-decoration: underline; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.chip {
  padding: 5px 12px; border-radius: 999px; font-size: 13.5px; color: var(--ink-2);
  background: rgba(255, 255, 255, .55); border: 1px solid var(--glass-edge);
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { background: #fff; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--blue-600); border-color: var(--blue-600); color: #fff; box-shadow: 0 4px 12px -4px rgba(36, 83, 224, .6); }
.chip .n { opacity: .7; margin-left: 4px; font-variant-numeric: tabular-nums; }
.seg {
  display: inline-flex; padding: 3px; border-radius: 12px; gap: 2px;
  background: rgba(255, 255, 255, .55); border: 1px solid var(--glass-edge);
}
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 9px; font-size: 13.5px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--blue-600); font-weight: 600; box-shadow: 0 1px 3px rgba(30, 64, 175, .14); }

/* ---------- 专题总览卡片 ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 36px; }
.topic-card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
}
.topic-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); background: var(--glass-strong); }
.topic-card .grp { font-size: 12px; color: var(--blue-600); font-weight: 600; letter-spacing: .04em; }
.topic-card h3 { margin: 0; font-size: 17px; color: var(--navy); }
.topic-card p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.topic-card .cnt { margin-top: auto; padding-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 14px; }
.section-title h2 { margin: 0; font-size: 20px; color: var(--navy); }
.section-title a { font-size: 14px; color: var(--blue-600); }
.section-title a:hover { text-decoration: underline; }

/* ---------- 资源卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; gap: 8px; min-height: 148px;
  padding: 16px 18px; border-radius: var(--radius);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
  content-visibility: auto; contain-intrinsic-size: 160px;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); background: var(--glass-strong); }
.card-top { display: flex; align-items: flex-start; gap: 10px; }
.favicon {
  flex: none; width: 34px; height: 34px; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--blue-700);
  background: linear-gradient(135deg, #fff, var(--blue-50)); border: 1px solid var(--line);
}
.favicon { position: relative; }
.favicon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.card-title { min-width: 0; flex: 1; }
.card-title h3 { margin: 0; font-size: 15.5px; line-height: 1.35; color: var(--ink); word-break: break-word; }
.card-title .host { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); }
.stars {
  flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 8px; background: rgba(255,255,255,.7);
}
.stars svg { width: 12px; height: 12px; fill: #f5b301; }
.card p {
  margin: 0; font-size: 13.8px; color: var(--ink-2); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 7px; color: var(--blue-700); background: rgba(220, 232, 255, .75); }
.tag.muted { color: var(--ink-3); background: rgba(255, 255, 255, .7); }
.tag.warn { color: #9a3412; background: #ffedd5; }
.tag.up { color: #15803d; background: #dcfce7; font-weight: 600; }
mark { background: #fff2a8; color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- 热门榜 ---------- */
.trend-card { position: relative; }
.rank {
  margin-right: 6px; font-size: 13px; font-weight: 700; color: var(--blue-500);
  font-variant-numeric: tabular-nums;
}
.spark { width: 100%; height: 30px; display: block; }
.spark path.line { fill: none; stroke: var(--blue-500); stroke-width: 1.6; }
.spark path.area { fill: url(#sparkFill); stroke: none; }
.trend-note {
  margin: 0 0 18px; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; color: var(--ink-2);
}

/* ---------- 其他 ---------- */
.empty, .loading { padding: 60px 20px; text-align: center; color: var(--ink-3); border-radius: var(--radius); }
.more { display: block; margin: 22px auto 0; padding: 10px 22px; border-radius: 12px; border: 1px solid var(--glass-edge); background: rgba(255,255,255,.7); color: var(--blue-600); font-weight: 600; }
.more:hover { background: #fff; }
.footer { max-width: 1320px; margin: 0 auto; padding: 24px 24px 48px; font-size: 13.5px; color: var(--ink-3); text-align: center; }
.footer a { color: var(--blue-600); }
.to-top {
  position: fixed; right: 22px; bottom: 22px; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
}
.to-top svg { width: 20px; height: 20px; fill: none; stroke: var(--blue-600); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.menu-btn { display: none; }
body.searching .hero { display: none; }
body.searching .layout { padding-top: 28px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .brand-text { display: none; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; display: flex; gap: 8px; overflow-x: auto; padding: 8px; border-radius: 16px; }
  .side-group { display: contents; }
  .side-group h3 { display: none; }
  .side-link { flex: none; white-space: nowrap; }
  .side-link .n { display: none; }
  .side-link.new::after { display: none; }
  .hero { padding: 40px 2px 24px; }
}
@media (max-width: 640px) {
  .topbar { top: 0; margin: 0; border-radius: 0 0 18px 18px; gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .topnav { margin-left: auto; }
  .topnav a { padding: 6px 10px; }
  .gh-link span { display: none; }
  kbd { display: none; }
  main { padding: 0 14px; }
  .grid { grid-template-columns: 1fr; }
  .toolbar .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 2px 14px; }
  .chip { flex: none; }
  .content-head p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .stats div { min-width: calc(50% - 6px); flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(255, 255, 255, .92); }
}
