/* =========================================
   1. VARIABLES & RESET (Pomai Unified Theme)
   ========================================= */
:root {
  /* Colors */
  --bg-color: #ffffff;
  --text-main: #111111;
  /* Đen thuần cho văn bản chính */
  --text-muted: #555555;
  /* Xám cho chú thích */
  --link-color: #2563EB;
  /* Xanh Royal Blue */
  --link-hover: #1d4ed8;
  --border-color: #E5E7EB;
  --code-bg: #F3F4F6;
  --sidebar-bg: #ffffff;
  /* Sidebar nền trắng cho sạch */

  /* Dimensions */
  --container-width: 1200px;
  /* Rộng hơn để chứa 2 cột */
  --sidebar-width: 260px;

  /* Fonts */
  --font-serif: 'Georgia', 'Cambria', 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-serif);
  line-height: 1.7;
  /* Dãn dòng rộng để dễ đọc */
  font-size: 18px;
  /* Cỡ chữ tối ưu cho long-form reading */
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* =========================================
   2. LAYOUT (Grid System)
   ========================================= */
.layout-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  /* Cột 1: Sidebar, Cột 2: Nội dung */
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 60px;
  position: relative;
}

/* =========================================
   3. SIDEBAR (Navigation)
   ========================================= */
.sidebar {
  font-family: var(--font-sans);
  position: sticky;
  top: 40px;
  /* Dính khi cuộn */
  height: fit-content;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding-right: 20px;
  border-right: 1px solid transparent;
  /* Bỏ border dọc để thoáng hơn */
}

/* Thanh cuộn mảnh cho sidebar */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 4px;
}

.sidebar-header h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
  margin-bottom: 16px;
  margin-top: 0;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar li {
  margin-bottom: 8px;
}

/* Link cấp 1 */
.sidebar>ul>li>a {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 600;
  display: block;
  line-height: 1.4;
}

/* Link cấp 2 (Submenu) */
.sidebar ul ul {
  padding-left: 12px;
  margin-top: 6px;
  border-left: 1px solid var(--border-color);
}

.sidebar ul ul li a {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar a:hover {
  color: var(--link-color);
}

/* =========================================
   4. MAIN CONTENT
   ========================================= */
.content {
  max-width: 100%;
  /* Tràn hết cột grid còn lại */
  padding: 0;
  /* Padding do grid lo */
}

/* Paper Header */
.paper-header {
  margin-bottom: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  /* Canh trái cho hiện đại */
}

.paper-title {
  font-family: var(--font-sans);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: var(--text-main);
}

.authors {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

.affiliation {
  color: var(--text-muted);
  font-size: 1rem;
}

.meta-info {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Sections & Typography */
section {
  margin-bottom: 60px;
}

h2 {
  font-family: var(--font-sans);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

h3 {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 16px;
}

h4 {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
}

p {
  margin-bottom: 24px;
  text-align: left;
}

/* Abstract Box */
.abstract-section {
  background-color: var(--code-bg);
  /* Nền xám nhẹ */
  padding: 30px;
  border-radius: 8px;
  margin-bottom: 60px;
}

.abstract-section h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: none;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.abstract-section p {
  font-size: 1rem;
  margin-bottom: 0;
  color: var(--text-main);
  font-style: italic;
}

/* Feature Blocks (Paradigm, Challenges) */
.paradigm-block,
.challenge-item,
.future-block {
  margin-bottom: 30px;
  padding-left: 20px;
  border-left: 3px solid var(--border-color);
}

.paradigm-block h4,
.challenge-item h4,
.future-block h4 {
  color: var(--link-color);
  /* Màu xanh làm điểm nhấn */
}

/* References */
.ref-list {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.ref-item {
  margin-bottom: 12px;
  padding-left: 32px;
  text-indent: -32px;
  /* Thụt đầu dòng treo (Hanging Indent) */
}

/* MathJax Adjustment */
mjx-container {
  font-size: 1.1em !important;
}

/* =========================================
   5. RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 900px) {
  .layout-container {
    grid-template-columns: 1fr;
    /* 1 cột duy nhất */
    padding: 20px;
  }

  .sidebar {
    display: none;
    /* Ẩn TOC trên mobile cho gọn */
  }

  .paper-title {
    font-size: 2rem;
  }
}

/* Citation Box Styles */
#citation {
  margin-top: 60px;
  margin-bottom: 60px;
}

.citation-box {
  background-color: var(--code-bg);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--link-color);
  border-radius: 4px;
  padding: 15px 20px;
  margin-top: 15px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  overflow-x: auto;
}

/* Ghi đè style cho pre và code bên trong citation box */
.citation-box pre {
  background: transparent;
  /* Ghi đè style pre mặc định để tránh bị trùng nền */
  padding: 0;
  margin: 0;
  border: none;
  color: #333;
}

.citation-box code {
  background: transparent;
  padding: 0;
  color: inherit;
}