/* 史仔 (Stitch) 的科技日志样式表 */
:root {
  --primary-color: #4a6fa5;
  --secondary-color: #6d9dc5;
  --background-color: #ffffff;
  --text-color: #2c3e50;
  --border-color: #e1e4e8;
  --accent-color: #e74c3c;
  --card-bg: #f8f9fa;
  --hover-color: #3498db;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.7;
  color: var(--text-color);
  background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
  background-attachment: fixed;
  max-width: 850px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  padding: 30px 0 20px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

nav h1 a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 2.2em;
  font-weight: 700;
  letter-spacing: -0.5px;
  transition: transform 0.3s ease, color 0.3s ease;
}

nav h1 a:hover {
  color: var(--hover-color);
  transform: translateY(-2px);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 25px;
  flex-wrap: wrap;
  justify-content: center;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 15px;
  border-radius: 20px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

nav a:hover {
  color: var(--primary-color);
  background-color: var(--card-bg);
  border-color: var(--border-color);
  transform: translateY(-1px);
}

main {
  min-height: calc(100vh - 250px);
}

.post {
  background: white;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  border-left: 4px solid var(--primary-color);
}

.post:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.post header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.post h1 {
  font-size: 1.8em;
  margin-bottom: 10px;
  color: var(--primary-color);
  font-weight: 600;
}

time {
  color: #7f8c8d;
  font-size: 0.9em;
  display: block;
  margin-bottom: 10px;
  font-style: italic;
}

.post-tags {
  margin-top: 10px;
}

.tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8em;
  margin-right: 8px;
  margin-bottom: 8px;
  font-weight: 500;
  transition: transform 0.2s ease;
}

.tag:hover {
  transform: scale(1.05);
}

.post-content {
  line-height: 1.8;
  font-size: 1.05em;
}

.post-content p {
  margin-bottom: 18px;
  text-align: justify;
}

.post-content h2 {
  margin: 30px 0 18px 0;
  color: var(--primary-color);
  font-size: 1.5em;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--card-bg);
}

.post-content h3 {
  margin: 25px 0 12px 0;
  color: var(--secondary-color);
  font-size: 1.3em;
  font-weight: 500;
}

.post-content ul, .post-content ol {
  margin-left: 25px;
  margin-bottom: 20px;
  padding-left: 15px;
}

.post-content li {
  margin-bottom: 10px;
  position: relative;
}

.post-content li::marker {
  color: var(--primary-color);
}

.post-content code {
  background: var(--card-bg);
  padding: 3px 8px;
  border-radius: 5px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.9em;
  color: var(--accent-color);
  border: 1px solid var(--border-color);
}

.post-content pre {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.post-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
}

.post-footer {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

footer {
  text-align: center;
  padding: 35px 0 25px;
  color: #7f8c8d;
  font-size: 0.9em;
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.tags {
  margin: 15px 0;
}

.tags .tag {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
}

/* Responsive design */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }
  
  nav h1 a {
    font-size: 1.8em;
  }
  
  nav ul {
    gap: 12px;
  }
  
  .post {
    padding: 20px;
  }
  
  .post h1 {
    font-size: 1.6em;
  }
}

@media (max-width: 480px) {
  nav h1 a {
    font-size: 1.6em;
  }
  
  nav ul {
    flex-direction: column;
    align-items: center;
  }
  
  .post {
    padding: 18px;
  }
  
  .post-content {
    font-size: 1em;
  }
}

/* Animation for new elements */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.post {
  animation: fadeIn 0.5s ease-out;
}

/* Special classes for highlighting */
.highlight {
  background: linear-gradient(120deg, #e6f0ff 0%, #d1e3ff 100%);
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid var(--accent-color);
  margin: 20px 0;
}

.quote {
  border-left: 4px solid var(--secondary-color);
  padding: 15px 20px;
  margin: 20px 0;
  background: var(--card-bg);
  font-style: italic;
  color: #555;
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Emoji styling */
.emoji {
  font-size: 1.2em;
  vertical-align: middle;
  margin: 0 4px;
}