:root {
  --rb-radius: 20px;       /* 彩虹外壳圆角 */
  --rb-thickness: 6px;     /* 彩虹边框厚度 */
  --content-max: 1600px;   /* 内容最大宽度 */
}

/* 页面基础样式 */
body {
  margin: 0;
  padding: 2rem 5%;
  background-color: #f8f9fb;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  justify-content: flex-start;
}

/* 容器居中，最大宽度限制 */
.article-wrapper {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* 卡片样式 */
.article-card {
  background: white;
  border-radius: calc(var(--rb-radius) - var(--rb-thickness));
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 标题样式 */
.article-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #222;
}

/* 日期样式 */
.article-date {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 1.5rem;
}

/* 正文内容 */
.article-content p {
  line-height: 1.7;
  margin-bottom: 1rem;
  color: #333;
  font-size: 1.05rem;
}

/* Enhance article typography */
.article-content h2, .article-content h3, .article-content h4 {
  color: #111;
  margin: 1.5rem 0 .75rem;
}
.article-content ul, .article-content ol { padding-left: 1.25rem; margin: .75rem 0 1rem; }
.article-content li { margin: .25rem 0; }
.article-content a { color: #0a7cff; text-decoration: none; border-bottom: 1px dashed rgba(10,124,255,.5); }
.article-content a:hover { text-decoration: underline; }

/* Code blocks */
.article-content pre { background: #0a0a0a; color: #e8e8e8; border-radius: 10px; padding: 1rem; overflow: auto; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.article-content code { background: rgba(0,0,0,.06); padding: .2rem .4rem; border-radius: 6px; }

/* Blockquote */
.article-content blockquote { margin: 1.2rem 0; padding: .8rem 1rem; background: #f1f6ff; border-left: 4px solid #59a7ff; color: #2a405a; border-radius: 0 8px 8px 0; }

/* Images */
.article-content img { max-width: 100%; display: block; border-radius: 12px; box-shadow: 0 10px 24px rgba(0,0,0,.08); margin: 1rem auto; }

/* 响应式 */
@media (max-width: 600px) {
  .article-card {
    padding: 1.5rem 1rem;
  }

  .article-title {
    font-size: 1.5rem;
  }
}

/* 🌈 彩虹边框外壳 */
.rainbow-border {
  padding: var(--rb-thickness); /* 彩虹边框的厚度 */
  border-radius: var(--rb-radius);
  background: linear-gradient(270deg,
    #ff0000, #ff9900, #33cc33,
    #3399ff, #9933ff, #ff3399, #ff0000);
  background-size: 400% 400%;
  animation: rainbowFlow 8s linear infinite;

  display: block;
  width: 100%;
  max-width: var(--content-max);
  box-sizing: border-box;
  overflow: hidden;

  margin: 3rem auto; /* 页面居中 + 上下间距 */
  box-shadow: 0 0 20px rgba(255, 0, 150, 0.2); /* 可选：发光感 */
}

/* 🌈 彩虹流动动画 */
@keyframes rainbowFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  font-size: 24px;
  text-decoration: none;
  color: #333;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: background 0.3s;
  z-index: 1000;
}

.back-button:hover {
  background: #f0f0f0;
}

/* 保证彩虹外壳内的卡片占满容器宽度，避免边缘长度异常 */
.rainbow-border > .article-card {
  display: block;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}
