/* ==========================================================================
   云网智能系统实验室 · Design System v2
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300..900;1,14..32,300..900&family=Noto+Sans+SC:wght@300;400;500;700;900&display=swap');

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Brand */
  --cyan:        #0891b2;
  --cyan-glow:   #22d3ee;
  --teal:        #0d9488;
  --teal-dark:   #0f766e;
  --green:       #16a34a;
  --gold:        #d97706;
  --gold-light:  #fbbf24;

  /* Text */
  --ink:      #0f172a;
  --ink-soft: #334155;
  --muted:    #64748b;
  --subtle:   #94a3b8;

  /* Surfaces */
  --panel:      #ffffff;
  --panel-soft: #f8fafc;
  --panel-blue: #f0f9ff;
  --line:       #e2e8f0;
  --line-soft:  #f1f5f9;

  /* Dark palette */
  --night:      #060f1a;
  --night-mid:  #0a1d30;
  --navy:       #0c2d44;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15,23,42,.06);
  --shadow-sm: 0 2px 8px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.04);
  --shadow:    0 4px 16px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.04);
  --shadow-md: 0 8px 28px rgba(15,23,42,.10), 0 3px 10px rgba(15,23,42,.06);
  --shadow-lg: 0 20px 60px rgba(15,23,42,.13), 0 8px 24px rgba(15,23,42,.07);

  /* Radii */
  --r-sm:  6px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Layout */
  --max: 1200px;

  /* Easing */
  --t:        .22s cubic-bezier(.4,0,.2,1);
  --t-bounce: .38s cubic-bezier(.34,1.56,.64,1);
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: 'Inter', 'Noto Sans SC', ui-sans-serif, system-ui, -apple-system,
               'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  background: #fafbfc;
  -webkit-font-smoothing: antialiased;
}

a  { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
p  { margin: 0; }

/* --------------------------------------------------------------------------
   Scroll-reveal
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .55s cubic-bezier(.25,.46,.45,.94),
              transform .55s cubic-bezier(.25,.46,.45,.94);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .08s; }
.reveal-d2 { transition-delay: .16s; }
.reveal-d3 { transition-delay: .24s; }

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 10px clamp(18px,4vw,52px);
  background: rgba(255,255,255,.90);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(15,23,42,.07);
  transition: background var(--t), box-shadow var(--t);
}

.site-header.scrolled {
  background: rgba(255,255,255,.97);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  background: linear-gradient(140deg, #0891b2 0%, #0d9488 50%, #d97706 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -.5px;
  box-shadow: 0 2px 10px rgba(8,145,178,.38);
}

.brand strong {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  transition: color var(--t), background var(--t);
  white-space: nowrap;
}

.nav a:hover {
  color: var(--ink);
  background: rgba(8,145,178,.07);
}

.nav-admin {
  border: 1px solid var(--line) !important;
}
.nav-admin:hover {
  border-color: var(--cyan) !important;
  color: var(--cyan) !important;
  background: rgba(8,145,178,.05) !important;
}

.lang-toggle {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  transition: all var(--t);
}
.lang-toggle:hover { border-color: var(--cyan); color: var(--cyan); }

.menu-button {
  display: none;
  width: 40px; height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.menu-button span {
  display: block;
  width: 16px; height: 1.5px;
  margin: 4px auto;
  background: var(--ink);
  border-radius: 2px;
  transition: all var(--t);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 13.5px;
  font-family: inherit;
  transition: all var(--t);
  white-space: nowrap;
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  box-shadow: 0 2px 10px rgba(8,145,178,.32);
}
.button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(8,145,178,.44);
}

.button.ghost {
  color: var(--ink-soft);
  border-color: var(--line);
  background: rgba(15,23,42,.03);
}
.button.ghost:hover {
  color: var(--ink);
  border-color: rgba(15,23,42,.22);
  background: rgba(15,23,42,.06);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  transition: all var(--t);
  backdrop-filter: blur(8px);
}
.icon-button:hover {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.38);
}

/* --------------------------------------------------------------------------
   Section Layout
   -------------------------------------------------------------------------- */
.section {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 88px 0;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.section-kicker::before {
  content: '';
  display: inline-block;
  width: 20px; height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--teal));
  border-radius: 2px;
  flex-shrink: 0;
}

/* alias */
.eyebrow { margin: 0 0 14px; color: var(--cyan); font-size: 11.5px;
           font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.section-heading     { max-width: 680px; }
.section-heading.wide { max-width: 860px; }

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px,3.8vw,50px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.025em;
}

.section-heading p:not(.section-kicker) {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.78;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 36px;
}

/* --------------------------------------------------------------------------
   Segmented Control
   -------------------------------------------------------------------------- */
.segmented {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}
.segmented button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  transition: all var(--t);
}
.segmented button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  box-shadow: var(--shadow-sm);
}
.segmented button:not(.active):hover {
  color: var(--ink-soft);
  background: rgba(15,23,42,.04);
}

/* --------------------------------------------------------------------------
   Hero / News Band
   -------------------------------------------------------------------------- */
.news-band {
  position: relative;
  width: 100%;
  padding: 112px max(20px, calc((100vw - var(--max)) / 2)) 64px;
  background: var(--night);
  overflow: hidden;
}

/* gradient orbs */
.news-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 10% 50%, rgba(8,145,178,.28) 0%, transparent 55%),
    radial-gradient(ellipse 55% 75% at 88% 15%, rgba(13,148,136,.22) 0%, transparent 50%),
    radial-gradient(ellipse 45% 55% at 65% 88%, rgba(217,119,6,.18) 0%, transparent 48%);
  pointer-events: none;
}

/* dot grid */
.news-band::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, black 20%, transparent 100%);
  pointer-events: none;
}

.first-section { padding-top: 112px; }

.news-inner {
  position: relative;
  z-index: 2;
}

.news-kicker {
  color: rgba(34,211,238,.85);
  margin-bottom: 24px;
}
.news-kicker::before {
  background: linear-gradient(90deg, rgba(34,211,238,.85), transparent);
}

/* editorial layout: featured left, sidebar right.
   Fixed height regardless of item count — sidebar scrolls internally. */
.news-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  height: 264px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 28px 80px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08);
}

/* featured item */
.news-featured {
  padding: 22px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid rgba(255,255,255,.08);
  transition: opacity .2s ease, transform .2s ease;
  overflow: hidden;
}
.news-featured.fading {
  opacity: 0;
  transform: translateY(10px);
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.news-meta span,
.news-meta time {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
}
.news-meta span { color: #022c22; background: rgba(20,184,166,.78); }
.news-meta time  { color: #431407; background: rgba(251,191,36,.78); }

.news-featured-title {
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 1.9vw, 27px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.news-featured-body {
  margin: 10px 0 0;
  color: rgba(255,255,255,.55);
  font-size: 13.5px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-width: 540px;
}

.news-featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 0 15px;
  height: 34px;
  border: 1px solid rgba(8,145,178,.45);
  border-radius: 9px;
  color: var(--cyan-glow);
  background: rgba(8,145,178,.1);
  font-size: 13px;
  font-weight: 700;
  width: fit-content;
  transition: all var(--t);
}
.news-featured-cta:hover {
  background: rgba(8,145,178,.22);
  border-color: rgba(8,145,178,.7);
  transform: translateX(3px);
}

/* sidebar list — scrolls internally, layout height stays fixed */
.news-sidebar {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}
.news-sidebar::-webkit-scrollbar { width: 5px; }
.news-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }

.news-side-item {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
  padding: 13px 20px 13px 16px;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.06);
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background var(--t);
  flex: 0 0 auto;
}
.news-side-item:last-child { border-bottom: none; }

/* active accent line */
.news-side-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--cyan-glow), var(--teal));
  opacity: 0;
  transition: opacity var(--t);
}
.news-side-item:hover { background: rgba(255,255,255,.04); }
.news-side-item.active { background: rgba(8,145,178,.08); }
.news-side-item.active::before { opacity: 1; }

.news-side-num {
  color: rgba(255,255,255,.2);
  font-size: 10.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .05em;
  padding-top: 3px;
  transition: color var(--t);
  font-family: 'Inter', ui-monospace, monospace;
}
.news-side-item.active .news-side-num,
.news-side-item:hover .news-side-num { color: var(--cyan-glow); }

.news-side-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}

.news-side-type {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(20,184,166,.22);
  color: rgba(94,234,212,.85);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
}

.news-side-date {
  color: rgba(255,255,255,.28);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.news-side-title {
  margin: 0;
  color: rgba(255,255,255,.55);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.52;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  transition: color var(--t);
}
.news-side-item.active .news-side-title,
.news-side-item:hover .news-side-title { color: rgba(255,255,255,.9); }

/* --------------------------------------------------------------------------
   Works / Publications
   -------------------------------------------------------------------------- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 20px;
}

.work-card,
.product-card,
.person-card,
.photo-card,
.alumni-person,
.student-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
}

.work-card {
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.work-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(8,145,178,.2);
}

.work-card-image {
  aspect-ratio: 16/9;
  background: var(--panel-soft);
  overflow: hidden;
}
.work-card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.25,.46,.45,.94);
}
.work-card:hover .work-card-image img { transform: scale(1.05); }

.work-card-body { padding: 22px 24px 26px; }

.work-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: rgba(13,148,136,.1);
  font-size: 11.5px;
  font-weight: 700;
}
.pill.gold { color: #92400e; background: rgba(217,119,6,.12); }

.work-card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.015em;
}

.work-card h4 {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
}

.work-card p { margin: 13px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.7; }

.highlight-list {
  display: grid;
  gap: 6px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.highlight-list li {
  position: relative;
  padding-left: 16px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}
.highlight-list li::before {
  content: '';
  position: absolute;
  left: 0; top: .65em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.card-links a {
  color: var(--cyan);
  font-size: 12.5px;
  font-weight: 700;
  transition: color var(--t);
}
.card-links a:hover { color: var(--teal-dark); }

/* --- Publication list --- */
.pub-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

/* year divider */
.pub-year {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 30px 0 8px;
}
.pub-list > .pub-year:first-child { margin-top: 16px; }
.pub-year strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1;
}
.pub-year span {
  color: var(--subtle);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.pub-year::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.pub-item {
  display: grid;
  grid-template-columns: 96px minmax(0,1fr) auto;
  gap: 0 16px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--t), border-radius var(--t), padding var(--t), margin var(--t);
}
.pub-item:hover {
  background: var(--panel-blue);
  margin: 0 -14px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border-bottom-color: transparent;
}

/* conference badge: conference name primary, year secondary */
.pub-badge {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}
.pub-badge span {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--teal-dark);
  background: rgba(13,148,136,.09);
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.6;
  text-transform: uppercase;
  white-space: nowrap;
}
.pub-badge strong {
  padding-left: 2px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .01em;
}

.pub-item h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -.008em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.pub-item p { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.pub-authors {
  color: var(--ink-soft) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pub-item .card-links { justify-content: flex-end; margin-top: 0; white-space: nowrap; }
.pub-item .card-links a { font-size: 12px; }

/* --------------------------------------------------------------------------
   Products Section
   -------------------------------------------------------------------------- */
.product-section { padding-top: 56px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 20px;
  margin-top: 36px;
}

.product-card {
  display: grid;
  align-content: start;
  padding: 26px;
  box-shadow: var(--shadow);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  position: relative;
  overflow: hidden;
}
.product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--teal));
  border-radius: var(--r) var(--r) 0 0;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(8,145,178,.18);
}

.product-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.product-card-top span,
.product-card-top strong {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.product-card-top span   { color: var(--teal-dark); background: rgba(13,148,136,.1); }
.product-card-top strong { color: #7c2d12;          background: rgba(217,119,6,.12); }

.product-card h3 {
  margin: 0 0 12px;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.product-card p { color: var(--muted); font-size: 13.5px; line-height: 1.72; }

/* --------------------------------------------------------------------------
   Team Section
   -------------------------------------------------------------------------- */
.team-section { background: var(--panel-soft); }

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px,1fr));
  gap: 20px;
  margin-top: 40px;
}

.person-card {
  display: grid;
  grid-template-columns: 116px 1fr;
  overflow: hidden;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  transition: transform var(--t), box-shadow var(--t);
}
.person-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.person-photo {
  background: var(--panel-soft);
  position: relative;
  overflow: hidden;
}
.person-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(8,145,178,.14) 0%, transparent 55%,
              rgba(13,148,136,.1) 100%);
  pointer-events: none;
}
.person-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.person-card:hover .person-photo img { transform: scale(1.04); }

.person-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
}
.person-body h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.person-body h3 small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}
.person-role {
  margin: 8px 0 0;
  color: var(--teal-dark);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .01em;
}
.person-body p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.person-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
  padding-top: 10px;
}
.person-links a {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
  transition: color var(--t);
}
.person-links a:hover { color: var(--teal-dark); }

/* --------------------------------------------------------------------------
   Alumni & Students
   -------------------------------------------------------------------------- */
.alumni-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px,1fr));
  gap: 14px;
  margin-top: 24px;
}

.alumni-person,
.student-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 14px;
  padding: 18px;
  box-shadow: var(--shadow-xs);
  transition: transform var(--t), box-shadow var(--t);
}
.alumni-person:hover,
.student-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.alumni-person img,
.student-card img {
  width: 100px; height: 80px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--panel-soft);
}

.alumni-person strong,
.student-card strong { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
.alumni-person span,
.student-card span   { display: block; margin-top: 4px; color: var(--teal-dark);
                       font-size: 12px; font-weight: 700; }
.alumni-person p,
.student-card p      { margin: 7px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px,1fr));
  gap: 14px;
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   Photo cards
   -------------------------------------------------------------------------- */
.photo-card {
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform var(--t), box-shadow var(--t);
}
.photo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.photo-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--panel-soft); }
.photo-card div { padding: 14px; }
.photo-card h3 { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.35; }
.photo-card p  { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Bot Widget
   -------------------------------------------------------------------------- */
.bot-widget {
  position: fixed;
  top: 92px; right: 20px;
  z-index: 90;
}

.bot-button {
  display: grid;
  place-items: center;
  width: 54px; height: 54px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4a373, #a9745b);
  box-shadow: 0 4px 20px rgba(169,116,91,.48), 0 2px 8px rgba(0,0,0,.15);
  transition: transform var(--t-bounce), box-shadow var(--t);
}
.bot-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(169,116,91,.62), 0 3px 12px rgba(0,0,0,.15);
}
.bot-button:active { transform: scale(.95); }

.capy-face {
  width: 38px;
  height: 38px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
}

/* Chat window */
.bot-window {
  position: absolute;
  top: 66px; right: 0;
  display: grid;
  grid-template-rows: auto auto minmax(200px,360px) auto;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 108px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: botSlideIn .24s cubic-bezier(.34,1.56,.64,1);
}
@keyframes botSlideIn {
  from { opacity: 0; transform: scale(.92) translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.bot-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--night), var(--navy));
}
.bot-window-header strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.bot-window-header span {
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,.5);
  font-size: 11.5px;
}
.bot-window-header .icon-button {
  width: 28px; height: 28px;
  font-size: 15px;
  flex-shrink: 0;
}

.bot-intro {
  margin: 0;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.chat-message {
  max-width: 86%;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.62;
  border: 1px solid var(--line-soft);
  background: var(--panel-soft);
  border-radius: 14px 14px 14px 4px;
}
.chat-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(8,145,178,.12), rgba(13,148,136,.09));
  border-color: rgba(8,145,178,.15);
  border-radius: 14px 14px 4px 14px;
}
.chat-message strong {
  display: block;
  margin-bottom: 4px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--teal-dark);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.chat-message.user strong { color: var(--cyan); }
.chat-message p { margin: 0; color: var(--ink-soft); }

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.chat-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  height: 40px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--panel-soft);
  transition: border-color var(--t), box-shadow var(--t);
}
.chat-form input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(8,145,178,.1);
}
.chat-form .button { min-height: 40px; padding: 0 16px; font-size: 13px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  padding: 48px clamp(20px,5vw,52px);
  background: var(--night);
  border-top: 1px solid rgba(255,255,255,.06);
}
.site-footer strong {
  display: block;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.site-footer p { margin: 6px 0 0; color: rgba(255,255,255,.42); font-size: 13px; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-end;
  align-items: center;
}
.footer-links a {
  color: var(--cyan-glow);
  font-size: 13px;
  font-weight: 600;
  transition: color var(--t);
}
.footer-links a:hover { color: var(--gold-light); }

/* --------------------------------------------------------------------------
   Admin Shell
   -------------------------------------------------------------------------- */
.admin-shell {
  min-height: 100vh;
  padding: 106px max(20px, calc((100vw - var(--max)) / 2)) 80px;
  background:
    radial-gradient(ellipse 70% 60% at 0 0, rgba(8,145,178,.07) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 100% 100%, rgba(217,119,6,.07) 0%, transparent 50%),
    #f8fafc;
}

.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}
.admin-header h1 {
  margin: 0;
  font-size: clamp(28px,4vw,44px);
  font-weight: 900;
  letter-spacing: -.03em;
}
.admin-header p { margin: 10px 0 0; color: var(--muted); line-height: 1.7; font-size: 15px; }

.admin-grid {
  display: grid;
  grid-template-columns: .78fr 1.22fr;
  gap: 18px;
  align-items: start;
}

.admin-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.admin-panel h2 {
  margin: 0;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
  background: var(--panel-soft);
}

.form { display: grid; gap: 16px; padding: 24px; }

.field { display: grid; gap: 7px; }
.field label { color: var(--ink-soft); font-size: 12.5px; font-weight: 700; letter-spacing: .01em; }
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
  font-size: 14px;
  transition: border-color var(--t), box-shadow var(--t);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(8,145,178,.1);
}
.field textarea { min-height: 88px; resize: vertical; }

.status        { min-height: 20px; color: var(--muted); font-size: 13.5px; }
.status.ok     { color: var(--teal-dark); font-weight: 600; }
.status.err    { color: #b91c1c; font-weight: 600; }

.admin-photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px,1fr));
  gap: 14px;
  padding: 24px;
}

.doc-list,
.chat-history-list { display: grid; gap: 10px; padding: 24px; }

.doc-item,
.chat-history-item {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--panel-soft);
  transition: border-color var(--t);
}
.doc-item:hover,
.chat-history-item:hover { border-color: var(--line); }

.doc-item span,
.doc-item time,
.chat-history-item time,
.chat-history-item p { color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.chat-history-item strong { color: var(--ink); font-size: 13.5px; }
.chat-history-item p { margin: 0; }

.empty-state { margin: 0; color: var(--muted); font-size: 13.5px; }

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */
.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   Responsive ≤ 980px
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .nav {
    position: absolute;
    top: 68px; left: 14px; right: 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: rgba(255,255,255,.98);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
  }
  .nav.open { display: flex; }
  .nav a { border-radius: 8px; }
  .menu-button { display: block; }

  .works-grid,
  .product-grid,
  .student-grid { grid-template-columns: repeat(2,1fr); }
  .admin-grid   { grid-template-columns: 1fr; }

  .news-layout      { grid-template-columns: 1fr; height: auto; }
  .news-sidebar     { max-height: 220px; }
  .news-featured    { padding: 32px 28px; border-right: none; border-bottom: 1px solid rgba(255,255,255,.08); }
  .news-sidebar     { flex-direction: row; overflow-x: auto; }
  .news-side-item   { flex: 0 0 220px; border-bottom: none; border-right: 1px solid rgba(255,255,255,.06); }
  .news-side-item:last-child { border-right: none; }

  .person-card { grid-template-columns: 116px 1fr; }
}

/* --------------------------------------------------------------------------
   Responsive ≤ 680px
   -------------------------------------------------------------------------- */
@media (max-width: 680px) {
  .site-header { min-height: 62px; padding: 8px 14px; }
  .brand small  { display: none; }
  .brand strong { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav { top: 62px; }

  .section       { padding-top: 60px; padding-bottom: 60px; }
  .news-band     { padding-top: 88px; padding-bottom: 40px; }
  .first-section { padding-top: 88px; }
  .news-sidebar  { flex-direction: column; overflow-x: unset; }
  .news-side-item { flex: unset; border-right: none; border-bottom: 1px solid rgba(255,255,255,.06); }
  .news-featured { padding: 28px 22px; }

  .section-title-row { flex-direction: column; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }

  .works-grid,
  .product-grid,
  .student-grid { grid-template-columns: 1fr; }

  .pub-item  { grid-template-columns: 1fr; gap: 6px; align-items: start; }
  .pub-badge { flex-direction: row; align-items: center; gap: 8px; }
  .pub-item .card-links { justify-content: flex-start; }

  .bot-widget { top: 78px; right: 12px; }
  .bot-window {
    position: fixed;
    top: 126px; left: 12px; right: 12px;
    width: auto;
    max-height: calc(100vh - 146px);
  }
  .chat-form { grid-template-columns: 1fr; }

  .person-card { grid-template-columns: 116px 1fr; }
  .person-photo { max-height: 160px; }

  .alumni-person,
  .student-card { grid-template-columns: 84px 1fr; }
  .alumni-person img,
  .student-card img { width: 84px; height: 76px; }

  .team-grid { grid-template-columns: 1fr; }

  .site-footer,
  .admin-header  { flex-direction: column; }
  .footer-links  { justify-content: flex-start; }
}

/* --------------------------------------------------------------------------
   Admin · WYSIWYG editing
   -------------------------------------------------------------------------- */
body[data-admin] { padding-bottom: 76px; }

.admin-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  padding: 8px clamp(16px,4vw,40px);
  background: rgba(6,15,26,.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 -8px 32px rgba(0,0,0,.28);
}
.admin-bar .status { margin: 0; color: rgba(255,255,255,.55); flex: 1; text-align: right; }
.admin-bar .status.ok  { color: var(--cyan-glow); }
.admin-bar .status.err { color: #fca5a5; }

.admin-bar-login {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-bar-login strong { color: #fff; font-size: 13.5px; white-space: nowrap; }
.admin-bar-login input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  width: 150px;
}
.admin-bar-login input::placeholder { color: rgba(255,255,255,.4); }
.admin-bar-login input:focus { outline: none; border-color: var(--cyan-glow); }
.admin-bar-login .button { min-height: 38px; }

.admin-bar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-bar-tools .button.ghost {
  min-height: 36px;
  padding: 0 14px;
  color: rgba(255,255,255,.82);
  border-color: rgba(255,255,255,.2);
  background: rgba(255,255,255,.06);
  font-size: 12.5px;
}
.admin-bar-tools .button.ghost:hover {
  color: #fff;
  border-color: var(--cyan-glow);
  background: rgba(34,211,238,.12);
}
.admin-bar-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  color: #022c22;
  background: var(--cyan-glow);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

/* edit affordances */
.has-edit { position: relative; }
.edit-btn {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  padding: 0;
  border: none;
  border-radius: 50%;
  color: #fff;
  background: rgba(8,145,178,.92);
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(8,145,178,.5);
  opacity: 0;
  transition: opacity var(--t), transform var(--t);
}
.has-edit:hover > .edit-btn { opacity: 1; }
.edit-btn:hover { transform: scale(1.12); background: var(--cyan); }

.add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 16px;
  border: 1.5px dashed rgba(8,145,178,.55);
  border-radius: 10px;
  color: var(--cyan);
  background: rgba(8,145,178,.05);
  font-size: 13px;
  font-weight: 700;
  transition: all var(--t);
}
.add-btn:hover { background: rgba(8,145,178,.12); border-style: solid; }
.news-inner > .add-btn {
  position: absolute;
  top: 0; right: 0;
  border-color: rgba(34,211,238,.55);
  color: var(--cyan-glow);
  background: rgba(34,211,238,.08);
}
.news-layout > .edit-btn { opacity: 1; top: 12px; right: 12px; }
.product-grid > .add-btn,
.team-grid > .add-btn,
.alumni-people > .add-btn,
.student-grid > .add-btn { min-height: 72px; }

/* edit modal */
.edit-modal { position: fixed; inset: 0; z-index: 200; }
.edit-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6,15,26,.62);
  backdrop-filter: blur(4px);
}
.edit-modal-panel {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(680px, calc(100vw - 32px));
  max-height: min(82vh, 860px);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: botSlideIn .22s cubic-bezier(.34,1.56,.64,1);
}
.edit-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: linear-gradient(135deg, var(--night), var(--navy));
}
.edit-modal-head strong { color: #fff; font-size: 15px; }
.edit-modal-form {
  display: grid;
  gap: 14px;
  padding: 20px 22px;
  overflow-y: auto;
}
.edit-field { display: grid; gap: 6px; }
.edit-field > span {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
}
.edit-field > span em {
  margin-left: 6px;
  color: var(--gold);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}
.edit-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-soft);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  resize: vertical;
}
.edit-field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(8,145,178,.1);
  background: #fff;
}
.edit-modal-status { min-height: 18px; margin: 0; color: #b91c1c; font-size: 13px; }
.edit-modal-actions { display: flex; align-items: center; gap: 10px; }
.edit-modal-actions-gap { flex: 1; }
.button.danger {
  color: #b91c1c;
  border-color: rgba(185,28,28,.3);
  background: rgba(185,28,28,.06);
}
.button.danger:hover { background: rgba(185,28,28,.12); border-color: rgba(185,28,28,.5); }

/* admin drawer */
.admin-drawer {
  position: fixed;
  left: 0; right: 0; bottom: 60px;
  z-index: 110;
  max-height: 62vh;
  overflow-y: auto;
  padding: 24px clamp(16px,4vw,40px);
  background: rgba(248,250,252,.98);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -16px 48px rgba(15,23,42,.18);
}
.admin-drawer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: var(--max);
  margin: 0 auto;
}
.admin-drawer-panel {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.admin-drawer-panel h2 {
  margin: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel-soft);
  font-size: 14px;
  font-weight: 800;
}
.admin-drawer-panel .form { padding: 18px; gap: 12px; }
.admin-drawer-panel .admin-photo-list,
.admin-drawer-panel .doc-list,
.admin-drawer-panel .chat-history-list { padding: 0 18px 18px; max-height: 300px; overflow-y: auto; }

@media (max-width: 980px) {
  .admin-drawer-grid { grid-template-columns: 1fr; }
  .admin-bar { flex-wrap: wrap; }
  .admin-bar .status { flex-basis: 100%; text-align: left; }
  body[data-admin] { padding-bottom: 110px; }
}
