:root {
  --bg: #fff7e6;
  --card: #ffffff;
  --text: #333;
  --accent: #ff9f43;
}

body.dark {
  --bg: #1e1e2f;
  --card: #2a2a40;
  --text: #eee;
  --accent: #ffb347;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', 'ZCOOL KuaiLe', sans-serif;
  background: radial-gradient(circle at 20px 20px, #ffe0b2 10%, transparent 11%),
              radial-gradient(circle at 60px 60px, #ffe0b2 10%, transparent 11%),
              var(--bg);
  background-size: 80px 80px;
  color: var(--text);
  transition: 0.3s;
}

header {
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  border-bottom: 4px solid var(--accent);
}

header h1 {
  font-family: 'ZCOOL KuaiLe';
  color: var(--accent);
}

nav a {
  margin-left: 15px;
  text-decoration: none;
  color: var(--text);
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-box input {
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid #ccc;
}

.toggle-btn {
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--accent);
  color: white;
  border: none;
}

.hero {
  text-align: center;
  padding: 80px 20px;
}

.hero h2 {
  font-size: 42px;
  color: var(--accent);
}

.tags {
  text-align: center;
  margin-bottom: 10px;
}

.tag {
  display: inline-block;
  margin: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.container {
  max-width: 1000px;
  margin: auto;
  padding: 20px;
}

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  transition: 0.3s;
  cursor: pointer;
  border: 2px dashed #ffd6a5;
}

.card:hover {
  transform: translateY(-5px) scale(1.03);
}

.card h3 {
  color: var(--accent);
  margin-bottom: 10px;
}

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0.7;
}

footer p {
  margin: 0;
}

.fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

.fab button {
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.fab-moyu {
  position: relative;
  width: 50px;
  height: 50px;
}

.moyu-count {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(255, 159, 67, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-50%) translateX(8px);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s ease;
}

.moyu-count.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.moyu-count.hide {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) translateX(8px);
}

#moyuBtn.moyu-pop {
  animation: moyuPop 0.35s ease;
}

@keyframes moyuPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.18) rotate(-8deg); }
  100% { transform: scale(1); }
}

#articlePage {
  display: none;
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
  background: var(--card);
  border-radius: 20px;
  border: 2px dashed #ffd6a5;
}

/* 文章图片样式 */
#articleContent img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 代码块样式 - 可调节代码位置 */
#articleContent pre {
  background: #282c34;
  border-radius: 8px;
  overflow-x: auto;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid #3e4452;

  /* 👇 调整这4个值来改变代码块与外界文字的位置间隔 */
  margin: 0 0 12px 0;
  
  /* 👇 调整这4个值来改变代码在代码块中的位置 */
  padding-top: 0px;      /* 代码与上边缘的距离 */
  padding-bottom: 0px;   /* 代码与下边缘的距离 */
  padding-left: 0px;     /* 代码与左边缘的距离 */
  padding-right: 16px;    /* 代码与右边缘的距离 */
}

#articleContent code {
  font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
}

/* 行内代码样式 */
#articleContent p code,
#articleContent li code {
  background: rgba(255, 159, 67, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent);
}

/* 深色模式下的代码块 */
body.dark #articleContent pre {
  background: #1a1d23;
  border-color: #2a2e38;
}

/* 代码块语言标签 */
.code-language-label {
  position: absolute;
  top: 0;
  right: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #abb2bf;
  font-size: 11px;
  font-family: monospace;
  padding: 4px 10px;
  border-radius: 0 0 6px 6px;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
  z-index: 10;
  pointer-events: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 深色模式下的语言标签 */
body.dark .code-language-label {
  background: rgba(0, 0, 0, 0.4);
  color: #8b949e;
}

/* 视频样式 */
#articleContent video,
#articleContent iframe {
  max-width: 100%;
  border-radius: 12px;
  margin: 0 0 12px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 深色模式下的视频边框 */
body.dark #articleContent video,
body.dark #articleContent iframe {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 评论区样式 */
.comment-section {
  margin-top: 30px;
  padding: 22px 22px 18px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  border: 1px solid rgba(255, 159, 67, 0.18);
  box-shadow: 0 10px 30px rgba(255, 159, 67, 0.08);
}
body.dark .comment-section {
  background: rgba(32, 32, 52, 0.96);
  border-color: rgba(255, 180, 100, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.comment-header h3 {
  margin: 0;
  color: var(--accent);
  font-size: 20px;
}

.comment-badge {
  font-size: 13px;
  color: #555;
}
body.dark .comment-badge {
  color: #c2c6e1;
}

.comment-local-hint,
.comment-setup-hint {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #666;
}
body.dark .comment-local-hint,
body.dark .comment-setup-hint {
  color: #b9bbd1;
}
.comment-setup-hint a {
  color: var(--accent);
}

.comment-author-line {
  font-size: 13px;
  color: #666;
}
body.dark .comment-author-line {
  color: #c2c6e1;
}

.comment-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.comment-char-count {
  font-size: 12px;
  color: #888;
}
body.dark .comment-char-count {
  color: #a8acc8;
}

.giscus-root {
  min-height: 120px;
}

.comment-count {
  font-size: 13px;
  color: #555;
}
body.dark .comment-count {
  color: #c2c6e1;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-form textarea {
  width: 100%;
  min-height: 110px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(166, 141, 237, 0.25);
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(255,255,255,0.96);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
body.dark .comment-form textarea {
  background: #262644;
  border-color: rgba(255,255,255,0.12);
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 159, 67, 0.12);
}

.comment-form button {
  align-self: flex-end;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.comment-form button:hover {
  opacity: 0.93;
  transform: translateY(-1px);
}

.comment-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comment-item {
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 159, 67, 0.15);
}
body.dark .comment-item {
  background: rgba(37, 37, 59, 0.96);
  border-color: rgba(255,180,100,0.14);
}

.comment-item .comment-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 159, 67, 0.16);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: #666;
}
body.dark .comment-meta {
  color: #b9bbd1;
}

.comment-text {
  white-space: pre-wrap;
  line-height: 1.75;
  color: var(--text);
  font-size: 14px;
}
body.dark .comment-text {
  color: #e9e9f4;
}

.comment-empty {
  opacity: 0.75;
  text-align: center;
  font-size: 14px;
  color: #777;
}
body.dark .comment-empty {
  color: #abb0db;
}

/* 登录按钮样式 */
.login-btn {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-size: 14px;
  transition: opacity 0.2s;
}
.login-btn:hover {
  opacity: 0.8;
}