/* ============================================
   极夜深海蓝 / 霓虹冰川青流光主题
   ============================================ */

:root {
  --bg-deep:       #040812;
  --bg-mid:        #0a1326;
  --accent-start:  #00d2ff;
  --accent-end:    #3a7bd5;
  --card-bg:       rgba(10, 19, 38, 0.85);
  --card-border:   rgba(0, 210, 255, 0.25);
  --card-glow:     rgba(0, 210, 255, 0.18);
  --text-primary:  #e8f4ff;
  --text-secondary:#8ab8d8;
  --text-muted:    #4a7a9b;
  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     20px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---- Animated starfield backdrop ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20%  30%, rgba(0,210,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 75%  15%, rgba(58,123,213,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 55%  70%, rgba(0,210,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 90%  60%, rgba(58,123,213,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 10%  85%, rgba(0,210,255,0.3) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ---- Links ---- */
a { color: var(--accent-start); text-decoration: none; transition: color .2s; }
a:hover { color: #fff; text-shadow: 0 0 8px var(--accent-start); }

/* ---- Header / Nav ---- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(4, 8, 18, 0.80);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
  padding: 0 24px;
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.nav-logo {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { font-size: .92rem; color: var(--text-secondary); }
.nav-links a:hover { color: var(--accent-start); }

/* ---- Main layout ---- */
main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ---- Section titles ---- */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Frosted card ---- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow:
    0 0 24px var(--card-glow),
    0 4px 24px rgba(0, 0, 0, 0.5);
  padding: 28px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow .3s, transform .3s;
}
.card:hover {
  box-shadow:
    0 0 36px rgba(0, 210, 255, 0.28),
    0 8px 32px rgba(0, 0, 0, 0.6);
  transform: translateY(-2px);
}

/* ---- Article / post grid ---- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.post-card {
  composes: card;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: 0 0 24px var(--card-glow), 0 4px 24px rgba(0,0,0,.5);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow .3s, transform .3s;
}
.post-card:hover {
  box-shadow: 0 0 36px rgba(0,210,255,.28), 0 8px 32px rgba(0,0,0,.6);
  transform: translateY(-2px);
}

.post-card .post-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-start);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2px 10px;
  margin-bottom: 10px;
}

.post-card h2 { font-size: 1.08rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.post-card p  { font-size: .88rem; color: var(--text-secondary); margin-bottom: 16px; }
.post-card .post-meta { font-size: .78rem; color: var(--text-muted); }

/* ---- Hero banner ---- */
.hero {
  text-align: center;
  padding: 72px 24px 56px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 20px;
  background: linear-gradient(120deg, var(--accent-start) 0%, #fff 50%, var(--accent-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 36px;
}

/* ---- Glow button ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  border-radius: 40px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: filter .25s, transform .2s, box-shadow .25s;
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent-start) 0%, var(--accent-end) 100%);
  color: #fff;
  box-shadow: 0 0 24px rgba(0, 210, 255, 0.45), 0 4px 16px rgba(0,0,0,.4);
  position: relative;
  overflow: hidden;
}

/* Shimmer sweep */
.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: rgba(255, 255, 255, 0.18);
  transform: skewX(-20deg);
  animation: shimmer 2.4s infinite;
}
@keyframes shimmer {
  0%   { left: -75%; }
  100% { left: 150%; }
}

.btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(0, 210, 255, 0.65), 0 6px 20px rgba(0,0,0,.5);
  -webkit-text-fill-color: #fff;
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--accent-start);
  border: 1px solid var(--card-border);
  box-shadow: 0 0 12px var(--card-glow);
}
.btn-outline:hover {
  background: rgba(0, 210, 255, 0.08);
  border-color: var(--accent-start);
  transform: translateY(-2px);
  color: var(--accent-start);
}

/* ---- Article page ---- */
.article-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.article-wrap h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.3;
}
.article-meta { font-size: .82rem; color: var(--text-muted); margin-bottom: 32px; }
.article-body h2 { font-size: 1.3rem; font-weight: 700; margin: 36px 0 12px; color: var(--accent-start); }
.article-body h3 { font-size: 1.1rem; font-weight: 600; margin: 24px 0 10px; }
.article-body p  { margin-bottom: 16px; color: var(--text-secondary); }
.article-body ul, .article-body ol { margin: 0 0 16px 20px; color: var(--text-secondary); }
.article-body li { margin-bottom: 6px; }
.article-body code {
  background: rgba(0,210,255,0.1);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: .88em;
  color: var(--accent-start);
}
.article-body pre {
  background: rgba(4, 8, 18, 0.9);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 20px;
}
.article-body blockquote {
  border-left: 3px solid var(--accent-start);
  padding: 12px 20px;
  margin: 20px 0;
  background: rgba(0,210,255,0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

/* ---- Table ---- */
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
th, td { padding: 10px 14px; text-align: left; border: 1px solid var(--card-border); font-size: .9rem; }
th { background: rgba(0,210,255,0.08); color: var(--accent-start); font-weight: 600; }
tr:nth-child(even) td { background: rgba(10,19,38,0.4); }

/* ---- Footer ---- */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--card-border);
  padding: 32px 24px;
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
}
footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent-start); }

/* ---- Utility ---- */
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(0,210,255,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,210,255,0.55); }

/* ---- Responsive ---- */
@media (max-width: 680px) {
  nav { height: auto; flex-wrap: wrap; padding: 12px 0; }
  .nav-links { gap: 16px; }
  .hero { padding: 48px 16px 36px; }
  .post-grid { grid-template-columns: 1fr; }
}
