/* ============================================================
   顶栏 · 骨架布局 · 页头
   来源：2.1.1 基准概览页原型 / styles.css（2026-09-15 机械搬迁）
   ============================================================ */

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: stretch;
  gap: 16px;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15, 98, 254, 0.55), rgba(0, 163, 196, 0.35), transparent);
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue) 0%, #2b7bff 55%, var(--d-special) 140%);
  color: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(15, 98, 254, 0.32);
}
.brand-mark svg { width: 20px; height: 20px; }

.brand-name { font-size: 14px; font-weight: 600; letter-spacing: 0.01em; }

.brand-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--blue);
  border: 1px solid rgba(15, 98, 254, 0.3);
  background: var(--blue-wash);
  border-radius: 999px;
  padding: 1px 7px;
}

.topnav {
  display: flex;
  align-items: stretch;
  gap: 2px;
  margin-left: 4px;
  min-width: 0;
  /* 下拉菜单（评测榜单）是绝对定位子元素：这里必须保持溢出可见，
     否则点击弹出两个榜单菜单时下拉会被裁掉（原 overflow-x: auto 即此问题的原因） */
  overflow: visible;
}
.topnav a {
  display: flex;
  align-items: center;
  padding: 0 15px;
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: 0.15s;
}
.topnav a:hover { color: var(--blue-700); background: var(--blue-wash); }
.topnav a.active { color: var(--blue-700); font-weight: 600; border-bottom-color: var(--blue); }

/* 顶部菜单下拉：评测榜单模块无左侧菜单，两个榜单在顶部下拉切换 */
.topnav-item { position: relative; display: flex; align-items: stretch; }
.topnav-item > a { gap: 7px; }
.topnav-caret {
  width: 6px;
  height: 6px;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.5;
  transition: transform 0.2s var(--ease);
}
.topnav-item:hover .topnav-caret,
.topnav-item.is-open .topnav-caret { transform: rotate(-135deg) translateY(-1px); }

.topnav-menu {
  position: absolute;
  top: 100%;
  left: 6px;
  z-index: 30;
  display: none;
  flex-direction: column;
  gap: 2px;
  min-width: 156px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 14px 30px rgba(15, 36, 80, 0.14);
}
.topnav-item:hover .topnav-menu,
.topnav-item.is-open .topnav-menu { display: flex; }
.topnav-menu a {
  padding: 8px 12px;
  border-bottom: none;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-2);
}
.topnav-menu a.active { background: var(--blue-wash-2); color: var(--blue-700); font-weight: 600; }

/* 窄屏：顶栏七项收紧内边距与字号（下拉不再裁切后，顶栏不采用横向滚动） */
@media (max-width: 1180px) {
  .topnav { gap: 0; margin-left: 0; }
  .topnav a { padding: 0 10px; font-size: 13px; }
}
@media (max-width: 900px) {
  .topnav a { padding: 0 8px; font-size: 12.5px; }
}

/* 打印（学术使用：导出 PDF / 纸质稿，2026-09-21）：只留正文与图表，去掉导航与工具项 */
@media print {
  .topbar,
  .foot,
  .rail { display: none !important; }
  .shell { display: block; grid-template-columns: minmax(0, 1fr); }
  .content { padding: 0; margin: 0; max-width: none; }
  body { background: #fff; }
  .page-head { break-after: avoid; }
  @page { margin: 14mm; }
}

/* 无左侧菜单的模块（评测榜单）：内容区占满宽度 */
.shell.is-full { grid-template-columns: minmax(0, 1fr); }
.shell.is-full .rail { display: none; }

.topbar-search {
  width: 240px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-4);
  transition: border-color 0.16s, box-shadow 0.16s;
}
.topbar-search:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-wash);
}
.topbar-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
}
.topbar-search input::placeholder { color: var(--ink-4); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  cursor: pointer;
  transition: 0.16s;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--blue); }
.badge-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 2px #fff, 0 0 8px var(--blue-glow);
}

.user { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #3d86ff);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 10px rgba(15, 98, 254, 0.28);
}
.user-name { font-size: 13px; color: var(--ink-2); }

/* ---------------- 骨架布局 ---------------- */

.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-h));
}

.rail {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 12px 0 40px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(8px);
}

.rail-head {
  padding: 18px 20px 10px;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line-2);
}

.rail-list { display: flex; flex-direction: column; padding-bottom: 10px; }

.rail-node-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 9px 20px;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  font-size: 13.5px;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
  transition: 0.15s;
}
.rail-node-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.78); }
.rail-node.is-open > .rail-node-btn { color: var(--blue-700); }
.rail-node-caret {
  margin-left: 8px;
  width: 7px;
  height: 7px;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.45;
  transition: transform 0.2s var(--ease);
}
.rail-node.is-open > .rail-node-btn .rail-node-caret { transform: rotate(-135deg); }

.rail-pages { display: none; padding: 2px 0 8px; }
.rail-node.is-open > .rail-pages { display: block; }
.rail-pages.is-flat { display: block; padding-top: 6px; }

.rail-page {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 20px 7px 34px;
  font-size: 13px;
  color: var(--ink-3);
  transition: 0.15s;
}
.rail-page::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-4);
  flex: none;
}
.rail-page:hover { color: var(--ink); background: rgba(255, 255, 255, 0.78); }
.rail-page.active {
  color: var(--blue-700);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--blue);
  background: linear-gradient(90deg, var(--blue-wash-2), rgba(15, 98, 254, 0.02) 80%);
}
.rail-page.active::before { background: var(--blue); box-shadow: 0 0 6px var(--blue-glow); }

.rail-empty { padding: 12px 20px; font-size: 12.5px; color: var(--ink-4); line-height: 1.6; }

.rail-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
}
.rail-node.is-open > .rail-node-btn .rail-count { color: var(--blue); }

.main {
  padding: 24px 34px 64px;
  max-width: 1440px;
  width: 100%;
}

/* ---------------- 页头 ---------------- */

.crumbs {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-4);
}
.crumbs i { font-style: normal; color: var(--line); }
.crumbs em { font-style: normal; color: var(--blue); }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-top: 12px;
}

.page-head h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.lede {
  margin-top: 10px;
  max-width: 680px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-3);
}

.sync {
  flex: none;
  text-align: right;
  padding-bottom: 4px;
}
.sync-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.sync-time {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--blue-700);
}

