/* ==========================================================================
   IT技术展示网 · 落地页样式 (itjsw.net)
   代码感科技风 · 深空 Hero + 浅色阅读区 · 简单大气
   ========================================================================== */

:root {
  --c-primary:        #2E9BFF;
  --c-primary-dark:   #1B7FE0;
  --c-primary-light:  #E8F3FF;
  --c-accent:         #FF9F43;
  --c-green:          #3DDC97;
  --c-purple:         #8B7CF6;

  --c-dark:           #0E1726;
  --c-dark-2:         #152B4A;
  --c-dark-card:      #16233B;
  --c-code-bg:        #0D1B2A;

  --c-bg:             #F7F9FC;
  --c-surface:        #FFFFFF;
  --c-surface-2:      #F0F4F9;
  --c-text:           #1A2332;
  --c-text-sub:       #5B6B82;
  --c-text-weak:      #8C99AB;
  --c-border:         #E2E8F0;
  --c-border-strong:  #CBD5E1;

  --c-on-dark:        #FFFFFF;
  --c-on-dark-sub:    #B8C6D9;
  --c-on-dark-weak:   #7E8FA6;
  --c-dark-line:      rgba(255,255,255,.12);
  --c-dark-glass:     rgba(255,255,255,.05);

  --c-success:        #22C55E;
  --c-warning:        #F59E0B;
  --c-error:          #EF4444;

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;

  --sh-sm: 0 1px 3px rgba(16,35,60,.06), 0 1px 2px rgba(16,35,60,.04);
  --sh-md: 0 4px 16px rgba(16,35,60,.08);
  --sh-lg: 0 12px 32px rgba(16,35,60,.12);
  --sh-primary: 0 8px 24px rgba(46,155,255,.28);

  --t-fast: .16s ease;
  --t-base: .24s ease;

  --font-sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, "Courier New", monospace;

  --container: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ==========================================================================
   顶部导航
   ========================================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 68px;
  display: flex; align-items: center;
  background: rgba(14,23,38,.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background var(--t-base), box-shadow var(--t-base);
}
.nav.scrolled { background: rgba(14,23,38,.92); box-shadow: 0 8px 24px rgba(0,0,0,.25); }

.nav-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }

.logo { display: flex; align-items: center; gap: 10px; color: var(--c-on-dark); font-weight: 700; font-size: 19px; letter-spacing: .5px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-purple));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 15px; color: #fff; font-weight: 700;
  box-shadow: var(--sh-primary);
}
.logo span em { color: var(--c-primary); font-style: normal; }

.nav-menu { display: flex; gap: 4px; }
.nav-menu a {
  color: var(--c-on-dark-sub); font-size: 14.5px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--r-md);
  transition: color var(--t-fast), background var(--t-fast);
  position: relative;
}
.nav-menu a:hover { color: var(--c-on-dark); background: rgba(255,255,255,.06); }
.nav-menu a.active { color: var(--c-on-dark); }
.nav-menu a.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2.5px; border-radius: 2px; background: var(--c-primary);
}

.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-search-btn {
  width: 38px; height: 38px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-on-dark-sub); transition: background var(--t-fast), color var(--t-fast);
}
.nav-search-btn:hover { background: rgba(255,255,255,.08); color: var(--c-on-dark); }

.hamburger { display: none; width: 38px; height: 38px; flex-direction: column; gap: 5px; align-items: center; justify-content: center; border-radius: var(--r-md); }
.hamburger span { width: 20px; height: 2px; background: var(--c-on-dark); border-radius: 2px; transition: var(--t-fast); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding: 160px 0 90px;
  background: radial-gradient(1200px 600px at 70% -10%, #1c3a66 0%, transparent 55%),
              radial-gradient(900px 500px at 10% 20%, #142c50 0%, transparent 50%),
              linear-gradient(160deg, #0E1726 0%, #101E33 55%, #152B4A 100%);
  overflow: hidden;
  color: var(--c-on-dark);
}

/* 网格光效 */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 20%, transparent 70%);
}

/* 浮动代码符号 */
.hero-symbol {
  position: absolute; font-family: var(--font-mono); font-weight: 700;
  color: rgba(255,255,255,.06); font-size: 120px; user-select: none; pointer-events: none;
}
.hero-symbol.s1 { top: 90px; left: 4%; transform: rotate(-12deg); }
.hero-symbol.s2 { top: 160px; right: 5%; font-size: 150px; transform: rotate(10deg); }
.hero-symbol.s3 { bottom: 40px; left: 14%; font-size: 80px; transform: rotate(-6deg); }

.hero-inner { position: relative; z-index: 2; text-align: center; max-width: 820px; margin: 0 auto; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: var(--r-pill);
  background: var(--c-dark-glass); border: 1px solid var(--c-dark-line);
  color: var(--c-on-dark-sub); font-size: 13px; font-weight: 500;
  margin-bottom: 28px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-green); box-shadow: 0 0 8px var(--c-green); }

.hero-title {
  font-size: 54px; line-height: 1.15; font-weight: 800; letter-spacing: -1px;
  margin-bottom: 20px;
}
.hero-title em { font-style: normal; background: linear-gradient(90deg, var(--c-primary), var(--c-purple)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.hero-sub { color: var(--c-on-dark-sub); font-size: 18px; line-height: 1.7; margin-bottom: 36px; }

/* 搜索 */
.hero-search {
  display: flex; max-width: 620px; margin: 0 auto 16px;
  background: rgba(255,255,255,.08); border: 1px solid var(--c-dark-line);
  border-radius: var(--r-lg); padding: 6px; backdrop-filter: blur(8px);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.hero-search:focus-within { border-color: var(--c-primary); background: rgba(255,255,255,.1); }
.hero-search input {
  flex: 1; background: none; border: none; outline: none; color: var(--c-on-dark);
  font-size: 15px; padding: 10px 14px; font-family: inherit;
}
.hero-search input::placeholder { color: var(--c-on-dark-weak); }
.hero-search .btn-search {
  padding: 10px 24px; border-radius: var(--r-md); background: var(--c-primary);
  color: #fff; font-weight: 600; font-size: 14px; transition: background var(--t-fast), transform var(--t-fast);
  display: flex; align-items: center; gap: 6px;
}
.hero-search .btn-search:hover { background: var(--c-primary-dark); transform: translateY(-1px); }

.hero-tags { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--c-on-dark-weak); margin-bottom: 48px; }
.hero-tags .t-label { margin-right: 4px; }
.hero-tags a { color: var(--c-on-dark-sub); padding: 4px 12px; border-radius: var(--r-pill); border: 1px solid var(--c-dark-line); transition: var(--t-fast); }
.hero-tags a:hover { color: var(--c-on-dark); border-color: var(--c-primary); background: rgba(46,155,255,.12); }

/* 代码终端窗口 */
.code-window {
  max-width: 780px; margin: 0 auto 56px; text-align: left;
  background: rgba(13,27,42,.85); border: 1px solid var(--c-dark-line);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.code-titlebar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: rgba(255,255,255,.04);
  border-bottom: 1px solid var(--c-dark-line);
}
.code-titlebar .dots { display: flex; gap: 6px; }
.code-titlebar .dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.code-titlebar .dots i:nth-child(1){ background:#FF5F56; } .code-titlebar .dots i:nth-child(2){ background:#FFBD2E; } .code-titlebar .dots i:nth-child(3){ background:#27C93F; }
.code-titlebar .filename { margin-left: 8px; color: var(--c-on-dark-weak); font-family: var(--font-mono); font-size: 12.5px; }
.code-body { padding: 22px 24px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.75; overflow-x: auto; color: #E6EDF3; white-space: pre; }

.code-body .k { color: #FF7B72; }   /* 关键字 */
.code-body .s { color: #A5D6FF; }   /* 字符串 */
.code-body .n { color: #79C0FF; }   /* 数字 */
.code-body .f { color: #D2A8FF; }   /* 函数 */
.code-body .c { color: #8B98A5; font-style: italic; } /* 注释 */
.code-body .v { color: #E6EDF3; }   /* 变量/默认 */
.code-body .cursor { display: inline-block; width: 8px; height: 15px; background: var(--c-primary); vertical-align: -2px; animation: blink 1s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0;} }

/* 数据条 */
.hero-stats {
  display: flex; justify-content: center; gap: 64px; flex-wrap: wrap;
  border-top: 1px solid var(--c-dark-line); padding-top: 40px;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 34px; font-weight: 800; color: var(--c-on-dark); font-family: var(--font-sans); }
.hero-stat .num em { color: var(--c-primary); font-style: normal; }
.hero-stat .lbl { font-size: 13px; color: var(--c-on-dark-weak); margin-top: 2px; }

/* ==========================================================================
   通用区块
   ========================================================================== */
.section { padding: 80px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 40px; gap: 16px; }
.section-title { font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.section-title small { display: block; font-size: 14px; color: var(--c-text-weak); font-weight: 400; margin-top: 6px; }
.section-more { color: var(--c-primary); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.section-more:hover { gap: 8px; }
.section-more { transition: gap var(--t-fast); }

/* 卡片通用 */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--sh-sm);
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  display: block;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--c-primary); }

/* ==========================================================================
   分类入口
   ========================================================================== */
.cats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.cat-card { padding: 28px 22px; text-align: center; }
.cat-icon {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
}
.cat-icon svg { width: 26px; height: 26px; }
.cat-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.cat-card p { font-size: 13px; color: var(--c-text-weak); line-height: 1.5; margin-bottom: 12px; }
.cat-card .count { font-size: 12px; color: var(--c-text-weak); font-family: var(--font-mono); }
.cat-card .count b { color: var(--c-primary); font-weight: 600; }

/* 分类图标配色 */
.cat-icon.c-blue { background: var(--c-primary-light); color: var(--c-primary); }
.cat-icon.c-green { background: #E7F8F1; color: #16A06A; }
.cat-icon.c-amber { background: #FFF3E4; color: var(--c-accent); }
.cat-icon.c-purple { background: #F0EDFF; color: var(--c-purple); }
.cat-icon.c-teal { background: #E4F5FA; color: #0E9FB8; }

/* ==========================================================================
   热门教程 / 内容卡
   ========================================================================== */
.tutorials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.content-card .cover {
  height: 170px; position: relative; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 40px; font-weight: 700; color: rgba(255,255,255,.9);
}
.content-card .cover .badge-hot {
  position: absolute; top: 14px; left: 14px; background: var(--c-accent); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-pill);
  font-family: var(--font-sans); letter-spacing: .5px;
}
.cover.c1 { background: linear-gradient(135deg, #2E9BFF, #1B7FE0); }
.cover.c2 { background: linear-gradient(135deg, #3DDC97, #16A06A); }
.cover.c3 { background: linear-gradient(135deg, #8B7CF6, #6A5AE0); }
.cover.c4 { background: linear-gradient(135deg, #FF9F43, #F07C00); }
.cover.c5 { background: linear-gradient(135deg, #0E9FB8, #087A8C); }

.content-card .body { padding: 20px; }
.content-card .tags { display: flex; gap: 6px; margin-bottom: 12px; }
.content-card .tags span {
  font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: var(--r-pill);
  background: var(--c-primary-light); color: var(--c-primary-dark);
}
.content-card .tags span.g { background: #E7F8F1; color: #16A06A; }
.content-card h3 { font-size: 16.5px; font-weight: 600; line-height: 1.4; margin-bottom: 8px; }
.content-card p.desc { font-size: 13.5px; color: var(--c-text-sub); line-height: 1.6; margin-bottom: 14px; }
.content-card .meta { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--c-text-weak); }
.content-card .meta .diff { font-family: var(--font-mono); font-size: 12px; }
.content-card .meta .diff.easy { color: var(--c-success); }
.content-card .meta .diff.mid { color: var(--c-warning); }

/* ==========================================================================
   最新源码（大卡 + 榜单）
   ========================================================================== */
.source-wrap { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.source-list { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.source-card { display: flex; gap: 16px; padding: 20px; }
.source-card .repo-icon {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.source-card .repo-icon svg { width: 22px; height: 22px; }
.source-card h3 { font-size: 15.5px; font-weight: 600; margin-bottom: 4px; }
.source-card p { font-size: 12.5px; color: var(--c-text-sub); line-height: 1.5; margin-bottom: 10px; }
.source-card .meta { display: flex; gap: 12px; font-size: 12px; color: var(--c-text-weak); font-family: var(--font-mono); }
.source-card .meta b { color: var(--c-primary); font-weight: 600; }

.rank-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--sh-sm); }
.rank-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.rank-card h3 svg { width: 20px; height: 20px; color: var(--c-accent); }
.rank-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--c-border); }
.rank-list li:last-child { border-bottom: none; }
.rank-list .no { font-family: var(--font-mono); font-size: 13px; font-weight: 700; width: 22px; color: var(--c-text-weak); }
.rank-list li:nth-child(1) .no { color: var(--c-accent); }
.rank-list li:nth-child(2) .no { color: #B8A9F5; }
.rank-list li:nth-child(3) .no { color: #F0A85A; }
.rank-list .name { flex: 1; font-size: 13.5px; font-weight: 500; }
.rank-list .views { font-size: 12px; color: var(--c-text-weak); font-family: var(--font-mono); }

/* ==========================================================================
   开源工具
   ========================================================================== */
.tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.tool-card { padding: 24px 20px; text-align: left; }
.tool-card .tool-icon {
  width: 48px; height: 48px; border-radius: 13px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.tool-card h3 { font-size: 15.5px; font-weight: 600; margin-bottom: 6px; }
.tool-card p { font-size: 12.5px; color: var(--c-text-sub); line-height: 1.55; margin-bottom: 12px; }
.tool-card .tool-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--c-text-weak); }
.tool-card .tool-meta .free { color: var(--c-green); font-weight: 600; }

/* ==========================================================================
   SEO 干货
   ========================================================================== */
.seo-wrap { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.seo-list { display: flex; flex-direction: column; gap: 16px; }
.seo-item { padding: 22px 24px; }
.seo-item .row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.seo-item .row1 span { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: var(--r-pill); background: #FFF3E4; color: var(--c-accent); }
.seo-item h3 { font-size: 16.5px; font-weight: 600; margin-bottom: 6px; }
.seo-item p { font-size: 13.5px; color: var(--c-text-sub); margin-bottom: 10px; }
.seo-item .meta { font-size: 12.5px; color: var(--c-text-weak); }

.subscribe-card { padding: 28px 24px; background: linear-gradient(160deg, var(--c-dark), var(--c-dark-2)); color: var(--c-on-dark); border-radius: var(--r-lg); }
.subscribe-card h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.subscribe-card p { font-size: 13.5px; color: var(--c-on-dark-sub); margin-bottom: 18px; }
.subscribe-card input { width: 100%; padding: 11px 14px; border-radius: var(--r-md); border: 1px solid var(--c-dark-line); background: rgba(255,255,255,.08); color: var(--c-on-dark); font-size: 14px; margin-bottom: 12px; font-family: inherit; outline: none; }
.subscribe-card input::placeholder { color: var(--c-on-dark-weak); }
.subscribe-card input:focus { border-color: var(--c-primary); }
.subscribe-card .btn-full { width: 100%; padding: 11px; background: var(--c-primary); color: #fff; font-weight: 600; border-radius: var(--r-md); font-size: 14px; transition: var(--t-fast); }
.subscribe-card .btn-full:hover { background: var(--c-primary-dark); }

/* ==========================================================================
   CTA
   ========================================================================== */
.cta {
  padding: 0 0 80px;
}
.cta-box {
  background: linear-gradient(135deg, var(--c-dark) 0%, var(--c-dark-2) 100%);
  border-radius: var(--r-xl); padding: 56px 48px; text-align: center; color: var(--c-on-dark);
  position: relative; overflow: hidden;
}
.cta-box::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
.cta-box h2 { font-size: 30px; font-weight: 800; margin-bottom: 12px; position: relative; }
.cta-box p { color: var(--c-on-dark-sub); margin-bottom: 28px; position: relative; }
.cta-btns { display: flex; justify-content: center; gap: 14px; position: relative; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 28px;
  background: var(--c-primary); color: #fff; font-weight: 600; border-radius: var(--r-md);
  font-size: 15px; transition: var(--t-fast); box-shadow: var(--sh-primary);
}
.btn-primary:hover { background: var(--c-primary-dark); transform: translateY(-2px); }
.btn-ghost-dark { display: inline-flex; align-items: center; gap: 8px; padding: 13px 28px; border: 1.5px solid var(--c-dark-line); color: var(--c-on-dark); font-weight: 600; border-radius: var(--r-md); font-size: 15px; transition: var(--t-fast); }
.btn-ghost-dark:hover { border-color: var(--c-primary); color: var(--c-on-dark); background: rgba(46,155,255,.12); }

/* ==========================================================================
   页脚
   ========================================================================== */
.footer { background: var(--c-dark); color: var(--c-on-dark-sub); padding: 64px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid var(--c-dark-line); }
.footer-brand .logo { margin-bottom: 16px; }
.footer-brand p { font-size: 13.5px; color: var(--c-on-dark-weak); line-height: 1.7; max-width: 300px; }
.footer-col h4 { color: var(--c-on-dark); font-size: 14.5px; font-weight: 600; margin-bottom: 18px; }
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a { font-size: 13.5px; color: var(--c-on-dark-weak); transition: color var(--t-fast); }
.footer-col a:hover { color: var(--c-primary); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding: 24px 0; font-size: 12.5px; color: var(--c-on-dark-weak); flex-wrap: wrap; gap: 8px; }
.footer-bottom .beian a { color: var(--c-on-dark-sub); transition: color var(--t-fast); }
.footer-bottom .beian a:hover { color: var(--c-primary); }

/* 返回顶部 */
.back-top {
  position: fixed; right: 28px; bottom: 28px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--c-primary); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--sh-primary); opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: var(--t-base);
}
.back-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-top:hover { background: var(--c-primary-dark); }

/* 滚动入场 —— 内容默认始终可见；仅做轻微上移动画，绝不隐藏内容 */
.reveal { opacity: 1; transform: none; }
.js-anim .reveal { transition: opacity .5s cubic-bezier(.22,.61,.36,1), transform .5s cubic-bezier(.22,.61,.36,1); }
.js-anim .reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1199px) {
  .cats-grid { grid-template-columns: repeat(3, 1fr); }
  .tutorials-grid { grid-template-columns: repeat(2, 1fr); }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .source-wrap, .seo-wrap { grid-template-columns: 1fr; }
  .hero-title { font-size: 44px; }
}

@media (max-width: 767px) {
  .container { padding: 0 16px; }
  .nav-menu { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 120px 0 64px; }
  .hero-title { font-size: 32px; }
  .hero-sub { font-size: 16px; }
  .hero-stats { gap: 28px; }
  .hero-stat .num { font-size: 26px; }
  .hero-symbol { font-size: 60px; }
  .code-body { font-size: 12px; padding: 16px; }
  .cats-grid, .tutorials-grid, .tools-grid, .source-list { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .section-title { font-size: 23px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .cta-box { padding: 40px 24px; }
  .cta-box h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   二级目录列表页 + 详情页（复用全局，追加以下）
   ========================================================================== */

/* 分类 Banner（深色） */
.page-hero {
  padding: 132px 0 56px;
  background: radial-gradient(900px 420px at 80% -20%, #1c3a66 0%, transparent 55%),
              linear-gradient(160deg, #0E1726 0%, #152B4A 100%);
  color: var(--c-on-dark); position: relative; overflow: hidden;
}
.page-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, #000 20%, transparent 75%);
}
.page-hero .container { position: relative; z-index: 2; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-on-dark-weak); margin-bottom: 20px; flex-wrap: wrap; }
.crumb a { color: var(--c-on-dark-sub); transition: color var(--t-fast); }
.crumb a:hover { color: var(--c-primary); }
.crumb .sep { color: var(--c-on-dark-weak); }
.crumb .cur { color: var(--c-on-dark); font-weight: 500; }
.page-hero h1 { font-size: 38px; font-weight: 800; margin-bottom: 12px; }
.page-hero h1 em { font-style: normal; color: var(--c-primary); }
.page-hero .page-desc { color: var(--c-on-dark-sub); font-size: 16px; max-width: 620px; }
.page-hero .page-count { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; font-size: 13px; color: var(--c-on-dark-weak); }

/* 面包屑+内容 */
.page-body { padding: 48px 0 80px; }
.crumb-light { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-text-weak); margin-bottom: 28px; flex-wrap: wrap; }
.crumb-light a { color: var(--c-text-sub); transition: color var(--t-fast); }
.crumb-light a:hover { color: var(--c-primary); }
.crumb-light .cur { color: var(--c-text); font-weight: 500; }

/* 列表页布局：筛选栏 + 内容网格 */
.list-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
.filter-panel { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 24px; position: sticky; top: 88px; }
.filter-panel h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; color: var(--c-text); }
.filter-group { margin-bottom: 22px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-group .fg-title { font-size: 12.5px; font-weight: 600; color: var(--c-text-weak); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .5px; }
.filter-group a { display: block; padding: 8px 12px; border-radius: var(--r-md); font-size: 14px; color: var(--c-text-sub); margin-bottom: 2px; transition: var(--t-fast); }
.filter-group a:hover { background: var(--c-surface-2); color: var(--c-primary); }
.filter-group a.active { background: var(--c-primary-light); color: var(--c-primary-dark); font-weight: 600; }

.list-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.list-toolbar .count { font-size: 13.5px; color: var(--c-text-sub); }
.list-toolbar .count b { color: var(--c-primary); }
.list-toolbar .sort { display: flex; gap: 6px; }
.list-toolbar .sort a { font-size: 13px; padding: 5px 12px; border-radius: var(--r-pill); color: var(--c-text-sub); border: 1px solid var(--c-border); }
.list-toolbar .sort a.active { color: var(--c-primary); border-color: var(--c-primary); background: var(--c-primary-light); }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; }
.pagination a { min-width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--c-border); border-radius: var(--r-md); font-size: 14px; color: var(--c-text-sub); background: var(--c-surface); transition: var(--t-fast); }
.pagination a:hover { border-color: var(--c-primary); color: var(--c-primary); }
.pagination a.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); font-weight: 600; }
.pagination a.disabled { opacity: .4; pointer-events: none; }

/* ==========================================================================
   详情页
   ========================================================================== */
.article-wrap { max-width: 860px; margin: 0 auto; }
.article-head { text-align: center; padding: 56px 0 36px; border-bottom: 1px solid var(--c-border); margin-bottom: 40px; }
.article-head .tags { display: flex; justify-content: center; gap: 8px; margin-bottom: 18px; }
.article-head .tags span { font-size: 12px; font-weight: 600; padding: 3px 12px; border-radius: var(--r-pill); background: var(--c-primary-light); color: var(--c-primary-dark); }
.article-head .tags span.g { background: #E7F8F1; color: #16A06A; }
.article-head h1 { font-size: 34px; line-height: 1.3; font-weight: 800; margin-bottom: 18px; letter-spacing: -.5px; }
.article-meta { display: flex; justify-content: center; gap: 22px; font-size: 13px; color: var(--c-text-weak); flex-wrap: wrap; }
.article-meta span { display: flex; align-items: center; gap: 6px; }
.article-meta svg { width: 14px; height: 14px; }
.article-cover { border-radius: var(--r-lg); overflow: hidden; margin-bottom: 40px; box-shadow: var(--sh-md); }
.article-cover .cover { height: 320px; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 64px; font-weight: 700; color: rgba(255,255,255,.92); }
.article-body { font-size: 16px; line-height: 1.9; color: var(--c-text); }
.article-body h2 { font-size: 24px; font-weight: 700; margin: 40px 0 18px; padding-left: 14px; border-left: 4px solid var(--c-primary); }
.article-body h3 { font-size: 19px; font-weight: 600; margin: 30px 0 14px; }
.article-body p { margin-bottom: 20px; }
.article-body ul, .article-body ol { margin: 0 0 20px 24px; }
.article-body li { margin-bottom: 8px; }
.article-body li::marker { color: var(--c-primary); }
.article-body blockquote { background: var(--c-surface-2); border-left: 4px solid var(--c-accent); padding: 16px 20px; border-radius: 0 var(--r-md) var(--r-md) 0; margin: 24px 0; color: var(--c-text-sub); font-size: 15px; }
.article-body code { background: var(--c-surface-2); color: var(--c-primary-dark); padding: 2px 7px; border-radius: 4px; font-family: var(--font-mono); font-size: .88em; }

/* 详情页代码块 */
.article-code { background: var(--c-code-bg); border-radius: var(--r-md); overflow: hidden; margin: 24px 0; box-shadow: var(--sh-md); }
.article-code .code-titlebar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: rgba(255,255,255,.04); border-bottom: 1px solid var(--c-dark-line); }
.article-code .code-titlebar .left { display: flex; align-items: center; gap: 8px; }
.article-code .code-titlebar .dots { display: flex; gap: 6px; }
.article-code .code-titlebar .dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.article-code .code-titlebar .dots i:nth-child(1){ background:#FF5F56; } .article-code .code-titlebar .dots i:nth-child(2){ background:#FFBD2E; } .article-code .code-titlebar .dots i:nth-child(3){ background:#27C93F; }
.article-code .code-titlebar .lang { color: var(--c-on-dark-weak); font-family: var(--font-mono); font-size: 12px; margin-left: 6px; }
.article-code .copy-btn { color: var(--c-on-dark-sub); font-size: 12px; padding: 4px 12px; border-radius: var(--r-sm); border: 1px solid var(--c-dark-line); transition: var(--t-fast); font-family: var(--font-sans); }
.article-code .copy-btn:hover { color: var(--c-on-dark); border-color: var(--c-primary); }
.article-code .copy-btn.copied { color: var(--c-green); border-color: var(--c-green); }
.article-code pre { padding: 20px 24px; overflow-x: auto; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.75; color: #E6EDF3; }
.article-code .k { color: #FF7B72; } .article-code .s { color: #A5D6FF; } .article-code .n { color: #79C0FF; } .article-code .f { color: #D2A8FF; } .article-code .c { color: #8B98A5; font-style: italic; }

/* 上一篇/下一篇 */
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 48px 0; }
.article-nav a { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 20px; transition: var(--t-fast); }
.article-nav a:hover { border-color: var(--c-primary); box-shadow: var(--sh-md); }
.article-nav .dir { font-size: 12px; color: var(--c-text-weak); margin-bottom: 6px; }
.article-nav .ttl { font-size: 15px; font-weight: 600; color: var(--c-text); }
.article-nav a.next { text-align: right; }

/* 相关推荐 */
.related { margin-top: 24px; }
.related h2 { font-size: 22px; font-weight: 700; margin-bottom: 24px; }

/* 移动端：列表页 & 详情页 */
@media (max-width: 767px) {
  .list-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
  .list-grid { grid-template-columns: 1fr; }
  .page-hero h1 { font-size: 28px; }
  .article-head h1 { font-size: 25px; }
  .article-cover .cover { height: 200px; font-size: 44px; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav a.next { text-align: left; }
}
@media (max-width: 1199px) and (min-width: 768px) {
  .list-grid { grid-template-columns: repeat(2, 1fr); }
}
