/* ============================================================
   Pulse Theme — 科技博客风
   橙 + 电青, 卡片网格, The Verge / Engadget 感
   ============================================================ */

:root{
  --theme-primary:      #ff6a1a;     /* 主色 橙 */
  --theme-primary-dark: #cc4f0a;
  --theme-primary-soft: #fff4ec;
  --theme-accent:       #00d4ff;     /* 辅色 电青 */
  --theme-accent-dark:  #0099bb;
  --theme-text:         #15171f;
  --theme-text-muted:   #6b7280;
  --theme-border:       #e5e7eb;
  --theme-bg:           #fafafa;
  --theme-bg-soft:      #f0f2f5;
  --theme-radius:       12px;
  --theme-radius-sm:    6px;
  --theme-shadow:       0 1px 2px rgba(20,23,30,.04), 0 2px 6px rgba(20,23,30,.05);
  --theme-shadow-lg:    0 12px 32px rgba(20,23,30,.10), 0 4px 12px rgba(20,23,30,.06);
  --theme-container:    1200px;
  --theme-font:         -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --theme-mono:         ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0; font-family:var(--theme-font);
  font-size:15px; line-height:1.7;
  color:var(--theme-text); background:var(--theme-bg);
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}
a{ color:var(--theme-primary); text-decoration:none; transition:color .15s; }
a:hover{ color:var(--theme-primary-dark); }
img{ max-width:100%; height:auto; display:block; }
h1,h2,h3,h4{ margin:0 0 .65em; font-weight:700; line-height:1.28; color:var(--theme-text); letter-spacing:-.015em; }
h1{ font-size:1.85rem; }
h2{ font-size:1.45rem; }
h3{ font-size:1.18rem; }
p{ margin:0 0 1em; }
ul,ol{ padding-left:1.4em; margin:0 0 1em; }
code{
  font-family:var(--theme-mono);
  background:var(--theme-primary-soft); color:var(--theme-primary-dark);
  padding:2px 6px; border-radius:4px; font-size:.9em;
}
.container{ max-width:var(--theme-container); margin:0 auto; padding:0 20px; }

/* 头部 */
.site-header{
  background:rgba(255,255,255,.95); backdrop-filter:saturate(180%) blur(14px);
  -webkit-backdrop-filter:saturate(180%) blur(14px);
  border-bottom:1px solid var(--theme-border);
  position:sticky; top:0; z-index:50;
}
.site-header__inner{
  display:flex; align-items:center; justify-content:space-between;
  height:64px; gap:24px;
}
.site-brand{ display:flex; align-items:center; gap:12px; flex-shrink:0; }
.site-brand a{ color:var(--theme-text); display:flex; align-items:center; gap:10px; }
.site-brand .logo-mark{
  width:38px; height:38px; border-radius:10px;
  background:linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
  display:inline-flex; align-items:center; justify-content:center;
  color:#fff; font-weight:800; font-size:18px;
  box-shadow:0 4px 12px rgba(255,106,26,.25);
}
.site-brand .brand-text{ font-size:1.18rem; font-weight:800; letter-spacing:-.02em; }
.site-brand .brand-sub{ font-size:.75rem; color:var(--theme-text-muted); margin-top:2px; font-family:var(--theme-mono); }

.main-nav{ display:flex; align-items:center; gap:2px; flex:1; min-width:0; }
.main-nav a{
  display:inline-block; padding:8px 14px; border-radius:8px;
  color:var(--theme-text); font-size:14px; font-weight:600;
  white-space:nowrap; transition:background .15s, color .15s;
}
.main-nav a:hover, .main-nav a.active{
  background:var(--theme-primary-soft); color:var(--theme-primary);
}

.header-search{ flex-shrink:0; }
.header-search input{
  width:220px; height:38px; padding:0 14px 0 38px;
  border:1px solid var(--theme-border); border-radius:20px;
  font-size:14px; background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 14px center;
  outline:none; transition:border-color .15s, box-shadow .15s;
}
.header-search input:focus{ border-color:var(--theme-primary); box-shadow:0 0 0 3px var(--theme-primary-soft); }
.mobile-menu-btn{ display:none; border:0; background:none; padding:8px; cursor:pointer; color:var(--theme-text); }

/* 主体 */
.page{ padding:24px 0 44px; }
.page-grid{ display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:28px; }
.page-grid--full{ display:block; }

/* Hero：科技渐变 */
.hero{
  background:linear-gradient(120deg, #15171f 0%, #1f2937 55%, #ff6a1a 200%);
  color:#fff; padding:62px 0 56px; margin-bottom:28px;
  border-radius:0; position:relative; overflow:hidden;
}
.hero::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(circle at 80% 30%, rgba(0,212,255,.18), transparent 50%);
}
.hero .container{ position:relative; z-index:1; }
.hero h1{
  color:#fff; font-size:2.4rem; margin-bottom:.4em;
  font-weight:800; letter-spacing:-.02em;
}
.hero .hero-sub{ color:rgba(255,255,255,.85); font-size:1.05rem; max-width:680px; }

/* 卡片 */
.card{
  background:#fff; border:1px solid var(--theme-border); border-radius:var(--theme-radius);
  box-shadow:var(--theme-shadow); overflow:hidden;
}
.card + .card{ margin-top:22px; }
.card__header{
  padding:18px 22px; border-bottom:1px solid var(--theme-border);
  display:flex; align-items:center; justify-content:space-between;
}
.card__title{ font-size:1.12rem; font-weight:700; margin:0; display:flex; align-items:center; gap:10px; }
.card__title::before{
  content:""; display:inline-block; width:6px; height:18px;
  background:linear-gradient(180deg, var(--theme-primary), var(--theme-accent));
  border-radius:3px;
}
.card__more{ font-size:.85rem; color:var(--theme-primary); font-weight:600; }
.card__more:hover{ color:var(--theme-primary-dark); }

/* 文章列表 */
.article-list{ display:grid; gap:0; }
.article-item{
  display:flex; gap:18px; padding:18px 22px;
  border-bottom:1px solid var(--theme-border); transition:background .15s;
}
.article-item:last-child{ border-bottom:0; }
.article-item:hover{ background:var(--theme-bg-soft); }
.article-item__cover{
  width:180px; height:120px; border-radius:8px; overflow:hidden;
  flex-shrink:0; background:var(--theme-bg-soft); position:relative;
}
.article-item__cover::after{
  content:""; position:absolute; inset:0; border-radius:8px;
  background:linear-gradient(180deg, transparent 60%, rgba(0,0,0,.25));
  pointer-events:none; opacity:0; transition:opacity .2s;
}
.article-item:hover .article-item__cover::after{ opacity:1; }
.article-item__cover img{ width:100%; height:100%; object-fit:cover; transition:transform .3s; }
.article-item:hover .article-item__cover img{ transform:scale(1.05); }
.article-item__body{ flex:1; min-width:0; display:flex; flex-direction:column; }
.article-item__title{
  font-size:1.08rem; font-weight:700; margin:0 0 .35em; line-height:1.38;
  letter-spacing:-.01em;
}
.article-item__title a{ color:var(--theme-text); }
.article-item__title a:hover{ color:var(--theme-primary); }
.article-item__excerpt{
  color:var(--theme-text-muted); font-size:14px; line-height:1.62;
  margin:0 0 auto;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.article-item__meta{
  display:flex; align-items:center; gap:14px; margin-top:8px;
  font-size:12px; color:var(--theme-text-muted); font-family:var(--theme-mono);
}
.article-item__meta .views::before{ content:"› "; color:var(--theme-accent-dark); }
.article-item__meta .date::before{  content:"# "; color:var(--theme-primary); }

/* 文章详情 */
.article{
  background:#fff; border:1px solid var(--theme-border); border-radius:var(--theme-radius);
  box-shadow:var(--theme-shadow); padding:36px 44px;
}
.article__title{ font-size:2.1rem; line-height:1.28; margin-bottom:14px; letter-spacing:-.02em; }
.article__meta{
  display:flex; gap:14px; flex-wrap:wrap; padding-bottom:18px;
  border-bottom:1px solid var(--theme-border); margin-bottom:24px;
  font-size:13px; color:var(--theme-text-muted); font-family:var(--theme-mono);
}
.article__meta a{ color:var(--theme-text-muted); }
.article__meta a:hover{ color:var(--theme-primary); }
.article__cover{ width:100%; max-height:400px; object-fit:cover; border-radius:10px; margin-bottom:22px; }
.article__content{ font-size:16px; line-height:1.85; color:#2a2e3a; }
.article__content h2,.article__content h3{ margin-top:1.6em; }
.article__content h2{ padding-bottom:.3em; border-bottom:2px solid var(--theme-primary-soft); }
.article__content p{ margin-bottom:1.2em; }
.article__content img{ border-radius:10px; margin:1em 0; box-shadow:var(--theme-shadow); }
.article__content blockquote{
  margin:1em 0; padding:.8em 1.4em; border-left:4px solid var(--theme-primary);
  background:var(--theme-primary-soft); color:#2a2e3a; border-radius:0 8px 8px 0;
}
.article__content pre{
  background:#15171f; color:#e6e8ee; padding:16px 20px; border-radius:8px;
  overflow-x:auto; font-size:13.5px; font-family:var(--theme-mono);
}

/* 侧栏 */
.aside{ position:sticky; top:88px; align-self:start; }
.widget{
  background:#fff; border:1px solid var(--theme-border); border-radius:var(--theme-radius);
  box-shadow:var(--theme-shadow); margin-bottom:18px; overflow:hidden;
}
.widget__title{
  padding:14px 18px; border-bottom:1px solid var(--theme-border);
  font-size:1rem; font-weight:700; margin:0;
  display:flex; align-items:center; gap:8px;
}
.widget__title::before{
  content:""; width:6px; height:16px;
  background:linear-gradient(180deg, var(--theme-accent), var(--theme-primary));
  border-radius:3px;
}
.widget__body{ padding:8px 0; }
.widget__list{ list-style:none; padding:0; margin:0; }
.widget__list li{ padding:8px 18px; }
.widget__list li a{
  color:var(--theme-text); font-size:14px; line-height:1.5;
  display:block; transition:color .15s;
}
.widget__list li a:hover{ color:var(--theme-primary); }

.widget--ranked .widget__list{ counter-reset:rank; }
.widget--ranked .widget__list li{ display:flex; gap:10px; align-items:flex-start; counter-increment:rank; }
.widget--ranked .widget__list li::before{
  content:"0" counter(rank); flex-shrink:0;
  width:auto; padding:2px 8px;
  background:var(--theme-bg-soft); color:var(--theme-text-muted);
  border-radius:4px; font-size:11.5px; font-weight:700;
  font-family:var(--theme-mono);
}
.widget--ranked .widget__list li:nth-child(-n+3)::before{
  background:linear-gradient(135deg, var(--theme-primary), #ff8a3a); color:#fff;
}

/* 分类页头 */
.cat-header{
  background:#fff; border:1px solid var(--theme-border); border-radius:var(--theme-radius);
  box-shadow:var(--theme-shadow); padding:24px 28px; margin-bottom:20px;
  position:relative; overflow:hidden;
}
.cat-header::before{
  content:""; position:absolute; top:0; left:0; right:0; height:3px;
  background:linear-gradient(90deg, var(--theme-primary), var(--theme-accent));
}
.cat-header h1{ margin:0 0 .3em; }
.cat-header p{ margin:0; color:var(--theme-text-muted); }

/* 标签云 */
.tag-cloud{ display:flex; flex-wrap:wrap; gap:8px; padding:18px 22px; }
.tag-chip{
  display:inline-block; padding:5px 12px; border-radius:14px;
  background:var(--theme-bg-soft); color:var(--theme-text);
  border:1px solid var(--theme-border); font-size:13px; font-weight:500;
  font-family:var(--theme-mono);
  transition:background .15s, color .15s, border-color .15s;
}
.tag-chip:hover{ background:var(--theme-primary); color:#fff; border-color:var(--theme-primary); }

/* 标签详情 */
.tag-detail{
  background:#fff; border:1px solid var(--theme-border); border-radius:var(--theme-radius);
  box-shadow:var(--theme-shadow); padding:32px;
}
.tag-detail__title{ font-size:1.7rem; margin-bottom:.5em; }
.tag-detail__lead{
  color:var(--theme-text-muted); font-size:.95rem; margin-bottom:24px;
}
.tag-detail__section{ margin-top:26px; }
.tag-detail__section h2{ font-size:1.15rem; }

/* 分页 */
.pager,.pagination{
  display:flex; gap:6px; justify-content:center; flex-wrap:wrap;
  padding:24px 0; list-style:none; margin:0;
}
.pager a, .pager span,
.pagination li > a, .pagination li > span{
  display:inline-block; padding:7px 13px; border-radius:8px;
  border:1px solid var(--theme-border); background:#fff;
  color:var(--theme-text); font-size:14px; text-decoration:none;
  font-family:var(--theme-mono);
}
.pager a:hover, .pagination li > a:hover{ border-color:var(--theme-primary); color:var(--theme-primary); }
.pager .active, .pager .current,
.pagination li.active > span, .pagination li.active > a{
  background:linear-gradient(135deg, var(--theme-primary), #ff8a3a);
  border-color:var(--theme-primary); color:#fff;
}
.pager .disabled, .pagination li.disabled > span{ color:var(--theme-text-muted); cursor:not-allowed; }

/* 搜索 */
.search-summary{
  background:var(--theme-primary-soft); border-left:4px solid var(--theme-primary);
  border-radius:6px; padding:14px 18px; margin-bottom:16px;
  color:var(--theme-primary-dark); font-size:14px;
}
.search-summary strong{ color:var(--theme-primary-dark); }

/* 面包屑 */
.crumb{
  font-size:13px; color:var(--theme-text-muted); margin-bottom:16px;
  display:flex; flex-wrap:wrap; gap:6px; align-items:center;
  font-family:var(--theme-mono);
}
.crumb a{ color:var(--theme-text-muted); }
.crumb a:hover{ color:var(--theme-primary); }
.crumb .sep{ opacity:.5; }

/* footer */
.site-footer{
  background:#15171f; color:#9ca3af; margin-top:60px; padding:40px 0 22px;
}
.site-footer a{ color:#d1d5db; }
.site-footer a:hover{ color:var(--theme-accent); }
.site-footer .friend{ margin-bottom:16px; font-size:14px; }
.site-footer .friend a{ margin-right:14px; }
.site-footer .copyright{
  border-top:1px solid #2a2e3a; padding-top:16px; font-size:13px;
  display:flex; flex-wrap:wrap; gap:14px; justify-content:space-between;
}

/* 错误页 */
.error{ text-align:center; padding:80px 20px; }
.error h1{
  font-size:6.5rem; margin-bottom:0; letter-spacing:-.03em;
  background:linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
  -webkit-background-clip:text; background-clip:text; color:transparent;
  -webkit-text-fill-color:transparent;
}
.error p{ font-size:1.1rem; color:var(--theme-text-muted); }
.error .btn{
  display:inline-block; margin-top:18px; padding:10px 24px;
  background:linear-gradient(135deg, var(--theme-primary), #ff8a3a); color:#fff;
  border-radius:8px; font-weight:600;
}
.error .btn:hover{ box-shadow:0 6px 18px rgba(255,106,26,.35); }

/* 移动端 */
@media (max-width: 992px){
  .page-grid{ grid-template-columns:1fr; }
  .aside{ position:static; }
  .article{ padding:24px; }
  .article__title{ font-size:1.6rem; }
}
@media (max-width: 768px){
  .main-nav{ display:none; position:absolute; top:64px; left:0; right:0;
              background:#fff; flex-direction:column; padding:8px;
              box-shadow:var(--theme-shadow-lg); border-bottom:1px solid var(--theme-border); }
  .main-nav.open{ display:flex; }
  .header-search{ display:none; }
  .mobile-menu-btn{ display:inline-flex; }
  .article-item{ flex-direction:column; }
  .article-item__cover{ width:100%; height:200px; }
  .hero{ padding:42px 0 32px; }
  .hero h1{ font-size:1.7rem; }
  .article{ padding:20px; }
  .article__title{ font-size:1.4rem; }
}

/* 首页聚合块 */
.cat-block .card__title{ font-size:1.18rem; }
.cat-block .card__title a{ color:var(--theme-text); }
.cat-block .card__title a:hover{ color:var(--theme-primary); }
.cat-block__desc{
  margin:0; padding:10px 22px;
  color:var(--theme-text-muted); font-size:13px;
  background:var(--theme-bg-soft);
  border-bottom:1px solid var(--theme-border);
}
.cat-block__body{ display:flex; flex-direction:column; }

.cat-block__featured{
  display:grid; grid-template-columns:1fr 1fr;
  gap:16px; padding:18px 22px;
  border-bottom:1px solid var(--theme-border);
}
.cat-block__featured .article-item{
  flex-direction:column; gap:0; padding:0;
  border:1px solid var(--theme-border); border-radius:10px;
  overflow:hidden; background:#fff;
  transition:transform .2s, box-shadow .2s, border-color .2s;
}
.cat-block__featured .article-item:hover{
  transform:translateY(-3px); background:#fff;
  box-shadow:var(--theme-shadow-lg);
  border-color:var(--theme-primary);
}
.cat-block__featured .article-item__cover{ width:100%; height:170px; border-radius:0; }
.cat-block__featured .article-item__body{ padding:14px 16px 16px; }
.cat-block__featured .article-item__title{ font-size:1rem; }
.cat-block__featured .article-item__excerpt{ -webkit-line-clamp:2; }

.cat-block__list{
  list-style:none; margin:0;
  padding:14px 24px 18px;
  display:grid; grid-template-columns:1fr 1fr;
  gap:0 36px;
}
.cat-block__list li{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 0; border-bottom:1px dashed var(--theme-border);
  font-size:14px;
}
.cat-block__list li a{
  color:var(--theme-text); flex:1; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  padding-left:14px; position:relative;
  transition:color .15s;
}
.cat-block__list li a::before{
  content:""; position:absolute; left:2px; top:50%;
  width:5px; height:5px; border-radius:1px;
  background:var(--theme-accent);
  transform:translateY(-50%) rotate(45deg); transition:background .15s;
}
.cat-block__list li a:hover{ color:var(--theme-primary); }
.cat-block__list li a:hover::before{ background:var(--theme-primary); }
.cat-block__list time{
  color:var(--theme-text-muted); font-size:11.5px;
  flex-shrink:0; margin-left:12px; font-family:var(--theme-mono);
}
@media (max-width: 768px){
  .cat-block__featured{ grid-template-columns:1fr; gap:12px; padding:14px; }
  .cat-block__featured .article-item__cover{ height:180px; }
  .cat-block__list{ grid-template-columns:1fr; gap:0; padding:12px 16px; }
}
