/* Article Pages - Dark Theme */

.article-page {
  background: linear-gradient(135deg, #0a0612 0%, #1a0a2e 50%, #0d1033 100%);
  min-height: 100vh;
}

/* Hero Section */
.article-hero {
  position: relative;
  padding: 100px 20px 80px;
  text-align: center;
  overflow: hidden;
}

.article-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 600px 400px at 15% 25%, rgba(139, 92, 246, 0.2) 0%, transparent 70%),
    radial-gradient(ellipse 500px 350px at 85% 75%, rgba(99, 102, 241, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 350px 250px at 50% 10%, rgba(167, 139, 250, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.article-hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}

.article-hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.article-hero-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.2));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.article-hero-icon svg {
  width: 40px;
  height: 40px;
  color: #a78bfa;
}

.article-hero h1 {
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}

.article-hero h1 .gradient-text {
  background: linear-gradient(135deg, #a78bfa 0%, #818cf8 50%, #a78bfa 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientFlow 3s ease infinite;
}

@keyframes gradientFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.article-hero p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 32px;
}

/* Search Box */
.article-search {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.article-search-form {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 60px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.article-search-form:focus-within {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
}

.article-search-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 18px 28px;
  font-size: 16px;
  color: #fff;
  outline: none;
}

.article-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.article-search-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  border: none;
  padding: 18px 36px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-search-btn:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
}

.article-search-btn svg {
  width: 20px;
  height: 20px;
}

/* Main Content Layout */
.article-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 80px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
}

/* Sidebar */
.article-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.article-sidebar-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  overflow: hidden;
}

.article-sidebar-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.05));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-sidebar-header svg {
  width: 22px;
  height: 22px;
  color: #a78bfa;
}

.article-sidebar-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.article-category-list {
  padding: 12px;
}

.article-category-item {
  display: block;
  padding: 14px 20px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s ease;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.article-category-item:hover {
  background: rgba(139, 92, 246, 0.1);
  color: #fff;
}

.article-category-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.15));
  color: #a78bfa;
  font-weight: 500;
}

.article-category-item svg {
  width: 16px;
  height: 16px;
  opacity: 0;
  transform: translateX(-5px);
  transition: all 0.3s ease;
}

.article-category-item:hover svg,
.article-category-item.active svg {
  opacity: 1;
  transform: translateX(0);
}

/* Content Area */
.article-content-area {
  min-width: 0;
}

/* Search Result Tip */
.article-search-tip {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.article-search-tip-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.article-search-tip-text strong {
  color: #a78bfa;
}

.article-search-tip-clear {
  color: #a78bfa;
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.3s ease;
}

.article-search-tip-clear:hover {
  color: #c4b5fd;
}

.article-search-tip-clear svg {
  width: 16px;
  height: 16px;
}

/* Article List */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 24px 28px;
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 20px;
}

.article-card:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.2);
  transform: translateX(8px);
}

.article-card-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.1));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.article-card-icon svg {
  width: 24px;
  height: 24px;
  color: #a78bfa;
}

.article-card-content {
  flex: 1;
  min-width: 0;
}

.article-card-title {
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

.article-card:hover .article-card-title {
  color: #a78bfa;
}

.article-card-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-card-meta svg {
  width: 14px;
  height: 14px;
}

.article-card-arrow {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.article-card-arrow svg {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
}

.article-card:hover .article-card-arrow {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.article-card:hover .article-card-arrow svg {
  color: #fff;
  transform: translateX(2px);
}

/* Empty State */
.article-empty {
  text-align: center;
  padding: 80px 20px;
  color: rgba(255, 255, 255, 0.4);
}

.article-empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-empty-icon svg {
  width: 40px;
  height: 40px;
  color: rgba(255, 255, 255, 0.2);
}

.article-empty p {
  font-size: 16px;
}

/* Pagination */
.article-pagination {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.article-pagination a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: #fff;
  text-decoration: none;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.article-pagination a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.article-pagination a svg {
  width: 18px;
  height: 18px;
}

/* ==================== */
/* Article Detail Page  */
/* ==================== */

.article-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* When inside article-main with sidebar */
.article-content-area .article-detail-card {
  margin-bottom: 40px;
}

.article-detail-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  overflow: hidden;
}

/* Article Header */
.article-detail-header {
  padding: 50px 50px 40px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.05));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.article-detail-title {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 20px;
}

.article-detail-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.article-detail-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

.article-detail-meta-item svg {
  width: 16px;
  height: 16px;
  color: #a78bfa;
}

/* Article Body */
.article-detail-body {
  padding: 50px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.3px;
}

.article-detail-body p {
  margin-bottom: 1.5em;
  text-align: justify;
}

.article-detail-body h1,
.article-detail-body h2,
.article-detail-body h3,
.article-detail-body h4,
.article-detail-body h5,
.article-detail-body h6 {
  color: #fff;
  margin: 2em 0 1em;
  font-weight: 600;
}

.article-detail-body h2 {
  font-size: 24px;
  padding-left: 16px;
  border-left: 4px solid #8b5cf6;
}

.article-detail-body h3 {
  font-size: 20px;
}

.article-detail-body h4 {
  font-size: 18px;
}

.article-detail-body a {
  color: #a78bfa;
  text-decoration: none;
  border-bottom: 1px dashed rgba(167, 139, 250, 0.5);
  transition: all 0.3s ease;
}

.article-detail-body a:hover {
  color: #c4b5fd;
  border-bottom-color: #c4b5fd;
}

.article-detail-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 30px auto;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.article-detail-body ul,
.article-detail-body ol {
  margin: 1.5em 0;
  padding-left: 2em;
}

.article-detail-body li {
  margin: 0.5em 0;
}

.article-detail-body li::marker {
  color: #8b5cf6;
}

.article-detail-body blockquote {
  margin: 2em 0;
  padding: 20px 24px;
  background: rgba(139, 92, 246, 0.1);
  border-left: 4px solid #8b5cf6;
  border-radius: 0 12px 12px 0;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

.article-detail-body blockquote p:last-child {
  margin-bottom: 0;
}

.article-detail-body code {
  background: rgba(139, 92, 246, 0.15);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'Fira Code', Consolas, Monaco, monospace;
  font-size: 14px;
  color: #c4b5fd;
}

.article-detail-body pre {
  background: #1a1025;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 12px;
  padding: 24px;
  overflow-x: auto;
  margin: 2em 0;
}

.article-detail-body pre code {
  background: none;
  padding: 0;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.6;
}

.article-detail-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 15px;
}

.article-detail-body th,
.article-detail-body td {
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.article-detail-body th {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.15));
  color: #fff;
  font-weight: 600;
}

.article-detail-body tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.article-detail-body tr:hover {
  background: rgba(139, 92, 246, 0.05);
}

.article-detail-body hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.3), transparent);
  margin: 3em 0;
}

.article-detail-body strong,
.article-detail-body b {
  color: #fff;
  font-weight: 600;
}

.article-detail-body mark {
  background: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Article Footer */
.article-detail-footer {
  padding: 30px 50px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: center;
}

.article-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: #fff;
  text-decoration: none;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.article-back-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.article-back-btn svg {
  width: 20px;
  height: 20px;
}

/* Related Articles */
.article-related {
  margin-top: 60px;
}

.article-related-title {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-related-title svg {
  width: 24px;
  height: 24px;
  color: #a78bfa;
}

.article-related-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.article-related-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.article-related-item:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.2);
}

.article-related-item-title {
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

.article-related-item:hover .article-related-item-title {
  color: #a78bfa;
}

/* Quick Links (Floating) */
.article-quick-links {
  position: fixed;
  right: 30px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
}

.article-quick-link {
  width: 50px;
  height: 50px;
  background: rgba(139, 92, 246, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.article-quick-link:hover {
  background: #8b5cf6;
  transform: scale(1.1);
}

.article-quick-link svg {
  width: 24px;
  height: 24px;
}

/* Responsive */
@media (max-width: 1024px) {
  .article-main {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    position: static;
  }

  .article-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
  }

  .article-category-item {
    padding: 10px 18px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .article-category-item svg {
    display: none;
  }

  .article-related-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .article-hero {
    padding: 80px 20px 60px;
  }

  .article-hero h1 {
    font-size: 32px;
  }

  .article-hero p {
    font-size: 16px;
  }

  .article-search-form {
    flex-direction: column;
    border-radius: 20px;
  }

  .article-search-input {
    padding: 16px 20px;
    text-align: center;
  }

  .article-search-btn {
    justify-content: center;
    border-radius: 0 0 20px 20px;
  }

  .article-card {
    padding: 20px;
  }

  .article-card-icon {
    display: none;
  }

  .article-detail-header {
    padding: 30px 24px;
  }

  .article-detail-title {
    font-size: 24px;
  }

  .article-detail-body {
    padding: 30px 24px;
  }

  .article-detail-footer {
    padding: 24px;
  }

  .article-quick-links {
    right: 20px;
    bottom: 80px;
  }

  .article-quick-link {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .article-hero h1 {
    font-size: 26px;
  }

  .article-detail-meta {
    flex-direction: column;
    gap: 12px;
  }

  .article-pagination {
    flex-direction: column;
    align-items: center;
  }

  .article-pagination a {
    width: 100%;
    justify-content: center;
  }
}
