/* ==========================================================================
   OSO-JLU 课题组网站样式
   改配色只要动 :root 里的几个变量；没有外部字体和框架，全部本地。
   ========================================================================== */

:root {
  --ink: #1f2328;
  --ink-soft: #43494f;
  --muted: #6b7280;
  --line: #e3e6ea;
  --bg: #ffffff;
  --panel: #f6f7f9;
  --panel-2: #eef1f4;
  --header-bg: #23262b;
  --header-bg-2: #1b1e22;
  --accent: #b69e40;          /* 旧站主色：金 */
  --accent-dark: #8d7a2c;
  --accent-soft: #f3edda;
  --blue: #2f6f9e;            /* 链接蓝，呼应旧站 #95C9E1 */
  --blue-soft: #e8f1f8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .07);
  --wrap: 1180px;
  --hex: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB",
               "Noto Sans CJK SC", Tahoma, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

img { max-width: 100%; height: auto; display: block; }

/* 关键：只要带 hidden 属性就必须消失。
   像 .people-grid 这类自己写了 display:grid 的元素，
   否则会把 hidden 覆盖掉，标签页切换就失效了。 */
[hidden] { display: none !important; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 650; }
h2 { font-size: 1.6rem; letter-spacing: .2px; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; text-align: justify; }

/* 正文两端对齐。最后一行本来就不拉伸，所以短行不会出现大空隙；
   英文靠 hyphens 自动断词，避免单词太长把行间距撑开。
   标题、日期、按钮这类短文字保持原样，不做对齐。 */
.news-topic,
.pub-list li,
.rich { text-align: justify; hyphens: auto; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #1b1e22; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- 顶栏 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(180deg, var(--header-bg), var(--header-bg-2));
  border-bottom: 3px solid var(--accent);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 76px; }
.brand img { width: 200px; height: auto; }
.brand:hover { text-decoration: none; }

.nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a {
  display: block; color: #e9ecef; padding: 10px 14px; border-radius: 8px;
  font-size: .95rem; font-weight: 550; letter-spacing: .3px;
}
.nav a:hover { background: rgba(182, 158, 64, .18); color: #fff; text-decoration: none; }
.nav a[aria-current="true"] { background: var(--accent); color: #23240f; }

.nav-toggle {
  display: none; background: transparent; border: 1px solid rgba(255, 255, 255, .35);
  color: #fff; border-radius: 8px; padding: 8px 12px; font: inherit; cursor: pointer;
}

/* ------------------------------------------------------------- 区块骨架 */
.section { padding: 54px 0 64px; }
.section[hidden] { display: none; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head .sub { color: var(--muted); font-size: .95rem; }
.rule { width: 46px; height: 4px; background: var(--accent); border-radius: 2px; margin: 0 0 22px; }

/* ------------------------------------------------------------- 首页轮播 */
/* 轮播在左栏顶部，宽度只有半栏，所以要做小一点、矮一点 */
.carousel { position: relative; background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.carousel-track { position: relative; aspect-ratio: 16 / 9; }
.slide {
  position: absolute; inset: 0; opacity: 0;
  /* 关键：六张图是叠在同一个位置的。以前只靠透明度区分，
     看不到的那五张其实还盖在上面，鼠标点哪都落到最后一张的链接上
     （所以下面两行把它们真正隐藏、并且不接收点击和键盘）。 */
  visibility: hidden; pointer-events: none; z-index: 1;
  transition: opacity .5s ease, visibility .5s;
  display: flex; align-items: center; justify-content: center; background: #101215;
}
.slide.is-on { opacity: 1; visibility: visible; pointer-events: auto; z-index: 2; }
.slide img { width: 100%; height: 100%; object-fit: contain; }
.slide.is-link { cursor: pointer; }
.carousel-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 16px 12px;
  color: #fff; font-size: .88rem; background: linear-gradient(transparent, rgba(0, 0, 0, .72));
}
.carousel-caption:empty { display: none; }
.car-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 34px; height: 50px; border: 0; background: rgba(20, 22, 25, .42); color: #fff;
  font-size: 1.25rem; cursor: pointer; border-radius: 8px; line-height: 1;
}
.car-btn:hover { background: var(--accent); color: #23240f; }
.car-prev { left: 8px; } .car-next { right: 8px; }
.car-dots { position: absolute; bottom: 7px; left: 0; right: 0; display: flex; gap: 6px; justify-content: center; z-index: 3; }
.car-dots button { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .5); cursor: pointer; }
.car-dots button[aria-current="true"] { background: var(--accent); transform: scale(1.25); }

/* --------------------------------------------------------- 首页两栏
   左：轮播 + Introduction + Contact
   右：整栏都是 News（和旧站排布一致）
   用 grid 区域名排版，窄屏时能把 News 提到简介前面，不用改 HTML 顺序。 */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr);
  grid-template-areas:
    "car   news"
    "intro news"
    "ct    news";
  gap: 26px 40px;
  align-items: start;
}
.carousel { grid-area: car; }
.home-news { grid-area: news; padding-top: 4px; }
.home-intro { grid-area: intro; }
.home-contact { grid-area: ct; }
/* 卡片之间的距离交给 grid 的 gap，卡片自身不要再加底边距 */
.home-grid .card { margin-bottom: 0; }

.news-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.news-list li { padding: 14px 2px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: baseline; }
.news-date { flex: 0 0 92px; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.news-topic { flex: 1 1 auto; text-align: justify; }
.news-topic a, .news-topic button { color: var(--ink); font: inherit; text-align: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.news-topic a:hover, .news-topic button:hover { color: var(--accent-dark); }
/* 期刊名由 app.js 自动识别后包一层 <strong class="jr">。
   正文色是 #1f2328，这里压到纯黑并加粗，扫一眼就能看见发在哪。
   鼠标移到整条新闻上时，期刊名跟着变金色，不然它会被链接色盖住。 */
.jr { font-weight: 700; color: #000; }
.news-topic a:hover .jr, .news-topic button:hover .jr { color: var(--accent-dark); }
.news-more { margin-top: 16px; display: flex; gap: 10px; align-items: center; }
/* 收起之后要把 News 标题滚回视野；顶栏是 sticky 的 66px，
   不给这点余量的话标题正好被压在顶栏底下看不见。 */
#news-head { scroll-margin-top: 78px; }

.btn {
  display: inline-block; background: var(--panel-2); color: var(--ink); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 8px; font: inherit; font-size: .92rem; cursor: pointer;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #23240f; text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* 次要按钮：收起用，比“显示更多”淡一点 */
.btn-2 { background: transparent; color: var(--muted); }
.btn-2:hover { background: var(--panel-2); color: var(--ink); border-color: var(--line); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; }
.card h2 { font-size: 1.25rem; }
.card.contact p { margin: 0; }
.card.contact .email { word-break: break-all; }

/* --------------------------------------------------------- 研究方向 */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.research-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.research-card img { width: 100%; height: 210px; object-fit: cover; }
.research-card .body { padding: 20px 22px 24px; }
.research-card h3 { display: flex; align-items: center; gap: 10px; }
.research-card h3::before { content: ""; width: 10px; height: 10px; background: var(--accent); border-radius: 2px; flex: 0 0 auto; }
.research-card p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------- 人员 */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; border-bottom: 1px solid var(--line); padding-bottom: 0; }
.tab {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px;
  font: inherit; font-size: .95rem; color: var(--ink-soft); cursor: pointer; margin-bottom: -1px;
}
.tab:hover { color: var(--accent-dark); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 650; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 26px; }
.people-grid.alumni { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.person { text-align: center; }
.person .hexwrap { position: relative; width: 132px; height: 150px; margin: 0 auto 14px; background: var(--accent-soft); clip-path: var(--hex); display: grid; place-items: center; }
.people-grid.alumni .person .hexwrap { width: 96px; height: 110px; }
.person .hexwrap img { width: 100%; height: 100%; object-fit: cover; clip-path: var(--hex); }
.person .hexwrap .fallback {
  width: 100%; height: 100%; display: grid; place-items: center; clip-path: var(--hex);
  background: var(--panel-2); color: var(--muted); font-size: 1.9rem; font-weight: 600; letter-spacing: 1px;
}
.person h3 { margin-bottom: 4px; font-size: 1.02rem; }
.person h3 a { color: var(--ink); }
.person .role { color: var(--accent-dark); font-size: .86rem; font-weight: 600; margin-bottom: 6px; }
.person .meta { color: var(--muted); font-size: .82rem; line-height: 1.55; word-break: break-word; }
.person .meta .cvlink { display: inline-block; margin-top: 4px; font-size: .82rem; }

/* ------------------------------------------------------------- 论文 */
.year-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 28px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  padding: 5px 13px; border-radius: 999px; font: inherit; font-size: .88rem; cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.chip[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #23240f; font-weight: 650; }

.pub-list { list-style: none; counter-reset: pub; margin: 0; padding: 0; }
.pub-list li { counter-increment: pub; position: relative; padding: 0 0 22px 46px; border-bottom: 1px dashed var(--line); margin-bottom: 22px; }
.pub-list li:last-child { border-bottom: 0; margin-bottom: 0; }
.pub-list li::before {
  content: counter(pub); position: absolute; left: 0; top: 1px;
  width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); color: var(--ink-soft);
  display: grid; place-items: center; font-size: .85rem; font-weight: 650;
}
.pub-title { font-weight: 650; color: var(--ink); }
.pub-authors { color: var(--ink-soft); font-size: .95rem; margin: 3px 0; }
.pub-journal { font-size: .95rem; }
.pub-journal a { color: var(--accent-dark); font-weight: 650; }
.pub-journal a:hover { text-decoration: underline; }

/* Attached Files 下载区已按用户要求撤掉，相关样式一并删除 */

/* --------------------------------------------------------- 图片墙 */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.photo-grid button { padding: 0; border: 1px solid var(--line); background: none; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; display: block; width: 100%; }
.photo-grid img { width: 100%; height: 178px; object-fit: cover; transition: transform .35s ease; }
.photo-grid button:hover img { transform: scale(1.05); }
.photo-grid figcaption, .photo-grid .cap { display: block; padding: 8px 10px; font-size: .85rem; color: var(--muted); text-align: left; background: #fff; }

/* ------------------------------------------------------- 弹层与灯箱 */
.modal, .lightbox { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(15, 17, 20, .72); padding: 20px; }
.modal[hidden], .lightbox[hidden] { display: none; }
.modal-box { background: #fff; border-radius: var(--radius); max-width: 860px; width: 100%; max-height: 84vh; overflow: auto; padding: 30px 34px; position: relative; }
.modal-box h3 { padding-right: 40px; }
.close-x { position: absolute; right: 12px; top: 10px; width: 36px; height: 36px; border-radius: 8px; border: 0; background: var(--panel-2); font-size: 1.2rem; cursor: pointer; }
.close-x:hover { background: var(--accent); color: #23240f; }
/* 详情片段是 Word 生成的，内联样式很重：用 !important 统一拉回本站排版 */
.rich :is(p, span, b, i, strong, font, li, div) { font-size: inherit !important; color: inherit !important; font-family: inherit !important; line-height: 1.75 !important; margin: 0 0 .9em; }
.rich p { text-align: justify; }
.rich img { margin: 12px 0; border-radius: 6px; }
.lightbox figure { margin: 0; max-width: 94vw; }
.lightbox img { max-height: 82vh; width: auto; margin: 0 auto; border-radius: 6px; background: #fff; }
.lightbox figcaption { color: #e9ecef; text-align: center; padding-top: 12px; font-size: .92rem; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 68px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.6rem; cursor: pointer; }
.lb-nav:hover { background: var(--accent); color: #23240f; }
.lb-prev { left: 14px; } .lb-next { right: 14px; }

/* ------------------------------------------------------------- 提示 */
.notice { border: 1px solid #f0c36d; background: #fff8e8; color: #7a5a10; border-radius: 8px; padding: 12px 16px; margin: 0 0 20px; font-size: .92rem; }
.notice[hidden] { display: none; }
.empty { color: var(--muted); font-style: italic; }

/* ------------------------------------------------------------ 页脚 */
.site-footer { background: linear-gradient(180deg, var(--header-bg-2), #14161a); color: #b9bec4; border-top: 3px solid var(--accent); margin-top: 40px; padding: 34px 0 30px; font-size: .9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.site-footer a { color: #dfe3e7; }
.site-footer a:hover { color: var(--accent); }
.site-footer .copy { line-height: 1.9; }

/* ------------------------------------------------------------ 断点 */
@media (max-width: 1000px) {
  .home-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "car"
      "news"
      "intro"
      "ct";
    gap: 24px;
  }
  .grid-2 { grid-template-columns: 1fr; }
  /* 单列后轮播变成整宽，给它一个高度上限，别又撑成一个大门板 */
  .carousel-track { aspect-ratio: 16 / 9; max-height: 340px; }
}

@media (max-width: 760px) {
  .header-inner { min-height: 64px; }
  .brand img { width: 158px; }
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--header-bg-2); border-bottom: 3px solid var(--accent); padding: 8px 16px 16px; }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 2px; }
  .nav a { padding: 12px 10px; border-radius: 6px; }
  .section { padding: 36px 0 44px; }
  .carousel-track { aspect-ratio: 16 / 10; max-height: 300px; }
  .news-list li { flex-direction: column; gap: 2px; }
  .news-date { flex: none; }
  .people-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px; }
  .modal-box { padding: 22px 18px; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .photo-grid img { height: 128px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slide, .photo-grid img { transition: none; }
}

@media print {
  .site-header, .site-footer, .tabs, .year-chips, .news-more, .car-btn, .car-dots { display: none !important; }
  .section { padding: 0; }
  .section[hidden] { display: block !important; }
  body { font-size: 11pt; }
}
