/* =========================
   Base Reset
========================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #1f2937;
  background: #f8fafc;
  line-height: 1.6;
}

/* =========================
   Header
========================= */

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-weight: 700;
  font-size: 18px;
  color: #111827;
  text-decoration: none;
}

.nav-links a {
  margin-left: 18px;
  color: #4b5563;
  text-decoration: none;
  font-size: 14px;
}

.nav-links a:hover {
  color: #111827;
}

/* =========================
   Page Layout (IMPORTANT)
   上下结构
========================= */

.hero {
  display: flex;
  flex-direction: column;   /* ⭐关键：上下布局 */
  max-width: 900px;
  margin: 0 auto;
  gap: 30px;
  padding: 40px 20px;
}

/* =========================
   Profile Card
========================= */

.profile-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
}

.profile-card h1 {
  margin: 8px 0 4px;
  font-size: 24px;
}

.profile-card p {
  color: #6b7280;
  font-size: 14px;
}

.profile-links a {
  display: inline-block;
  margin: 6px 10px;
  color: #2563eb;
  text-decoration: none;
  font-size: 14px;
}

/* =========================
   Content Card
========================= */

.content-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

/* =========================
   Typography
========================= */

h1, h2, h3 {
  color: #111827;
}

h2 {
  margin-top: 28px;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
}

h3 {
  margin-top: 18px;
}

/* =========================
   Bullet System
========================= */

p.bullet {
  position: relative;
  padding-left: 14px;
  margin: 6px 0;
  color: #374151;
}

p.bullet::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #6b7280;
}

/* =========================
   Links
========================= */

a {
  color: #2563eb;
}

a:hover {
  color: #1d4ed8;
}

/* =========================
   Project Grid (备用)
========================= */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.project-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
}

/* =========================
   Footer
========================= */

.site-footer {
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
  padding: 32px;
}

/* =========================
   Mobile
========================= */

@media (max-width: 760px) {

  .hero {
    padding: 20px 16px;
  }

  .content-card {
    padding: 20px;
  }

  .profile-links a {
    display: block;
    margin: 6px 0;
  }
}

/* =========================
   Research Dashboard
========================= */

.research-page { height: 100vh; overflow: hidden; background: #07111f; }
.research-nav-container { max-width: none; padding-left: 20px; padding-right: 20px; }
.nav-links a[aria-current="page"] { color: #0f766e; font-weight: 700; }
.research-dashboard { --sidebar-width: 292px; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); height: calc(100vh - 57px); min-height: 0; background: #07111f; }
.research-sidebar { min-width: 0; overflow-y: auto; padding: 18px 14px 28px; color: #dbe8f5; background: #071522; border-right: 1px solid #20384d; scrollbar-color: #29465d transparent; }
.research-sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 14px; color: #f1f7fd; font-size: 16px; font-weight: 750; border-bottom: 1px solid #22394c; }
.research-close { display: none; border: 0; color: #b4c6d7; background: transparent; font-size: 26px; cursor: pointer; }
.research-section-label { margin: 18px 6px 10px; color: #38d7c6; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.research-tree, .tree-section, .tree-branch { display: flex; flex-direction: column; }
.tree-section + .tree-section { margin-top: 10px; }
.tree-toggle, .tree-link { width: 100%; min-height: 34px; border: 0; border-radius: 9px; color: #dbe8f5; background: transparent; font: inherit; font-size: 14px; font-weight: 650; line-height: 1.35; text-align: left; }
.tree-toggle { display: flex; align-items: center; gap: 7px; padding: 7px 8px; cursor: pointer; }
.tree-caret { width: 0; height: 0; flex: 0 0 auto; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 5px solid #87a1b8; transition: transform .16s ease; }
.tree-toggle[aria-expanded="true"] .tree-caret { transform: rotate(90deg); }
.tree-link { display: block; padding: 8px 10px; color: #91a8bc; text-decoration: none; cursor: pointer; transition: color .15s ease, background .15s ease; }
.tree-link:hover { color: #eaf5ff; background: #10283a; }
.tree-link.active { color: #032225; background: #38d2c3; box-shadow: 0 5px 18px rgba(56, 210, 195, .18); }
.tree-toggle.level-1 { font-weight: 800; }
.tree-toggle.level-2, .tree-link.level-2 { padding-left: 20px; }
.tree-link.level-3 { padding-left: 32px; }
.tree-branch[hidden] { display: none; }
.research-content { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; background: #0b1724; }
.research-toolbar { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 18px; color: #dceaf6; background: #0b1b2a; border-bottom: 1px solid #20384d; }
.research-toolbar h1 { min-width: 0; margin: 0; overflow: hidden; color: #edf6ff; font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.research-open-link { margin-left: auto; flex: 0 0 auto; color: #39d4c4; font-size: 13px; font-weight: 700; text-decoration: none; }
.research-open-link:hover { color: #7de9df; }
.research-menu-button { display: none; border: 1px solid #2b485e; border-radius: 8px; padding: 6px 10px; color: #dceaf6; background: #10283a; font: inherit; cursor: pointer; }
.research-frame-wrap { min-width: 0; min-height: 0; background: #07111f; }
.research-frame { display: block; width: 100%; height: 100%; border: 0; background: #07111f; }

@media (max-width: 840px) {
  .research-page { overflow: auto; }
  .research-page .site-header { position: relative; }
  .research-page .nav-container { align-items: flex-start; }
  .research-page .nav-links { display: flex; flex-wrap: wrap; justify-content: flex-end; }
  .research-page .nav-links a { margin-left: 12px; }
  .research-dashboard { display: block; height: calc(100vh - 57px); }
  .research-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 300; width: min(88vw, 310px); transform: translateX(-102%); box-shadow: 18px 0 50px rgba(0, 0, 0, .38); transition: transform .2s ease; }
  .research-dashboard.menu-open .research-sidebar { transform: translateX(0); }
  .research-close, .research-menu-button { display: inline-block; }
  .research-content { height: 100%; }
  .research-toolbar { padding: 8px 10px; }
}
