/* 精致黑白风格 - aitechflow.cn */
/* refined minimal black & white */

:root {
  --bg: #000000;
  --text: #ffffff;
  --text-secondary: #6b6b6b;
  --text-tertiary: #444444;
  --divider: #1a1a1a;
  --divider-light: #2a2a2a;
  --hover: rgba(255, 255, 255, 0.06);
  --hover-light: rgba(255, 255, 255, 0.1);
  --accent: #ffffff;
  --shadow: rgba(0, 0, 0, 0.4);
}

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

html {
  scroll-behavior: smooth;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', Consolas, 'Noto Sans SC', monospace;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Page load animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

body {
  animation: fadeIn 0.6s ease-out;
}

/* Background texture */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: -1;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover {
  opacity: 0.7;
}

/* Layout */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 32px;
  margin-bottom: 48px;
  position: relative;
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--divider) 0%, transparent 50%, var(--divider) 100%);
}

.logo {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  position: relative;
}

.logo::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: var(--text);
  border-radius: 50%;
}

.nav {
  display: flex;
  gap: 28px;
}

.nav a {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  position: relative;
  padding: 4px 0;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width 0.3s ease;
}

.nav a:hover {
  color: var(--text);
  opacity: 1;
}

.nav a:hover::after {
  width: 100%;
}

.nav a.active {
  color: var(--text);
}

.nav a.active::after {
  width: 100%;
}

/* Main content */
.main {
  min-height: 60vh;
}

/* Post List */
.post-list {
  list-style: none;
}

.post-item {
  margin-bottom: 36px;
  padding: 24px;
  border-radius: 4px;
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease-out backwards;
}

.post-item:nth-child(1) { animation-delay: 0.1s; }
.post-item:nth-child(2) { animation-delay: 0.2s; }
.post-item:nth-child(3) { animation-delay: 0.3s; }
.post-item:nth-child(4) { animation-delay: 0.4s; }
.post-item:nth-child(5) { animation-delay: 0.5s; }

.post-item:hover {
  background: var(--hover);
}

.post-item a {
  display: block;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.post-date {
  color: var(--text-tertiary);
  font-size: 12px;
  font-feature-settings: 'tnum';
}

.post-category {
  color: var(--text-tertiary);
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid var(--divider-light);
  border-radius: 2px;
}

.post-title {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 6px;
  transition: color 0.25s ease;
}

.post-item:hover .post-title {
  color: var(--text-secondary);
}

.post-excerpt {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Arrow indicator */
.post-item::after {
  content: '→';
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: all 0.3s ease;
  color: var(--text-secondary);
}

.post-item {
  position: relative;
}

.post-item:hover::after {
  opacity: 1;
  right: 16px;
}

/* Post Page */
.post-header {
  margin-bottom: 40px;
  animation: fadeInUp 0.5s ease-out;
}

.post-back {
  margin-bottom: 24px;
}

.post-back a {
  color: var(--text-tertiary);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
}

.post-back a:hover {
  color: var(--text-secondary);
}

.post-back a::before {
  content: '←';
}

.post-header .post-title {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.post-header .post-meta {
  color: var(--text-tertiary);
  font-size: 13px;
}

.post-content {
  font-size: 15px;
  line-height: 1.85;
  animation: fadeInUp 0.5s ease-out 0.1s backwards;
}

.post-content h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 44px 0 20px;
  letter-spacing: -0.2px;
  position: relative;
  padding-left: 16px;
}

.post-content h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 3px;
  background: var(--text);
  border-radius: 50%;
}

.post-content h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 32px 0 14px;
}

.post-content p {
  margin-bottom: 22px;
}

.post-content ul, .post-content ol {
  margin: 0 0 22px 20px;
}

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

.post-content pre {
  background: #0a0a0a;
  border: 1px solid var(--divider);
  padding: 20px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 24px 0;
  font-size: 13px;
  line-height: 1.6;
}

.post-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.post-content p code {
  background: var(--divider);
  padding: 2px 6px;
  border-radius: 3px;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 28px 0;
  border-radius: 4px;
  border: 1px solid var(--divider);
}

.post-content blockquote {
  border-left: 2px solid var(--divider-light);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.post-content a {
  border-bottom: 1px solid var(--text-tertiary);
}

.post-content a:hover {
  border-bottom-color: var(--text);
}

.post-tags {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  color: var(--text-tertiary);
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--divider-light);
  border-radius: 3px;
  transition: all 0.2s ease;
}

.tag:hover {
  border-color: var(--text-tertiary);
  color: var(--text-secondary);
}

.post-divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 48px 0;
  position: relative;
}

.post-divider::before {
  content: '· · ·';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  padding: 0 16px;
  color: var(--text-tertiary);
  font-size: 12px;
  letter-spacing: 4px;
}

/* Archives */
.archives {
  padding-top: 20px;
}

.archives .page-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-tertiary);
  margin-bottom: 40px;
  font-weight: 400;
}

.archive-year {
  margin-bottom: 40px;
}

.year {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--divider);
  display: inline-block;
}

.archive-list {
  list-style: none;
}

.archive-list li {
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
  padding: 8px 0;
  transition: background 0.2s ease;
  border-radius: 4px;
}

.archive-list li:hover {
  background: var(--hover);
}

.archive-list .date {
  color: var(--text-tertiary);
  font-size: 12px;
  min-width: 45px;
  font-feature-settings: 'tnum';
}

.archive-list a {
  font-size: 14px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 56px;
  padding-top: 36px;
  position: relative;
}

.pagination::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 1px;
  background: var(--divider);
}

.pagination a {
  color: var(--text-tertiary);
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid var(--divider-light);
  border-radius: 3px;
  transition: all 0.2s ease;
}

.pagination a:hover {
  color: var(--text);
  border-color: var(--text-tertiary);
}

.pagination .current {
  color: var(--text);
  font-size: 13px;
}

/* Page */
.page-header {
  margin-bottom: 40px;
}

.page-header .page-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-tertiary);
  font-weight: 400;
}

.page-content {
  font-size: 15px;
  line-height: 1.85;
}

/* Footer */
.footer {
  margin-top: 80px;
  padding-top: 32px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12px;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: var(--divider);
}

.footer p {
  margin-bottom: 8px;
}

.footer a {
  color: var(--text-tertiary);
}

.footer a:hover {
  color: var(--text-secondary);
}

/* Giscus */
.comments {
  margin-top: 48px;
}

.giscus {
  margin-top: 20px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--divider-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Selection */
::selection {
  background: var(--text);
  color: var(--bg);
}

/* Mobile */
@media (max-width: 640px) {
  .container {
    padding: 32px 16px;
  }
  
  .header {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }
  
  .nav {
    gap: 16px;
    flex-wrap: wrap;
  }
  
  .post-item {
    padding: 16px;
  }
  
  .post-header .post-title {
    font-size: 22px;
  }
  
  .post-content h2 {
    font-size: 16px;
  }
  
  .archive-list li {
    flex-direction: column;
    gap: 4px;
  }
}