/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 粒子特效 Canvas 样式 */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

body {
  font-family: "Source Code Pro", monospace;
  background: linear-gradient(135deg, #000000, #1a1a1a, #2d2d2d);
  background-attachment: fixed;  /* 关键：固定背景，让渐变覆盖整个文档 */
  color: #f0f0f0;
  min-height: 100vh;  /* 保持最小高度为视口高度 */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 900px;
  padding: 20px;
}

/* Terminal Styles */
.terminal-container {
  background-color: #1e1e1e;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  margin: 0 auto;
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.terminal-container:hover {
  opacity: 0.8;
  transform: translateY(-5px);
}

.terminal-header {
  background-color: #2d2d2d;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #3d3d3d;
}

.terminal-buttons {
  display: flex;
  gap: 8px;
  margin-right: 15px;
}

.terminal-button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-button.close {
  background-color: #ff5f56;
}

.terminal-button.minimize {
  background-color: #ffbd2e;
}

.terminal-button.maximize {
  background-color: #27c93f;
}

.terminal-title {
  color: #b3b3b3;
  font-size: 14px;
  font-weight: 500;
}

.terminal-body {
  padding: 20px;
  min-height: 400px;
}

.terminal-content {
  line-height: 1.6;
}

/* Command line styles */
.command-line {
  margin-bottom: 15px;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.command-line.active {
  opacity: 1;
  transform: translateY(0);
}

.prompt {
  color: #4ec9b0;
  font-weight: 600;
  margin-right: 10px;
}

.command {
  color: #f0f0f0;
}

.cursor {
  color: #4ec9b0;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* Output line styles */
.output-line {
  margin-bottom: 15px;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.output-line.show {
  opacity: 1;
  transform: translateY(0);
}

.output {
  color: #f0f0f0;
}

.output-line.success .output {
  color: #4ec9b0;
}

/* Typewriter styles */
.typewriter-cursor {
  color: #4ec9b0;
  animation: blink 1s infinite;
  font-weight: bold;
}

/* File loading container */
.file-loading-container {
  margin: 20px 0 30px 0;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.file-loading-container.show {
  opacity: 1;
  transform: translateY(0);
}

.file-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #333;
  opacity: 0;
  transform: translateX(-20px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.file-item.show {
  opacity: 1;
  transform: translateX(0);
}

.file-icon {
  font-size: 20px;
  width: 40px;
  text-align: center;
}

#html-file .file-icon {
  color: #e34c26;
}
#css-file .file-icon {
  color: #264de4;
}
#js-file .file-icon {
  color: #f0db4f;
}
#json-file .file-icon {
  color: #6c757d;
}

.file-name {
  flex: 1;
  color: #f0f0f0;
  font-weight: 500;
}

.file-status {
  color: #ffbd2e;
  margin-right: 15px;
  font-size: 14px;
  min-width: 80px;
  text-align: right;
}

.file-status.loaded {
  color: #27c93f;
}

.progress-bar {
  width: 120px;
  height: 6px;
  background-color: #333;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4ec9b0, #2d9cdb);
  border-radius: 3px;
  transition: width 1.5s ease;
}

/* Homepage Styles */
.homepage {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease,
    visibility 0s linear 0.8s;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  padding: 30px;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.homepage.show {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease,
    visibility 0s linear 0s;
}

.homepage-header {
  text-align: center;
  margin-bottom: 40px;
  padding-top: 20px;
}

.homepage-header h1 {
  font-size: 2.8rem;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #4ec9b0, #2d9cdb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.homepage-header p {
  color: #b3b3b3;
  font-size: 1.2rem;
}

.homepage-content {
  display: flex;
  flex-direction: column;
  gap: 35px;
  margin-bottom: 40px;
}

.card {
  background-color: rgba(20, 20, 20, 0.5);
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 40px;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    width 0.3s ease,
    opacity 0.3s ease;
  border: 1px solid rgba(78, 201, 176, 0.2);
  backdrop-filter: blur(5px);
  cursor: pointer;
  transform: scale(1);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(78, 201, 176, 0.5);
}

/* 卡片激活状态 - 放大居中 */
.card.active {
  position: relative;
  width: 66.66%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 10vh;
  margin-bottom: 10vh;
  transform: scale(1.1);
}
@media (orientation: portrait) {
  .card.active {
    width: auto;
  }
}
/* 其他卡片隐藏状态 */
.card.hidden {
  opacity: 0.1;
  pointer-events: none;
  filter: blur(2px);
}

.card[onclick] {
  cursor: pointer;
}

.card-icon {
  font-size: 2.5rem;
  color: #4ec9b0;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px; /* 图标容器宽度 - 可调整 */
  height: 60px; /* 图标容器高度 - 可调整 */
  border-radius: 50%;
  background-color: rgba(78, 201, 176, 0.1);
  float: left; /* 左浮动，使图标在左上角 */
  margin-right: 50px; /* 与标题的间距 */
  margin-left: 10px;
  margin-top: 10px; /* 微调垂直位置 */
}

.blog-icon-image {
  /* 图片尺寸控制参数 */
  width: 100%; /* 图片宽度占满容器 - 可改为固定值如 50px */
  height: 100%; /* 图片高度占满容器 - 可改为固定值如 50px */
  max-width: 100%; /* 最大宽度限制 - 可调整 */
  max-height: 100%; /* 最大高度限制 - 可调整 */
  min-width: 100px; /* 最小宽度限制 - 可调整 */
  min-height: 100px; /* 最小高度限制 - 可调整 */
  
  /* 图片显示方式 */
  object-fit: cover; /* 图片填充方式: cover(填充) | contain(包含) | fill(拉伸) | none(原始) | scale-down(缩小) */
  object-position: center; /* 图片定位: center | top | bottom | left | right */

  
  /* 过渡效果 */
  transition: all 0.3s ease; /* 过渡效果: 可调整时间、缓动函数 */
}

/* 悬停效果 */
.blog-card:hover .blog-icon-image {
  transform: scale(1.1); /* 悬停缩放比例 - 可调整 */
  filter: brightness(1.2); /* 悬停亮度 - 可调整 */
  border-color: rgba(78, 201, 176, 0.8); /* 悬停边框颜色 - 可调整 */
}

.card h3 {
  color: #f0f0f0;
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.card p {
  color: #b3b3b3;
  line-height: 1.5;
}

.homepage-footer {
  margin-top: auto;
  text-align: center;
  padding: 20px 0;
}

.command-example {
  color: #4ec9b0;
  font-weight: 600;
  background-color: rgba(78, 201, 176, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: "Source Code Pro", monospace;
}

.terminal-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  background-color: rgba(20, 20, 20, 0.5);
  padding: 15px;
  border-radius: 8px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  backdrop-filter: blur(5px);
}

.home-input {
  background: transparent;
  border: none;
  color: #f0f0f0;
  font-family: "Source Code Pro", monospace;
  font-size: 16px;
  flex: 1;
  margin-left: 10px;
  outline: none;
}

.home-input::placeholder {
  color: #666;
}

/* ICP 备案号页脚 */
.icp-footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
}

.icp-footer a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.3s ease;
}

/* Pagination Controls Styles */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 30px 0 20px 0;
  padding: 15px;
}

.pagination-btn {
  background-color: rgba(20, 20, 20, 0.5);
  border: 1px solid rgba(78, 201, 176, 0.3);
  color: #f0f0f0;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Source Code Pro", monospace;
  font-size: 14px;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    transform 0.2s ease;
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-btn:hover:not(:disabled) {
  background-color: rgba(78, 201, 176, 0.2);
  border-color: rgba(78, 201, 176, 0.6);
  transform: translateY(-2px);
}

.pagination-btn:active:not(:disabled) {
  transform: translateY(0);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  color: #b3b3b3;
  font-size: 14px;
  font-weight: 500;
  min-width: 80px;
  text-align: center;
}

/* 卡片淡入动画 - 用于换页时显示新页面内容 */
.fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 命令输出样式 */
.command-output {
  margin: 15px 0;
  animation: fadeIn 0.3s ease-out;
}

.command-output .command-line {
  margin-bottom: 5px;
  opacity: 1;
  transform: none;
}

.command-output .output-line {
  margin-bottom: 0;
  opacity: 1;
  transform: none;
}

.command-output .output-line.error .output {
  color: #ff6b6b;
}

.command-output .output-line.success .output {
  color: #4ec9b0;
}

/* 抖动动画 - 保留但不再使用 */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-1px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(1px);
  }
}

.shake-animation {
  animation: shake 0.5s ease-in-out;
}

/* Blog Styles */
.blog-header {
  text-align: center;
  margin: 40px 0 30px 0;
  padding: 20px 0;
  border-top: 1px solid rgba(78, 201, 176, 0.2);
  border-bottom: 1px solid rgba(78, 201, 176, 0.2);
}

.blog-header h2 {
  font-size: 2rem;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #4ec9b0, #2d9cdb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.blog-header p {
  color: #b3b3b3;
  font-size: 1rem;
}

.blog-content {
  display: flex;
  flex-direction: column;
  gap: 35px;
  margin-bottom: 30px;
}

.blog-card {
  position: relative;
}

.blog-card:hover {
  transform: translateY(-5px),scale(1.1);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(78, 201, 176, 0.5);
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-date {
  color: #b3b3b3;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.blog-date i {
  color: #4ec9b0;
}

.external-link-indicator {
  color: #2d9cdb;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 5px;
  background-color: rgba(45, 156, 219, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(45, 156, 219, 0.3);
}

.external-link-indicator i {
  color: #2d9cdb;
  font-size: 0.7rem;
}

.blog-cover {
  margin: 15px 0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.1);
}

.blog-cover img {
  max-width: 100%;
  max-height: 200px;
  height: auto;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-cover img {
  transform: scale(1.05);
}

.detail-cover {
  max-height: 300px;
  margin: 20px 0;
}

.detail-cover img {
  max-height: 300px;
}

.blog-content-full {
  margin-top: 20px;
  line-height: 1.6;
  color: #f0f0f0;
}

.blog-content-full h1,
.blog-content-full h2,
.blog-content-full h3,
.blog-content-full h4 {
  color: #4ec9b0;
  margin: 20px 0 10px 0;
}

.blog-content-full p {
  margin-bottom: 15px;
}

.blog-content-full ul,
.blog-content-full ol {
  margin-left: 20px;
  margin-bottom: 15px;
}

.blog-content-full li {
  margin-bottom: 5px;
}

.blog-content-full code {
  background-color: rgba(78, 201, 176, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Source Code Pro", monospace;
  font-size: 0.9em;
}

.blog-content-full pre {
  background-color: rgba(20, 20, 20, 0.8);
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 15px 0;
  border: 1px solid rgba(78, 201, 176, 0.2);
}

.blog-content-full pre code {
  background-color: transparent;
  padding: 0;
}

.blog-content-full blockquote {
  border-left: 4px solid #4ec9b0;
  padding-left: 15px;
  margin: 15px 0;
  color: #b3b3b3;
  font-style: italic;
}

.blog-content-full img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 15px 0;
}

.close-detail-btn {
  background: transparent;
  border: none;
  color: #b3b3b3;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 5px;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-detail-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ff6b6b;
  transform: rotate(90deg);
}

.close-detail-btn i {
  font-size: 1rem;
}

/* Blog loading and error states */
.blog-loading,
.blog-empty,
.blog-error,
.detail-loading,
.detail-error {
  text-align: center;
  padding: 40px 20px;
  background-color: rgba(20, 20, 20, 0.5);
  border-radius: 10px;
  border: 1px solid rgba(78, 201, 176, 0.2);
  backdrop-filter: blur(5px);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(78, 201, 176, 0.3);
  border-top-color: #4ec9b0;
  border-radius: 50%;
  margin: 0 auto 20px auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.blog-loading p,
.detail-loading p {
  color: #b3b3b3;
  font-size: 1rem;
}

.blog-empty p {
  color: #b3b3b3;
  font-size: 1.1rem;
}

.blog-error,
.detail-error {
  color: #ff6b6b;
}

.blog-error i,
.detail-error i {
  font-size: 2rem;
  margin-bottom: 15px;
  color: #ff6b6b;
}

.blog-error p,
.detail-error p {
  margin-bottom: 20px;
  color: #f0f0f0;
}

.retry-btn {
  background-color: rgba(78, 201, 176, 0.2);
  border: 1px solid rgba(78, 201, 176, 0.5);
  color: #4ec9b0;
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Source Code Pro", monospace;
  font-size: 14px;
  transition: all 0.3s ease;
}

.retry-btn:hover {
  background-color: rgba(78, 201, 176, 0.3);
  transform: translateY(-2px);
}

/* Blog pagination */
.blog-pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0 40px 0;
  padding: 15px;
}

/* Social Icons Row Styles */
.social-icons-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  padding: 20px 0;
  margin-bottom: 30px;
}
.social-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(20, 20, 20, 0.5);
  border-radius: 8px;
  transition:
    transform 0.3s ease,
    background-color 0.3s ease,
    box-shadow 0.3s ease;
  text-decoration: none;
  backdrop-filter: blur(5px);
}

.social-icon i {
  font-size: 20px;
  color: #f0f0f0;
}

.social-icon:hover {
  transform: translateY(-3px);
  background-color: rgba(78, 201, 176, 0.2);
  box-shadow: 0 5px 15px rgba(78, 201, 176, 0.3);
}

.social-icon:hover i {
  color: #4ec9b0;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .terminal-body {
    padding: 15px;
    min-height: 350px;
  }

  .homepage-header h1 {
    font-size: 2.2rem;
  }

  .homepage-header p {
    font-size: 1rem;
  }

  .card {
    padding: 20px;
  }
}
