/* GreenLab 站点主题：清新植物 / 生态配色
   —— 在 Bootstrap 5 之上覆盖，保持栅格与组件，替换色彩与排版气质。 */

:root {
  --forest: #1b4332;
  --moss: #2d6a4f;
  --leaf: #40916c;
  --sprout: #74c69d;
  --mint: #b7e4c7;
  --pale: #e9f5ec;
  --cream: #fbfaf5;
  --sand: #f3efe3;
  --ink: #22302a;
  --muted: #6b7d73;
  --line: #e2ece6;
  --sun: #d9a441;
  --radius: 16px;
  --shadow-sm: 0 2px 10px rgba(27, 67, 50, .06);
  --shadow-md: 0 12px 30px rgba(27, 67, 50, .10);
}

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--moss); text-decoration: none; }
a:hover { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4, h5 { color: var(--forest); font-weight: 700; letter-spacing: .01em; }

.skip-link {
  position: absolute; left: 1rem; top: .5rem; z-index: 1080;
  background: #fff; padding: .4rem .8rem; border-radius: 8px;
}

/* ---------- 导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1030;
  background: rgba(251, 250, 245, .92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-nav { padding: .55rem 0; }
/* 品牌区可被压缩：英文标语较长时先省略号截断，避免把右侧导航挤到换行 */
.site-brand { display: flex; align-items: center; gap: .75rem; min-width: 0; flex: 0 1 auto; }
.site-brand img { display: block; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name {
  font-weight: 700; color: var(--forest); font-size: 1.15rem; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-sub {
  font-size: .74rem; color: var(--muted); letter-spacing: .08em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.site-nav .nav-link {
  color: var(--ink);
  font-weight: 500;
  padding: .35rem .8rem;
  border-radius: 999px;
  position: relative;
}
/* 「登录/注册」「Sign in/Sign up」等条目不允许在词间折行 */
.site-nav .nav-link,
.site-nav .navbar-nav .btn,
.site-nav .lang-toggle { white-space: nowrap; }
.site-nav .nav-link:hover { color: var(--moss); background: var(--pale); text-decoration: none; }
.site-nav .nav-link.active { color: var(--forest); background: var(--mint); }
.navbar-toggler { border-color: var(--line); }
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(64, 145, 108, .25); }

/* ---------- 语言切换（下拉菜单） ---------- */
.lang-toggle {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--pale); border: 1px solid var(--mint); color: var(--moss);
  border-radius: 999px; padding: .28rem .8rem;
  font-size: .84rem; font-weight: 600; line-height: 1.4; cursor: pointer;
}
.lang-toggle:hover { background: #fff; color: var(--forest); border-color: var(--sprout); }
.lang-toggle:focus-visible { outline: 2px solid var(--leaf); outline-offset: 1px; }
.lang-toggle::after { margin-left: .1rem; border-top-color: currentColor; }
.lang-globe { flex: none; }

.lang-menu {
  min-width: 9.5rem; padding: .35rem;
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-md); background: #fff;
}
.lang-menu .dropdown-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; border: 0; border-radius: 8px;
  padding: .4rem .65rem; font-size: .9rem; color: var(--ink); cursor: pointer;
}
.lang-menu .dropdown-item:hover,
.lang-menu .dropdown-item:focus { background: var(--pale); color: var(--forest); }
.lang-menu .dropdown-item.active {
  background: var(--mint); color: var(--forest); font-weight: 600;
}
.lang-menu .dropdown-item.active::after { content: "✓"; margin-left: .75rem; color: var(--moss); }

/* ---------- 按钮 ---------- */
.btn-leaf {
  background: var(--leaf); border-color: var(--leaf); color: #fff;
  border-radius: 999px; padding: .45rem 1.15rem; font-weight: 600;
}
.btn-leaf:hover { background: var(--moss); border-color: var(--moss); color: #fff; }
.btn-outline-leaf {
  color: var(--moss); border: 1px solid var(--sprout); background: transparent;
  border-radius: 999px; padding: .45rem 1.15rem; font-weight: 600;
}
.btn-outline-leaf:hover { background: var(--pale); color: var(--forest); }

/* ---------- 首页 hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 420px at 82% -10%, rgba(183, 228, 199, .55), transparent 60%),
    linear-gradient(180deg, var(--pale) 0%, var(--cream) 100%);
  border-bottom: 1px solid var(--line);
  padding: 4.5rem 0 4rem;
}
.hero::after {
  content: "";
  position: absolute; right: -60px; bottom: -70px; width: 340px; height: 340px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M85 15C55 15 30 33 22 60c-2 7-3 15-3 25 8-2 15-6 21-11 6-6 10-13 12-21 3 8 9 14 17 16-5-6-8-13-8-21 0-1 0-3 .3-4C74 40 85 29 85 15z' fill='%2374c69d' fill-opacity='.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: contain;
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  background: #fff; border: 1px solid var(--mint); color: var(--moss);
  border-radius: 999px; padding: .3rem .9rem; font-size: .82rem; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 1rem 0 .75rem; }
.hero .lead { color: #35473d; max-width: 46rem; }
.hero-list { list-style: none; padding: 0; margin: 1.25rem 0 0; max-width: 48rem; }
.hero-list li {
  position: relative; padding-left: 1.6rem; margin-bottom: .55rem; color: #35473d;
}
.hero-list li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: .55rem; height: .55rem; border-radius: 50% 0 50% 50%;
  background: var(--leaf); transform: rotate(45deg);
}

/* ---------- 页面通用 ---------- */
.site-main { padding-bottom: 4rem; }
.page-head {
  background: linear-gradient(180deg, var(--pale), var(--cream));
  border-bottom: 1px solid var(--line);
  padding: 2.75rem 0 2.25rem;
  margin-bottom: 2.5rem;
}
.page-head h1 { font-size: clamp(1.6rem, 3vw, 2.25rem); margin-bottom: .35rem; }
.page-head .page-sub { color: var(--muted); margin: 0; }
.page-head .page-en { color: var(--leaf); font-size: .82rem; letter-spacing: .18em; text-transform: uppercase; }

.section-title {
  display: flex; align-items: center; gap: .6rem;
  font-size: 1.35rem; margin: 0 0 1.25rem;
}
.section-title::before {
  content: ""; width: .7rem; height: .7rem; border-radius: 50% 0 50% 50%;
  background: var(--leaf); transform: rotate(45deg); flex: none;
}

/* 注意：不要在这里写 height:100%。栅格列会被拉伸到整行高度，
   若一列里有多张卡片，height:100% 会让最后一张溢出到 row 外面（盖住页脚）。
   需要等高时在模板里给卡片加 Bootstrap 的 .h-100。 */
.eco-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.eco-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--sprout); }
.eco-card .card-body { padding: 1.35rem 1.4rem; }
.eco-card .card-title { font-size: 1.08rem; margin-bottom: .35rem; }
.eco-card .card-en { color: var(--leaf); font-size: .8rem; letter-spacing: .06em; }
.eco-card p { color: #46564d; margin-bottom: .5rem; }

/* 卡片内的链接列表（页脚请用 .footer-list，两者配色不同） */
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list > li {
  padding: .6rem 0;
  border-bottom: 1px dashed var(--line);
  color: #46564d;
}
.link-list > li:first-child { padding-top: 0; }
.link-list > li:last-child { padding-bottom: 0; border-bottom: 0; }
.link-list > li > a {
  display: inline-block; color: var(--forest); font-weight: 500; line-height: 1.5;
}
.link-list > li > a:hover { color: var(--leaf); text-decoration: none; }
.link-list .list-note {
  display: block; color: var(--muted); font-size: .84rem; line-height: 1.5; margin-top: .15rem;
}

.tag {
  display: inline-block; background: var(--pale); color: var(--moss);
  border: 1px solid var(--mint); border-radius: 999px;
  padding: .1rem .6rem; font-size: .74rem; font-weight: 600; margin-right: .35rem;
}
.tag-sun { background: #fdf3e0; border-color: #f0dcb4; color: #8a6417; }

.stat-tile {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm); height: 100%;
}
.stat-num { font-size: 1.9rem; font-weight: 700; color: var(--moss); line-height: 1.2; }
.stat-label { color: var(--muted); font-size: .86rem; }

/* ---------- 论文列表 ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  margin-bottom: 1.75rem;
}
.filter-chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: .3rem .9rem; font-size: .88rem;
}
.filter-chip:hover { background: var(--pale); color: var(--forest); text-decoration: none; }
.filter-chip.active { background: var(--moss); border-color: var(--moss); color: #fff; }

.year-block { margin-bottom: 2.25rem; }
.year-label {
  display: inline-block; background: var(--forest); color: #fff;
  border-radius: 999px; padding: .15rem .85rem; font-weight: 600; font-size: .9rem;
  margin-bottom: .9rem;
}
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-item {
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--sprout);
  border-radius: 12px; padding: .95rem 1.15rem; margin-bottom: .7rem;
}
.pub-item:hover { border-left-color: var(--leaf); box-shadow: var(--shadow-sm); }
.pub-title { font-weight: 600; color: var(--forest); }
.pub-authors { color: #46564d; font-size: .92rem; }
.pub-venue { color: var(--muted); font-size: .88rem; }
.pub-meta { margin-top: .35rem; font-size: .82rem; }

/* ---------- 团队 ---------- */
.member-card { display: flex; gap: 1rem; align-items: flex-start; }
.member-photo {
  width: 76px; height: 76px; border-radius: 50%; object-fit: cover; flex: none;
  border: 2px solid var(--mint); background: var(--pale);
}
.member-initial {
  width: 76px; height: 76px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--mint), var(--pale));
  color: var(--forest); font-size: 1.6rem; font-weight: 700;
  border: 2px solid var(--mint);
}
.member-name { font-size: 1.05rem; font-weight: 700; color: var(--forest); margin: 0; }
.member-en { color: var(--leaf); font-size: .82rem; }
.member-meta { color: #46564d; font-size: .9rem; margin: .35rem 0 0; }

/* ---------- 书籍 ---------- */
.book-cover {
  width: 100%; max-width: 230px; border-radius: 10px;
  box-shadow: var(--shadow-md); border: 1px solid var(--line);
}
.book-highlights { list-style: none; padding: 0; margin: 0 0 1rem; }
.book-highlights li { position: relative; padding-left: 1.5rem; margin-bottom: .35rem; }
.book-highlights li::before {
  content: "✓"; position: absolute; left: 0; color: var(--leaf); font-weight: 700;
}

/* ---------- 教程 / 软件 ---------- */
.doc-link { font-weight: 600; }
.release-row {
  display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline;
  padding: .6rem 0; border-bottom: 1px dashed var(--line);
}
.release-row:last-child { border-bottom: 0; }
.release-name { font-weight: 600; color: var(--forest); }
.prose p { margin-bottom: .9rem; }
.prose code {
  background: var(--pale); color: var(--forest); padding: .1rem .35rem;
  border-radius: 6px; font-size: .9em;
}
.prose pre {
  background: #10271d; color: #d8f3dc; padding: 1rem 1.15rem;
  border-radius: 12px; overflow-x: auto;
}
.prose pre code { background: transparent; color: inherit; padding: 0; }

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--forest); color: #cfe6d8; padding: 3rem 0 1.5rem; margin-top: 3rem;
}
.footer-brand { font-size: 1.25rem; font-weight: 700; color: #fff; letter-spacing: .04em; }
.footer-title { color: #fff; font-weight: 600; margin-bottom: .6rem; }
.footer-text { color: #cfe6d8; font-size: .92rem; margin-bottom: .5rem; }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list a, .footer-link { color: #b7e4c7; font-size: .92rem; }
.footer-list a:hover, .footer-link:hover { color: #fff; }
.footer-bottom {
  margin-top: 2.25rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .12);
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between;
  font-size: .85rem; color: #a9c9b7;
}
.footer-bottom a { color: #a9c9b7; }
.footer-bottom a:hover { color: #fff; }

.empty-hint {
  background: var(--sand); border: 1px dashed #ddd2b6; border-radius: var(--radius);
  padding: 1.25rem 1.4rem; color: #7a6a45;
}

/* 导航在 xl 以下折叠成汉堡菜单；英文条目较宽，1200-1399px 之间再收紧一点间距 */
@media (min-width: 1200px) {
  .site-nav .navbar-collapse { flex: none; }
  /* 英文标语（Plant Growth Modeling and Intelligent Agriculture）比中文长得多，
     导航展开时放不下；这里直接隐藏，避免被截断成半截或把导航挤到换行。
     xl 以下导航是汉堡菜单，标语照常显示。 */
  html[lang="en"] .brand-sub { display: none; }
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .site-nav .site-brand { margin-right: .5rem; }
  .site-nav .site-brand img { height: 40px; }
  .site-nav .navbar-nav .nav-link { padding: .35rem .35rem; font-size: .9rem; }
  .site-nav .navbar-nav .btn { padding: .25rem .55rem; font-size: .78rem; }
  .site-nav .lang-toggle { padding: .26rem .5rem; font-size: .78rem; }
  .site-nav .nav-item.ms-xl-3 { margin-left: .4rem !important; }
  .site-nav .nav-item.ms-xl-2 { margin-left: .25rem !important; }
}

@media (max-width: 1199.98px) {
  .site-nav .nav-link { padding: .5rem .25rem; }
  .site-nav .nav-item.ms-xl-3 { margin-top: .5rem; }
}

@media (max-width: 991.98px) {
  .hero { padding: 3rem 0 2.5rem; }
}
