/* FMelCodec demo page – lightweight modern styling
   Works as a drop-in for the provided HTML (GitHub Pages friendly).
*/

:root{
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --muted2:#64748b;
  --border: rgba(15, 23, 42, .10);
  --shadow: 0 10px 30px rgba(2, 6, 23, .08);
  --shadow2: 0 6px 18px rgba(2, 6, 23, .10);
  --accent: #157878;
  --accent2:#0ea5a7;
  --maxw: 1120px;
  --radius: 16px;
  --radius-sm: 12px;
  --ring: 0 0 0 3px rgba(21, 120, 120, .18);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(14,165,167,.20), transparent 60%),
    radial-gradient(900px 500px at 85% 0%, rgba(21,120,120,.18), transparent 55%),
    var(--bg);
}

/* Links */
a{ color: var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; }
a:focus{ outline: none; box-shadow: var(--ring); border-radius: 8px; }

/* Header */
.page-header{
  padding: 56px 20px 72px;
  background:
    radial-gradient(800px 420px at 25% 10%, rgba(255,255,255,.25), transparent 55%),
    linear-gradient(135deg, rgba(21,120,120,.92), rgba(14,165,167,.80));
  color: #fff;
}
.header-inner{
  max-width: var(--maxw);
  margin: 0 auto;
}
.badge{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  font-size: 14px;
  letter-spacing: .2px;
}
.badge .dot{ opacity: .85; }
.hero-title{
  margin: 18px 0 10px;
  font-size: clamp(22px, 3.2vw, 36px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}
.hero-sub{
  font-weight: 600;
  opacity: .95;
}
.hero-authors{
  margin: 0 0 18px;
  font-size: 15px;
  opacity: .95;
}
.hero-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 10px;
}
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
  color: #fff;
  text-decoration: none;
  backdrop-filter: blur(6px);
}
.btn:hover{ text-decoration: none; background: rgba(255,255,255,.18); }
.btn:focus{ box-shadow: 0 0 0 3px rgba(255,255,255,.22); }
.btn-primary{
  border-color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.22);
}
.hero-note{
  margin: 10px 0 0;
  font-size: 13px;
  opacity: .9;
}

/* Main card */
.main-content{
  max-width: var(--maxw);
  margin: -36px auto 48px;
  padding: 28px 22px 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
}
@media (max-width: 640px){
  .main-content{ margin: -26px 12px 36px; padding: 20px 14px 28px; }
}

h1, h2, h3{ letter-spacing: -0.01em; }
h2{
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(15,23,42,.10);
  font-size: 22px;
}
h3{
  margin: 18px 0 10px;
  font-size: 18px;
}
p{ margin: 10px 0; color: var(--text); }
.main-content > p{ color: var(--muted); }

/* Abstract card-like feel */
#abstract + p{
  padding: 16px 16px;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(2,6,23,.02), transparent);
}

/* TOC as sticky pills */
#toc_container{
  position: sticky;
  top: 12px;
  z-index: 20;
  margin: 16px 0 18px;
  padding: 10px 10px;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: var(--radius);
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
}
.toc_title{
  margin: 22px 0 8px;
  color: var(--muted2);
  font-weight: 700;
  letter-spacing: .02em;
}
ul.toc{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
ul.toc li{ margin: 0; }
ul.toc a{
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(2,6,23,.02);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
ul.toc a:hover{
  background: rgba(21,120,120,.08);
  border-color: rgba(21,120,120,.28);
  text-decoration: none;
}

/* Figure */
img{
  max-width: 100%;
  height: auto !important;
  border-radius: var(--radius);
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: var(--shadow2);
}
figcaption{
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
}
figcaption font{ color: var(--muted); }

/* Tables → “card tables” */
table{
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 0 rgba(2,6,23,.02);
}
thead th{
  background: rgba(2,6,23,.03);
  color: var(--muted);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: .04em;
  text-transform: none;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15,23,42,.10);
}
tbody td{
  padding: 12px;
  border-bottom: 1px solid rgba(15,23,42,.08);
}
tbody tr:last-child td{ border-bottom: none; }

/* Audio */
audio{
  width: 100%;
  height: 34px;
  display: block;
}

/* Spacing between tables */
table + br, br + table{ margin-top: 12px; }
br{ line-height: 10px; }

@media (max-width: 860px){
  table{ display: block; overflow-x: auto; }
  thead th, tbody td{ white-space: nowrap; }
}

/* Back to top */
.back-to-top{
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.14);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow2);
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}
.back-to-top.show{
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover{
  background: #fff;
}
.back-to-top:focus{ outline: none; box-shadow: var(--ring); }

/* Reduce visual noise from legacy tags */
center{ display:block; }

/* Footer */
.footer{
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px dashed rgba(15,23,42,.16);
  color: var(--muted2);
  font-size: 13px;
}
.footer-text{ margin: 0; }


/* Make audio columns uniform (avoid header text driving column width) */
thead th, tbody td{
  min-width: 0; /* allow contents to shrink in flex-like contexts */
}
audio{
  max-width: 100%;
}
