/* ==============================
   Layout
============================== */
.page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin: 30px auto 30px auto;
  gap: 30px;
  max-width: 1200px;
  padding: 0 20px;
}

h2[id] {
  scroll-margin-top: 80px;
}

/* ==============================
   Side Navigation
============================== */
.sidenav {
  position: sticky;
  top: 80px;
  flex: 0 0 220px;
  max-height: calc(100vh - 80px);
  background: #fff;
  border-right: 1px solid #ddd;
  box-shadow: 0 0 5px rgba(0,0,0,0.05);
  padding: 20px;
  box-sizing: border-box;
}

.sidenav h3 {
  margin: 0 0 10px;
  font-size: 16px;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

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

.sidenav li {
  margin: 6px 0;
}

.sidenav a {
  position: relative;
  display: inline-block;
  padding: 4px 0;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

/* underline animation */
.sidenav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #007acc;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.sidenav a:hover,
.sidenav a.active {
  color: #007acc;
}

.sidenav a:hover::after,
.sidenav a.active::after {
  transform: scaleX(1);
}

/* ==============================
   Contents
============================== */
.contents {
  flex: 1;
  max-width: 1200px;
  padding: 0px;
  /* background-color: ; */
  background: none;
  text-align: left;
  box-sizing: border-box;
}

.content-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.content-image img {
    max-width: 750px;
    height: auto;
    border-radius: 8px;
}

.graybox {
  background: #f8f9fa;
  padding: 20px;
}

/* responsive */
@media (max-width: 768px) {
  .page {
    flex-direction: column;
    padding: 0 10px;
  }

  .sidenav {
    position: relative;
    top: auto;
    width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }

  .contents {
    width: 100%;
    max-width: 100%;
  }

  .content-image {
      width: 100%;
  }

  .content-image {
      margin-top: 20px;
      justify-content: center;
  }

  .content-image img {
      max-width: 80%;
  }
}

/* ==============================
   References
============================== */
.references {
  margin-top: 40px;
  padding: 10px;
}

.references h2 {
  font-size: 20px;
  margin-bottom: 20px;
  padding-left: 8px;
  border-left: 4px solid #007acc;
  color: #007acc;
}

.reference-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  margin-bottom: 15px;
  background: #fff;
  border: 1px solid #ddd;
}

.ref-body {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

.ref-authors {
  font-weight: normal;
  margin-right: 6px;
}

.ref-year {
  color: #666;
}

.ref-paper {
  font-weight: bold;
  display: block;
  margin-top: 4px;
}

.ref-journal {
  color: #444;
  display: block;
  margin-top: 2px;
}

.ref-links a {
  display: inline-block;
  margin-right: 10px;
  padding: 5px 12px;
  font-size: 13px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.3s ease;
}

.pdf-link {
  background: #e74c3c;
  color: #fff;
}
.pdf-link:hover {
  background: #c0392b;
}

.bibtex-link {
  background: #3498db;
  color: #fff;
}
.bibtex-link:hover {
  background: #2980b9;
}

/* ==============================
   Download Box
============================== */
.download-box {
  display: flex;
  align-items: center;
  max-width: 400px;
  margin: 15px 0;
  background: #fff;
  border: 1px solid #ddd;
  overflow: hidden;
}

.download-left {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
}

.download-icon img {
  width: 40px;
  height: auto;
  margin: 10px 10px 5px 10px;
  object-fit: contain;
}

.download-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 15px;
}

.download-label a {
  display: inline-block;
  margin-bottom: 3px;
  font-size: 16px;
  font-weight: bold;
  color: #007acc;
  text-decoration: none;
}
.download-label a:hover {
  color: #005f99;
  text-decoration: underline;
}

.download-version,
.download-amount {
  font-size: 13px;
  color: #666;
}

/* ==============================
   Table
============================== */
.table-wrapper {
  text-align: center;
}

.table-wrapper table {
  margin: 1rem auto;
  border-collapse: collapse;
  width: 80%;
  font-size: 13px;
  font-family: "Segoe UI", Arial, sans-serif;
  background-color: #fff;
}

th, td {
  border: 1px solid #ddd;
  padding: 10px 12px;
  text-align: left;
}

th {
  background: #eaeaea;
  font-weight: 600;
  color: #333;
}

th .sort-btn {
  font-size: 0.8em;
  cursor: pointer;
  margin-left: 5px;
  color: #aaa;
  transition: color 0.2s ease;
}

th .sort-btn.active {
  color: #000;
}

tbody tr:nth-child(odd) {
  background-color: #fff;
}

tbody tr:nth-child(even) {
  background-color: #f7f9fb;
}

tbody tr:hover {
  background-color: #eaf3ff;
}
