/* Shared detail-page template extracted from experts/chunying_zhao.html. */
:root {
  --font-sans: "Avenir Next", "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  --font-display: "Avenir Next", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #18202a;
  --muted: #5f6b7a;
  --line: #e5e7eb;
  --brand: #0f3b66;
  --brand-2: #1e5a93;
  --accent: #eef6ff;
  --accent-2: #fdf3e7;
  --tag: #eef2f7;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --radius: 24px;
  --max: 1480px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  background: linear-gradient(180deg, #f8fafc 0%, #f5f7fb 100%);
  color: var(--text);
  line-height: 1.72;
}

a { color: inherit; text-decoration: none; }
section[id], [id^="profile-"] { scroll-margin-top: 96px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.86);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
  flex-wrap: nowrap;
}
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: contain;
  flex: 0 0 auto;
  background: white;
  border: 1px solid var(--line);
  padding: 4px;
}
.brand-copy { min-width: 0; }
.brand-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.brand-subtitle {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.nav {
  display: flex;
  gap: 16px;
  flex-wrap: nowrap;
  font-size: 0.95rem;
  color: var(--muted);
  flex: 0 1 auto;
}
.nav a {
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.nav a:hover { color: var(--text); }
.lang-switch {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 4px;
  flex: 0 0 auto;
}
.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  min-width: 44px;
}
.lang-btn.active {
  background: #0f172a;
  color: white;
}

.container {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

.hero {
  padding: 36px 0 20px;
}

.hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
  border: 1px solid #e8eef5;
  border-radius: 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.78fr);
  gap: 28px;
  padding: 34px;
  align-items: start;
}

.hero-main {
  grid-column: 1;
  grid-row: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}

h1 {
  margin: 18px 0 0;
  line-height: 1.05;
  letter-spacing: -0.03em;
  display: grid;
  gap: 6px;
}

.name-cn {
  font-size: clamp(42px, 4.5vw, 54px);
  font-weight: 800;
}

.name-en {
  font-size: clamp(36px, 3.9vw, 46px);
  font-weight: 760;
}

.subhead {
  font-size: 24px;
  line-height: 1.3;
  color: var(--brand);
  font-weight: 760;
  margin: 16px 0 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: #e8edf3;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.hero-photo {
  display: flex;
  grid-column: 2;
  grid-row: 1;
}

.photo-card {
  width: 100%;
  height: auto;
  background: #f7f9fc;
  border: 1px solid #dbe3ee;
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  position: sticky;
  top: 24px;
}

.photo-frame {
  width: 100%;
  aspect-ratio: 10 / 11;
  max-height: 620px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #dbe3ee;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  display: grid;
  place-items: center;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-placeholder {
  padding: 18px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
  line-height: 1.65;
}

.photo-note {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
  word-break: break-word; overflow-wrap: anywhere;
}

.side-card {
  background: #f8fbff;
  border: 1px solid #d9e3ef;
  border-radius: 24px;
  padding: 24px 22px;
}

.profile-card {
  margin-top: 22px;
}

.side-card h3 {
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--brand);
}

.side-list {
  display: grid;
  gap: 0;
}

.side-item {
  padding: 14px 0;
  border-top: 1px solid #e6edf5;
  border-bottom: none;
}

.side-item:first-child {
  border-top: none;
  padding-top: 0;
}

.side-item:last-child {
  padding-bottom: 0;
}

.side-label {
  font-size: 12px;
  color: #64748b;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.side-value {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  color: #1f2937;
}

section {
  padding: 18px 0;
}

.section-title {
  margin: 0 0 16px;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.section-subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  max-width: 920px;
  font-size: 16px;
}

.dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}
body[data-lang="zh"] .en-only { display: none !important; }
body[data-lang="en"] .cn-only { display: none !important; }
.lang-toggle-grid { grid-template-columns: 1fr; }

.lang-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  min-height: 100%;
}

.lang-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef2f7;
}

.lang-head h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.lang-badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--accent);
  color: var(--brand);
}

.lang-card p {
  margin: 0 0 16px;
  color: #334155;
  font-size: 15px;
  line-height: 1.72;
  overflow-wrap: break-word;
  word-break: normal;
}

.lang-card h2,
.lang-card h3,
.lang-card h4 {
  margin: 22px 0 10px;
  color: var(--brand);
  font-family: var(--font-display);
  line-height: 1.28;
  letter-spacing: 0;
}

.lang-card h2 { font-size: 20px; }
.lang-card h3 { font-size: 18px; }
.lang-card h4 { font-size: 16px; }

.lang-card h2:first-child,
.lang-card h3:first-child,
.lang-card h4:first-child {
  margin-top: 0;
}

.lang-card ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 12px;
  color: #334155;
}

.lang-card li {
  line-height: 1.7;
  overflow-wrap: break-word;
  word-break: normal;
}

.lang-card li strong {
  color: #111827;
  margin-right: 4px;
}

.expert-profile-toggle {
  display: none;
}

html[lang="de"] .lang-card p,
html[lang="de"] .lang-card li,
html[lang="es"] .lang-card p,
html[lang="es"] .lang-card li,
html[lang="fr"] .lang-card p,
html[lang="fr"] .lang-card li {
  hyphens: auto;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.info-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
}

.info-box h4 {
  margin: 0 0 12px;
  font-size: 17px;
  color: var(--brand);
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  padding: 9px 12px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 14px;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  border-left: 3px solid #dbeafe;
  padding-left: 14px;
}

.timeline-item strong {
  display: block;
  margin-bottom: 4px;
  color: #111827;
}

.slider-wrap {
  position: relative;
}

.review-carousel {
  position: relative;
  padding: 0 56px;
}

.slider-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: #111827;
  cursor: pointer;
  font-size: 18px;
  transition: transform .15s ease, background .15s ease;
  pointer-events: auto;
  z-index: 2;
}

.slider-btn.prev { left: 6px; }
.slider-btn.next { right: 6px; }
.slider-btn:hover { transform: translateY(calc(-50% - 1px)); background: #f8fafc; }

.review-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(340px, 42%);
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.review-track::-webkit-scrollbar { height: 10px; }
.review-track::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 999px; }

.review-card {
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  display: grid;
  gap: 18px;
  min-height: 100%;
  align-content: start;
}

.review-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.review-user {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #f1f5f9);
  display: grid;
  place-items: center;
  font-size: 18px;
}

.review-name {
  font-weight: 800;
  color: #111827;
}

.pill {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff4e6;
  color: #d97706;
  font-size: 12px;
  font-weight: 700;
}

.review-meta {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

.stars {
  color: #f59e0b;
  letter-spacing: 1px;
  font-size: 16px;
  margin-top: 2px;
}

.review-quote-cn,
.review-quote-en {
  margin: 0;
  font-size: 15px;
  color: #334155;
}

.review-quote-cn {
  margin-top: 0;
  padding-left: 0;
  text-indent: 0;
  text-align: left;
}

.review-quote-cn::first-letter {
  margin-left: 0;
}

.review-quote-en {
  color: #64748b;
  padding-top: 12px;
  border-top: 1px dashed #e5e7eb;
  font-style: italic;
}

.footer-note {
  margin: 24px 0 10px;
  padding: 18px 20px;
  border-radius: 18px;
  background: #fffdf8;
  border: 1px solid #f6e7c7;
  color: #7c5b19;
  font-size: 14px;
}

.cta {
  margin: 22px 0 42px;
  background: linear-gradient(135deg, #0f3b66 0%, #1e5a93 100%);
  color: white;
  border-radius: 30px;
  padding: 30px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: center;
  box-shadow: var(--shadow);
}

.cta h3 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
}

.cta p {
  margin: 0;
  color: rgba(255,255,255,.86);
  max-width: 760px;
}

.cta-box {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  padding: 18px;
}

.cta-box strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.cta-box ul {
  margin: 0;
  padding-left: 18px;
  color: rgba(255,255,255,.9);
}

.muted { color: var(--muted); }

@media (max-width: 1320px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.74fr);
  }
  .name-cn { font-size: clamp(38px, 4.6vw, 48px); }
  .name-en { font-size: clamp(33px, 4vw, 42px); }
  .subhead { font-size: 22px; }
  .chip { font-size: 12px; }
  .side-card h3 { font-size: 17px; }
  .side-label { font-size: 11px; }
  .side-value { font-size: 15px; }
}

@media (max-width: 1180px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-main,
  .hero-photo {
    grid-column: auto;
    grid-row: auto;
  }

  .photo-card {
    position: static;
    height: auto;
  }

  .photo-frame {
    aspect-ratio: 4 / 5;
    max-height: none;
  }

  .cta,
  .dual-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .review-track {
    grid-auto-columns: minmax(300px, 88%);
  }
}

@media (max-width: 720px) {
  .container { width: min(calc(100% - 24px), var(--max)); }
  .header-inner,
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }
  .brand-title, .brand-subtitle {
    white-space: normal;
    overflow: visible;
  }
  .hero {
    padding: 14px 0 10px;
  }
  .hero-card {
    border-radius: 22px;
  }
  .hero-inner {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-areas:
      "photo title"
      "photo subhead"
      "quick quick";
    gap: 10px 12px;
    align-items: start;
    padding: 14px;
  }
  .hero-main {
    display: contents;
  }
  .hero-photo {
    grid-area: photo;
    display: block;
    min-width: 0;
  }
  .photo-card {
    position: static;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: transparent;
    box-shadow: none;
  }
  .photo-frame {
    aspect-ratio: 4 / 5;
    max-height: none;
    border-radius: 16px;
  }
  h1 {
    grid-area: title;
    align-self: end;
    gap: 3px;
    margin: 0;
    min-width: 0;
  }
  .subhead {
    grid-area: subhead;
    min-width: 0;
  }
  .profile-card {
    grid-area: quick;
    margin-top: 2px;
  }
  .lang-card, .info-box, .review-card, .side-card { padding: 16px; }
  .review-carousel { padding: 0 44px; }
  .cta { padding: 22px; }
  .name-cn {
    font-size: clamp(27px, 8vw, 34px);
    line-height: 1.04;
    overflow-wrap: anywhere;
  }
  .name-en {
    font-size: clamp(17px, 5vw, 23px);
    line-height: 1.08;
    color: #475569;
    overflow-wrap: anywhere;
  }
  .subhead {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-top: 0;
    color: #1e3a5f;
    overflow-wrap: anywhere;
  }
  .chips {
    display: grid;
    gap: 7px;
    margin: 0 0 10px;
  }
  .chip {
    width: 100%;
    padding: 7px 9px;
    border-radius: 13px;
    font-size: 0.76rem;
    line-height: 1.34;
    overflow-wrap: anywhere;
  }
  .side-card h3 {
    font-size: 0.92rem;
    margin-bottom: 10px;
  }
  .side-list {
    gap: 8px;
  }
  .side-item {
    padding: 10px;
    border: 1px solid #e6edf5;
    border-radius: 13px;
    background: rgba(255,255,255,0.76);
  }
  .side-item:first-child {
    padding-top: 10px;
  }
  .side-item:last-child {
    padding-bottom: 10px;
  }
  .side-label { font-size: 11px; }
  .side-value {
    font-size: 0.84rem;
    line-height: 1.48;
  }
  section {
    padding: 12px 0;
  }
  .lang-card {
    border-radius: 18px;
  }
  .lang-card h2 {
    font-size: 1.02rem;
    margin: 18px 0 8px;
  }
  .lang-card h3 {
    font-size: 0.98rem;
    margin: 18px 0 8px;
  }
  .lang-card p,
  .lang-card li {
    font-size: 0.92rem;
    line-height: 1.72;
  }
  .lang-card .expert-profile-body,
  .lang-card.expert-profile-collapsed .expert-profile-body {
    max-height: none;
    overflow: visible;
  }
  .lang-card.expert-profile-collapsed .expert-profile-body::after {
    display: none;
  }
  .expert-profile-toggle {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .hero-inner {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 9px 10px;
    padding: 12px;
  }
  .name-cn {
    font-size: clamp(25px, 8vw, 31px);
  }
  .name-en {
    font-size: clamp(16px, 4.8vw, 21px);
  }
  .subhead {
    font-size: 0.84rem;
    line-height: 1.38;
  }
}
