/* Cactus Theme Style - 完全模仿 hexo-theme-cactus */

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

/* Color Variables */
:root {
  --bg-color: #ffffff;
  --text-color: #34495e;
  --text-secondary: #7f8c8d;
  --link-color: #42b983;
  --link-hover: #33a06f;
  --border-color: #ecf0f1;
  --code-bg: #f8f8f8;
  --shadow: 0 0 1px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
  --bg-color: #292a2d;
  --text-color: #a9a9b3;
  --text-secondary: #87888f;
  --link-color: #42b983;
  --link-hover: #33a06f;
  --border-color: #3b3d42;
  --code-bg: #2d2d2d;
  --shadow: 0 0 1px rgba(255,255,255,0.1);
}

/* Base */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-color);
  background: var(--bg-color);
  transition: background 0.3s, color 0.3s;
  font-weight: 600;
}

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

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  padding: 60px 0 40px;
  margin-bottom: 60px;
}

.nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
}

.nav-left {
  position: absolute;
  left: 0;
}

.nav-left .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
}

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

/* 导航项 */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

.nav-link:hover {
  color: var(--link-color);
  text-decoration: none;
}

/* 下拉图标 */
.dropdown-icon {
  color: var(--text-secondary);
  transition: transform 0.3s ease, color 0.2s;
  flex-shrink: 0;
}

.nav-item:hover .dropdown-icon {
  color: var(--link-color);
  transform: rotate(180deg);
}

/* 下拉菜单 */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 12px;
  min-width: 160px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  padding: 8px 0;
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: 8px 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: var(--code-bg);
  color: var(--link-color);
  text-decoration: none;
}

/* 兼容旧的直接链接样式 */
.nav-center > a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

.nav-center > a:hover {
  color: var(--link-color);
  text-decoration: none;
}

.nav-right {
  display: flex;
  gap: 8px;
  align-items: center;
  position: absolute;
  right: 0;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  padding: 0;
}

.icon-btn:hover {
  color: var(--link-color);
}

/* 用户头像 */
.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  transition: opacity 0.2s;
  text-decoration: none;
}

.user-avatar:hover {
  opacity: 0.8;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.theme-toggle .moon-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: block;
}

/* Site Intro */
.site-intro {
  margin-bottom: 80px;
  padding: 40px 0;
}

.site-intro h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  font-weight: 700;
  line-height: 1.2;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
}

.site-intro p,
.site-intro .site-description {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
  word-wrap: break-word;
}

/* 打字机光标 */
.site-description::after {
  content: '|';
  animation: blink 1s infinite;
  margin-left: 2px;
}

.site-description.typing-done::after {
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Heatmap - GitHub style */
.heatmap {
  margin-bottom: 60px;
  padding: 0;
  background: transparent;
  border: none;
  position: relative;
  z-index: 1;
}

.heatmap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.heatmap-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.heatmap-year {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

.heatmap-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  overflow: hidden;
}

/* 月份标签 */
.heatmap-months {
  display: grid;
  grid-template-columns: 30px repeat(53, 1fr);
  gap: 3px;
  padding-left: 30px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

.heatmap-months span {
  text-align: left;
  grid-column: span 4;
}

/* 热力图网格容器 */
.heatmap-grid {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 3px;
}

/* 星期标签 */
.heatmap-weekdays {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
  padding-right: 8px;
}

.heatmap-weekdays span {
  height: 12px;
  line-height: 12px;
  text-align: right;
}

/* 日期网格 */
.heatmap-days {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 3px;
}

/* 单个日期格子 */
.heatmap-day {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #ebedf0;
}

.heatmap-day:hover {
  transform: scale(1.2);
  border: 1px solid var(--link-color);
}

/* 热力等级 - 浅色模式 */
.heatmap-day[data-level="0"] { background-color: #ebedf0; }
.heatmap-day[data-level="1"] { background-color: #9be9a8; }
.heatmap-day[data-level="2"] { background-color: #40c463; }
.heatmap-day[data-level="3"] { background-color: #30a14e; }
.heatmap-day[data-level="4"] { background-color: #216e39; }

/* 热力等级 - 深色模式 */
[data-theme="dark"] .heatmap-day[data-level="0"] { background-color: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .heatmap-day[data-level="1"] { background-color: #0e4429; }
[data-theme="dark"] .heatmap-day[data-level="2"] { background-color: #006d32; }
[data-theme="dark"] .heatmap-day[data-level="3"] { background-color: #26a641; }
[data-theme="dark"] .heatmap-day[data-level="4"] { background-color: #39d353; }

/* 图例 */
.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 8px;
  padding-right: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

.heatmap-legend-item {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.heatmap-legend-item[data-level="0"] { background-color: #ebedf0; }
.heatmap-legend-item[data-level="1"] { background-color: #9be9a8; }
.heatmap-legend-item[data-level="2"] { background-color: #40c463; }
.heatmap-legend-item[data-level="3"] { background-color: #30a14e; }
.heatmap-legend-item[data-level="4"] { background-color: #216e39; }

[data-theme="dark"] .heatmap-legend-item[data-level="0"] { background-color: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .heatmap-legend-item[data-level="1"] { background-color: #0e4429; }
[data-theme="dark"] .heatmap-legend-item[data-level="2"] { background-color: #006d32; }
[data-theme="dark"] .heatmap-legend-item[data-level="3"] { background-color: #26a641; }
[data-theme="dark"] .heatmap-legend-item[data-level="4"] { background-color: #39d353; }

/* Tooltip */
.heatmap-tooltip {
  position: absolute;
  padding: 8px 12px;
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10000;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.heatmap-tooltip.show {
  opacity: 1;
}

[data-theme="dark"] .heatmap-tooltip {
  background-color: rgba(255, 255, 255, 0.95);
  color: black;
}

/* Post List - Cactus style */
.post-list {
  margin-bottom: 60px;
}

.post-item {
  margin-bottom: 40px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.post-item:hover {
  transform: none;
}

.post-header-line {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 8px;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
  min-width: 100px;
  flex-shrink: 0;
}

.post-meta .separator {
  margin: 0 8px;
  color: var(--border-color);
}

.post-title {
  font-size: 1.1rem;
  margin: 0;
  line-height: 1.4;
  font-weight: 600;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  flex: 1;
}

.post-title a {
  color: var(--text-color);
  text-decoration: none;
}

.post-title a:hover {
  color: var(--link-color);
  text-decoration: none;
}

.post-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 12px;
  margin-left: 120px;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

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

.tag {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.tag:hover {
  color: var(--link-color);
  background: transparent;
  transform: none;
}

/* Post Detail - Cactus style */
.post-detail {
  margin-bottom: 60px;
}

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

.post-header .post-title {
  font-size: 2rem;
  margin-bottom: 15px;
  line-height: 1.3;
}

.post-content {
  font-size: 1rem;
  line-height: 1.9;
  margin-bottom: 60px;
  color: var(--text-color);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin: 40px 0 20px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text-color);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
}

.post-content h1 { font-size: 1.8rem; }
.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.3rem; }

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

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

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

.post-content code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9rem;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
  color: var(--text-color);
}

.post-content pre {
  background: var(--code-bg);
  padding: 20px;
  border-radius: 0;
  overflow-x: auto;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content blockquote {
  border-left: 3px solid var(--link-color);
  padding-left: 20px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-style: italic;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 30px 0;
  border-radius: 0;
  box-shadow: none;
}

.post-content a {
  color: var(--link-color);
  text-decoration: underline;
}

.post-content a:hover {
  color: var(--link-hover);
}

/* Post TOC - 文章目录 */
.post-container {
  position: relative;
}

.post-detail {
  max-width: 100%;
}

.post-toc {
  position: fixed;
  right: max(20px, calc((100vw - 1000px) / 2 - 280px));
  top: 140px;
  width: 240px;
  max-height: calc(100vh - 240px);
  z-index: 10;
}

/* 当屏幕宽度小于1600px时，隐藏目录 */
@media (max-width: 1600px) {
  .post-toc {
    display: none;
  }
}

.post-toc-wrapper {
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  padding: 16px;
  border-radius: 4px;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
}

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

.post-toc-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-color);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
}

#post-toc {
  font-size: 0.85rem;
  line-height: 1.6;
}

#post-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#post-toc li {
  margin: 0;
  padding: 0;
}

#post-toc a {
  display: block;
  padding: 4px 0;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#post-toc a:hover {
  color: var(--link-color);
  text-decoration: none;
}

#post-toc a.active {
  color: var(--link-color);
  font-weight: 700;
}

/* 目录层级缩进 */
#post-toc ul ul {
  padding-left: 15px;
  margin-top: 2px;
}

#post-toc ul ul a {
  font-size: 0.8rem;
}

/* 滚动条样式 */
.post-toc-wrapper::-webkit-scrollbar {
  width: 4px;
}

.post-toc-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.post-toc-wrapper::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.post-toc-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Post Navigation - Cactus style */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 60px;
  padding: 30px 0;
  border-top: 1px solid var(--border-color);
}

.post-nav-item {
  flex: 1;
}

.post-nav-item:last-child {
  text-align: right;
}

.post-nav-item a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
}

.post-nav-item a:hover {
  color: var(--link-color);
}

.nav-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
  display: block;
}

.nav-title {
  font-size: 0.95rem;
}

/* Archives - Cactus style */
.archives,
.categories,
.tags,
.category-posts,
.tag-posts {
  margin-bottom: 60px;
}

.page-title {
  font-size: 2rem;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
}

.archives-list {
  margin-bottom: 40px;
}

.archive-item {
  display: flex;
  gap: 30px;
  margin-bottom: 20px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  align-items: baseline;
}

.archive-item:hover {
  background: transparent;
  transform: none;
}

.archive-item time {
  color: var(--text-secondary);
  font-size: 0.85rem;
  min-width: 100px;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

.archive-item a {
  color: var(--text-color);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

.archive-item a:hover {
  color: var(--link-color);
}

/* Categories & Tags - Cactus style */
.category-list,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 40px;
}

.category-item,
.tag-item {
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-size: 0.95rem;
  box-shadow: none;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

.category-item:hover,
.tag-item:hover {
  background: transparent;
  color: var(--link-color);
  transform: none;
}

.category-item .count {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Pagination - Cactus style */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin: 60px 0;
}

.pagination-btn {
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-size: 0.9rem;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
  box-shadow: none;
  color: var(--text-secondary);
  text-decoration: none;
}

.pagination-btn:hover {
  background: transparent;
  color: var(--link-color);
  transform: none;
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

/* Footer - Cactus style */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 0 60px;
  margin-top: 80px;
  background: transparent;
}

.footer-content {
  text-align: center;
}

.friend-links {
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

.friend-links a {
  color: var(--link-color);
  margin: 0 10px;
}

.footer-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

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

.footer-info a {
  color: var(--link-color);
}

/* No Content */
.no-posts,
.no-content {
  text-align: center;
  padding: 60px 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

/* Back to Top Button - Cactus style */
.back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 0;
  background: var(--bg-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  color: var(--link-color);
  border-color: var(--link-color);
  transform: none;
}

/* Comments */
.post-comments {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border-color);
}

.post-comments h3 {
  font-size: 1.3rem;
  margin-bottom: 30px;
  font-weight: 700;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
}

/* Links Page - Cactus style */
.links-page {
  margin-bottom: 60px;
}

.link-group {
  margin-bottom: 60px;
}

.group-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
}

.links-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.link-item {
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 0;
  transition: border-color 0.2s;
}

.link-item:hover {
  border-color: var(--link-color);
}

.link-item a {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  text-decoration: none;
  color: var(--text-color);
}

.link-logo {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--code-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
}

.link-item:hover .link-name {
  color: var(--link-color);
}

.link-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

/* 汉堡菜单按钮 */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 28px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  position: absolute;
  right: 0;
}

.mobile-menu-toggle span {
  width: 100%;
  height: 2px;
  background: var(--text-color);
  transition: all 0.3s ease;
  transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(11px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-11px) rotate(-45deg);
}

/* Responsive */
@media (max-width: 768px) {
  /* 显示汉堡菜单按钮 */
  .mobile-menu-toggle {
    display: flex;
  }
  
  /* 导航布局调整 */
  .nav {
    flex-wrap: nowrap;
  }
  
  .nav-left {
    position: static;
    flex: 1;
  }
  
  .nav-left .logo {
    font-size: 1.2rem;
  }
  
  /* 隐藏中间导航，改为移动端菜单 */
  .nav-center {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
  }
  
  .nav-center.active {
    opacity: 1;
    visibility: visible;
  }
  
  .nav-center .nav-link,
  .nav-center > a {
    font-size: 1.2rem;
  }
  
  /* 移动端下拉菜单 */
  .nav-item {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  
  .nav-item.has-dropdown {
    position: relative;
  }
  
  .nav-item.has-dropdown .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .dropdown-icon {
    display: inline-block !important;
    transition: transform 0.3s ease;
  }
  
  .nav-item.active .dropdown-icon {
    transform: rotate(180deg);
  }
  
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    border: none;
    box-shadow: none;
    margin-top: 10px;
    padding: 0;
    background: transparent;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    width: 100%;
  }
  
  .nav-item.active .dropdown-menu {
    max-height: 500px;
  }
  
  .dropdown-item {
    font-size: 1rem;
    padding: 10px 20px;
    text-align: center;
    background: transparent;
  }
  
  .dropdown-item:hover {
    background: var(--code-bg);
  }
  
  /* 右侧按钮调整 */
  .nav-right {
    position: static;
    gap: 12px;
    margin-left: auto;
    margin-right: 40px;
  }
  
  /* 其他响应式调整 */
  .links-list {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 15px;
  }
  
  .header {
    padding: 30px 0 20px;
    margin-bottom: 40px;
  }
  
  .site-intro {
    margin-bottom: 40px;
    padding: 20px 0;
  }
  
  .site-intro h1 {
    font-size: 1.8rem;
  }
  
  /* 文章目录 - 移动端隐藏 */
  .post-toc {
    display: none;
  }
  
  .post-container {
    flex-direction: column;
  }
  
  .post-title {
    font-size: 1rem;
  }
  
  .post-header .post-title {
    font-size: 1.5rem;
  }
  
  .post-excerpt {
    margin-left: 0;
    font-size: 0.9rem;
  }
  
  .post-header-line {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  
  .post-meta {
    min-width: auto;
  }
  
  /* 热力图移动端优化 */
  .heatmap {
    margin-bottom: 40px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1;
  }
  
  /* 防止热力图在菜单打开时显示 */
  body.menu-open .heatmap {
    display: none;
  }
  
  .heatmap-wrapper {
    min-width: 600px;
  }
  
  .heatmap-grid {
    grid-template-columns: 20px 1fr;
  }
  
  .heatmap-months {
    grid-template-columns: 20px repeat(53, 1fr);
    padding-left: 20px;
  }
  
  .heatmap-weekdays {
    padding-right: 4px;
  }
  
  .heatmap-day {
    width: 10px;
    height: 10px;
  }
  
  /* 归档页面 */
  .archive-item {
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
  }
  
  .archive-item time {
    min-width: auto;
  }
  
  /* 文章导航 */
  .post-nav {
    flex-direction: column;
    gap: 20px;
  }
  
  .post-nav-item:last-child {
    text-align: left;
  }
  
  /* 返回顶部按钮 */
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
  }
  
  /* 页面标题 */
  .page-title {
    font-size: 1.5rem;
  }
  
  /* 文章内容 */
  .post-content {
    font-size: 0.95rem;
  }
  
  .post-content h1 { font-size: 1.5rem; }
  .post-content h2 { font-size: 1.3rem; }
  .post-content h3 { font-size: 1.1rem; }
  
  .post-content pre {
    padding: 15px;
    overflow-x: auto;
  }
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 0;
}

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

/* Selection */
::selection {
  background: var(--link-color);
  color: white;
}

::-moz-selection {
  background: var(--link-color);
  color: white;
}
/* About Page - 乱中有序的砖块式布局 */
.about-sticker-wall {
  position: relative;
  min-height: 100vh;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 40px 20px;
  margin-bottom: 60px;
}

/* 基础贴纸样式 */
.sticker {
  position: absolute;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
}

.sticker:hover {
  transform: scale(1.05) !important;
  z-index: 100;
}

/* === 轻量级动画（仅图片） === */
@keyframes gentle-shake {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

@keyframes float-up-down {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* === 大标题 - 中心焦点 === */
.banner-large {
  top: 45%;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  background: #000;
  color: #fff;
  padding: 30px 100px;
  border: 4px solid #fff;
  font-size: 2.5rem;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.2);
  text-align: center;
  z-index: 5;
}

[data-theme="dark"] .banner-large {
  background: var(--link-color);
  border-color: var(--text-color);
}

.banner-large:hover {
  transform: translateX(-50%) rotate(-3deg) scale(1.02) !important;
}

/* === 标签群 - 砖块式堆叠，无动画 === */
.mini-tag {
  background: #fff;
  color: #000;
  padding: 10px 20px;
  border: 2px solid #000;
  font-size: 0.85rem;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
  z-index: 3;
}

[data-theme="dark"] .mini-tag {
  background: var(--code-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}

/* 标签位置 - 像砖块一样堆叠 */
.tag-1 { top: 20%; left: 15%; transform: rotate(-5deg); }
.tag-2 { top: 22%; left: 25%; transform: rotate(3deg); }
.tag-3 { top: 25%; left: 35%; transform: rotate(-2deg); }
.tag-4 { top: 20%; right: 30%; transform: rotate(4deg); }
.tag-5 { top: 23%; right: 20%; transform: rotate(-3deg); }
.tag-6 { top: 26%; right: 10%; transform: rotate(2deg); }
.tag-7 { top: 70%; left: 20%; transform: rotate(3deg); }
.tag-8 { top: 72%; left: 30%; transform: rotate(-4deg); }

/* === 装饰图片 - 大小不一 === */
.deco-img {
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* 大图片 */
.img-large img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(4px 4px 10px rgba(0, 0, 0, 0.2));
  animation: float-up-down 5s ease-in-out infinite;
}

/* 中图片 */
.img-medium img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(3px 3px 8px rgba(0, 0, 0, 0.15));
  animation: gentle-shake 4s ease-in-out infinite;
}

/* 小图片 */
.img-small img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  filter: drop-shadow(2px 2px 6px rgba(0, 0, 0, 0.12));
}

[data-theme="dark"] .deco-img img {
  filter: drop-shadow(3px 3px 8px rgba(255, 255, 255, 0.15));
}

/* 图片位置 - 乱中有序 */
.img-1 { top: 35%; left: 10%; transform: rotate(-12deg); }
.img-2 { top: 40%; left: 25%; transform: rotate(8deg); }
.img-3 { top: 10%; left: 45%; transform: rotate(-5deg); }
.img-4 { top: 38%; right: 15%; transform: rotate(10deg); }
.img-6 { top: 12%; right: 15%; transform: rotate(6deg); }
.img-7 { top: 54%; right: 6%; transform: rotate(-10deg); z-index: 4; }

/* === 信息卡片 === */
.info-card {
  background: #fff;
  border: 2px solid #000;
  padding: 25px;
  min-width: 250px;
  max-width: 320px;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.15);
  z-index: 2;
}

[data-theme="dark"] .info-card {
  background: var(--code-bg);
  border-color: var(--border-color);
}

.info-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-card p {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-color);
  margin-bottom: 8px;
}

.info-card p:last-child {
  margin-bottom: 0;
}

/* 卡片位置 */
.card-contact { top: 55%; left: 8%; transform: rotate(-4deg); }
.card-intro { top: 58%; right: 8%; transform: rotate(5deg); }
.card-tech { top: 80%; left: 50%; transform: translateX(-50%) rotate(-2deg); }

/* 花的位置 - 在关于我和技术栈的横向中间 */
.img-5 { 
  top: 69%; 
  left: 50%; 
  transform: translateX(-50%) rotate(-8deg); 
}

/* 可编辑内容区域 */
.about-editable-content {
  margin-top: 700px;
  padding: 40px;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text-color);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

.about-editable-content h2,
.about-editable-content h3 {
  margin: 30px 0 15px;
  font-weight: 700;
}

.about-editable-content p {
  margin-bottom: 15px;
}

.about-editable-content a {
  color: var(--link-color);
  text-decoration: underline;
}

/* About Page Responsive */
@media (max-width: 768px) {
  .about-sticker-wall {
    min-height: 1200px;
    padding: 20px 10px;
  }
  
  .sticker {
    font-size: 0.8rem;
  }
  
  /* 禁用动画 */
  .deco-img img {
    animation: none !important;
  }
  
  /* 大标题 - 移动端居中 */
  .banner-large {
    top: 50px;
    left: 50%;
    transform: translateX(-50%) rotate(0deg) !important;
    width: 90%;
    font-size: 1.5rem;
    padding: 20px 30px;
    text-align: center;
  }
  
  /* 标签群 - 重新排列 */
  .mini-tag {
    padding: 8px 15px;
    font-size: 0.75rem;
  }
  
  .tag-1 { top: 150px; left: 5%; transform: rotate(-3deg); }
  .tag-2 { top: 150px; right: 5%; transform: rotate(3deg); }
  .tag-3 { top: 200px; left: 15%; transform: rotate(2deg); }
  .tag-4 { top: 200px; right: 15%; transform: rotate(-2deg); }
  .tag-5 { top: 250px; left: 25%; transform: rotate(-4deg); }
  .tag-6 { top: 250px; right: 25%; transform: rotate(4deg); }
  .tag-7 { top: 300px; left: 10%; transform: rotate(3deg); }
  .tag-8 { top: 300px; right: 10%; transform: rotate(-3deg); }
  
  /* 图片 - 缩小并重新定位 */
  .img-large img {
    width: 80px;
    height: 80px;
  }
  
  .img-medium img {
    width: 60px;
    height: 60px;
  }
  
  .img-small img {
    width: 40px;
    height: 40px;
  }
  
  .img-1 { top: 360px; left: 8%; transform: rotate(-10deg); }
  .img-2 { top: 360px; right: 8%; transform: rotate(10deg); }
  .img-3 { top: 420px; left: 30%; transform: rotate(-5deg); }
  .img-4 { top: 420px; right: 30%; transform: rotate(5deg); }
  .img-5 { top: 780px; left: 50%; transform: translateX(-50%) rotate(-8deg); }
  .img-6 { top: 480px; left: 50%; transform: translateX(-50%) rotate(6deg); }
  .img-7 { top: 680px; right: 10%; transform: rotate(-8deg); z-index: 4; }
  
  /* 信息卡片 - 垂直堆叠 */
  .info-card {
    min-width: 85%;
    max-width: 85%;
    padding: 20px;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) rotate(0deg) !important;
  }
  
  .card-contact {
    top: 540px;
  }
  
  .card-intro {
    top: 700px;
  }
  
  .card-tech {
    top: 860px;
  }
  
  /* 可编辑内容区域 */
  .about-editable-content {
    margin-top: 1050px;
    padding: 20px;
  }
  
  /* 评论区 */
  .post-comments {
    padding: 20px 10px;
  }
}


/* 评论组件暗色模式适配 */
[data-theme="dark"] {
  --halo-cw-primary-1-color: #42b983;
  --halo-cw-primary-2-color: #5ac99a;
  --halo-cw-primary-3-color: #7dd9b1;
  --halo-cw-text-1-color: #ffffff;
  --halo-cw-text-2-color: #c0c0c3;
  --halo-cw-text-3-color: #6b6c72;
  --halo-cw-muted-1-color: #3b3d42;
  --halo-cw-muted-2-color: #2d2e32;
  --halo-cw-muted-3-color: #25262a;
  --halo-cw-base-rounded: 4px;
  --halo-cw-avatar-rounded: 50%;
  --halo-cw-avatar-size: 40px;
  --halo-cw-base-font-size: 14px;
  --halo-cw-base-font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
}

/* 评论组件浅色模式 */
:root {
  --halo-cw-primary-1-color: #42b983;
  --halo-cw-primary-2-color: #5ac99a;
  --halo-cw-primary-3-color: #7dd9b1;
  --halo-cw-text-1-color: #34495e;
  --halo-cw-text-2-color: #7f8c8d;
  --halo-cw-text-3-color: #95a5a6;
  --halo-cw-muted-1-color: #ecf0f1;
  --halo-cw-muted-2-color: #f8f9fa;
  --halo-cw-muted-3-color: #ffffff;
  --halo-cw-base-rounded: 4px;
  --halo-cw-avatar-rounded: 50%;
  --halo-cw-avatar-size: 40px;
  --halo-cw-base-font-size: 14px;
  --halo-cw-base-font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
}


/* ==================== 主题切换动画 ==================== */
body {
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background: var(--bg-color);
  transition: background 0.3s ease;
}

.theme-transition-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  transition: clip-path 1.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.theme-transition-mask.to-dark {
  background: #292a2d;
}

.theme-transition-mask.to-light {
  background: #ffffff;
}


/* ==================== 图文列表样式 ==================== */
.post-list-card {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.post-card {
  display: flex;
  gap: 20px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: border-color 0.2s;
  overflow: hidden;
}

.post-card:hover {
  border-color: var(--link-color);
}

.post-card-cover {
  flex-shrink: 0;
  width: 280px;
  height: 200px;
  overflow: hidden;
  background: var(--code-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px 0 0 8px;
}

.post-card-cover a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.post-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.post-card:hover .post-card-cover img {
  transform: scale(1.05);
}

.post-card-content {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.post-card-title {
  font-size: 1.3rem;
  margin: 0;
  line-height: 1.4;
  font-weight: 700;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
}

.post-card-title a {
  color: var(--text-color);
  text-decoration: none;
}

.post-card-title a:hover {
  color: var(--link-color);
}

.post-card-excerpt {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: auto;
}

.post-card-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
}

.post-card-meta-item svg {
  flex-shrink: 0;
}

.post-card-meta-item a {
  color: var(--text-secondary);
  text-decoration: none;
}

.post-card-meta-item a:hover {
  color: var(--link-color);
}

/* 图文列表响应式 */
@media (max-width: 768px) {
  .post-card {
    flex-direction: column;
  }
  
  .post-card-cover {
    width: 100%;
    height: 180px;
  }
  
  .post-card-content {
    padding: 15px;
  }
  
  .post-card-title {
    font-size: 1.1rem;
  }
  
  .post-card-meta {
    gap: 10px;
  }
  
  .post-card-meta-item {
    font-size: 0.8rem;
  }
}


/* ==================== 文章点赞按钮 ==================== */
.post-content-wrapper {
  position: relative;
}

.post-upvote-float {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
}

.post-upvote-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: "Menlo", "Meslo LG", "Microsoft YaHei", "微软雅黑", monospace, sans-serif;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 8px;
  transition: all 0.3s;
  box-shadow: var(--shadow);
}

.post-upvote-btn:hover {
  color: var(--link-color);
  border-color: var(--link-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-upvote-btn.upvoted {
  color: #e74c3c;
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.05);
}

.post-upvote-btn.upvoted svg {
  fill: #e74c3c;
}

.post-upvote-btn:active {
  transform: translateY(0) scale(0.95);
}

.post-upvote-btn svg {
  transition: fill 0.2s;
  flex-shrink: 0;
}

.upvote-count {
  font-size: 0.9rem;
  font-weight: 700;
}

/* 响应式：移动端隐藏浮动点赞按钮 */
@media (max-width: 768px) {
  .post-upvote-float {
    display: none;
  }
}
