/* 基础样式 */
:root {
  --primary-color: #6a3093;
  --primary-dark: #532978;
  --primary-light: #8a50b0;
  --secondary-color: #a663cc;
  --accent-color: #c8a2c8;
  --text-color: #f0f0f0;
  --text-light: #d0d0d0;
  --bg-color: #1a1a2e;
  --bg-light: #2a2a40;
  --bg-dark: #0f0f1a;
  --success-color: #4caf50;
  --danger-color: #f44336;
  --warning-color: #ff9800;
  --border-color: #3a3a50;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s ease;
  --border-radius: 8px;
  --card-bg: #222236;
  --input-bg: #2d2d42;

  /* 动画持续时间变量 */
  --animation-slow: 1.2s;
  --animation-medium: 0.8s;
  --animation-fast: 0.4s;
  --animation-very-fast: 0.2s;
}

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

/* 减少动画设置 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: "Microsoft YaHei", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  overflow-x: hidden; /* 防止水平滚动条 */
}

/* 页面加载动画 */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  opacity: 0;
  animation: fadeInPage var(--animation-medium) ease-out forwards;
}

@keyframes fadeInPage {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 排版 */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary-color);
  text-shadow: 0 0 8px rgba(198, 162, 200, 0.4);
}

/* 头部 */
.header {
  background-color: var(--bg-dark);
  box-shadow: var(--shadow);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--primary-color);
  animation: slideInDown var(--animation-medium) ease-out;
}

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-light);
}

.logo i {
  font-size: 1.5rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.logo h1 {
  font-size: 1.5rem;
  margin-bottom: 0;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 10px rgba(166, 99, 204, 0.3);
  position: relative;
  overflow: hidden;
}

.logo h1::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  to {
    left: 100%;
  }
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

nav a {
  color: var(--text-light);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: width 0.3s ease;
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

nav a.active {
  color: var(--accent-color);
}

/* 主要内容 */
main {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  animation: fadeIn var(--animation-medium) ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 英雄区域 */
.hero {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  padding: 4rem 2rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  animation: scaleIn var(--animation-medium) ease-out;
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(166, 99, 204, 0.2) 0%, rgba(106, 48, 147, 0) 70%);
  animation: pulse 15s infinite linear;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(106, 48, 147, 0.2) 0%, rgba(166, 99, 204, 0.1) 100%);
  animation: colorPulse 8s infinite alternate;
}

@keyframes colorPulse {
  0% {
    opacity: 0.5;
  }
  100% {
    opacity: 0.8;
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.primary-btn {
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.primary-btn:hover {
  background: linear-gradient(45deg, var(--primary-dark), var(--primary-color));
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.primary-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.primary-btn:active::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

.secondary-btn {
  background-color: transparent;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.secondary-btn:hover {
  background-color: rgba(166, 99, 204, 0.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.danger-btn {
  background-color: var(--danger-color);
  color: white;
}

.danger-btn:hover {
  background-color: #d32f2f;
}

/* 文章网格 */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.article-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(166, 99, 204, 0.1);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp var(--animation-medium) forwards;
  animation-delay: calc(var(--animation-very-fast) * var(--index, 0));
}

.article-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
  border-color: rgba(166, 99, 204, 0.5);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.article-image {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.article-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 70%, var(--card-bg));
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.article-card:hover .article-image img {
  transform: scale(1.1) rotate(2deg);
}

.article-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.article-category {
  display: inline-block;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.article-card:hover .article-category {
  transform: translateY(-3px);
}

.article-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
  transition: color 0.3s ease;
}

.article-card:hover .article-title {
  color: var(--accent-color);
}

.article-excerpt {
  color: var(--text-light);
  margin-bottom: 1rem;
  flex: 1;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(166, 99, 204, 0.1);
}

.article-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--primary-light);
  transition: transform 0.3s ease;
}

.article-card:hover .author-avatar {
  transform: scale(1.1);
}

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

/* 文章列表 */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.article-list-item {
  display: flex;
  gap: 1.5rem;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(166, 99, 204, 0.1);
  opacity: 0;
  transform: translateX(-20px);
  animation: fadeInRight var(--animation-medium) forwards;
  animation-delay: calc(var(--animation-very-fast) * var(--index, 0));
}

@keyframes fadeInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.article-list-item:hover {
  transform: translateX(5px) scale(1.01);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(166, 99, 204, 0.3);
}

.article-list-image {
  flex: 0 0 200px;
  height: 150px;
  position: relative;
  overflow: hidden;
}

.article-list-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.article-list-item:hover .article-list-image img {
  transform: scale(1.1);
}

.article-list-content {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

/* 章节标题 */
section h2 {
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  color: var(--accent-color);
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp var(--animation-medium) forwards;
}

section h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  animation: expandWidth 0.8s 0.3s forwards ease-out;
}

@keyframes expandWidth {
  to {
    width: 50px;
  }
}

/* 页脚 */
footer {
  background-color: var(--bg-dark);
  color: var(--text-light);
  padding: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--primary-color);
  animation: fadeIn var(--animation-medium) ease-out;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-light);
}

/* 撰写文章页面 */
.write-article {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(166, 99, 204, 0.1);
  animation: fadeIn var(--animation-medium) ease-out;
}

.article-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  color: var(--accent-color);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  background-color: var(--input-bg);
  color: var(--text-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.content-editor:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(166, 99, 204, 0.2);
  animation: glowPulse 1.5s infinite alternate;
}

@keyframes glowPulse {
  from {
    box-shadow: 0 0 0 2px rgba(166, 99, 204, 0.1);
  }
  to {
    box-shadow: 0 0 0 4px rgba(166, 99, 204, 0.3);
  }
}

.content-editor {
  min-height: 300px;
  border: 1px solid var(--border-color);
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  padding: 1rem;
  overflow-y: auto;
  background-color: var(--input-bg);
  color: var(--text-color);
}

.editor-toolbar {
  display: flex;
  gap: 0.5rem;
  background-color: var(--bg-light);
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.editor-toolbar button {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition);
  color: var(--text-light);
  position: relative;
  overflow: hidden;
}

.editor-toolbar button:hover {
  background-color: rgba(166, 99, 204, 0.2);
  color: var(--text-color);
  transform: translateY(-2px);
}

.editor-toolbar button::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.editor-toolbar button:hover::after {
  transform: translateY(0);
}

.form-actions {
  display: flex;
  gap: 1rem;
}

/* 管理面板 */
.admin-panel {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid rgba(166, 99, 204, 0.1);
  animation: fadeIn var(--animation-medium) ease-out;
}

.admin-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
}

.admin-tabs {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-light);
  transition: var(--transition);
  border-radius: var(--border-radius);
  position: relative;
  overflow: hidden;
}

.tab-btn::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.tab-btn:hover {
  background-color: rgba(166, 99, 204, 0.1);
  color: var(--accent-color);
}

.tab-btn:hover::after {
  transform: scaleX(0.8);
}

.tab-btn.active {
  color: var(--accent-color);
  background-color: rgba(166, 99, 204, 0.1);
}

.tab-btn.active::after {
  transform: scaleX(1);
}

.admin-content {
  padding: 2rem;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn var(--animation-medium) ease-out;
}

.admin-search {
  display: flex;
  margin-bottom: 1.5rem;
}

.admin-search input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius) 0 0 var(--border-radius);
  font-family: inherit;
  font-size: 1rem;
  background-color: var(--input-bg);
  color: var(--text-color);
  transition: all 0.3s ease;
}

.admin-search input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(166, 99, 204, 0.2);
}

.admin-search button {
  padding: 0.75rem 1rem;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-search button:hover {
  background: linear-gradient(45deg, var(--primary-dark), var(--primary-color));
  transform: translateX(2px);
}

.admin-table-container {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  background-color: var(--bg-light);
  font-weight: 600;
  color: var(--accent-color);
  position: relative;
}

.admin-table th::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--primary-color), transparent);
}

.admin-table tr {
  transition: all 0.3s ease;
}

.admin-table tr:hover {
  background-color: rgba(166, 99, 204, 0.05);
  transform: translateX(5px);
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

.table-actions button {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
  color: var(--text-light);
}

.table-actions button:hover {
  background-color: rgba(166, 99, 204, 0.1);
  color: var(--text-color);
  transform: translateY(-2px);
}

.table-actions .edit {
  color: var(--primary-light);
}

.table-actions .delete {
  color: var(--danger-color);
}

.table-actions .view {
  color: var(--accent-color);
}

/* 数据分析 */
.analytics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.analytics-card {
  background-color: var(--bg-light);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid rgba(166, 99, 204, 0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp var(--animation-medium) forwards;
  animation-delay: calc(var(--animation-very-fast) * var(--index, 0));
}

.analytics-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  border-color: rgba(166, 99, 204, 0.3);
}

.analytics-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.analytics-card:hover .analytics-icon {
  transform: rotate(10deg) scale(1.1);
}

.analytics-data h4 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: var(--text-light);
}

.analytics-data p {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-color);
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
}

.analytics-data p.animate-value {
  animation: countUp 2s ease-out forwards;
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.analytics-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

.chart-container {
  background-color: var(--bg-light);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  border: 1px solid rgba(166, 99, 204, 0.1);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp var(--animation-medium) forwards;
  animation-delay: 0.2s;
}

.chart-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  border-color: rgba(166, 99, 204, 0.3);
}

.chart {
  height: 300px;
  margin-top: 1rem;
}

.chart-placeholder {
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  padding-top: 2rem;
}

.chart-bar {
  flex: 1;
  background: linear-gradient(to top, var(--primary-color), var(--secondary-color));
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: height 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  height: 0;
}

.chart-bar.animate {
  height: var(--height, 50%);
}

.chart-label {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: var(--text-light);
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
  animation: fadeIn var(--animation-fast) ease-out;
}

.modal-content {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid var(--primary-color);
  opacity: 0;
  transform: scale(0.9);
  animation: scaleIn var(--animation-fast) forwards;
}

@keyframes scaleIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
  z-index: 10;
}

.close-modal:hover {
  color: var(--accent-color);
  transform: rotate(90deg);
}

#article-preview {
  padding: 2rem;
}

.modal-actions {
  padding: 1rem 2rem 2rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  border-top: 1px solid var(--border-color);
}

/* 文章详情 */
.article-detail {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(166, 99, 204, 0.1);
  animation: fadeIn var(--animation-medium) ease-out;
}

.article-header {
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp var(--animation-medium) forwards;
}

.article-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
  position: relative;
  display: inline-block;
}

.article-header h1::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  animation: expandWidth 1.2s 0.5s forwards ease-out;
}

.article-meta-info {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-light);
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp var(--animation-medium) 0.2s forwards;
}

.article-author-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.article-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--primary-color);
  transition: all 0.3s ease;
}

.article-author-avatar:hover {
  transform: scale(1.1);
  border-color: var(--secondary-color);
}

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

.article-author-name {
  font-weight: 500;
  color: var(--text-color);
}

.article-date,
.article-category-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-featured-image {
  width: 100%;
  max-height: 500px;
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: scale(0.95);
  animation: scaleIn var(--animation-medium) 0.4s forwards;
}

.article-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 10s ease;
}

.article-featured-image:hover img {
  transform: scale(1.05);
}

.article-body {
  font-size: 1.1rem;
  line-height: 1.8;
  opacity: 0;
  animation: fadeIn var(--animation-medium) 0.6s forwards;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote {
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp var(--animation-medium) forwards;
  animation-delay: calc(0.6s + var(--index, 0) * 0.1s);
}

.article-body h2,
.article-body h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
  position: relative;
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp var(--animation-medium) forwards;
  animation-delay: calc(0.6s + var(--index, 0) * 0.1s);
}

.article-body h2::after,
.article-body h3::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  animation: expandWidth 0.8s forwards;
  animation-delay: calc(0.8s + var(--index, 0) * 0.1s);
}

.article-body blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1.5rem;
  font-style: italic;
  color: var(--text-light);
  background-color: rgba(166, 99, 204, 0.05);
  padding: 1rem 1.5rem;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  position: relative;
  overflow: hidden;
}

.article-body blockquote::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: 10px;
  font-size: 5rem;
  color: rgba(166, 99, 204, 0.1);
  font-family: Georgia, serif;
}

.article-body img {
  max-width: 100%;
  border-radius: var(--border-radius);
  margin: 1.5rem 0;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  opacity: 0;
  transform: scale(0.95);
  animation: scaleIn var(--animation-medium) forwards;
  animation-delay: calc(0.6s + var(--index, 0) * 0.1s);
}

.article-body img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.article-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(166, 99, 204, 0.1);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

/* 通知 */
.notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transform: translateY(150%);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notification.active {
  transform: translateY(0);
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

/* 动画 */
.animate-text {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp var(--animation-medium) forwards;
}

.delay-1 {
  animation-delay: 0.2s;
}

.delay-2 {
  animation-delay: 0.4s;
}

.delay-3 {
  animation-delay: 0.6s;
}

.delay-4 {
  animation-delay: 0.8s;
}

.slide-in {
  opacity: 0;
  transform: translateX(-20px);
  animation: slideIn var(--animation-medium) forwards;
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 页面切换动画 */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  z-index: 9999;
  transform: translateY(100%);
}

.page-transition.active {
  animation: pageTransition 1s forwards;
}

@keyframes pageTransition {
  0% {
    transform: translateY(100%);
  }
  100% {
    transform: translateY(0%);
  }
}

/* 响应式 */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    padding: 1rem;
  }

  .logo {
    margin-bottom: 1rem;
  }

  .hero {
    padding: 2rem 1rem;
  }

  .hero h2 {
    font-size: 2rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .article-list-item {
    flex-direction: column;
  }

  .article-list-image {
    flex: 0 0 auto;
    height: 200px;
  }

  .analytics-charts {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .admin-tabs {
    flex-wrap: wrap;
  }

  .article-meta-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
  .app-container,
  .header,
  .hero,
  .article-card,
  .article-list-item,
  section h2,
  .analytics-card,
  .chart-container,
  .article-header,
  .article-meta-info,
  .article-featured-image,
  .article-body,
  .article-body p,
  .article-body h2,
  .article-body h3,
  .article-body blockquote,
  .article-body img {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .chart-bar {
    transition: none !important;
    height: var(--height, 50%) !important;
  }

  .primary-btn:hover,
  .secondary-btn:hover,
  .article-card:hover,
  .article-list-item:hover,
  .analytics-card:hover,
  .chart-container:hover,
  .table-actions button:hover {
    transform: none !important;
  }
}

