/* ============================================
   FPGA / IC Design - Global Stylesheet
   Blue tech theme, minimal
   ============================================ */

:root {
  --bg: #060b17;
  --bg-deep: #04070f;
  --surface: rgba(14, 26, 52, 0.5);
  --surface-solid: #0c1628;
  --surface-border: rgba(61, 139, 255, 0.18);
  --text: #dce7f8;
  --text-secondary: #8fa3c2;
  --text-muted: #58709a;
  --accent: #3d8bff;
  --accent-bright: #5ba8ff;
  --cyan: #35e0ff;
  --glow: rgba(61, 139, 255, 0.35);
  --radius: 12px;
  --max-width: 1080px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background-color: var(--bg);
  /* 细网格线：电路板氛围 */
  background-image:
    linear-gradient(rgba(61, 139, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 139, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* 顶部蓝色光晕 */
body::before {
  content: "";
  position: fixed;
  top: -260px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 520px;
  background: radial-gradient(ellipse at center, rgba(61, 139, 255, 0.16), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--accent-bright);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--cyan);
}

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: rgba(61, 139, 255, 0.35);
}

/* ---------------- Navigation ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 11, 23, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(61, 139, 255, 0.12);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.logo .logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.logo em {
  font-style: normal;
  color: var(--accent-bright);
}

.nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-bright);
  background: rgba(61, 139, 255, 0.1);
}

/* ---------------- Layout ---------------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

section {
  padding: 72px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 36px;
}

.section-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-sub {
  color: var(--text-muted);
  font-size: 14px;
  font-family: var(--font-mono);
}

/* ---------------- Hero ---------------- */
.hero {
  padding: 110px 0 96px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--cyan);
  border: 1px solid rgba(53, 224, 255, 0.25);
  background: rgba(53, 224, 255, 0.05);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 28px;
  text-transform: uppercase;
}

.hero-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero h1 {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  background: linear-gradient(120deg, #ffffff 30%, #7db8ff 70%, #35e0ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 终端装饰卡片 */
.term {
  max-width: 460px;
  margin: 36px auto 40px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 2;
  box-shadow: 0 0 40px rgba(61, 139, 255, 0.08);
  backdrop-filter: blur(6px);
}

.term .bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(61, 139, 255, 0.12);
}

.term .bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: block;
}

.term .bar i:nth-child(1) { background: #ff5f57; }
.term .bar i:nth-child(2) { background: #febc2e; }
.term .bar i:nth-child(3) { background: #28c840; }

.term .line {
  color: var(--text-secondary);
  white-space: nowrap;
}

.term .prompt {
  color: var(--cyan);
}

.term .out {
  color: var(--text);
}

.term .out .dim {
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 28px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-mono);
}

.btn-primary {
  background: linear-gradient(135deg, #2f7bff, #3d8bff);
  color: #fff;
  box-shadow: 0 4px 24px rgba(61, 139, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(61, 139, 255, 0.5);
  color: #fff;
}

.btn-outline {
  border-color: rgba(61, 139, 255, 0.4);
  color: var(--accent-bright);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 20px rgba(53, 224, 255, 0.15);
}

/* ---------------- Blog list ---------------- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 24px 4px;
  border-bottom: 1px solid rgba(61, 139, 255, 0.12);
}

.post-item:last-child {
  border-bottom: none;
}

.post-item h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.post-item h3 a {
  color: var(--text);
}

.post-item h3 a:hover {
  color: var(--accent-bright);
}

.post-item .desc {
  color: var(--text-secondary);
  font-size: 14px;
}

.post-item .date {
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* 空状态 */
.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 88px 24px;
  border: 1px dashed rgba(61, 139, 255, 0.22);
  border-radius: var(--radius);
}

.empty .empty-icon {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  display: block;
  margin-bottom: 14px;
  letter-spacing: 0.12em;
}

/* ---------------- Article page ---------------- */
.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}

.article h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin-bottom: 16px;
}

.article .meta {
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-mono);
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(61, 139, 255, 0.12);
}

.article .content {
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-secondary);
}

.article .content h2 {
  font-size: 23px;
  margin: 40px 0 16px;
  font-weight: 700;
  color: var(--text);
}

.article .content h3 {
  font-size: 18px;
  margin: 28px 0 12px;
  font-weight: 600;
  color: var(--text);
}

.article .content p {
  margin-bottom: 20px;
}

.article .content ul,
.article .content ol {
  margin: 0 0 20px 24px;
}

.article .content li {
  margin-bottom: 8px;
}

.article .content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(61, 139, 255, 0.12);
  border: 1px solid rgba(61, 139, 255, 0.18);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--cyan);
}

.article .content pre {
  background: var(--surface-solid);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 18px;
  overflow-x: auto;
  margin: 0 0 20px;
}

.article .content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-secondary);
}

.article .content blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 0 0 20px;
  color: var(--text-secondary);
}

/* ---------------- About page ---------------- */
.about-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 44px 44px 52px;
  backdrop-filter: blur(6px);
}

.about-card h2 {
  font-size: 15px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--cyan);
  margin-bottom: 18px;
  font-weight: 600;
}

.about-card .intro {
  color: var(--text);
  font-size: 17px;
  line-height: 2;
  margin-bottom: 8px;
}

.about-card .intro .dim {
  color: var(--text-secondary);
}

.skill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 44px;
}

.skill {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-bright);
  background: rgba(61, 139, 255, 0.08);
  border: 1px solid rgba(61, 139, 255, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.skill:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 14px rgba(53, 224, 255, 0.15);
}

.about-card .note {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.9;
}

/* ---------------- Footer ---------------- */
.footer {
  border-top: 1px solid rgba(61, 139, 255, 0.1);
  padding: 36px 0 30px;
  margin-top: 40px;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.footer .copy {
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-mono);
}

.footer .icp {
  font-size: 12.5px;
  color: var(--text-muted);
}

.footer .icp a {
  color: var(--text-muted);
  border-bottom: 1px solid rgba(88, 112, 154, 0.4);
}

.footer .icp a:hover {
  color: var(--accent-bright);
  border-color: var(--accent-bright);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 768px) {
  .hero {
    padding: 72px 0 64px;
  }
  .hero h1 {
    font-size: 32px;
  }
  section {
    padding: 48px 0;
  }
  .term {
    font-size: 12px;
  }
  .post-item {
    flex-direction: column;
    gap: 8px;
  }
  .article h1 {
    font-size: 25px;
  }
  .nav-links a {
    padding: 6px 10px;
    font-size: 13px;
  }
}
