/* ========== 全站统一主题变量 ========== */
:root {
  --bg: #f5f5f7;
  --content-width: 1120px;
  --header-offset: 96px;

  --primary: #660874;            /* 顶部蓝色，保持现有风格 */
  --primary-soft: #e4edf9;
  --card-bg: #ffffff;

  --text-main: #111827;
  --text-sub: #6b7280;

  --border-soft: #e5e7eb;
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
  --radius-card: 12px;
}

/* 全局盒模型 & 基础排版 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 链接默认不带下划线，颜色随文字 */
a {
  color: inherit;
  text-decoration: none;
}

/* ========== 顶部 Banner / 导航（所有页面共用） ========== */

.banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 32px;
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

.logo a {
  display: inline-flex;
  align-items: center;
  gap: 8px;                 /* 图和文字的间距 */
  text-decoration: none;
  color: #ffffff;
  font-size: 22px;
  font-weight: bold;
}

.logo img {
  height: 50px;            /* 根据你 logo 比例微调 */
  width: auto;             /* 让宽度跟着比例走 */
  display: block;
}

/* 顶部导航 */
.nav ul {
  list-style: none;
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 0;
}

.nav li {
  margin: 0;
  padding: 0;
}

.nav a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: #ffffff;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.nav a.active {
  background: #ffffff;
  color: var(--primary);
}

/* ========== 页面主体布局（所有页面共用） ========== */

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--content-width);
  margin: 24px auto 40px;
  padding: 0 24px;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: 2rem;
  font-weight: 600;
}

h2 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.people-page h2 {
  font-size: 1.6rem;
  font-weight: 650;
}

p {
  margin: 0 0 0.8rem;
  font-size: 0.98rem;
  line-height: 1.7;
}

ul {
  margin: 0.25rem 0 0.9rem;
  padding-left: 1.2rem;
}

li {
  font-size: 0.96rem;
  line-height: 1.6;
}

/* 可以给 section 标题下面一点细线（可选） */
/*
h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin-top: 4px;
  background: var(--primary-soft);
}
*/

/* ========== People 页面统一卡片风格 ========== */

/* 名字 + 图标在一行 */
.person-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* 头部行中的名字，不要太大 margin */
.person-name {
  font-weight: 600;
  margin-top: 0;        /* 之前如果是 8px，可以去掉 */
}

/* 放在 header 里时，图标行不要再有额外的上边距 */
.person-links {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* People 页面相关样式 */
.people-container {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  align-items: start;
}

.alumni-container {
  display: block;
}

.alumni-section {
  margin-bottom: 24px;
}

.alumni-section > h3 {
  margin: 0 0 12px 0;
}

.alumni-section .people-container {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alumni-card {
  width: 100%;
  cursor: pointer;
  padding: 14px 16px;
}

.alumni-no-drawer {
  cursor: default;
}

.alumni-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.alumni-card-text {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.alumni-card .person-name {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.alumni-role,
.alumni-position {
  color: #4b5563;
  font-size: 14px;
}

.alumni-details {
  color: #374151;
  font-size: 14px;
  display: inline;
}

.alumni-links {
  margin-left: auto;
}

.alumni-links .icon-link {
  display: inline-flex;
}

.alumni-card .person-links {
  margin-top: 0;
}

.alumni-drawer .person-drawer-inner {
  gap: 16px;
}

.alumni-drawer-top {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: start;
}

.alumni-drawer-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alumni-container .person-drawer-row {
  grid-column: 1 / -1;
  width: 100%;
}

.alumni-drawer-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.alumni-drawer-photo .person-photo {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
}

.alumni-drawer-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alumni-drawer-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alumni-drawer-right .person-drawer-section {
  margin: 0;
}

.alumni-pubs {
  border-top: 1px solid var(--border-soft);
  padding-top: 10px;
}

/* 通用卡片样式 */
.person-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
  position: relative;
}

/* 点击头像后展开的抽屉区域 */
.person-drawer {
  width: 100%;
  box-sizing: border-box;
  margin-top: 10px;
  background: transparent;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--border-soft);
  box-shadow: none;
  padding: 12px 0 6px;
}

.person-drawer-row {
  grid-column: 1 / -1;
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 16px 20px;
}

.person-drawer-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}


/* 头部：头像 + 文本一体化 */
.person-drawer-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.person-drawer-header.inline {
  justify-content: space-between;
  gap: 8px;
}

.person-drawer-avatar-wrap {
  flex-shrink: 0;
}

.person-drawer-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.person-drawer-header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.person-drawer-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.person-drawer-position {
  margin: 0;
  font-size: 14px;
  color: var(--text-sub);
}

.person-drawer-section + .person-drawer-section {
  margin-top: 12px;
}

.person-drawer-section-title {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-main);
}

.person-drawer-text {
  font-size: 14px;
  line-height: 1;
  white-space: pre-wrap;
  color: var(--text-sub);
}

.person-drawer-pubs {
  font-size: 14px;
  line-height: 1;
}

.person-drawer .pub-list {
  gap: 6px;
}

.person-drawer .pub-item {
  padding: 6px 0;
  border: none;
  box-shadow: none;
  background: transparent;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1;
}

.person-drawer .pub-index {
  min-width: 34px;
  font-size: 14px;
  line-height: 1;
}

.person-drawer .section-title {
  font-size: 15px;
  margin: 6px 0 6px;
  font-weight: 600;
}

.person-drawer .pub-text {
  font-size: 14px;
  line-height: 1;
}

/* 抽屉展开时，高亮卡片边框 */
.person-card.is-open {
  border-color: var(--primary);
  box-shadow: var(--shadow-soft);
}

/* 头像按钮：去掉 button 默认样式 */
.person-photo-button {
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  cursor: pointer;
  display: block;
  width: 100%;
}

/* 非 PI 基本信息区域 */
.person-basic {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.person-position {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.person-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

/* 利用已有的 icon 样式 */
.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-image {
  width: 18px;
  height: 18px;
} 





/* 统一头像显示尺寸，和 card 宽度解耦 */
.person-photo {
  width: 230px;          /* 或者你原来喜欢的宽度，比如 230 */
  height: 307px;         /* 约 3:4 比例，对应 450x600 的缩放 */
  object-fit: cover;
  border-radius: 6px;
  background: #ddd;
  display: block;
  margin: 0 auto;        /* 水平居中，不占满整个 card */
  max-width: 100%;
}

/* ========== Chip Gallery ========== */

.chip-gallery {
  margin-top: 24px;
}

.chip-gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

.chip-gallery-card {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
  border-radius: 14px;
  background: #dfe3ea;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  height: 220px;
  width: 220px;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.chip-gallery-card-link {
  color: inherit;
  text-decoration: none;
}

.chip-gallery-card-link:focus-visible {
  outline: 3px solid rgba(102, 8, 116, 0.45);
  outline-offset: 3px;
}

.chip-gallery-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.chip-gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(17, 24, 39, 0.84), rgba(17, 24, 39, 0.1) 52%, rgba(17, 24, 39, 0));
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.chip-gallery-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  margin: 0;
  color: #ffffff;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 1;
}

.chip-gallery-caption-title {
  font-size: 0.98rem;
  font-weight: 600;
}

.chip-gallery-caption-name,
.chip-gallery-caption-process {
  font-size: 0.88rem;
  font-weight: 500;
}

.chip-gallery-card:hover::after,
.chip-gallery-card:focus-within::after {
  opacity: 1;
}

.chip-gallery-card:hover .chip-gallery-image,
.chip-gallery-card:focus-within .chip-gallery-image {
  transform: scale(1.03);
  filter: brightness(0.78);
}

.chip-gallery-card:hover .chip-gallery-caption,
.chip-gallery-card:focus-within .chip-gallery-caption {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 720px) {
  .chip-gallery-grid {
    gap: 16px;
  }

  .chip-gallery-card {
    max-width: 100%;
    height: 190px;
  }
}

@media (max-width: 1100px) and (min-width: 721px) {
  .chip-gallery-card {
    max-width: 100%;
  }
}

.person-name {
  font-weight: 600;
  margin-top: 8px;
}

.person-position {
  font-size: 14px;
  line-height: 1.2;
  color: var(--text-sub);
  margin-top: 2px;
}

.person-intro {
  font-size: 14px;
  line-height: 1.2;
  margin-top: 6px;
  white-space: pre-wrap;
  color: var(--text-sub);
}

/* 邮箱 / Scholar 图标行 */
.person-links {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.person-drawer-header .person-links {
  margin-top: 0;
}

.pi-see-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 0;
  border: none;
  background: none;
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
}

.pi-see-more-icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.pi-card .pi-extra {
  display: none;
  margin-top: 12px;
  border-top: 1px solid var(--border-soft);
  padding-top: 12px;
  width: 100%;
}

.pi-card.pi-expanded .pi-extra {
  display: block;
}

.pi-card.pi-expanded .pi-see-more-icon {
  transform: rotate(180deg);
}

.pi-extra-section {
  margin-bottom: 10px;
}

.pi-extra-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.pi-extra-text {
  font-size: 14px;
  line-height: 1.2;
  white-space: pre-wrap;
  color: var(--text-sub);
}

.pi-extra-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pi-extra-item {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  line-height: 1;
  position: relative;
  padding-left: 14px;
  width: 100%;
  font-size: 14px;
  color: var(--text-sub);
}

.pi-extra-main {
  flex: 1;
  min-width: 0;
}

.pi-extra-year {
  flex-shrink: 0;
  color: #6b7280;
  margin-left: auto;
  text-align: right;
}

.pi-extra-item::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #111827;
  line-height: 1.5;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background-color: #f3f4f6;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.icon-link:hover {
  background-color: #e5e7eb;
  transform: translateY(-1px);
}

.icon-image {
  width: 16px;
  height: 16px;
  display: block;
}

/* PI 特殊布局：图片左，文字右 */
#pi-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 24px;
}

#pi-container .person-card.pi-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

.pi-card-top {
  display: flex;
  gap: 20px;
  width: 100%;
}

.pi-photo-wrap {
  flex: 0 0 auto;
}

.pi-photo-wrap .person-photo {
  width: 225px;   /* 显示约 225x300，配合源文件 450x600 更清晰 */
  height: 300px;
}

.pi-info {
  flex: 1;
  padding-left: 20px;
}

/* 非 PI：大屏每行最多五个 */
.people-container:not(#pi-container) .person-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ========== Join us 页面 ========== */
.join-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.join-card {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  white-space: pre-line; /* 保留换行，便于直接放入 TXT 内容 */
}

/* ========== Footer ========== */
.site-footer {
  margin-top: 48px;
  padding: 18px 24px;
  background: rgb(102, 8, 116);
  color: #ffffff;
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  font-size: 0.95rem;
  white-space: nowrap;
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.footer-divider {
  opacity: 0.6;
}

.footer-links a {
  color: #e5e7eb;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration-color: #ffffff;
}

@media (max-width: 1099px) and (min-width: 768px) {
  .people-container:not(#pi-container) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) and (min-width: 520px) {
  .people-container:not(#pi-container) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 519px) {
  .people-container:not(#pi-container) {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* ========== 小屏幕适配 ========== */

@media (max-width: 768px) {
  .banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .footer-inner {
    justify-content: center;
    align-items: center;
    gap: 8px;
  }

  main {
    padding: 16px 16px 32px;
    margin-top: 16px;
  }

  .person-card {
    width: 100%;
    max-width: 360px;
  }
}

/* ========== Wiki 页面 ========== */
.wiki-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.wiki-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.wiki-sidebar {
  position: sticky;
  top: var(--header-offset);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - var(--header-offset) - 24px);
  overflow: auto;
}

.wiki-hero,
.wiki-card,
.wiki-article,
.wiki-callout {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

.wiki-hero {
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(102, 8, 116, 0.08), rgba(102, 8, 116, 0.02)),
    #ffffff;
}

.wiki-eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
}

.wiki-hero p,
.wiki-card p,
.wiki-article p,
.wiki-article li {
  color: #374151;
}

.wiki-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.wiki-card {
  padding: 20px;
}

.wiki-card h2,
.wiki-card h3 {
  margin-top: 0;
}

.wiki-link {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  color: var(--primary);
  font-weight: 600;
}

.wiki-link:hover {
  text-decoration: underline;
}

.wiki-meta {
  color: var(--text-sub);
  font-size: 0.92rem;
}

.wiki-article > .wiki-meta {
  margin-bottom: 16px;
}

.wiki-article {
  padding: 28px;
}

.wiki-article h1 {
  margin-bottom: 0.5rem;
}

.wiki-article h2 {
  margin-top: 2rem;
}

.wiki-article h3 {
  margin-top: 1.25rem;
  font-size: 1.05rem;
}

.wiki-article ol {
  margin: 0.25rem 0 1rem;
  padding-left: 1.3rem;
}

.wiki-article li + li {
  margin-top: 0.55rem;
}

.wiki-article pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: 10px;
  background: #111827;
  color: #f9fafb;
  font-size: 0.9rem;
  line-height: 1.6;
}

.wiki-article code {
  font-family: "SFMono-Regular", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

.wiki-article :not(pre) > code {
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  background: #f3f4f6;
  color: #111827;
}

.wiki-callout {
  padding: 16px 18px;
  border-left: 4px solid var(--primary);
}

.wiki-callout strong {
  color: var(--primary);
}

.wiki-image {
  max-width: 920px;
  margin: 18px auto 24px;
}

.wiki-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.wiki-image figcaption {
  margin-top: 8px;
  color: var(--text-sub);
  font-size: 0.92rem;
}

.wiki-backlink {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--primary);
  font-weight: 600;
}

.wiki-backlink:hover {
  text-decoration: underline;
}

.wiki-toc {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.wiki-toc-title {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wiki-toc-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.wiki-toc-item + .wiki-toc-item {
  margin-top: 0.3rem;
}

.wiki-toc-link {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: baseline;
}

.wiki-toc-number {
  color: var(--primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.wiki-toc-label {
  min-width: 0;
}

.wiki-toc a {
  color: var(--text-sub);
}

.wiki-toc a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.wiki-timeline {
  margin: 0 0 24px;
}

.wiki-sidebar .wiki-timeline {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.wiki-timeline-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.wiki-timeline-latest,
.wiki-timeline-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.wiki-timeline-latest {
  flex: 1;
}

.wiki-timeline-item {
  padding: 16px 18px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.wiki-timeline-item.is-inline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border-bottom: 1px solid var(--border-soft);
}

.wiki-timeline-date {
  color: var(--text-sub);
  font-size: 0.9rem;
}

.wiki-timeline-author {
  color: var(--text-sub);
  font-weight: 400;
  margin-bottom: 4px;
}

.wiki-timeline-separator {
  color: var(--text-sub);
}

.wiki-timeline-inline-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wiki-timeline-item.is-inline .wiki-timeline-author {
  margin-bottom: 0;
}

.wiki-timeline-subject,
.wiki-timeline-commit {
  color: #4b5563;
  font-size: 0.94rem;
}

.wiki-timeline-item.is-inline .wiki-timeline-subject {
  width: 100%;
}

.wiki-timeline-commit {
  margin-top: 8px;
}

.wiki-timeline-more {
  display: block;
}

.wiki-timeline-more summary {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  cursor: pointer;
  list-style: none;
}

.wiki-timeline-more summary::-webkit-details-marker {
  display: none;
}

.wiki-timeline-toggle {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--primary);
  line-height: 1;
  margin-top: 1px;
}

.wiki-timeline-toggle::before {
  content: "▸";
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

.wiki-timeline-more[open] summary {
  margin-bottom: 8px;
}

.wiki-timeline-more[open] .wiki-timeline-toggle::before {
  content: "▾";
}

.wiki-timeline-history {
  padding-left: 30px;
}

.protected-content {
  margin: 18px 0 24px;
}

.protected-content-shell {
  padding: 16px 18px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.protected-content-label {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.protected-content-help,
.protected-content-status {
  margin: 0;
  color: var(--text-sub);
}

.protected-content-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.protected-content-input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text-main);
}

.protected-content-button {
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.protected-content-button:disabled,
.protected-content-input:disabled {
  opacity: 0.7;
  cursor: wait;
}

.protected-content-status {
  margin-top: 10px;
  font-size: 0.92rem;
}

.protected-content-output {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.protected-content-output p:last-child {
  margin-bottom: 0;
}

.protected-content-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  color: var(--text-main);
}

@media (max-width: 768px) {
  .wiki-layout {
    display: flex;
    flex-direction: column;
  }

  .wiki-sidebar {
    position: static;
    order: -1;
    max-height: none;
    overflow: visible;
  }

  .wiki-toc {
    position: static;
    max-height: none;
    overflow: visible;
    margin: 0 0 12px;
  }

  .wiki-hero,
  .wiki-card,
  .wiki-article,
  .wiki-callout {
    padding: 18px;
  }

  .wiki-timeline-item.is-inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .wiki-timeline-item.is-inline .wiki-timeline-separator {
    display: none;
  }

  .wiki-timeline-history {
    padding-left: 0;
  }

  .wiki-timeline-row {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 1040px) and (min-width: 769px) {
  .wiki-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
}
