/* ============================================================
   news_techdark — 暗夜科技风主题样式
   OTCMS/小旋风模板专用样式表
   ============================================================ */

/* ---------- 1. 基础变量 ---------- */
:root {
  --bg-body: #0a0e1a;
  --bg-panel: #0f1424;
  --bg-panel-2: #131a2e;
  --bg-card: #111827;
  --border-line: #1f2a44;
  --border-glow: #00d9ff;
  --accent-cyan: #00d9ff;
  --accent-cyan-dim: #0891b2;
  --accent-purple: #7c3aed;
  --accent-pink: #ec4899;
  --text-main: #d6e2f0;
  --text-dim: #7d8aa3;
  --text-heading: #eaf6ff;
  --font-mono: "Consolas", "SFMono-Regular", "Cascadia Code", "Courier New", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --radius: 6px;
  --glow-sm: 0 0 6px rgba(0, 217, 255, 0.35);
  --glow-md: 0 0 16px rgba(0, 217, 255, 0.25), 0 0 2px rgba(0, 217, 255, 0.6);
  --max-width: 1200px;
}

/* ---------- 2. Reset ---------- */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background-color: var(--bg-body);
  background-image:
    linear-gradient(180deg, rgba(0, 217, 255, 0.04) 0%, transparent 240px),
    repeating-linear-gradient(
      0deg,
      rgba(0, 217, 255, 0.025) 0px,
      rgba(0, 217, 255, 0.025) 1px,
      transparent 1px,
      transparent 32px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0, 217, 255, 0.025) 0px,
      rgba(0, 217, 255, 0.025) 1px,
      transparent 1px,
      transparent 32px
    );
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}
a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}
a:hover {
  color: #7ef1ff;
  text-shadow: 0 0 8px rgba(0, 217, 255, 0.6);
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
img {
  max-width: 100%;
  display: block;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-mono);
  color: var(--text-heading);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
}
p {
  margin: 0 0 12px;
}

/* ---------- 3. 布局容器 ---------- */
.header-inner,
.home-main,
.page-wrap,
.site-footer .footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.page-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  padding-top: 28px;
  padding-bottom: 40px;
  align-items: start;
}
.home-main {
  padding-top: 28px;
  padding-bottom: 40px;
}

/* ---------- 4. 头部 / 导航 (head.html) ---------- */
.site-header {
  position: relative;
  background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-body) 100%);
  border-bottom: 1px solid var(--border-line);
  box-shadow: 0 1px 0 rgba(0, 217, 255, 0.15);
}
.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-cyan),
    var(--accent-purple),
    transparent
  );
  opacity: 0.8;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}
.site-logo {
  display: inline-flex;
  align-items: center;
  filter: drop-shadow(0 0 6px rgba(0, 217, 255, 0.35));
}
.site-logo:hover {
  filter: drop-shadow(0 0 12px rgba(0, 217, 255, 0.6));
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.site-nav a {
  display: inline-block;
  padding: 8px 14px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  position: relative;
}
.site-nav a::before {
  content: "//";
  color: var(--accent-cyan);
  opacity: 0;
  margin-right: 2px;
  transition: opacity 0.15s ease;
}
.site-nav a:hover,
.site-nav a:focus {
  color: var(--accent-cyan);
  border-color: var(--border-line);
  background: rgba(0, 217, 255, 0.06);
  text-shadow: none;
}
.site-nav a:hover::before {
  opacity: 1;
}

/* ---------- 5. 首页：分类板块 + 文章卡片 (index.html) ---------- */
.category-block {
  margin-bottom: 36px;
}
.category-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-line);
  padding-bottom: 10px;
  margin-bottom: 18px;
}
.category-block-head h2 {
  margin: 0;
  font-size: 19px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-block-head h2::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  box-shadow: var(--glow-sm);
  border-radius: 1px;
  display: inline-block;
}
.category-block-head h2 a {
  color: var(--text-heading);
}
.category-block-head h2 a:hover {
  color: var(--accent-cyan);
}
.more-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}
.more-link:hover {
  color: var(--accent-cyan);
}
.article-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.article-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-cyan), transparent 40%);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}
.article-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-cyan-dim);
  box-shadow: var(--glow-md);
}
.article-card:hover::after {
  opacity: 0.5;
}
.article-card h3 {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.5;
}
.article-card h3 a {
  color: var(--text-main);
}
.article-card:hover h3 a {
  color: var(--accent-cyan);
}
.article-card time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------- 6. 列表页 (list.html) ---------- */
.list-main h1 {
  font-size: 22px;
  border-left: 3px solid var(--accent-cyan);
  padding-left: 12px;
  margin-bottom: 20px;
}
.article-list-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.article-list-item:hover {
  border-color: var(--accent-cyan-dim);
  box-shadow: var(--glow-sm);
}
.article-list-item h2 {
  font-size: 17px;
  margin: 0 0 8px;
}
.article-list-item h2 a {
  color: var(--text-heading);
}
.article-list-item:hover h2 a {
  color: var(--accent-cyan);
}
.article-list-item .meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}
.article-list-item .summary {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0;
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.pagination a {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--border-line);
  border-radius: var(--radius);
  color: var(--text-main);
}
.pagination a:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: var(--glow-sm);
}

/* ---------- 7. 侧边栏 (list.html / show.html) ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.side-block {
  background: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.side-block h3 {
  font-size: 14px;
  color: var(--accent-cyan);
  border-bottom: 1px dashed var(--border-line);
  padding-bottom: 10px;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.side-block ul li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}
.side-block ul li:last-child {
  border-bottom: none;
}
.side-block ul li a {
  color: var(--text-main);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-block ul li a:hover {
  color: var(--accent-cyan);
}
.side-block ul li time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ---------- 8. 文章详情页 (show.html) ---------- */
.article-detail {
  background: var(--bg-panel);
  border: 1px solid var(--border-line);
  border-radius: var(--radius);
  padding: 26px 28px;
}
.article-detail h1 {
  font-size: 24px;
  line-height: 1.4;
  margin-bottom: 14px;
}
.article-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--border-line);
  padding-bottom: 14px;
  margin-bottom: 16px;
}
.article-meta .source {
  color: var(--accent-cyan-dim);
}
.summary {
  background: rgba(0, 217, 255, 0.05);
  border-left: 3px solid var(--accent-cyan);
  padding: 12px 16px;
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.article-body {
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--text-main);
}
.article-body img {
  border-radius: var(--radius);
  border: 1px solid var(--border-line);
  margin: 14px 0;
}
.article-body p {
  margin: 0 0 16px;
}
.article-body h2,
.article-body h3 {
  margin-top: 24px;
}
.article-nav {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}
.article-nav a {
  color: var(--text-main);
}
.article-nav a:hover {
  color: var(--accent-cyan);
}

/* ---------- 9. 底部 (footer.html) ---------- */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border-line);
  background: var(--bg-panel-2);
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-purple), transparent);
  opacity: 0.6;
}
.footer-inner {
  padding-top: 28px;
  padding-bottom: 24px;
}
.friendlink h3 {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.friendlink ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 20px;
}
.friendlink ul li a {
  font-size: 13px;
  color: var(--text-dim);
}
.friendlink ul li a:hover {
  color: var(--accent-cyan);
}
.copyright {
  border-top: 1px solid var(--border-line);
  padding-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.9;
}
.copyright a {
  color: var(--text-dim);
}
.copyright a:hover {
  color: var(--accent-cyan);
}

/* ---------- 10. 响应式 (<768px) ---------- */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .site-nav ul {
    gap: 2px;
  }
  .site-nav a {
    padding: 6px 10px;
    font-size: 13px;
  }
  .page-wrap {
    grid-template-columns: 1fr;
    padding-top: 18px;
  }
  .home-main {
    padding-top: 18px;
  }
  .article-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .article-detail {
    padding: 18px;
  }
  .article-detail h1 {
    font-size: 19px;
  }
  .article-list-item {
    padding: 14px 16px;
  }
  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .side-block {
    flex: 1 1 260px;
  }
}

@media (max-width: 480px) {
  .article-card-grid {
    grid-template-columns: 1fr;
  }
  body {
    font-size: 14px;
  }
  .article-meta {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* ---------- 11. 打印样式 ---------- */
@media print {
  body {
    background: #fff !important;
    color: #111 !important;
  }
  .site-header,
  .site-footer,
  .sidebar,
  .pagination,
  .article-nav {
    display: none !important;
  }
  .article-detail,
  .article-list-item {
    background: #fff !important;
    border: none !important;
    box-shadow: none !important;
    color: #111 !important;
  }
  a {
    color: #111 !important;
    text-shadow: none !important;
  }
}
