/* ============================================================
   components.css — Hipponylab Homepage
   Navigation, cards, buttons, tags, filter bar, profile links
   ============================================================ */

/* ── Navigation ────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.nav__logo {
  height: 36px;
  width: auto;
}

.nav__site-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-brand-dark);
  letter-spacing: -0.01em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav__link:hover,
.nav__link--active {
  color: var(--color-brand-blue);
  border-bottom-color: var(--color-brand-blue);
  text-decoration: none;
}

.nav__link--app {
  color: var(--color-brand-blue);
  font-weight: 600;
}

.nav__link--app:hover {
  opacity: 0.8;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-brand-dark);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  background: var(--color-brand-dark);
  padding: 4rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}

/* subtle dot-grid overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.hero__logo-wrap {
  flex-shrink: 0;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background-color: #fff;
  background-image: url('../images/logo.png');
  background-repeat: no-repeat;
  background-size: 85%;
  background-position: center 38%;
  box-shadow:
    0 0 0 5px rgba(255,255,255,0.18),
    0 0 0 10px rgba(255,255,255,0.07),
    0 10px 40px rgba(0,0,0,0.4);
}

/* Kept in DOM for accessibility (alt text), hidden visually */
.hero__logo {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.hero__text {
  color: #fff;
}

.hero__lab-name {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.hero__tagline {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: rgba(255,255,255,0.8);
  font-weight: 400;
  margin-bottom: 0.6rem;
}

.hero__affiliation {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero__affiliation::before {
  content: '';
  display: inline-block;
  width: 1.2em;
  height: 1px;
  background: rgba(255,255,255,0.4);
}

/* ── Language Toggle Button ────────────────────────────────── */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.3rem 0.85rem;
  border: 1.5px solid var(--color-brand-blue);
  border-radius: 20px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-brand-blue);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.lang-toggle:hover {
  background: var(--color-brand-blue);
  color: #fff;
}

.lang-toggle__icon {
  font-size: 0.9rem;
  line-height: 1;
}

/* ── Section Header Divider ────────────────────────────────── */
.section__title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--color-brand-blue);
  margin-top: 0.5rem;
  border-radius: 2px;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-brand-blue);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-brand-dark);
  color: #fff;
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.btn--ghost:hover {
  border-color: var(--color-brand-blue);
  color: var(--color-brand-blue);
  text-decoration: none;
}

.btn--sm {
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
}

.btn--rg {
  background: transparent;
  color: #00CCBB;
  border: 1px solid #00CCBB;
}

.btn--rg:hover {
  background: #00CCBB;
  color: #fff;
  text-decoration: none;
}

/* ── Tags / Badges ─────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag--publication  { background: #EAF2FB; color: #1A5276; }
.tag--award        { background: #FEF3E2; color: #9A5C00; }
.tag--event        { background: #EAFAF1; color: #1A6636; }
.tag--recruiting   { background: #FCF0F8; color: #7D2E6A; }
.tag--media        { background: #F4F0FB; color: #5B3A8E; }

.tag--area-dl      { background: #EAF2FB; color: var(--color-brand-blue); }
.tag--area-ms      { background: #EAFAF1; color: #1A6636; }
.tag--area-mv      { background: #FEF9E7; color: #9A5C00; }
.tag--area-rh      { background: #FCF0F8; color: #7D2E6A; }
.tag--area-sb      { background: #EDECFB; color: #3D2B8E; }

/* ── Research Focus Chips (About section) ──────────────────── */
.focus-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.focus-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  background: var(--color-brand-light);
  color: var(--color-brand-dark);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(42, 109, 181, 0.2);
}

.focus-chip::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-brand-blue);
  flex-shrink: 0;
}

/* ── News Cards ────────────────────────────────────────────── */
.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.news-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-xl);
  transition: box-shadow 0.2s, transform 0.2s;
}

.news-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.news-card__meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.news-card__date {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-brand-blue);
  flex-shrink: 0;
}

.news-card__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--color-brand-dark);
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}

.news-card__summary {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin: 0;
}

.news-card--has-image {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-lg);
  align-items: center;
}

.news-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.news-card__image {
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.news-card__link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-brand-blue);
  align-self: flex-start;
  margin-top: 0.25rem;
}

.news-card__link:hover {
  text-decoration: underline;
}

/* ── Funding Cards ─────────────────────────────────────────── */
.funding-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.funding-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-md);
  align-items: start;
  transition: box-shadow 0.2s;
}

.funding-card:hover {
  box-shadow: var(--shadow-md);
}

.funding-card__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
  color: #fff;
  flex-shrink: 0;
  line-height: 1.2;
}

.funding-card__badge--nsfc     { background: var(--color-fund-nsfc); }
.funding-card__badge--ministry { background: var(--color-fund-ministry); }
.funding-card__badge--univ     { background: var(--color-fund-univ); }
.funding-card__badge--zjnsf    { background: var(--color-fund-zjnsf); }
.funding-card__badge--other    { background: var(--color-fund-other); }

.funding-card__body {}

.funding-card__title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--color-brand-dark);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.3rem;
}

.funding-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.funding-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
}

.funding-card__role {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--color-brand-light);
  color: var(--color-brand-dark);
}

.funding-card__desc {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 0;
}

.funding-status {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.funding-status--active {
  background: #EAFAF1;
  color: #1A6636;
}

.funding-status--done {
  background: #F2F3F4;
  color: #717D7E;
}

/* ── Paper Filter Bar ──────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.filter-btn {
  padding: 0.4rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--color-brand-blue);
  color: #fff;
  border-color: var(--color-brand-blue);
}

/* ── Paper Cards ───────────────────────────────────────────── */
.papers-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.paper-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.paper-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.paper-card__image-wrap {
  flex-shrink: 0;
}

.paper-card__image {
  width: 140px;
  height: 100%;
  min-height: 120px;
  object-fit: cover;
}

/* Card with a real figure: image left, body right */
.paper-card--has-image {
  grid-template-columns: 280px 1fr;
}

.paper-card--has-image .paper-card__image {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: contain;
  background: #fff;
  padding: var(--space-sm);
  border-right: 1px solid var(--color-border);
}

.paper-card__image-placeholder {
  width: 140px;
  min-height: 120px;
  height: 100%;
  background: linear-gradient(160deg, var(--color-brand-light) 0%, var(--color-border) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
  padding: 0.5rem;
}

.paper-card__body {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.paper-card__areas {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.paper-card__citation {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text-primary);
  margin: 0;
}

.paper-card__citation em {
  color: var(--color-brand-dark);
  font-style: italic;
}

.paper-card__citation strong {
  color: var(--color-brand-dark);
}

.paper-card__highlights {
  margin: 0;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.paper-card__highlights li {
  font-size: 0.83rem;
  color: var(--color-text-secondary);
  padding-left: 1.1em;
  position: relative;
  line-height: 1.4;
}

.paper-card__highlights li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--color-brand-blue);
  font-size: 0.7rem;
  top: 0.1em;
}

.paper-card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

/* ── Tools Section ─────────────────────────────────────────── */
.tools-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.tool-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: 1fr;
  height: 180px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
}

.tool-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
}

.tool-card__icon {
  background: linear-gradient(135deg, var(--color-brand-light) 0%, #dce8f5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  border-right: 1px solid var(--color-border);
  overflow: hidden;
}

.tool-card__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
  mix-blend-mode: multiply;
}

.tool-card__body {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
  overflow: hidden;
}

.tool-card__name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--color-brand-dark);
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

.tool-card__desc {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-card__cta {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-brand-blue);
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  margin-top: 0.1rem;
}

.tool-card--coming-soon {
  opacity: 0.7;
  cursor: default;
  pointer-events: none;
}

.badge-soon {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #FEF3E2;
  color: #9A5C00;
}

/* ── Profile / Academic Links ──────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  justify-content: center;
  gap: var(--space-md);
}

.profile-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}

.profile-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.profile-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.profile-card__platform {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--color-brand-dark);
  font-weight: 700;
  margin: 0;
}

.profile-card__label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ResearchGate */
.profile-card--rg .profile-card__icon   { background: #e6faf8; }
/* Google Scholar */
.profile-card--gs .profile-card__icon   { background: #e8f0fe; }
/* ORCID */
.profile-card--orcid .profile-card__icon { background: #f0faf0; }
/* University */
.profile-card--univ .profile-card__icon  { background: var(--color-brand-light); }
/* WeChat */
.profile-card--wechat .profile-card__icon { background: #e6f9ee; }
.profile-card--wechat { cursor: default; }
/* Bilibili */
.profile-card--bilibili .profile-card__icon { background: #e6f5fb; }
.profile-card__qr {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  margin: 0.2rem 0;
}

/* ── About Section ─────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: var(--space-xl);
  align-items: center;
}

.about-contact {
  margin-top: var(--space-md);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.about-contact a {
  color: var(--color-brand-blue);
}

.about-photo {
  border: none;
  background: none;
  box-shadow: none;
  border-radius: 0;
  overflow: hidden;
}

.about-photo img {
  display: block;
  width: calc(100% + 4px);
  margin: -2px;
}

.about-photo .img-placeholder {
  aspect-ratio: 4/3;
  font-size: 0.85rem;
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  background: var(--color-brand-dark);
  color: rgba(255,255,255,0.75);
  padding: var(--space-xl) 0 var(--space-lg);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: var(--space-lg);
}

.footer__brand-logo-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: #fff;
  background-image: url('../images/logo.png');
  background-repeat: no-repeat;
  background-size: 85%;
  background-position: center 38%;
  box-shadow:
    0 0 0 3px rgba(255,255,255,0.15),
    0 4px 16px rgba(0,0,0,0.35);
  margin-bottom: var(--space-sm);
  flex-shrink: 0;
}

/* hidden img kept for accessibility */
.footer__brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.footer__brand-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
}

.footer p {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.25rem;
}

.footer__nav-heading,
.footer__contact-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: var(--space-sm);
}

.footer__nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer__nav-list a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color 0.15s;
}

.footer__nav-list a:hover {
  color: #fff;
  text-decoration: none;
}

.footer__bottom {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* ── Divider line above section ────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  margin: 0;
}
