/* ============================================================
   main.css — 主界面框架：顶栏 / 公告条 / Hero / 区块基座
   ============================================================ */

.main-view {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-0);
}

/* ---------- 顶栏 ---------- */
.topbar {
  flex: none;
  position: relative;
  z-index: 60;
  background: rgba(10, 14, 20, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-dark);
}
.topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* 左品牌 | 中导航 | 右用户 —— 导航严格居中 */
  align-items: center;
  gap: 26px;
  padding: 13px 34px;
  max-width: 1500px;
  margin: 0 auto;
}
.tb-brand { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; justify-self: start; }
.tb-name {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: .05em;
  color: var(--text-0);
  white-space: nowrap;
}
.tb-en {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .3em;
  color: #9fb2c4;
}
.tb-nav { display: flex; gap: 4px; justify-self: center; }
.tb-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-1);
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 99px;
  letter-spacing: .05em;
  transition: color .2s, background .2s, border-color .2s;
}
.tb-nav-btn:hover { color: var(--text-0); background: rgba(255, 255, 255, .06); }
.tb-nav-btn.active { color: #fff; background: rgba(77, 159, 255, .16); border-color: rgba(77, 159, 255, .5); }
/* "加入实验室"强调色（无论激活与否，文字均为强调蓝） */
.tb-nav-join { color: var(--accent-blue); }
.tb-nav-join:hover { color: #7fc0ff; }
.tb-nav-join.active { color: #fff; }

.tb-user { display: flex; align-items: center; gap: 12px; justify-self: end; }
.tb-username {
  font-size: 13.5px;
  color: var(--text-1);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-username::before { content: "◉ "; color: var(--ok); }
.tb-action {
  padding: 8px 18px;
  border-radius: 99px;
  font-size: 13px;
  letter-spacing: .08em;
  transition: all .2s ease;
}
/* 游客登录时：立即登录 = 强调 */
.tb-action.primary {
  background: var(--accent-blue);
  color: #fff;
  border: 1px solid var(--accent-blue);
  box-shadow: 0 0 22px rgba(77, 159, 255, .38);
}
.tb-action.primary:hover { background: #66adff; transform: translateY(-1px); }
/* 学号登录时：退出登录 = 不显眼 */
.tb-action.quiet {
  background: transparent;
  color: var(--text-2);
  border: 1px solid transparent;
}
.tb-action.quiet:hover { color: var(--text-1); border-color: var(--line-dark-2); }

/* ---------- 公告条 ---------- */
.notice-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 20px;
  font-size: 13px;
  letter-spacing: .06em;
  color: #ffe3b3;
  background: linear-gradient(90deg, rgba(255, 183, 77, .10), rgba(255, 183, 77, .16), rgba(255, 183, 77, .10));
  border-bottom: 1px solid rgba(255, 183, 77, .25);
}
.notice-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 10px rgba(255, 183, 77, .8);
  animation: noticeBlink 1.6s ease-in-out infinite;
}
@keyframes noticeBlink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- 主滚动区 ---------- */
.main-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ---------- Hero（像素封面延续） ---------- */
.hero {
  position: relative;
  height: 92vh;
  min-height: 560px;
  background: #000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hero-pixel { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-center { position: relative; z-index: 2; text-align: center; padding: 0 20px; }
.hero-slogan {
  font-size: clamp(34px, 5vw, 68px);
  font-weight: 800;
  letter-spacing: .12em;
  color: #fff;
  text-shadow: 0 0 30px rgba(77, 159, 255, .4);
}
.hero-sub {
  margin-top: 16px;
  font-size: clamp(14px, 1.6vw, 19px);
  letter-spacing: .26em;
  color: rgba(255, 255, 255, .62);
}
.hero-foot {
  position: absolute;
  bottom: 30px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 44px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .24em;
  color: rgba(255, 255, 255, .5);
}

/* ---------- 区块 ---------- */
.section { padding: 84px 34px 40px; scroll-margin-top: 0; }
.section-dark { background: var(--bg-0); }
/* B-13 自动登录迷你过场：主界面淡入（登录封面同步淡出，见 app.js） */
#main-view.auto-login { animation: autoLoginIn .55s ease both; }
@keyframes autoLoginIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #main-view.auto-login { animation: none; } }
/* B-03 板块互斥切换：非激活板块不渲染不占位；激活板块短促淡入上移 */
.section[hidden] { display: none; }
.section.entering { animation: section-enter .42s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes section-enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .section.entering { animation: none; } }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  max-width: 1360px;
  margin: 0 auto 40px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-dark);
}
.section-kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .32em;
  color: var(--accent-blue);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.section-title {
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 800;
  letter-spacing: .02em;
}
.section-note { font-size: 13.5px; color: var(--text-2); }
.section-head { flex-wrap: wrap; }

.block-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.block-title { font-size: clamp(20px, 2.4vw, 28px); font-weight: 700; letter-spacing: .04em; }

/* 通用区块容器（深色） */
.ide-wrap, .cal-block, .dir-block, .res-block {
  max-width: 1360px;
  margin: 0 auto 60px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 40px 34px 60px;
  border-top: 1px solid var(--line-dark);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--text-2);
  background: #05080c;
}

/* ---------- 文章横幅（加入实验室/关于我们头部氛围） ---------- */
@media (max-width: 860px) {
  .tb-nav { display: none; }
  .section { padding: 56px 18px 30px; }
  .hero-foot { gap: 18px; flex-wrap: wrap; padding: 0 16px; }
}
