/* =====================================================================
   Chaoxing Huang - personal website
   custom.css (plain CSS, loaded after main.css)
   ===================================================================== */

:root {
  --cx-bg: #f4f6fb;
  --cx-surface: #ffffff;
  --cx-text: #1d2433;
  --cx-muted: #5d6b82;
  --cx-border: #e5e9f2;
  --cx-accent: #2456d6;
  --cx-accent-dark: #1b3f9e;
  --cx-accent-soft: #edf2fe;
  --cx-radius: 16px;
  --cx-shadow: 0 12px 32px -12px rgba(24, 39, 90, 0.18);
  --cx-font: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --cx-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--cx-bg);
  color: var(--cx-text);
  font-family: var(--cx-font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cx-accent); }
a:hover { color: var(--cx-accent-dark); }

/* ----------------------------- masthead ----------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--cx-border);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}

.masthead__inner-wrap { padding: 0.55rem 1.4rem; }

.masthead a { text-decoration: none; }

.greedy-nav { background: transparent; }

.greedy-nav a { color: var(--cx-text); font-weight: 500; }
.greedy-nav a:hover { color: var(--cx-accent); }

.masthead__menu-item--lg {
  padding-right: 2em;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.masthead__menu-item--lg a { color: var(--cx-text); }
.masthead__menu-item--lg a:hover { color: var(--cx-text); }

/* ------------------------------ layout ------------------------------ */
#main { max-width: 1080px; margin: 0 auto; padding: 2rem 1.2rem 3.2rem; }

.page__inner-wrap { max-width: 860px; margin: 0 auto; }

/* pages that still use the theme sidebar (404 etc.) */
.sidebar.sticky {
  background: var(--cx-surface);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  padding: 1.4rem 1.4rem 1.1rem;
  box-shadow: var(--cx-shadow);
}
.author__avatar img {
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: var(--cx-shadow);
}
.author__name { font-size: 1.05rem; }

/* theme content page tweaks */
.page__title { font-size: 2rem; letter-spacing: -0.02em; }
.page__content { font-size: 1rem; line-height: 1.7; }
.page__content p { margin: 0 0 1rem; }

/* --------------------------- homepage hero -------------------------- */
.cx-home { min-height: 60vh; }

.cx-hero {
  background:
    radial-gradient(900px 420px at 88% -12%, rgba(36, 86, 214, 0.13), rgba(36, 86, 214, 0) 62%),
    radial-gradient(700px 380px at -8% 8%, rgba(15, 118, 110, 0.09), rgba(15, 118, 110, 0) 60%),
    linear-gradient(180deg, #ffffff 0%, var(--cx-bg) 100%);
  border-bottom: 1px solid var(--cx-border);
  padding: 3.4rem 1.2rem 2.8rem;
}

.cx-hero__inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2.8rem;
  flex-wrap: wrap;
}

.cx-hero__media { flex: 0 0 auto; }

.cx-hero__avatar {
  display: block;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 22%;
  border: 5px solid #fff;
  box-shadow: 0 18px 40px -16px rgba(24, 39, 90, 0.35);
}

.cx-hero__body { flex: 1 1 460px; min-width: 280px; }

.cx-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cx-accent);
}

.cx-hero h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.9rem, 4.6vw, 2.7rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.cx-hero__role {
  margin: 0 0 0.7rem;
  font-size: 1.12rem;
  font-weight: 600;
}

.cx-hero__intro {
  margin: 0 0 1.1rem;
  color: var(--cx-muted);
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 66ch;
}

.cx-chips { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cx-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  background: #fff;
  border: 1px solid var(--cx-border);
  color: var(--cx-muted);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.34rem 0.8rem;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.cx-hero__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.cx-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.62rem 1.2rem;
  border-radius: 999px;
  text-decoration: none !important;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cx-btn:hover { transform: translateY(-1px); }

.cx-btn--primary {
  background: var(--cx-accent);
  color: #fff !important;
  box-shadow: 0 10px 20px -10px rgba(36, 86, 214, 0.6);
}
.cx-btn--primary:hover { background: var(--cx-accent-dark); color: #fff !important; }

.cx-btn--ghost {
  background: #fff;
  color: var(--cx-text) !important;
  border-color: var(--cx-border);
}
.cx-btn--ghost:hover { border-color: var(--cx-accent); color: var(--cx-accent) !important; }

.cx-btn svg { width: 16px; height: 16px; fill: currentColor; flex: none; }

/* --------------------------- homepage body -------------------------- */
.cx-main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 2.2rem 1.2rem 3.6rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

.cx-section { scroll-margin-top: 92px; }

.cx-card {
  background: var(--cx-surface);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  padding: 1.7rem 1.9rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.cx-card--about { scroll-margin-top: 92px; }

.cx-section__title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1.1rem;
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--cx-border);
}

.cx-section__title::before {
  content: "";
  width: 10px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--cx-accent), #4f7cf0);
  flex: none;
}

.cx-section__title .cx-more {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

/* bio text */
.cx-prose { color: var(--cx-text); font-size: 1rem; line-height: 1.78; }
.cx-prose p { margin: 0 0 0.85rem; }
.cx-prose p:last-child { margin-bottom: 0; }

/* ------------------------------- news ------------------------------- */
.cx-timeline { list-style: none; margin: 0; padding: 0; }

.cx-news__item {
  display: flex;
  gap: 1.1rem;
  align-items: baseline;
  padding: 0.7rem 0.15rem;
  border-bottom: 1px dashed var(--cx-border);
}
.cx-news__item:last-child { border-bottom: 0; }

.cx-news__date {
  flex: 0 0 6.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cx-accent);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.cx-news__text { font-size: 0.97rem; line-height: 1.6; color: var(--cx-text); }

/* --------------------------- publications --------------------------- */
.cx-pubs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.9rem; }

.pub {
  min-width: 0;
  background: #fbfcfe;
  border: 1px solid var(--cx-border);
  border-radius: 13px;
  padding: 1.15rem 1.3rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.pub:hover {
  border-color: #c6d5f7;
  box-shadow: 0 8px 22px -14px rgba(24, 39, 90, 0.25);
  transform: translateY(-1px);
}

.pub__top { display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem; min-width: 0; }

.pub__title {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--cx-serif);
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.42;
  color: var(--cx-text);
}

.pub__title a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(180deg, transparent 62%, rgba(36, 86, 214, 0.22) 0);
  background-size: 100% 100%;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.pub__title a:hover { color: var(--cx-accent); }

.pub__title a::after {
  content: "97";
  display: inline-block;
  margin-left: 0.28em;
  font-family: var(--cx-font);
  font-size: 0.72em;
  vertical-align: 0.12em;
  color: var(--cx-soft, #8a96ab);
  opacity: 0.75;
}

.pub__venue {
  flex: none;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--cx-accent);
  background: var(--cx-accent-soft);
  border: 1px solid #d9e4fb;
  padding: 0.24rem 0.68rem;
  border-radius: 999px;
  white-space: normal;
  line-height: 1.35;
}

.pub__venue--preprint { color: #9a5b00; background: #fff7e8; border-color: #f3e3c2; }

.pub__authors {
  min-width: 0;
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--cx-muted);
  line-height: 1.6;
}

.pub__authors .me { color: var(--cx-text); font-weight: 700; }

/* ------------------------- experience / education ------------------- */
.cx-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }

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

.cx-list__item {
  position: relative;
  padding: 0 0 1.1rem 1.25rem;
}
.cx-list__item::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.42em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cx-accent);
}
.cx-list__item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1.1em;
  bottom: 0.15em;
  width: 1px;
  background: var(--cx-border);
}

.cx-list__title { font-size: 0.97rem; font-weight: 700; }
.cx-list__org { color: var(--cx-accent); font-weight: 600; }
.cx-list__period { display: inline-block; margin-left: 0.5rem; font-size: 0.8rem; font-weight: 600; color: var(--cx-muted); }
.cx-list__desc { font-size: 0.9rem; color: var(--cx-muted); margin-top: 0.15rem; line-height: 1.55; }

/* ------------------------------ gallery ----------------------------- */
.cx-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
}

.cx-gallery figure { margin: 0; }

.cx-gallery__frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #e9edf5;
  box-shadow: 0 10px 24px -14px rgba(24, 39, 90, 0.35);
}

/* 3:2 比例占位：用 padding-top 撑高，兼容不支持 aspect-ratio 的浏览器 */
.cx-gallery__frame::before {
  content: "";
  display: block;
  padding-top: 66.666%;
}

.cx-gallery__frame img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.cx-gallery figure:hover .cx-gallery__frame img { transform: scale(1.03); }

.cx-gallery figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--cx-muted);
  text-align: center;
}

/* ------------------------------ footer ------------------------------ */
.page__footer {
  background: #121826;
  color: #aeb8cc;
  border-top: 0;
}

.page__footer .page__footer-follow,
.page__footer .page__footer-copyright { max-width: 1080px; margin: 0 auto; }

.page__footer a { color: #cdd6e6; }
.page__footer a:hover { color: #ffffff; }

.page__footer .social-icons li a { color: #aeb8cc; font-size: 0.92rem; }
.page__footer .social-icons li a:hover { color: #ffffff; }
.page__footer-copyright { font-size: 0.85rem; }

/* 404 page */
.cx-404 { text-align: center; padding: 4rem 1rem; }
.cx-404 .cx-404__code { font-size: 4.5rem; font-weight: 800; letter-spacing: -0.03em; color: var(--cx-accent); margin: 0 0 0.4rem; }

/* ---------------------------- responsive ---------------------------- */
@media (max-width: 760px) {
  .cx-hero { padding-top: 2.4rem; }
  .cx-hero__inner { justify-content: center; text-align: center; gap: 1.6rem; }
  .cx-hero__intro { margin-left: auto; margin-right: auto; }
  .cx-chips, .cx-hero__actions { justify-content: center; }
  .cx-cols { grid-template-columns: minmax(0, 1fr); }
  .cx-gallery { grid-template-columns: minmax(0, 1fr); }
  .cx-card { padding: 1.3rem 1.25rem; }
  .cx-news__item { flex-direction: column; gap: 0.2rem; }
  .masthead__inner-wrap { padding: 0.5rem 1rem; }
}
