/* ============================================================
 * PIXEL DIMENSION · 文章页 + 列表页样式  v1.0
 * 类名前缀 pd-art- ，作用域隔离
 * 复用 pd-return-bar.css 的 :root 变量（--pd-cyan 等），并做防御性兜底
 * 零外部 CDN：字体沿用 index.html 已加载的 Google Fonts（Press Start 2P / VT323）
 * ============================================================ */

/* ---- 防御性变量兜底（即使 pd-return-bar.css 未加载也有值）---- */
:root{
  --pd-cyan: #00fff7;
  --pd-magenta: #ff00ff;
  --pd-bg: #1a1428;
  --pd-bg-card: rgba(42, 31, 61, 0.6);
  --pd-text: rgba(255, 255, 255, 0.85);
  --pd-text-dim: rgba(255, 255, 255, 0.6);
  --pd-font-pixel: 'Press Start 2P', 'Courier New', monospace;
  --pd-font-term: 'VT323', 'Courier New', monospace;
  --pd-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ---- 文章页 / 列表页 body ---- */
body.pd-art-body-bg{
  background: var(--pd-bg);
  color: var(--pd-text);
  font-family: var(--pd-font-body);
  line-height: 1.7;
  min-height: 100vh;
  margin: 0;
}

/* CRT 扫描线（与站点 dark 风格一致）*/
body.pd-art-body-bg::before{
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.18) 3px,
    rgba(0,0,0,0) 4px
  );
  pointer-events: none; z-index: 1;
}

/* ============ 文章页 ============ */
.pd-art-page{
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  position: relative; z-index: 2;
}

.pd-art-header{
  margin-bottom: 32px;
  text-align: center;
}

.pd-art-cover{
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border: 2px solid rgba(0, 255, 247, 0.3);
  border-radius: 4px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #2a1f3d 0%, #1a1428 100%);
  display: block;
}

.pd-art-cover--placeholder{
  height: 240px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--pd-font-pixel);
  font-size: 10px; letter-spacing: 2px;
  color: var(--pd-text-dim);
}

.pd-art-title{
  font-family: var(--pd-font-pixel);
  font-size: clamp(14px, 3vw, 20px);
  letter-spacing: 1px;
  color: #fff;
  margin: 0 0 12px;
  text-shadow: 0 0 12px rgba(0, 255, 247, 0.4);
  line-height: 1.4;
}

.pd-art-tagline{
  font-family: var(--pd-font-term);
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--pd-magenta);
  margin: 0 0 16px;
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.3);
}

.pd-art-meta{
  font-family: var(--pd-font-term);
  font-size: 16px;
  color: var(--pd-text-dim);
}

.pd-art-meta a{
  color: var(--pd-cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 255, 247, 0.4);
}

.pd-art-meta a:hover{
  text-shadow: 0 0 6px rgba(0, 255, 247, 0.6);
}

.pd-art-body{
  margin-bottom: 40px;
}

.pd-art-body h2{
  font-family: var(--pd-font-pixel);
  font-size: clamp(10px, 2vw, 13px);
  letter-spacing: 1.5px;
  color: var(--pd-cyan);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 255, 247, 0.2);
}

.pd-art-body p{
  font-size: 16px;
  line-height: 1.8;
  margin: 0 0 16px;
}

.pd-art-body ul{
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.pd-art-body li{
  font-size: 15px;
  line-height: 1.8;
  padding: 6px 0 6px 24px;
  position: relative;
}

.pd-art-body li::before{
  content: '▸';
  position: absolute; left: 0;
  color: var(--pd-magenta);
  font-family: var(--pd-font-term);
  font-size: 18px;
}

.pd-art-source{
  margin-top: 48px;
  padding: 20px;
  background: var(--pd-bg-card);
  border-left: 3px solid var(--pd-magenta);
  font-size: 14px;
  color: var(--pd-text-dim);
  border-radius: 4px;
}

.pd-art-source a{
  color: var(--pd-cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 255, 247, 0.4);
}

/* 语言切换器（文章页简化版，避让顶部返回条）*/
.pd-art-lang-toggle{
  position: fixed;
  top: calc(var(--pd-bar-total, 48px) + 10px);
  right: 16px;
  z-index: 1000001;
  display: flex; gap: 4px;
}

.pd-art-lang-toggle button{
  font-family: var(--pd-font-pixel);
  font-size: 9px; letter-spacing: 1px;
  padding: 6px 10px;
  background: rgba(42, 31, 61, 0.8);
  color: var(--pd-text-dim);
  border: 1px solid rgba(0, 255, 247, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: all .18s ease;
  -webkit-tap-highlight-color: transparent;
}

.pd-art-lang-toggle button:hover{
  color: #fff;
  border-color: var(--pd-cyan);
  box-shadow: 0 0 10px rgba(0, 255, 247, 0.3);
}

.pd-art-lang-toggle button[aria-pressed="true"]{
  color: var(--pd-cyan);
  border-color: var(--pd-cyan);
  text-shadow: 0 0 8px rgba(0, 255, 247, 0.5);
}

/* ============ 列表页 ============ */
.pd-art-list{
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  position: relative; z-index: 2;
}

.pd-art-list__header{
  text-align: center;
  margin-bottom: 40px;
}

.pd-art-list__title{
  font-family: var(--pd-font-pixel);
  font-size: clamp(14px, 3vw, 20px);
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 12px rgba(0, 255, 247, 0.4);
  margin: 0 0 12px;
}

.pd-art-list__desc{
  font-family: var(--pd-font-term);
  font-size: 20px;
  color: var(--pd-text-dim);
  margin: 0;
}

.pd-art-list__grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.pd-art-card{
  display: block;
  background: var(--pd-bg-card);
  border: 1px solid rgba(0, 255, 247, 0.2);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all .2s ease;
}

.pd-art-card:hover{
  border-color: var(--pd-cyan);
  box-shadow: 0 4px 24px rgba(0, 255, 247, 0.15);
  transform: translateY(-2px);
}

.pd-art-card__cover{
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: linear-gradient(135deg, #2a1f3d 0%, #1a1428 100%);
  display: block;
}

.pd-art-card__cover--placeholder{
  display: flex; align-items: center; justify-content: center;
  font-family: var(--pd-font-pixel);
  font-size: 9px; letter-spacing: 2px;
  color: var(--pd-text-dim);
}

.pd-art-card__body{
  padding: 16px;
}

.pd-art-card__date{
  font-family: var(--pd-font-term);
  font-size: 14px;
  color: var(--pd-cyan);
  margin: 0 0 6px;
}

.pd-art-card__title{
  font-family: var(--pd-font-pixel);
  font-size: 11px; letter-spacing: 1px;
  color: #fff;
  margin: 0 0 8px;
  line-height: 1.4;
}

.pd-art-card__desc{
  font-size: 14px;
  line-height: 1.6;
  color: var(--pd-text-dim);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pd-art-empty{
  text-align: center;
  padding: 60px 20px;
  font-family: var(--pd-font-term);
  font-size: 22px;
  color: var(--pd-text-dim);
}

.pd-art-empty__icon{
  font-family: var(--pd-font-pixel);
  font-size: 24px;
  color: var(--pd-cyan);
  margin-bottom: 16px;
  opacity: 0.6;
}

/* ---- 响应式 ---- */
@media (max-width: 600px){
  .pd-art-page, .pd-art-list{ padding: 16px 14px 60px; }
  .pd-art-list__grid{ grid-template-columns: 1fr; }
  .pd-art-cover{ max-height: 220px; }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce){
  .pd-art-card{ transition: none; }
  .pd-art-card:hover{ transform: none; }
  .pd-art-lang-toggle button{ transition: none; }
}
