/* ==========================================================================
   NLP2CT Lab — site stylesheet
   Palette derived from the lab logo (deep green + terracotta) with warm neutrals.
   ========================================================================== */
:root {
  --green: #1E5A3C;
  --green-dark: #163F2B;
  --green-ink: #0E2A1D;
  --green-soft: #E6F0EA;
  --terra: #B5582B;
  --terra-dark: #964620;
  --terra-soft: #F7E9E1;
  --gold: #C8A24A;
  --ink: #141A17;
  --text: #262D29;
  --muted: #5F6B66;
  --line: #E1E6E2;
  --bg: #FFFFFF;
  --bg-soft: #F6F7F4;
  --bg-mute: #EDF0EC;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --radius: 10px;
  --radius-lg: 16px;
  --gap: 24px;
  --max: 1180px;
  --shadow: 0 10px 30px rgba(14, 42, 29, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 140px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-sans); color: var(--text); background: var(--bg); line-height: 1.6; font-size: 16px; -webkit-font-smoothing: antialiased; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--ink); line-height: 1.2; margin: 0 0 0.5em; font-weight: 600; letter-spacing: -0.01em; }
h4 { font-family: var(--font-sans); font-size: 0.95rem; letter-spacing: 0.02em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
sup { font-size: 0.6em; line-height: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--terra); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gap); }
.container.narrow { max-width: 720px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--bg-mute); padding: 1px 5px; border-radius: 4px; }

/* ---------- Buttons, tags, links ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 0.95rem; line-height: 1.2; cursor: pointer; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease; font-family: inherit; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn--primary:hover { background: var(--green-dark); }
.btn--accent { background: var(--terra); color: #fff; border-color: var(--terra); }
.btn--accent:hover { background: var(--terra-dark); }
.btn--light { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.4); }
.btn--light:hover { background: rgba(255,255,255,0.22); }
.btn--outline { background: transparent; color: var(--green); border-color: var(--green); }
.btn--outline:hover { background: var(--green-soft); }
.btn--ghost { background: transparent; color: var(--green); border-color: var(--line); }
.btn--ghost:hover { background: var(--bg-soft); }
.btn--danger { background: #fff; color: #A32D2D; border-color: #E5B4B4; }
.btn--danger:hover { background: #FBECEC; }
.btn--sm { padding: 7px 12px; font-size: 0.85rem; }
.text-link { font-weight: 600; white-space: nowrap; }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--bg-mute); color: var(--muted); }
.tag--award { background: #FBF1DA; color: #8A6515; }
.tag--seminar, .tag--workshop, .tag--conference { background: var(--green-soft); color: var(--green-dark); }
.tag--news { background: var(--terra-soft); color: var(--terra-dark); }
.tag--journal { background: #E8EEF9; color: #2F4A8A; }
.tag--other { background: var(--bg-mute); color: var(--muted); }
.eyebrow { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.74rem; color: var(--terra); font-weight: 700; margin: 0 0 10px; }
.eyebrow--light { color: var(--gold); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 24px; padding: 0 9px; font-family: var(--font-sans); font-size: 0.78rem; line-height: 1; color: var(--green-dark); font-weight: 600; background: var(--green-soft); border: 1px solid #CBDDD2; border-radius: 999px; margin-left: 8px; align-self: center; position: relative; top: 0; }
.lead { font-size: 1.12rem; color: var(--text); line-height: 1.7; }

/* ---------- Header: large logo with the full name, navigation in the same row ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 84px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); flex: none; }
.brand:hover { text-decoration: none; }
.brand__logo { height: 44px; width: auto; }
.brand--full .brand__logo { height: 64px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__en { font-family: var(--font-serif); font-weight: 700; font-size: 0.98rem; color: var(--ink); letter-spacing: -0.005em; white-space: nowrap; }
.brand__zh { font-size: 0.82rem; letter-spacing: 0.18em; color: var(--text); margin-top: 3px; white-space: nowrap; }
.brand__zh--lead { font-size: 1.1rem; font-weight: 600; margin: 0 0 3px; letter-spacing: 0.14em; color: var(--ink); }
.brand__en--small { font-size: 0.74rem; font-weight: 600; color: var(--muted); }
.brand__name { font-family: var(--font-serif); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand__sub { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.brand--compact { display: none; gap: 10px; }
.brand--light, .brand--light .brand__name { color: #fff; }
.brand--light .brand__sub { color: rgba(255,255,255,0.7); }
.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav a { color: var(--text); font-weight: 500; font-size: 0.92rem; padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
.site-nav a:hover { background: var(--bg-soft); text-decoration: none; color: var(--green); }
.site-nav a.is-active { color: var(--green); background: var(--green-soft); }
.site-nav .nav-cta { margin-left: 6px; background: var(--green); color: #fff; }
.site-nav .nav-cta:hover { background: var(--green-dark); color: #fff; }
.site-nav__tools { display: flex; align-items: center; gap: 8px; margin-left: 10px; }
.lang-switch { padding: 6px 11px; font-size: 0.84rem; font-weight: 600; color: var(--green-dark); border: 1px solid var(--line); border-radius: 999px; background: #fff; white-space: nowrap; }
.lang-switch:hover { border-color: var(--green); background: var(--green-soft); text-decoration: none; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.nav-toggle span { width: 20px; height: 2px; background: var(--ink); display: block; }
@media (max-width: 1199px) {
  .brand--full { display: none; }
  .brand--compact { display: inline-flex; }
  .nav-toggle { display: flex; }
  .site-header__inner { min-height: 68px; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 12px var(--gap) 16px; gap: 2px; box-shadow: var(--shadow); }
  .site-nav.is-open { display: flex; }
  .site-nav a { white-space: normal; }
  .site-nav .nav-cta { margin-left: 0; }
  .site-nav__tools { flex-direction: column; align-items: flex-start; gap: 8px; margin: 8px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
  .site-nav__tools .lang-switch { margin-left: 12px; }
  .site-nav__tools .user-menu { width: 100%; margin: 0; }
  .site-nav__tools .user-menu__btn { display: none; }
  .site-nav__tools .user-menu__panel { display: block; position: static; box-shadow: none; border: 0; border-radius: 0; padding: 0; min-width: 0; }
}
/* Long pages: let the browser skip laying out and painting sections that are off screen. */
.pub-year, .news-year, .people-section { content-visibility: auto; contain-intrinsic-size: auto 900px; }
@media (max-width: 899px) {
  .site-nav .nav-cta { margin: 8px 0 0; text-align: center; }
}

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; background: radial-gradient(1200px 500px at 85% -10%, rgba(200,162,74,0.25), transparent 60%), radial-gradient(800px 400px at -10% 110%, rgba(181,88,43,0.25), transparent 60%), linear-gradient(160deg, var(--green-ink) 0%, var(--green-dark) 55%, var(--green) 100%); padding: 88px 0 0; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), transparent 90%); pointer-events: none; }
.hero__inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr); gap: 48px; align-items: center; padding-bottom: 88px; }
.hero__title { color: #fff; font-size: clamp(2rem, 4.2vw, 3.4rem); font-weight: 600; max-width: 18ch; margin-bottom: 18px; }
.hero__tagline { font-size: 1.2rem; color: rgba(255,255,255,0.86); max-width: 56ch; margin-bottom: 28px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__art { display: flex; justify-content: center; }
/* Translation demo card */
.mt-demo { width: min(100%, 440px); background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.18); border-radius: var(--radius-lg); padding: 18px 22px 22px; box-shadow: 0 30px 60px rgba(0,0,0,0.28); color: #fff; }
.mt-demo__bar { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.mt-demo__dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.25); }
.mt-demo__dot:nth-child(1) { background: #E77D6B; } .mt-demo__dot:nth-child(2) { background: #E9C46A; } .mt-demo__dot:nth-child(3) { background: #7CC08B; }
.mt-demo__title { margin-left: auto; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.65); }
.mt-demo__row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; }
.mt-demo__row--src { border-bottom: 1px dashed rgba(255,255,255,0.15); }
.mt-demo__lang { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; color: var(--gold); background: rgba(200,162,74,0.14); border: 1px solid rgba(200,162,74,0.35); border-radius: 6px; padding: 3px 0; text-align: center; margin-top: 3px; }
.mt-demo__text { margin: 0; min-height: 1.6em; font-size: 1rem; line-height: 1.6; color: rgba(255,255,255,0.92); overflow-wrap: anywhere; }
.mt-demo__text--zh { font-size: 1.3rem; font-family: var(--font-serif), "Noto Serif CJK TC", "PMingLiU", "Microsoft JhengHei", serif; letter-spacing: 0.04em; }
.mt-demo__text.is-typing::after { content: ""; display: inline-block; width: 2px; height: 1em; background: var(--gold); margin-left: 2px; vertical-align: -0.15em; animation: mt-caret 0.8s steps(1) infinite; }
.mt-demo__status { display: flex; align-items: center; gap: 8px; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.55); padding: 8px 0 2px; min-height: 28px; }
.mt-demo__status.is-done { color: #9ED8A8; }
.mt-demo__pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: mt-pulse 1.1s ease-in-out infinite; }
.mt-demo__status.is-done .mt-demo__pulse { background: #7CC08B; animation: none; }
@keyframes mt-caret { 50% { opacity: 0; } }
@keyframes mt-pulse { 0%, 100% { transform: scale(0.7); opacity: 0.5; } 50% { transform: scale(1.1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mt-demo__pulse, .mt-demo__text.is-typing::after { animation: none; } }
.stats-band { background: linear-gradient(180deg, var(--green-soft) 0%, #F3F7F4 100%); border-top: 4px solid var(--terra); border-bottom: 1px solid #CBDDD2; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 26px 20px 24px; text-align: center; border-left: 1px solid #CBDDD2; }
.stat:first-child { border-left: 0; }
.stat__num { display: block; font-family: var(--font-serif); font-size: 2.3rem; font-weight: 700; color: var(--green-dark); line-height: 1; }
.stat__label { display: block; font-size: 0.78rem; color: var(--terra-dark); margin-top: 8px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
@media (max-width: 899px) {
  .hero { padding-top: 56px; }
  .hero__inner { grid-template-columns: 1fr; gap: 28px; padding-bottom: 56px; }
  .hero__art { justify-content: flex-start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid #CBDDD2; }
}

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section--intro { padding-top: 72px; }
.section--tight { padding: 40px 0 72px; }
.section--soft { background: var(--bg-soft); }
.section__title { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-bottom: 24px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.section__title--light { color: #fff; }
.section__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.section__head .section__title { margin-bottom: 0; }
.section__head .muted { max-width: 60ch; margin: 0; }
.subsection__title { font-family: var(--font-sans); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 36px 0 14px; font-weight: 700; }
@media (max-width: 899px) { .section { padding: 52px 0; } }

.intro-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; align-items: start; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; align-items: stretch; }
.two-col > div { display: flex; flex-direction: column; min-height: 0; }
/* Both lists grow to the full column height so neither side leaves a gap. */
.two-col .news-list, .two-col .pub-list--compact { flex: 1; display: flex; flex-direction: column; }
.two-col .news-item, .two-col .pub-list--compact .pub { flex: 1 1 auto; }
.two-col .news-item { align-content: center; }
.two-col .pub-list--compact .pub { display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 899px) { .intro-grid, .two-col { grid-template-columns: 1fr; gap: 36px; } }

/* ---------- Page head + anchor nav ---------- */
.page-head { background: linear-gradient(180deg, var(--bg-soft), #fff); padding: 56px 0 36px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2rem, 3.6vw, 2.8rem); margin-bottom: 10px; }
.page-head__sub { color: var(--muted); font-size: 1.08rem; max-width: 70ch; margin: 0; }
.anchor-nav { position: sticky; top: 84px; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); }
.anchor-nav__inner { display: flex; justify-content: safe center; gap: 6px; overflow-x: auto; padding-top: 10px; padding-bottom: 10px; scrollbar-width: none; }
.anchor-nav a { white-space: nowrap; padding: 8px 16px; border-radius: 999px; font-size: 0.9rem; font-weight: 600; color: var(--green-dark); background: var(--bg-soft); border: 1px solid var(--line); }
.anchor-nav a:hover { background: var(--green-soft); border-color: #CBDDD2; color: var(--green); text-decoration: none; }

/* ---------- Research areas ---------- */
.areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.area { position: relative; display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px 24px 24px; color: var(--text); transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease; }
.area:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--green-soft); }
.area--static:hover { transform: none; box-shadow: none; }
.area__index { font-family: var(--font-serif); color: var(--terra); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.04em; }
.area__title { font-size: 1.2rem; margin: 10px 0 8px; }
.area__desc { color: var(--muted); font-size: 0.95rem; margin: 0; }
.areas--detailed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.areas--detailed .area__desc { font-size: 1rem; }
@media (max-width: 899px) { .areas, .areas--detailed { grid-template-columns: 1fr; } }

/* ---------- News ---------- */
.news-list { display: flex; flex-direction: column; }
.news-item { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.news-item:first-child { border-top: 1px solid var(--line); }
.news-item__date { font-size: 0.85rem; color: var(--muted); font-weight: 600; padding-top: 3px; }
.news-item__title { font-family: var(--font-sans); font-size: 1.05rem; font-weight: 600; margin: 6px 0 4px; line-height: 1.4; }
.news-item__title a { color: var(--ink); }
.news-item__title a:hover { color: var(--green); }
.news-item__summary { color: var(--muted); font-size: 0.95rem; margin: 0 0 6px; }
.news-list--page .news-item { padding: 22px 0; }
.news-year { margin-top: 28px; }
@media (max-width: 599px) { .news-item { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Publications ---------- */
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub { padding: 16px 0; border-bottom: 1px solid var(--line); }
.pub-list--compact .pub { padding: 12px 0; }
.pub__title { font-weight: 600; font-size: 1.02rem; line-height: 1.45; color: var(--ink); }
.pub__title a { color: var(--ink); }
.pub__title a:hover { color: var(--green); }
.pub__authors { font-size: 0.92rem; color: var(--muted); margin-top: 3px; }
.pub__authors strong { color: var(--text); font-weight: 600; }
.pub__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 6px; font-size: 0.85rem; }
.venue { color: var(--green-dark); font-weight: 600; }
.pub__year { color: var(--muted); }
.pub__note { color: var(--terra); font-weight: 600; }
.pub__link { font-weight: 600; }
.pubs-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; align-items: start; }
.filters { position: sticky; top: 96px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.filters__search input { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.filters__group { margin-top: 18px; }
.filters__group h4 { margin: 0 0 8px; color: var(--muted); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.1em; }
.filters .check { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; padding: 3px 0; }
.filters__count { margin: 16px 0 0; font-size: 0.85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips--row { margin-bottom: 8px; }
.chip { font: inherit; font-size: 0.85rem; font-weight: 500; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; }
.chip span { color: var(--muted); font-size: 0.78rem; margin-left: 3px; }
.chip:hover { border-color: var(--green); color: var(--green); }
.chip.is-active { background: var(--green); border-color: var(--green); color: #fff; }
.chip.is-active span { color: rgba(255,255,255,0.8); }
.pub-year { margin-bottom: 36px; }
.pub-year__title { font-size: 1.5rem; padding-bottom: 8px; border-bottom: 2px solid var(--green); display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
@media (max-width: 899px) { .pubs-layout { grid-template-columns: 1fr; gap: 24px; } .filters { position: static; } }

/* ---------- People ---------- */
/* Compact people cards: as many as fit at ~180px each (about six per row on a laptop). */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; align-items: start; }
.grid--wide { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
@media (max-width: 479px) { .grid, .grid--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow 0.15s ease, transform 0.15s ease; display: flex; flex-direction: column; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
/* Portrait box; the photo fills it, anchored near the top so heads and hair stay in frame. */
.card__photo { position: relative; aspect-ratio: 1 / 1; min-height: 0; overflow: hidden; background: var(--bg-mute); }
.card__photo img, .card__photo .avatar { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.card__name { font-family: var(--font-sans); font-size: 0.98rem; margin: 0; font-weight: 600; line-height: 1.3; }
.card__name a { color: var(--ink); }
.card__position { color: var(--terra); font-weight: 600; font-size: 0.8rem; margin: 0; }
.card__area { color: var(--muted); font-size: 0.82rem; margin: 0; line-height: 1.45; }
.card__link { margin-top: 5px; display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; font-weight: 600; }
.avatar { display: grid; place-items: center; font-weight: 700; font-size: 2.4rem; font-family: var(--font-serif); color: hsl(var(--h, 150) 35% 28%); background: hsl(var(--h, 150) 40% 90%); }
.avatar--lg { font-size: 3rem; }
.compact { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 48px; }
.compact li { break-inside: avoid; display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.compact__name { font-weight: 600; flex: 0 0 auto; }
.compact__name a { color: var(--ink); }
.compact__area { color: var(--muted); text-align: right; }
@media (max-width: 699px) { .compact { columns: 1; } .compact li { flex-direction: column; gap: 2px; } .compact__area { text-align: left; } }

/* ---------- Director ---------- */
.director { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 40px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; }
.director__photo { position: relative; aspect-ratio: 4 / 5; min-height: 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-mute); }
.director__photo img, .director__photo .avatar { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.director__name { font-size: 1.8rem; margin-bottom: 6px; }
.director__title { color: var(--green-dark); font-weight: 600; font-size: 0.98rem; }
.director__bio { color: var(--text); max-width: 72ch; }
.director__links { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 799px) { .director { grid-template-columns: 1fr; gap: 24px; padding: 24px; } .director__photo { max-width: 240px; } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.7fr); gap: 56px; align-items: start; }
.prose h2 { font-size: 1.7rem; }
.prose p { font-size: 1.05rem; line-height: 1.75; }
.about-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 100px; }
.fact { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; }
.fact__num { display: block; font-family: var(--font-serif); font-size: 2.4rem; font-weight: 700; color: var(--green); line-height: 1; }
.fact__label { display: block; color: var(--muted); font-size: 0.88rem; margin-top: 6px; }
.fact--text { font-size: 0.95rem; }
.fact--text .fact__label { margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; font-weight: 700; }
.mission { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.mission li { display: flex; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.mission li p { margin: 0; }
.mission__num { font-family: var(--font-serif); color: var(--terra); font-weight: 700; font-size: 1.3rem; line-height: 1; }
.pill-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.pill-list li { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 0.92rem; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.contact-list { margin: 0; display: grid; grid-template-columns: 120px 1fr; gap: 12px 16px; }
.contact-list dt { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; padding-top: 2px; }
.contact-list dd { margin: 0; }
.map { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: #fff; }
.map img { width: 100%; }
.map figcaption { padding: 10px 14px; font-size: 0.85rem; color: var(--muted); }
@media (max-width: 899px) { .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 32px; } .about-aside { position: static; } .mission { grid-template-columns: 1fr; } }

/* ---------- Research page ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); }
table.projects { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
table.projects th, table.projects td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.projects th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); background: var(--bg-soft); }
table.projects tr:last-child td { border-bottom: 0; }
.software { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.software__item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.software__item h3 { font-family: var(--font-sans); font-size: 1.05rem; margin-bottom: 6px; }
.software__item p { margin: 0; color: var(--muted); font-size: 0.93rem; }
@media (max-width: 899px) { .software { grid-template-columns: 1fr 1fr; } }
@media (max-width: 599px) { .software { grid-template-columns: 1fr; } }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--green-soft); }
.timeline li { position: relative; display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; padding: 0 0 22px 24px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--terra); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--green-soft); }
.timeline__year { font-family: var(--font-serif); font-weight: 700; color: var(--green); }
.timeline li p { margin: 0; }

/* ---------- Join + partners ---------- */
.section--join { background: linear-gradient(135deg, var(--green-dark), var(--green)); color: #fff; }
.join { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr); gap: 40px; align-items: center; }
.join__text { color: rgba(255,255,255,0.88); max-width: 60ch; }
.join__actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.join--inline { color: inherit; }
.join--inline .join__actions .btn { justify-content: center; }
@media (max-width: 899px) { .join { grid-template-columns: 1fr; } .join__actions { flex-direction: row; flex-wrap: wrap; } }
.section--partners { padding: 48px 0; }
.partners { display: flex; justify-content: center; align-items: center; gap: 40px; flex-wrap: nowrap; margin-top: 12px; }
.partner { flex: 0 0 auto; display: flex; align-items: center; }
.partner img { height: 100px; width: auto; max-width: 300px; object-fit: contain; opacity: 0.95; transition: opacity 0.15s ease, transform 0.15s ease; }
.partner:hover img { opacity: 1; transform: translateY(-2px); }
/* Wide sponsor logos (e.g. university + faculty banner) share the row with the others and take the remaining width */
.partner--wide { flex: 1 1 0; min-width: 0; max-width: 680px; }
.partner--wide img { height: auto; width: 100%; max-width: none; max-height: 100px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-ink); color: rgba(255,255,255,0.82); margin-top: 0; font-size: 0.93rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr 1fr; gap: 40px; padding: 56px var(--gap) 40px; }
.site-footer h4 { color: #fff; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: rgba(255,255,255,0.85); }
.site-footer a:hover { color: #fff; }
.footer-full { color: #fff; margin: 16px 0 6px; font-family: var(--font-serif); font-size: 1rem; }
.address { font-style: normal; display: flex; flex-direction: column; gap: 2px; }
.footer-contact li { line-height: 1.5; }
.footer-muted { color: rgba(255,255,255,0.6); margin: 0; }
.footer-bottom { display: flex; justify-content: center; text-align: center; gap: 16px; flex-wrap: wrap; padding: 18px var(--gap); border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.82rem; color: rgba(255,255,255,0.6); }
@media (max-width: 899px) { .partners { flex-wrap: wrap; gap: 32px; } .partner--wide { flex-basis: 100%; max-width: 100%; justify-content: center; } .partner--wide img { max-height: none; } }
@media (max-width: 699px) { .partner img { height: 84px; max-width: 45vw; } .partner--wide img { max-width: 100%; } }
@media (max-width: 899px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 599px) { .footer-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Admin
   ========================================================================== */
body.admin { background: var(--bg-soft); }
.admin-shell { max-width: var(--max); margin: 0 auto; padding: 20px var(--gap) 48px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.admin-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-serif); font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.admin-brand:hover { text-decoration: none; }
.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.admin-nav a { padding: 7px 12px; border-radius: 8px; font-weight: 500; font-size: 0.92rem; color: var(--text); }
.admin-nav a:hover { background: var(--bg-soft); text-decoration: none; }
.admin-nav a.is-active { background: var(--green-soft); color: var(--green); }
.admin-nav form { margin-left: 8px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 20px; }
.panel__title { font-family: var(--font-sans); font-size: 1.25rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; }
.flash--ok { background: #EAF6EE; color: #1E5A3C; border: 1px solid #BFE3CB; }
.flash--err { background: #FBECEC; color: #8E2626; border: 1px solid #F1C4C4; }
.login { max-width: 420px; margin: 10vh auto; }
.login h1 { font-size: 1.7rem; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { border: 1px solid var(--line); background: #fff; padding: 6px 12px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 0.88rem; color: var(--muted); }
.tabs button.is-active { background: var(--green); color: #fff; border-color: var(--green); }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; justify-content: space-between; }
.toolbar input[type="search"] { flex: 1; min-width: 220px; }
.toolbar select { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.hint { color: var(--muted); font-size: 0.85rem; }

table.members { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.members th, table.members td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.members th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
table.members tr.is-hidden-member td { opacity: 0.55; }
table.members .thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--bg-mute); }
table.members .thumb.avatar { font-size: 1rem; width: 44px; height: 44px; }
table.members select { font: inherit; padding: 5px 6px; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
table.members .row-actions { display: flex; gap: 6px; white-space: nowrap; }
.pos-cell { color: var(--muted); font-size: 0.85rem; }
.saving { outline: 2px solid #F1C27B; }
.saved { outline: 2px solid #7AC79A; }

form .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
form label { font-weight: 600; font-size: 0.9rem; }
form input[type="text"], form input[type="url"], form input[type="email"], form input[type="number"], form input[type="date"], form input[type="password"], form input[type="search"], form textarea, form select {
  font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; width: 100%; background: #fff; color: var(--text);
}
form input:focus, form textarea:focus, form select:focus { outline: 2px solid var(--green-soft); border-color: var(--green); }
form textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 699px) { form .row { grid-template-columns: 1fr; } }
form .check { display: flex; align-items: center; gap: 8px; }
form .check input { width: auto; }
.form-section { font-family: var(--font-sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--terra); margin: 28px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.photo-preview { width: 120px; height: 120px; border-radius: var(--radius); object-fit: cover; border: 1px solid var(--line); background: var(--bg-mute); }
button.btn { font: inherit; cursor: pointer; }
.inline-form { display: inline; }

/* ---------- Language, login and member pages ---------- */
html[lang="zh-Hant"] body { font-family: "Inter", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Heiti TC", sans-serif; }
html[lang="zh-Hant"] h1, html[lang="zh-Hant"] h2, html[lang="zh-Hant"] h3 { font-family: "Source Serif 4", "Songti TC", "PMingLiU", "Noto Serif TC", serif; letter-spacing: 0; }
html[lang="zh-Hant"] .eyebrow { letter-spacing: 0.2em; }
.site-nav .nav-user { color: var(--terra-dark); font-weight: 600; }
.site-nav .nav-logout { font: inherit; font-size: 0.9rem; color: var(--muted); background: none; border: 0; padding: 8px 10px; cursor: pointer; border-radius: 8px; }
.site-nav .nav-logout:hover { background: var(--bg-soft); color: var(--ink); }
.footer-login a { color: rgba(255,255,255,0.45); }
.footer-login a:hover { color: #fff; }
.auth-section { min-height: 60vh; display: flex; align-items: center; }
.auth-card { max-width: 440px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px 32px 26px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.8rem; margin-bottom: 6px; }
.auth-card .muted { margin-bottom: 20px; }
.card__photo { display: block; }
.director__photo { display: block; }
.card__name a:hover, .director__name a:hover, .compact__name a:hover { color: var(--green); text-decoration: none; }
.director__name a { color: inherit; }
.compact__ext { font-weight: 400; color: var(--muted); margin-left: 4px; }
/* profile page */
.page-head--profile { padding: 40px 0 32px; }
.profile-head { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: center; }
.profile__photo { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-mute); border: 1px solid var(--line); }
.profile__photo img, .profile__photo .avatar { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.profile__intro h1 { margin-bottom: 6px; }
.profile__position { color: var(--green-dark); font-weight: 600; font-size: 1.05rem; margin-bottom: 4px; }
.profile__area { margin-bottom: 14px; }
.profile__links { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.8fr); gap: 48px; align-items: start; }
.profile-main .section__title { font-size: 1.4rem; margin-top: 28px; }
.profile-main .prose p { font-size: 1.05rem; line-height: 1.75; }
.profile-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 100px; }
.pill-list--small { margin: 0; }
.pill-list--small li { font-size: 0.85rem; padding: 5px 10px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plain-list li { padding-left: 14px; position: relative; line-height: 1.45; }
.plain-list li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--terra); }
@media (max-width: 799px) { .profile-head { grid-template-columns: 1fr; } .profile__photo { max-width: 200px; } .profile-grid { grid-template-columns: 1fr; gap: 24px; } .profile-side { position: static; } }
/* my page */
.me-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.8fr); gap: 32px; align-items: start; }
.me-main { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px 26px 26px; }
.me-form .form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.me-side { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 899px) { .me-layout { grid-template-columns: 1fr; } }
/* admin: logins */
.credentials { border-color: #BFE3CB; background: #F3FAF5; }
.cred-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.cred-list dt { font-weight: 600; }
.cred-list dd { margin: 0; }
.cred-list code { font-size: 1rem; background: #fff; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); }
.accounts-form { margin-bottom: 18px; }
.login-badge { display: inline-block; font-size: 0.7rem; font-weight: 600; color: var(--green-dark); background: var(--green-soft); border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }

/* ---------- Header: account menu, compact when logged in ---------- */
.user-menu { position: relative; margin-left: 6px; }
.user-menu__btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 3px; cursor: pointer; white-space: nowrap; }
.user-menu__btn:hover, .user-menu.is-open .user-menu__btn { border-color: var(--green); background: var(--bg-soft); }
.user-menu__avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 0.74rem; font-weight: 700; overflow: hidden; flex: none; }
.user-menu__avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.user-menu__caret { font-size: 0.7rem; color: var(--muted); }
.user-menu__panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 40; }
.user-menu.is-open .user-menu__panel { display: block; }
.user-menu__panel a, .user-menu__panel button { display: block; width: 100%; text-align: left; font: inherit; font-size: 0.92rem; font-weight: 500; padding: 9px 12px; border-radius: 8px; color: var(--text); background: none; border: 0; cursor: pointer; white-space: nowrap; }
.user-menu__panel a:hover, .user-menu__panel button:hover { background: var(--bg-soft); color: var(--green); text-decoration: none; }
.user-menu__panel a.is-active { color: var(--green); background: var(--green-soft); }
.user-menu__panel form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }
.user-menu__who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 0.78rem; color: var(--muted); }
.user-menu__who strong { display: block; color: var(--ink); font-size: 0.92rem; }

/* ---------- Member's own design on the public page ---------- */
.custom-page { display: block; width: 100%; min-height: 70vh; border: 0; background: #fff; }
.custom-page__edit { position: fixed; right: 20px; bottom: 20px; z-index: 20; box-shadow: var(--shadow); }

/* ---------- Page designer (code editor + live preview) ---------- */
.design { padding: 22px var(--gap) 40px; max-width: 1640px; margin: 0 auto; }
.design__bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.design__bar h1 { font-size: 1.7rem; margin: 0 0 4px; }
.design__sub { margin: 0; color: var(--muted); font-size: 0.92rem; }
.design__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.design__mode-label { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.design__mode { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.design__mode input { margin: 0; }
.design__actions select { font: inherit; font-size: 0.88rem; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 260px; }
.design__status { font-size: 0.85rem; color: var(--muted); min-width: 70px; }
.design__status.is-ok { color: var(--green); font-weight: 600; }
.design__status.is-err { color: #A32D2D; font-weight: 600; }
.design__work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; height: calc(100vh - 250px); min-height: 520px; }
.design__editor, .design__preview { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: #fff; min-height: 0; }
.design__tabs, .design__preview-bar { display: flex; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--bg-soft); align-items: center; flex: none; }
.design__preview-bar { justify-content: space-between; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.design-tab, .design-device { font: inherit; font-size: 0.85rem; font-weight: 600; padding: 6px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.design-tab.is-active, .design-device.is-active { background: #fff; color: var(--green); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.design-tab--help { margin-left: auto; }
.ce { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); background: #1B221E; color: #E8EDEA; }
.ce__gutter { grid-column: 1; grid-row: 1; overflow: hidden; padding: 12px 10px 12px 0; text-align: right; color: #5F6E66; font: 13px/1.55 ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace; white-space: pre; user-select: none; border-right: 1px solid #2A3430; }
.ce__pre, .ce__ta { grid-column: 2; grid-row: 1; margin: 0; padding: 12px 16px 60px; font: 13px/1.55 ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace; white-space: pre; overflow-wrap: normal; word-break: normal; tab-size: 2; border: 0; min-width: 0; min-height: 0; }
.ce__pre { pointer-events: none; overflow: hidden; color: #E8EDEA; }
.ce__pre code { font: inherit; white-space: pre; }
.ce__ta { background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: #fff; resize: none; outline: none; overflow: auto; width: 100%; height: 100%; }
.ce__ta::selection { background: rgba(140, 208, 166, 0.3); }
.ce__ta::placeholder { color: #5F6E66; -webkit-text-fill-color: #5F6E66; }
.tk-tag { color: #8CD0A6; } .tk-attr { color: #E6C07B; } .tk-str { color: #F0A58F; } .tk-c { color: #7C8A83; font-style: italic; } .tk-p { color: #A7B3AC; }
.tk-s { color: #8CD0A6; } .tk-k { color: #9FC4F0; } .tk-num { color: #E6C07B; } .tk-ph { color: #FFD866; background: rgba(255, 216, 102, 0.12); border-radius: 3px; }
.design__help { flex: 1; overflow: auto; padding: 16px 18px; font-size: 0.9rem; }
.design__help p { margin: 0 0 12px; color: var(--muted); }
.placeholders { border-collapse: collapse; width: 100%; }
.placeholders td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.placeholders code { background: var(--bg-soft); padding: 1px 7px; border-radius: 4px; white-space: nowrap; color: var(--green-dark); }
.design__frame { flex: 1; min-height: 0; background: #E9ECE8; display: flex; justify-content: center; overflow: auto; }
#design-preview { width: 100%; height: 100%; border: 0; background: #fff; transition: width 0.2s ease; flex: none; }
.design__note { color: var(--muted); font-size: 0.85rem; margin: 12px 0 0; max-width: 110ch; }
@media (max-width: 999px) { .design__work { grid-template-columns: 1fr; height: auto; } .ce { height: 420px; } .design__frame { height: 560px; } }

/* hidden editor panes must stay hidden even though .ce is a grid */
.ce[hidden], .design__help[hidden] { display: none !important; }

.auth-card--wide { max-width: 580px; }
.auth-card__alt { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.panel--pending { border-color: #F1C27B; background: #FFF9EE; }

/* ---------- Member files (designer tab + My page panel) ---------- */
.design__files { flex: 1; overflow: auto; padding: 16px 18px; font-size: 0.9rem; }
.design__files-intro { margin: 0 0 10px; color: var(--muted); }
.design__files-intro code { background: var(--bg-soft); padding: 2px 8px; border-radius: 4px; color: var(--green-dark); }
.files-upload { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 6px; }
.files-upload input[type="file"] { font-size: 0.85rem; max-width: 100%; }
.files-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.files-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.files-table .thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--bg-mute); display: block; }
.files-table .ext { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; background: var(--bg-soft); font-size: 0.68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.files-table .name { font-weight: 600; }
.files-table .size { color: var(--muted); font-size: 0.82rem; }
.files-table code { font-size: 0.78rem; word-break: break-all; }
.files-table .row-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.me-files__url { display: inline-block; background: var(--bg-soft); padding: 3px 8px; border-radius: 4px; margin: 4px 0 8px; font-size: 0.85rem; }

/* ---------- Footer logo ---------- */
.footer-logo { display: inline-block; background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.footer-logo img { width: 240px; height: auto; display: block; }

/* Between 1200 and 1399px there is no room for the full name next to the navigation: show the short name with a large symbol. */
@media (max-width: 1399px) { .brand--full { display: none; } .brand--compact { display: inline-flex; } .brand--compact .brand__logo { height: 56px; } }
@media (max-width: 1199px) { .brand--compact .brand__logo { height: 44px; } }

.brand--footer .brand__logo { height: 64px; }
.brand--footer .brand__sub { font-size: 0.8rem; letter-spacing: 0.08em; max-width: none; }


/* Admin: publication form with the BibTeX box beside it */
.pub-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.bib-panel { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; position: sticky; top: 16px; }
.bib-panel__title { font-family: var(--font-sans); font-size: 1rem; margin: 0 0 6px; }
.bib-panel textarea { font-family: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace; font-size: 0.8rem; line-height: 1.45; min-height: 280px; }
.bib-panel .hint.is-ok { color: var(--green); font-weight: 600; }
@media (max-width: 899px) { .pub-layout { grid-template-columns: 1fr; } .bib-panel { position: static; } }

.btn[hidden] { display: none !important; }

/* E-mail addresses are pictures (no text, no mailto), so they are not harvested */
.email-pic { display: inline-flex; align-items: center; vertical-align: middle; }
.email-pic img { display: block; height: 20px; width: auto; }
.site-footer .email-pic img { height: 18px; opacity: 0.9; }
.director__links .email-pic { padding: 4px 0; }

/* The news type filter hides items with the hidden attribute; the display rules above must not override it */
.news-item[hidden], .news-year[hidden], #news-empty[hidden] { display: none !important; }
