/* 机构详情弹窗公共样式：由 organization.js 自动加载，供各页面共用。 */
/* 遮罩至少覆盖整页，并随弹窗内容自然增高，避免固定高度截断长内容。 */
.organization-modal { position: absolute; z-index: 100; top: 0; left: 0; width: 1920px; min-height: 100%; padding: 120px 60px 255px; overflow-y: auto; background: rgba(0, 0, 0, .5); }
.organization-modal[hidden] { display: none; }
/* 内容面板不设最小高度，由实际资料撑开，短内容仅保留底部正常内边距。 */
.organization-modal-panel { position: relative; width: 1800px; margin: 0 auto; padding: 40px 180px 80px; overflow: hidden; background: #fff; border-radius: 8px; }
.organization-modal-panel::before { position: absolute; top: 120px; right: 0; left: 0; height: 4px; content: ""; background: var(--blue); }
.organization-modal-header { height: 84px; margin: 0 -100px; padding: 0 80px; display: flex; align-items: flex-start; justify-content: space-between; }
.organization-modal-header h2 { margin: 0; color: var(--text); font-size: 24px; font-weight: 600; line-height: 34px; }
.organization-modal-close { width: 30px; height: 30px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.organization-modal-close img { width: 30px; height: 30px; }
.organization-modal-body { position: relative; margin-top: 40px; }
.organization-modal-body::before { position: absolute; z-index: 0; top: 224px; left: 99px; width: 1px; height: var(--directions-line-height, 1060px); content: ""; background: var(--blue); }
.organization-modal-intro { position: relative; z-index: 1; min-height: 366px; padding-left: 159px; }
.organization-modal-intro::before { position: absolute; top: 106px; left: 40px; width: 1px; height: 60px; content: ""; background: var(--blue); }
.organization-modal-symbol { position: absolute; top: 0; left: 0; width: 120px; height: 106px; }
.organization-modal-folder { position: absolute; top: 0; left: 0; width: 120px; height: 106px; }
.organization-modal-decoration { position: absolute; top: 176px; left: 40px; width: 60px; height: 68px; }
.organization-modal-name { height: 106px; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.organization-modal-name strong { color: var(--text); font-size: 24px; font-weight: 600; line-height: 34px; }
.organization-modal-name span { padding-left: 20px; color: var(--muted); font-size: 20px; line-height: 28px; border-left: 1px solid var(--line); }
.organization-modal-summary { margin: 34px 0 0; color: var(--text); font-size: 18px; line-height: 30px; }
.organization-modal-directions { margin-top: 40px; }
.organization-modal-directions > h3, .organization-modal-gallery > h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.organization-direction-list { display: grid; gap: 40px; margin-left: 100px; }
.organization-direction-list article { position: relative; padding-left: 59px; }
.organization-direction-list article::before { position: absolute; top: 9px; left: 0; width: 40px; height: 13px; content: ""; background: url("../images/organization-modal-bullet.svg") center / 40px 13px no-repeat; }
.organization-direction-list article::after { display: none; }
.organization-direction-list h4 { margin: 0; color: var(--text); font-size: 20px; font-weight: 600; line-height: 30px; }
.organization-direction-list h4::after { display: block; width: 600px; height: 4px; margin-top: 20px; margin-bottom: 20px; content: ""; background: var(--blue); }
.organization-direction-list p { margin: 0; color: var(--text); font-size: 18px; line-height: 30px; }
.organization-modal-gallery { margin-top: 106px; }
.organization-image-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; }
.organization-image-list figure { min-width: 0; height: 390px; margin: 0; padding: 20px 20px 16px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; border: 1px solid #f0f0f0; background: #fff; }
/* 桌面端只有一张图时横跨两列居中，保留原有单张卡片宽度。 */
html.is-pc .organization-image-list figure:only-child { grid-column: 1 / -1; width: calc((100% - 40px) / 2); justify-self: center; }
.organization-image-list img { width: 100%; height: 300px; object-fit: contain; }
.organization-image-list figcaption { max-width: 100%; color: var(--text); font-size: 18px; line-height: 30px; text-align: center; }
/* 办公联系模块补充外层边框，与 Figma 设计中的模块边界保持一致。 */
.organization-modal-contacts { margin-top: 108px; padding: 0 60px; display: grid; grid-template-columns: 144px 1fr; min-height: 280px; align-items: center; background: #f7f8f9; border: 1px solid #165C91; }
.organization-modal-contacts h3 { margin: 0; color: var(--text); font-size: 20px; font-weight: 400; line-height: 28px; }
.organization-contact-list { border-left: 4px solid var(--blue); }
.organization-contact-list article { min-height: 84px; padding: 0 0 0 60px; display: grid; grid-template-columns: 80px 300px 1fr; gap: 0; align-items: center; border-bottom: 1px solid var(--line); }
.organization-contact-list article:last-child { border-bottom: 0; }
.organization-contact-list strong { font-size: 18px; font-weight: 400; }
.organization-contact-list span { padding-left: 20px; font-size: 16px; line-height: 25px; border-left: 1px solid var(--line); }
.organization-contact-list span:last-child { border-left: 0; }
body.organization-modal-open { overflow-x: hidden; }

/* 行政办公保留地点栏和联系人表格，面板随折叠内容自动增减高度。 */
.organization-modal.is-admin .organization-modal-body::before { display: none; }
.organization-modal.is-admin .organization-modal-intro::before { display: none; }
.organization-modal.is-admin .organization-modal-intro { min-height: 106px; }
.organization-modal.is-admin .organization-modal-name { border-bottom: 0; }
.organization-modal.is-admin .organization-modal-name span,
.organization-modal.is-admin .organization-modal-decoration { display: none; }
.organization-modal.is-admin .organization-modal-summary { display: none; }
.organization-admin-content { margin-top: 40px; }
.organization-admin-location + .organization-admin-location { margin-top: 40px; }
.organization-admin-location-toggle { width: 100%; height: 60px; padding: 0 40px; display: grid; grid-template-columns: 120px 1fr 20px; align-items: center; color: #fff; text-align: left; background: var(--blue); border: 0; cursor: pointer; }
.organization-admin-location-toggle span { height: 20px; line-height: 20px; border-right: 1px solid rgba(255, 255, 255, .8); }
.organization-admin-location-toggle strong { padding-left: 40px; font-size: 16px; font-weight: 400; line-height: 24px; }
.organization-admin-location-toggle::after { width: 9px; height: 9px; margin-left: auto; content: ""; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg) translateY(-3px); transition: transform .2s ease; }
.organization-admin-location-toggle[aria-expanded="true"]::after { transform: rotate(225deg) translate(-1px, -1px); }
.organization-admin-location-details { padding-top: 20px; }
/* 公共邮箱与办公表格左侧对齐，长邮箱可自然换行。 */
.organization-admin-location-email { margin: 0 0 16px 240px; font-size: 16px; line-height: 25px; overflow-wrap: anywhere; }
.organization-admin-contact-table { width: 1200px; margin-left: 240px; border-collapse: collapse; table-layout: fixed; color: var(--text); font-size: 16px; line-height: 25px; }
.organization-admin-contact-table thead { height: 49px; border-bottom: 4px solid var(--blue); }
.organization-admin-contact-table th { padding: 0 40px; font-weight: 400; text-align: left; vertical-align: middle; }
.organization-admin-contact-table td { padding: 0 40px; height: 50px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.organization-admin-contact-table th:nth-child(1), .organization-admin-contact-table td:nth-child(1) { width: 160px; }
.organization-admin-contact-table th:nth-child(2), .organization-admin-contact-table td:nth-child(2) { width: 200px; }
.organization-admin-contact-table th:nth-child(3), .organization-admin-contact-table td:nth-child(3) { width: 260px; }
.organization-admin-contact-table th:nth-child(4), .organization-admin-contact-table td:nth-child(4) { width: 580px; }
.organization-admin-contact-table td:nth-child(-n+3) { white-space: nowrap; }
.organization-admin-contact-table tbody tr:first-child td { height: 80px; }
.organization-admin-contact-table tbody tr:not(:first-child) td { height: 70px; padding-top: 20px; padding-bottom: 0; }
/* 名单弹窗沿用文件夹图标与标题，移除教学简介的装饰线及预留高度。 */
.organization-modal.is-members .organization-modal-header { padding: 0; }
.organization-modal.is-members .organization-modal-body::before,
.organization-modal.is-members .organization-modal-intro::before,
.organization-modal.is-members .organization-modal-decoration { display: none; }
.organization-modal.is-members .organization-modal-intro { min-height: 106px; }
.organization-modal.is-members .organization-modal-name { border-bottom: 0; }
/* Figma 名单顶线距机构标题区 40px；职务左缩进 100px，姓名从第 300px 起排列。 */
.organization-member-table { width: 100%; margin-top: 40px; border-collapse: collapse; table-layout: fixed; border-top: 4px solid var(--blue); font-size: 18px; line-height: 25px; }
.organization-member-table[hidden] { display: none; }
.organization-member-table th, .organization-member-table td { padding: 38px 0 36px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.organization-member-table th { width: 300px; padding-left: 100px; font-weight: 600; }
/* 同职务人员保持原表顺序，姓名间隔按设计排列，空间不足时自然换行。 */
.organization-member-names { display: flex; flex-wrap: wrap; gap: 40px 93px; }
.organization-member-names span, .organization-member-names a { min-width: 54px; white-space: nowrap; }
/* 有个人主页的姓名使用学院蓝色，保持原来的字号、间距和换行布局。 */
.organization-member-names a { color: var(--blue); }
.organization-member-names a:hover, .organization-member-names a:focus-visible { text-decoration: underline; }
/* 显式覆盖模块的 display 声明，确保无官网资料的区块及英文名称真正隐藏。 */
.organization-modal .organization-modal-directions[hidden],
.organization-modal .organization-modal-gallery[hidden],
.organization-modal .organization-modal-contacts[hidden],
.organization-modal .organization-modal-name span[hidden] { display: none; }

/* 手机端将弹窗内容改为单列，长文本和图片按阅读顺序自然展开。 */
html.is-mobile .organization-modal { width: 390px; padding: 16px; }
html.is-mobile .organization-modal-panel { width: 358px; min-height: 0; padding: 24px 16px 40px; border-radius: 8px; }
html.is-mobile .organization-modal-panel::before { top: 72px; }
html.is-mobile .organization-modal-header { height: 48px; margin: 0; padding: 0; }
html.is-mobile .organization-modal-header h2 { font-size: 20px; line-height: 30px; }
html.is-mobile .organization-modal-close, html.is-mobile .organization-modal-close img { width: 24px; height: 24px; }
html.is-mobile .organization-modal-body { margin-top: 28px; }
/* 移动端取消内容区与简介区的竖向装饰线，避免挤占正文空间。 */
html.is-mobile .organization-modal-body::before,
html.is-mobile .organization-modal-intro::before { display: none; }
html.is-mobile .organization-modal-intro { min-height: 0; padding: 0; }
/* 手机端图标独立占位，避免装饰图与机构名称重叠。 */
html.is-mobile .organization-modal-symbol { position: relative; top: auto; left: auto; width: 100px; height: 160px; margin-bottom: 0; }
html.is-mobile .organization-modal-folder { width: 100px; height: 88px; }
html.is-mobile .organization-modal-decoration { top: 100px; left: 32px; width: 50px; height: 57px; }
html.is-mobile .organization-modal-name { height: auto; min-height: 72px; display: block; padding: 14px 0; }
/* 手机端标题缩小并保持单行，确保“材料学系”等名称完整显示。 */
/* 科研平台全称较长，手机端允许换行，避免新增机构名称溢出弹窗。 */
html.is-mobile .organization-modal-name strong { display: block; font-size: 18px; line-height: 26px; white-space: normal; }
html.is-mobile .organization-modal-name span { display: block; margin-top: 8px; padding: 0; font-size: 14px; border-left: 0; }
html.is-mobile .organization-modal-summary { margin-top: 20px; font-size: 16px; line-height: 28px; }
html.is-mobile .organization-modal-directions { margin-top: 0; }
html.is-mobile .organization-direction-list { gap: 24px; margin-top: 36px; margin-left: 0; }
html.is-mobile .organization-direction-list article { padding: 0 0 22px 32px; }
html.is-mobile .organization-direction-list article::before { top: 8px; left: 0; width: 24px; height: 8px; background-size: 24px 8px; }
html.is-mobile .organization-direction-list h4 { font-size: 18px; line-height: 28px; }
html.is-mobile .organization-direction-list h4::after { width: 100%; height: 3px; margin-top: 12px; margin-bottom: 14px; }
html.is-mobile .organization-direction-list p { font-size: 15px; line-height: 26px; }
html.is-mobile .organization-modal-gallery { margin-top: 48px; }
html.is-mobile .organization-image-list { display: block; }
html.is-mobile .organization-image-list figure { height: 250px; margin-bottom: 16px; padding: 12px; }
html.is-mobile .organization-image-list img { height: 192px; }
html.is-mobile .organization-image-list figcaption { font-size: 14px; line-height: 22px; }
html.is-mobile .organization-modal-contacts { margin-top: 48px; padding: 20px 16px; display: block; min-height: 0; }
html.is-mobile .organization-modal-contacts h3 { margin-bottom: 18px; font-size: 18px; }
html.is-mobile .organization-contact-list article { min-height: 70px; padding: 10px 0 10px 16px; display: block; }
html.is-mobile .organization-contact-list strong, html.is-mobile .organization-contact-list span { display: block; padding: 0; font-size: 14px; line-height: 24px; border-left: 0; }

/* 移动端行政办公表格改为单列，保证联系人工作内容不被压缩。 */
html.is-mobile .organization-modal.is-admin .organization-modal-panel { min-height: 0; }
html.is-mobile .organization-modal.is-admin .organization-modal-name { min-height: 0; padding-bottom: 0; }
html.is-mobile .organization-modal.is-admin .organization-modal-name strong { white-space: normal; }
html.is-mobile .organization-modal.is-admin .organization-admin-content { margin-top: 32px; }
html.is-mobile .organization-admin-location + .organization-admin-location { margin-top: 24px; }
html.is-mobile .organization-admin-location-toggle { height: 52px; padding: 0 16px; grid-template-columns: 76px 1fr 16px; font-size: 14px; }
html.is-mobile .organization-admin-location-toggle strong { padding-left: 16px; font-size: 14px; }
html.is-mobile .organization-admin-contact-table { width: 100%; margin-left: 0; display: block; font-size: 14px; line-height: 22px; }
/* 手机端公共邮箱跟随联系人表格改为单列对齐。 */
html.is-mobile .organization-admin-location-email { margin-left: 0; font-size: 14px; line-height: 22px; }
html.is-mobile .organization-admin-contact-table thead { display: none; }
html.is-mobile .organization-admin-contact-table tbody, html.is-mobile .organization-admin-contact-table tr { display: block; }
html.is-mobile .organization-admin-contact-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
html.is-mobile .organization-admin-contact-table td, html.is-mobile .organization-admin-contact-table tbody tr:first-child td, html.is-mobile .organization-admin-contact-table tbody tr:not(:first-child) td { width: auto; height: auto; padding: 2px 16px; display: block; border: 0; white-space: normal; }

/* 手机端名单按“机构图标、名称、职务、人员”纵向展示，避免桌面缩进挤压内容。 */
html.is-mobile .organization-modal.is-members .organization-modal-symbol { width: 100px; height: 88px; }
html.is-mobile .organization-modal.is-members .organization-modal-intro { min-height: 0; }
html.is-mobile .organization-member-table { margin-top: 24px; font-size: 16px; line-height: 26px; }
html.is-mobile .organization-member-table,
html.is-mobile .organization-member-table tbody,
html.is-mobile .organization-member-table tr,
html.is-mobile .organization-member-table th,
html.is-mobile .organization-member-table td { display: block; }
html.is-mobile .organization-member-table[hidden] { display: none; }
html.is-mobile .organization-member-table tr { padding: 20px 0; border-bottom: 1px solid var(--line); }
html.is-mobile .organization-member-table th,
html.is-mobile .organization-member-table td { width: auto; padding: 0; border: 0; }
html.is-mobile .organization-member-table td { margin-top: 12px; }
html.is-mobile .organization-member-names { gap: 12px 32px; }
