/* ============================================
   Awesome Issue Resolution - 匹配原网站样式
   https://noranotdora.github.io/
   ============================================ */

/* ============================================
   CSS Variables
   ============================================ */
:root {
  --md-primary-fg-color: #2563eb;
  --md-primary-fg-color--light: #3b82f6;
  --md-primary-fg-color--dark: #1e40af;
  --md-accent-fg-color: #10b981;
  
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --secondary-color: #10b981;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #ffffff;
  --bg-light: #f9fafb;
  --border-color: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #3b82f6;
  --md-primary-fg-color--light: #60a5fa;
  --md-primary-fg-color--dark: #2563eb;
  --md-accent-fg-color: #34d399;
  --bg-color: #1e1e1e;
  --bg-light: #2d2d2d;
  --text-color: #e5e5e5;
  --text-light: #a3a3a3;
  --border-color: #404040;
}

/* ============================================
   Header & Tabs - 深蓝色渐变
   ============================================ */
.md-header {
  background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%) !important;
  box-shadow: var(--shadow);
}

/* ============================================
   Hero Section - 紫色渐变
   ============================================ */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
  color: #ffffff;
  padding: 4rem 2rem;
  border-radius: 12px;
  text-align: center;
  margin: -1rem -1rem 2rem -1rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  z-index: 0;
}

.hero-section > * {
  position: relative;
  z-index: 1;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  line-height: 1.2;
  color: #ffffff !important;
}

.hero-subtitle {
  font-size: 1.2rem;
  font-weight: 600;
  opacity: 1;
  margin: 0 0 2rem 0;
  color: #ffffff !important;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-badges .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-badges .badge:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Hero Image */
.hero-image {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.hero-image img {
  max-width: 75%;
  max-height: 500px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Dynamic Badges */
.hero-badges-dynamic {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 2rem 0;
  position: relative;
  z-index: 1;
}

.hero-badges-dynamic a {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-block;
}

.hero-badges-dynamic a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-badges-dynamic img {
  height: 28px;
  border-radius: 4px;
}

/* Quick Navigation Pills */
.hero-quick-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
  position: relative;
  z-index: 1;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.nav-pill:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-badges-dynamic {
    gap: 8px;
  }
  
  .hero-badges-dynamic img {
    height: 24px;
  }
  
  .hero-quick-nav {
    gap: 0.5rem;
  }
  
  .nav-pill {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
  }
  
  .hero-image img {
    max-width: 90%;
  }
}

/* Top Navigation Tabs - 深蓝色渐变 */
.md-tabs {
  background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%) !important;
}

.md-tabs__link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
}

.md-tabs__link:hover,
.md-tabs__link--active {
  color: #ffffff !important;
  opacity: 1;
}

/* 隐藏右侧 TOC 导航 */
.md-sidebar--secondary {
  display: none !important;
}

/* 左侧导航栏标题改为 Table of contents */
.md-nav--primary .md-nav__title {
  display: none;
}

.md-nav--primary > .md-nav__list::before {
  content: "Table of contents";
  display: block;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
  padding: 0 0.6rem 0.4rem;
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

/* Hide the duplicate H1 title */
.md-content > article > h1:first-of-type {
  display: none;
}

/* ============================================
   Abstract Section
   ============================================ */
.abstract-content {
  background-color: var(--bg-color);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary-color);
  margin: 1rem 0;
}

[data-md-color-scheme="slate"] .abstract-content {
  background-color: var(--bg-light);
}

.abstract-content p {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 0.8rem;
}

.framework-figure {
  margin: 2rem 0;
  text-align: center;
}

.framework-figure img {
  max-width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.framework-figure figcaption {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-top: 0.75rem;
}

/* ============================================
   Section Headings
   ============================================ */
.md-typeset h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--primary-color);
}

.md-typeset h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem;
  color: var(--text-color);
}

.md-typeset h4 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.25rem 0 0.75rem;
  color: var(--primary-color);
}

/* ============================================
   Paper List - 原网站简洁列表样式
   ============================================ */
.md-typeset ul {
  list-style: none;
  padding-left: 0;
}

.md-typeset ul li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-color);
  line-height: 1.7;
}

.md-typeset ul li:last-child {
  border-bottom: none;
}

.md-typeset ul li strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* 论文链接徽章样式 */
.md-typeset ul li a img {
  height: 20px;
  vertical-align: middle;
  margin-left: 6px;
  border-radius: 3px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.md-typeset ul li a img:hover {
  transform: translateY(-1px);
  opacity: 0.85;
}

/* 链接样式 */
.md-typeset ul li a {
  text-decoration: none;
  border-bottom: none;
}

/* ============================================
   Resources Section
   ============================================ */
.resources-content {
  background-color: var(--bg-color);
  padding: 1.5rem 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin: 1rem 0;
}

[data-md-color-scheme="slate"] .resources-content {
  background-color: var(--bg-light);
}

.resources-content ul {
  margin: 1rem 0;
}

.resources-content li {
  font-size: 1.05rem;
}

/* ============================================
   Navigation Styling
   ============================================ */
.md-nav__link {
  font-weight: 500;
}

.md-nav__item--active > .md-nav__link {
  color: var(--primary-color);
  font-weight: 600;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
  .hero-section {
    padding: 2.5rem 1.5rem;
    margin: -0.5rem -0.5rem 1.5rem -0.5rem;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .hero-badges {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-badges .badge {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
  
  .abstract-content {
    padding: 1.5rem;
  }
  
  .md-typeset h2 {
    font-size: 1.5rem;
  }
  
  .md-typeset h3 {
    font-size: 1.25rem;
  }
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ============================================
   Paper Download Section
   ============================================ */
.paper-download {
  text-align: center;
  margin: 2rem 0;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: #ffffff !important;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.pdf-viewer {
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
}

/* ============================================
   Selection
   ============================================ */
::selection {
  background-color: var(--primary-color);
  color: #ffffff;
}

/* ============================================
   Tables
   ============================================ */

/* Markdown tables styling */
.md-typeset table:not([class]) {
  display: block;
  width: 100%;
  overflow-x: auto;
  font-size: 0.75rem;
  border-collapse: collapse;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.md-typeset table:not([class]) thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.md-typeset table:not([class]) thead th {
  padding: 10px 6px;
  text-align: left;
  font-weight: 600;
  border: none;
  white-space: nowrap;
  font-size: 0.8rem;
}

.md-typeset table:not([class]) tbody tr {
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.2s ease;
}

.md-typeset table:not([class]) tbody tr:hover {
  background-color: #f9fafb;
}

.md-typeset table:not([class]) tbody td {
  padding: 8px 6px;
  vertical-align: middle;
  border: none;
}

.md-typeset table:not([class]) tbody td:first-child {
  font-weight: 500;
}

/* Section rows (bold text spanning columns) */
.md-typeset table:not([class]) tbody tr:has(td:first-child strong:only-child) {
  background: #f3f4f6;
  font-weight: 600;
}

.md-typeset table:not([class]) tbody tr:has(td:first-child strong:only-child) td {
  text-align: center;
  color: #374151;
  padding: 8px 6px;
}

/* Links and badges in tables */
.md-typeset table:not([class]) a {
  text-decoration: none;
  margin: 0 2px;
  display: inline-block;
}

.md-typeset table:not([class]) img {
  vertical-align: middle;
  height: 18px;
  margin: 0 2px;
}

/* Table captions (italic text before table) */
.md-typeset p:has(+ table) em {
  display: block;
  margin-bottom: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px 8px 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  font-style: normal;
}

/* Dark mode support for tables */
[data-md-color-scheme="slate"] .md-typeset table:not([class]) {
  background: #1e293b;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tbody tr {
  border-bottom-color: #334155;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tbody tr:hover {
  background-color: #334155;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tbody tr:has(td:first-child strong:only-child) {
  background: #334155;
  color: #e5e7eb;
}
