/*
 * XieLab shared visual system
 * Keeps legacy Bootstrap pages typographically and spatially consistent while
 * allowing page-specific layouts (Research, Tools, Contact, Openings) to remain
 * in control of their own illustrations and feature compositions.
 */

:root {
  --xielab-ink: #15283b;
  --xielab-text: #34495b;
  --xielab-muted: #687887;
  --xielab-cyan: #03b4c8;
  --xielab-cyan-dark: #087f91;
  --xielab-link: #1478b8;
  --xielab-line: #dce7eb;
  --xielab-soft: #f5fafb;
  --xielab-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
    "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body,
button,
input,
select,
textarea {
  font-family: var(--xielab-font);
}

body {
  color: var(--xielab-text);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  color: var(--xielab-ink);
  font-family: var(--xielab-font);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.015em;
}

h1,
.h1 { font-size: 40px; }
h2,
.h2 { font-size: 32px; }
h3,
.h3 { font-size: 24px; }
h4,
.h4 { font-size: 19px; }
h5,
.h5 { font-size: 16px; }

p,
ul,
ol,
address {
  line-height: 1.72;
}

p { margin: 0 0 14px; }
li { margin-bottom: 4px; }

a {
  color: var(--xielab-link);
  text-underline-offset: 2px;
}

a:hover,
a:focus {
  color: var(--xielab-cyan-dark);
}

/* Header and page titles */
header .navbar-nav > li > a,
.navbar .nav > li > a {
  font-family: var(--xielab-font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 30px;
}

header .nav li .dropdown-menu li a {
  font-family: var(--xielab-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  padding: 8px 14px;
  text-transform: none;
}

.navbar-brand img {
  display: block;
  max-height: 46px;
  object-fit: contain;
}

#inner-headline h2.pageTitle {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 26px 0 8px;
  padding: 6px 0;
}

#inner-headline {
  background: linear-gradient(110deg, var(--xielab-ink), #0a6e7e);
  margin-top: 76px;
  padding: 26px 0 22px;
}

#inner-headline h2.pageTitle { color: #fff; margin: 0; }

/* Shared content rhythm */
#content {
  color: var(--xielab-text);
  font-size: 16px;
  line-height: 1.72;
  padding-top: 32px;
}

#content img {
  max-width: 100%;
  height: auto;
}

#content .panel {
  border-color: var(--xielab-line);
  border-radius: 4px;
  box-shadow: none;
  overflow: hidden;
}

#content .panel-cyan > .panel-heading {
  background: var(--xielab-cyan);
  border-color: var(--xielab-cyan);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  padding: 13px 16px;
}

#content .panel-body {
  color: var(--xielab-text);
  font-size: 16px;
  line-height: 1.72;
  padding: 24px 26px;
}

#content .list-group-item {
  color: #455462;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  padding: 13px 15px;
}

#content .list-group-item:hover,
#content .list-group-item:focus {
  background: var(--xielab-soft);
  color: var(--xielab-cyan-dark);
}

#content .panel-body > :first-child,
#content .member-section > :first-child {
  margin-top: 0;
}

#content .panel-body > :last-child,
#content .member-section > :last-child {
  margin-bottom: 0;
}

/* Members */
.member-section {
  margin-bottom: 38px;
}

.member-section h3 {
  border-bottom-color: var(--xielab-line);
  margin-bottom: 20px;
  padding-bottom: 10px;
}

.pi-profile {
  gap: 28px;
}

.pi-profile img {
  flex: 0 0 220px;
  width: 220px;
  border: 1px solid var(--xielab-line);
  border-radius: 5px;
  box-shadow: 0 5px 18px rgba(18, 55, 70, 0.09);
}

.pi-profile h4 {
  margin: 2px 0 14px;
}

.member-meta,
.member-list {
  font-size: 15.5px;
  line-height: 1.72;
}

.member-list li {
  margin-bottom: 13px;
}

.empty-section {
  background: var(--xielab-soft);
  border-left: 3px solid #b9dfe4;
  border-radius: 2px;
  padding: 13px 16px;
}

#Team img {
  display: block;
  width: 100%;
  border: 1px solid var(--xielab-line);
  border-radius: 5px;
}

/* Publications, patents, software and news */
.publication-year {
  margin-bottom: 30px;
}

.publication-year > p:first-child {
  color: var(--xielab-ink);
  font-size: 20px;
  margin-bottom: 14px;
}

.publication-item,
.record,
.copyright-record,
.news-item {
  color: var(--xielab-text);
  font-size: 15.5px;
  line-height: 1.72;
}

.publication-item {
  margin-bottom: 12px;
  padding-left: 35px;
  position: relative;
}

.publication-number {
  left: 0;
  min-width: 0;
  position: absolute;
  text-align: left;
  top: 0;
  width: 30px;
}

.citation-count,
.publication-source,
.record .meta,
.news-meta {
  color: var(--xielab-muted);
  font-size: 14px;
}

.section-title {
  color: var(--xielab-ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin: 28px 0 16px;
}

/* Tool cards and other paired text-image rows */
.emp-feature h2,
.emp-legacy h2 {
  font-size: 27px;
  line-height: 1.25;
}

.emp-feature {
  background: linear-gradient(135deg, #f2fbfc, #fff);
  border: 1px solid #cfe9ed;
  border-radius: 14px;
  margin-bottom: 28px;
  padding: 22px;
}

.emp-feature-image {
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(21, 40, 59, .12);
  display: block;
  height: 220px;
  object-fit: cover;
  width: 280px;
}

.emp-version {
  background: #dff5f6;
  border-radius: 999px;
  color: var(--xielab-cyan-dark);
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  padding: 5px 11px;
}

.emp-highlights { padding-left: 20px; }
.emp-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.emp-links a { border: 1px solid #acd9df; border-radius: 999px; font-size: 14px; font-weight: 700; padding: 8px 13px; text-decoration: none; }

/* Keep the four tool rows on one visual baseline: identical image boxes and
 * top-aligned copy make the catalogue scannable on desktop. */
#content .panel-body > .db:not(.emp-feature) .row,
#content .panel-body > .server .row {
  align-items: flex-start;
  display: flex;
}

#content .panel-body > .db:not(.emp-feature) img.img-center,
#content .panel-body > .server img.img-center {
  background: #f7fbfc;
  border: 1px solid var(--xielab-line);
  border-radius: 10px;
  display: block;
  height: 220px;
  object-fit: contain;
  width: 280px;
}

#content .panel-body > .emp-feature h2,
#content .panel-body > .db:not(.emp-feature) h2,
#content .panel-body > .server h2 { margin-top: 0; }

@media (max-width: 767px) {
  .emp-feature-image,
  #content .panel-body > .db:not(.emp-feature) img.img-center,
  #content .panel-body > .server img.img-center { height: 190px; margin: 0 auto 18px; max-width: 100%; width: 280px; }
  #content .panel-body > .db:not(.emp-feature) .row,
  #content .panel-body > .server .row { display: block; }
}

/* Preserve the catalogue box size after legacy image rules are loaded. */
.emp-feature-image { height: 220px !important; width: 280px !important; }
.emp-legacy-logo { background: #fff; border: 1px solid var(--xielab-line); border-radius: 10px; display: block; height: 220px !important; object-fit: contain; width: 280px !important; }
@media (max-width: 767px) {
  .emp-feature-image,
  .emp-legacy-logo { height: 190px !important; max-width: 100%; width: 280px !important; }
}

.emp-feature-image,
.emp-legacy-logo,
.contact-visual img,
.openings-visual img {
  height: auto;
  object-fit: contain;
}

footer,
footer a,
#sub-footer {
  font-family: var(--xielab-font);
}

#sub-footer {
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 991px) {
  #content .panel-body {
    padding: 22px;
  }

  .member-list {
    columns: 1;
  }
}

@media (max-width: 767px) {
  body,
  #content,
  #content .panel-body {
    font-size: 15.5px;
  }

  h1,
  .h1 { font-size: 32px; }
  h2,
  .h2 { font-size: 27px; }
  h3,
  .h3 { font-size: 22px; }
  h4,
  .h4 { font-size: 18px; }

  #inner-headline h2.pageTitle {
    font-size: 28px;
    margin: 22px 0 7px;
  }

  #content {
    padding-top: 24px;
  }

  /* The same destinations remain available in the hamburger navigation. */
  #content .row > .col-md-3:first-child {
    display: none;
  }

  #content .panel-body {
    padding: 20px 18px;
  }

  #content .panel-cyan > .panel-heading {
    padding: 12px 14px;
  }

  .pi-profile img {
    width: 190px;
    margin-bottom: 18px;
  }

  .publication-item,
  .record,
  .copyright-record,
  .news-item {
    font-size: 15px;
  }
}

/* Final type scale override: keep reading text comfortably legible even when
 * a legacy page's inline stylesheet declares a smaller base size. */
body { font-size: 17px !important; }
@media (max-width: 767px) {
  body { font-size: 16px !important; }
}

/* Site-wide refresh: the Research page is the visual reference for every
 * legacy page. Keep the existing templates and links, but give them one
 * calmer header, larger type and the same card/sidebar rhythm. */
header > .navbar.navbar-fixed-top {
  display: none;
}

.navbar-wrapper .navbar.navbar-fixed-top {
  min-height: 76px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--xielab-line);
  box-shadow: 0 7px 24px rgba(21, 40, 59, 0.07);
}

.navbar-wrapper .navbar-header,
.navbar-wrapper .navbar-collapse {
  min-height: 76px;
}

.navbar-wrapper .navbar-brand {
  display: flex;
  align-items: center;
  height: 76px;
  padding: 3px 15px 3px 0;
}

.navbar-wrapper .navbar-brand img {
  display: block;
  width: auto;
  height: 70px;
  max-width: none;
  max-height: 70px;
}

.navbar-wrapper .navbar-nav > li > a,
.navbar-wrapper .navbar .nav > li > a {
  display: flex;
  align-items: center;
  height: 62px;
  white-space: nowrap;
  color: var(--xielab-ink);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.2;
  padding: 0 14px;
  transition: background .2s ease, color .2s ease;
}

.navbar-wrapper .navbar-nav > li > a .caret {
  flex: 0 0 auto;
  margin-left: 5px;
}

.navbar-wrapper .navbar-nav > li > a:hover,
.navbar-wrapper .navbar-nav > li > a:focus,
.navbar-wrapper .navbar-nav > li.active > a,
.navbar-wrapper .navbar-nav > li.open > a {
  background: var(--xielab-ink);
  color: #fff;
}

/* Keep the enlarged brand and navigation on one desktop baseline. */
@media (min-width: 992px) {
  .navbar-wrapper .navbar > .container {
    display: flex;
    align-items: center;
  }

  .navbar-wrapper .navbar-header {
    float: none;
    flex: 0 0 auto;
  }

  .navbar-wrapper .navbar-collapse {
    display: block !important;
    height: auto !important;
    min-width: 0;
    padding-bottom: 0;
    overflow: visible !important;
    flex: 1 1 auto;
  }

  .navbar-wrapper .navbar-nav {
    display: flex;
    align-items: center;
    float: right;
    margin: 0;
  }

  .navbar-wrapper .navbar-nav > li {
    float: none;
  }
}

.navbar-wrapper .dropdown-menu {
  border: 1px solid var(--xielab-line);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 12px 26px rgba(21, 40, 59, .12);
  padding: 8px 0;
}

.navbar-wrapper .dropdown-menu > li > a {
  color: var(--xielab-text);
  font-size: 15px;
  line-height: 1.45;
  padding: 10px 16px;
}

.navbar-wrapper .dropdown-menu > li > a:hover,
.navbar-wrapper .dropdown-menu > li > a:focus {
  background: var(--xielab-soft);
  color: var(--xielab-cyan-dark);
}

#inner-headline h2.pageTitle {
  font-size: 38px;
  margin-top: 32px;
}

#content {
  font-size: 17px;
  line-height: 1.78;
}

#content .panel-body {
  font-size: 17px;
  line-height: 1.78;
}

#content .list-group-item {
  font-size: 16px;
  line-height: 1.5;
  padding: 14px 16px;
}

#content .panel-cyan {
  border: 1px solid var(--xielab-line);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(21, 40, 59, .07);
}

#content .panel-cyan > .panel-heading {
  background: linear-gradient(135deg, var(--xielab-ink), var(--xielab-cyan-dark));
  border: 0;
  color: #fff;
  font-size: 16px;
  letter-spacing: .02em;
  padding: 15px 17px;
}

#content > .container > .row > .col-md-3:first-child .panel-cyan {
  position: sticky;
  top: 96px;
}

.publication-item,
.record,
.copyright-record,
.news-item {
  font-size: 16.5px;
  line-height: 1.78;
}

.publication-year > p:first-child {
  font-size: 22px;
}

.citation-count,
.publication-source,
.record .meta,
.news-meta {
  font-size: 15px;
}

/* Homepage modules */
#wrapper.home-page #banner,
#wrapper.home-page > .callaction {
  display: none;
}

.home-modern {
  background: #fff;
  color: var(--xielab-text);
  padding-bottom: 36px;
}

.home-hero {
  align-items: center;
  background: linear-gradient(105deg, rgba(12, 31, 50, .97) 0%, rgba(12, 31, 50, .83) 45%, rgba(12, 31, 50, .32) 100%), url('../img/research/microbiome-host-axis-hero.jpg') center/cover;
  color: #fff;
  display: flex;
  min-height: 545px;
  padding: 118px 0 88px;
}

.home-hero .container { position: relative; z-index: 1; }

.home-eyebrow {
  color: #86e6ee;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .16em;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.home-hero h1 {
  color: #fff;
  font-size: clamp(42px, 5vw, 68px);
  letter-spacing: -.04em;
  line-height: 1.08;
  margin: 0 0 22px;
  max-width: 760px;
}

.home-hero p {
  color: rgba(255,255,255,.86);
  font-size: 20px;
  line-height: 1.7;
  margin-bottom: 30px;
  max-width: 720px;
}

.home-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.home-actions a,
.home-cta a {
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 999px;
  color: #fff;
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  padding: 12px 22px;
  text-decoration: none;
}

.home-actions a:first-child,
.home-cta a:first-child {
  background: var(--xielab-cyan);
  border-color: var(--xielab-cyan);
}

.home-signal-band {
  background: var(--xielab-ink);
  color: #fff;
  padding: 22px 0;
}

.home-signal-band .container { display: flex; flex-wrap: wrap; gap: 12px 34px; justify-content: space-between; }
.home-signal-band span { color: #b8e9ec; font-size: 16px; font-weight: 650; }

.home-section { padding: 74px 0 12px; }
.home-section.alt { background: var(--xielab-soft); }
.home-section h2 { font-size: 34px; margin: 0 0 12px; }
.home-section > .container > .section-lead { color: var(--xielab-muted); font-size: 18px; margin-bottom: 34px; max-width: 760px; }

.home-grid { display: grid; gap: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-card { background: #fff; border: 1px solid var(--xielab-line); border-radius: 14px; box-shadow: 0 10px 26px rgba(21,40,59,.06); height: 100%; overflow: hidden; }
.home-card img { display: block; height: 178px; object-fit: cover; width: 100%; }
.home-card-body { padding: 22px 22px 24px; }
.home-card h3 { font-size: 22px; margin: 0 0 10px; }
.home-card p { font-size: 16px; line-height: 1.7; margin-bottom: 16px; }
.home-card a { font-size: 16px; font-weight: 700; }
.home-paper .paper-kicker { color: var(--xielab-cyan-dark); font-size: 14px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.home-paper h3 { font-size: 20px; }
.home-news { border-left: 4px solid var(--xielab-cyan); padding-left: 18px; }
.home-news + .home-news { margin-top: 22px; }
.home-news time { color: var(--xielab-muted); display: block; font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.home-news h3 { font-size: 19px; margin-bottom: 6px; }
.home-news p { font-size: 16px; margin: 0; }
.home-tools .home-card img { height: 168px; object-fit: contain; padding: 18px; }
.home-cta { background: linear-gradient(110deg, var(--xielab-ink), #075f73); color: #fff; margin-top: 62px; padding: 46px 0; }
.home-cta h2 { color: #fff; font-size: 32px; margin: 0 0 10px; }
.home-cta p { color: rgba(255,255,255,.84); font-size: 18px; margin: 0; max-width: 700px; }
.home-cta .container { align-items: center; display: flex; gap: 28px; justify-content: space-between; }
.home-cta a { flex: 0 0 auto; }

.opening-page #content .panel,
.contact-page #content .col-md-12 > div {
  background: #fff;
  border: 1px solid var(--xielab-line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(21, 40, 59, .07);
  padding: 28px;
}

.opening-page #content .panel-body { padding: 30px; }
.opening-page #content .Join.Us,
.opening-page #content .Contact { color: var(--xielab-text); }
.opening-page #content strong[style*="FF4000"] { color: var(--xielab-cyan-dark) !important; font-size: 30px; }
.opening-page #content strong[style*="095eae"] { color: var(--xielab-ink) !important; }
.contact-page #content h2 { font-size: 30px; margin-top: 0; }
.contact-page #content img { border: 1px solid var(--xielab-line); border-radius: 10px; margin-top: 18px; max-width: 280px; padding: 12px; }

@media (max-width: 991px) {
  #content > .container > .row > .col-md-3:first-child .panel-cyan { position: static; }
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .navbar-wrapper .navbar.navbar-fixed-top,
  .navbar-wrapper .navbar-header,
  .navbar-wrapper .navbar-collapse { min-height: 64px; }
  .navbar-wrapper .navbar-brand { height: 64px; padding: 2px 15px 2px 0; }
  .navbar-wrapper .navbar-brand img { width: auto; height: 60px; max-height: 60px; }
  .navbar-wrapper .navbar-nav > li > a,
  .navbar-wrapper .navbar .nav > li > a { display: block; height: auto; min-height: 0; font-size: 16px; line-height: 1.45; padding: 12px 15px; white-space: normal; }
  #inner-headline { margin-top: 64px; }
  #inner-headline h2.pageTitle { font-size: 32px; }
  .home-hero { min-height: 580px; padding: 104px 0 64px; }
  .home-hero h1 { font-size: 42px; }
  .home-hero p { font-size: 18px; }
  .home-grid { grid-template-columns: 1fr; }
  .home-section { padding-top: 54px; }
  .home-cta .container { align-items: flex-start; flex-direction: column; }
}
