
/* ===== Base ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  color: #222;
  margin: 0;
  padding: 0;
  background: #fff;
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

/* ===== Header ===== */
.article-header {
  margin-bottom: 22px;
}

.journal-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4b5563;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 12px;
}

.article-header h1 {
  font-size: 28px;
  line-height: 1.25;
  margin: 0 0 10px;
}

.authors {
  font-style: italic;
  margin: 10px 0 6px;
}

.affiliation {
  font-size: 14px;
  color: #555;
  margin-bottom: 15px;
}

.pdf-link {
  display: inline-block;
  margin: 8px 0 8px;
  padding: 7px 12px;
  background: #2c7be5;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
}

.pdf-link:hover {
  background: #1a5ec8;
}

/* ===== Main two-column layout ===== */
.article-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* ===== TOC / Contents ===== */
.toc-card {
  position: sticky;
  top: 20px;
  align-self: start;
  background: #f8f9fa;
  border: 1px solid #d9dee5;
  border-radius: 8px;
  padding: 14px 14px 10px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  z-index: 1;
}

.toc-title {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 10px;
}

#toc {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#toc a {
  display: block;
  color: #1d4ed8;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

#toc a:hover {
  text-decoration: underline;
}

/* ===== Article area ===== */
.article-content {
  min-width: 0;
  width: 100%;
}

.article-content > *:first-child {
  margin-top: 0;
}

.article-content h2 {
  border-bottom: 2px solid #ddd;
  padding-bottom: 5px;
  margin-top: 30px;
  margin-bottom: 14px;
  font-size: 20px;
}

.article-content h3 {
  margin-top: 24px;
  margin-bottom: 10px;
  font-size: 17px;
}

.abstract-box {
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 24px;
}

.keywords {
  margin-top: 12px;
}

/* ===== Figures ===== */
.figure-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 14px 0 8px;
}

.figure-card {
  max-width: 300px;
  text-align: center;
  flex: 1 1 220px;
}

.figure-card img,
.table-wrap img,
.article-content img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid #ccc;
}

.caption {
  font-size: 13px;
  color: #444;
  text-align: center;
  margin-top: 5px;
  margin-bottom: 10px;
}

/* ===== Tables ===== */
.table-wrap {
  overflow-x: auto;
  margin: 15px 0;
  width: 100%;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  font-size: 14px;
}

table th,
table td {
  border: 1px solid #ccc;
  padding: 6px;
  text-align: center;
  vertical-align: top;
}

table th {
  background: #f0f0f0;
}

td p,
th p {
  margin: 0 0 6px;
}

td p:last-child,
th p:last-child {
  margin-bottom: 0;
}

/* ===== Equations ===== */
.equation {
  text-align: center;
  margin: 14px 0;
  font-size: 16px;
}

/* ===== References ===== */
.references {
  font-size: 14px;
  line-height: 1.6;
  padding-left: 22px;
}

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

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .toc-card {
    position: static;
    max-height: none;
    overflow: visible;
    order: -1;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 14px;
  }

  .article-header h1 {
    font-size: 24px;
  }

  .figure-card {
    max-width: 100%;
    flex-basis: 100%;
  }
}
