/* ============================================================
   site-shell-rail.css — 规范包 V2 阶段1/2：窄侧栏 + 覆盖式展开面板
   + 首页连续滚动章节（#home/#about/#products/#support）
   加载顺序：在 site-one-screen.css 之后。
   桌面 ≥901px：左侧 76px 图标栏（底部“我的/设置”），品牌按钮弹出
   216px 覆盖面板（不推挤内容）；首页改为连续滚动章节 + ScrollSpy。
   ≤900px：保持既有抽屉式导航，章节栅格按宽度自适应。
   ============================================================ */

/* ---------- 锚点定位留出顶栏高度；平滑滚动尊重系统动画偏好 ---------- */
#home, #about, #products, #support { scroll-margin-top: 84px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- 首页滚动章节 ---------- */
.home-section { padding: 30px 32px 8px; }
.home-section > .home-hero { margin-top: 6px; }

.home-about { padding-top: 10px; }
.home-about-inner {
  display: grid; gap: 6px; max-width: 860px;
  padding: 22px 26px; border: 1px solid #dce6f6; border-radius: 16px;
  background: rgba(255, 255, 255, .78);
}
.home-about-inner h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; color: #16264d; }
.home-about-inner p { margin: 0; font-size: 13px; line-height: 1.7; color: #44536f; }

.home-products { padding-top: 14px; }
.home-products-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 14px;
}
.home-products-head-copy h2 { margin: 2px 0; font-size: 22px; letter-spacing: -.02em; color: #16264d; }
.home-products-head-copy p { margin: 0; font-size: 12px; color: #61708c; }
.home-products-search {
  display: flex; align-items: center; gap: 8px;
  min-width: min(360px, 100%); padding: 6px 8px 6px 12px;
  border: 1px solid #d7e1f2; border-radius: 12px; background: rgba(255, 255, 255, .9);
}
.home-products-search .home-search-icon { display: inline-flex; color: #7d92bb; }
.home-products-search input {
  flex: 1 1 auto; min-width: 0; border: 0; outline: none; background: transparent;
  font-size: 12.5px; color: #22345c;
}
.home-products-search .button { min-height: 32px; padding: 4px 14px; font-size: 12px; }

/* 产品三/二/一列：≥1200px 三列，720–1199px 两列，<720px 一列 */
.home-product-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 720px) { .home-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .home-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.home-product-card {
  display: flex; flex-direction: column; gap: 9px; min-height: 280px;
  padding: 20px 22px 18px; border: 1px solid #e0e8f5; border-radius: 16px;
  background: rgba(255, 255, 255, .88); text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.home-product-card:hover, .home-product-card:focus-visible {
  transform: translateY(-3px); border-color: #c3d4f7;
  box-shadow: 0 14px 30px rgba(23, 72, 232, .12);
}
.hpc-mark {
  display: grid; width: 52px; height: 52px; place-items: center;
  border-radius: 14px; background: linear-gradient(145deg, #1655f5, #0a3ad1);
  color: #fff; font-size: 22px; font-weight: 900;
  box-shadow: 0 8px 18px rgba(23, 72, 232, .22);
}
.hpc-name { font-size: 18px; font-weight: 800; color: #16264d; letter-spacing: -.01em; }
.hpc-desc {
  font-size: 12.5px; line-height: 1.6; color: #556482;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hpc-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.hpc-tags span {
  padding: 3px 10px; border-radius: 999px; border: 1px solid #dbe5f6;
  background: #f5f8ff; color: #4a5d84; font-size: 11px; font-weight: 700;
}
.hpc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.hpc-cta { font-size: 12.5px; font-weight: 800; color: #1655f5; white-space: nowrap; }
.home-products-more { display: flex; justify-content: center; padding: 18px 0 6px; }

.home-support { padding-bottom: 26px; }
.home-support-head { display: grid; gap: 4px; margin-bottom: 14px; }
.home-support-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; color: #16264d; }
.home-support-head p { margin: 0; font-size: 12px; color: #61708c; }
.home-support-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 1000px) { .home-support-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.home-support-card {
  display: grid; gap: 4px; min-height: 86px; align-content: center;
  padding: 14px 18px; border: 1px solid #e0e8f5; border-radius: 14px;
  background: rgba(255, 255, 255, .88); text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.home-support-card:hover, .home-support-card:focus-visible { transform: translateY(-2px); border-color: #c3d4f7; box-shadow: 0 10px 22px rgba(23, 72, 232, .10); }
.home-support-card strong { font-size: 14px; color: #16264d; }
.home-support-card small { font-size: 11.5px; color: #6b7a97; }

@media (max-width: 720px) {
  .home-section { padding: 22px 16px 6px; }
  .home-product-card { min-height: 0; }
}

/* ============================================================
   桌面窄栏（≥901px）：76px 图标栏
   ============================================================ */
@media (min-width: 901px) {
  /* 覆盖 v3 的 224px：侧栏宽度、主区 margin、shell 网格列全部跟随变量 */
  :root,
  body.brand-site,
  body.brand-site.app-workspace-page { --app-sidebar: 76px !important; }

  body.shell-unified.brand-site.app-workspace-page .app-sidebar { padding: 14px 10px 12px; }

  /* 品牌：只留“渊”字标，点击弹出覆盖面板 */
  body.shell-unified.brand-site.app-workspace-page .app-brand,
  .app-sidebar .app-brand {
    display: flex; flex-direction: column; align-items: center; gap: 0;
    padding: 0 0 14px; margin: 0; border: 0; background: none; cursor: pointer; width: 100%;
  }
  .app-sidebar .app-brand .app-brand-copy { display: none; }
  .app-sidebar .app-brand:hover .app-brand-mark { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(23, 72, 232, .3); }

  /* 垂直导航按钮：图标在上、11px 标签在下，高 58px */
  .app-sidebar .app-nav-link {
    flex-direction: column; justify-content: center; gap: 5px;
    min-height: 58px; padding: 8px 4px; border-radius: 12px;
  }
  .app-sidebar .app-nav-link:hover, .app-sidebar .app-nav-link:focus-visible { transform: none; }
  .app-sidebar .app-nav-icon { width: 26px; height: 26px; flex: 0 0 26px; }
  .app-sidebar .app-nav-link > span:last-child { font-size: 11px; letter-spacing: .04em; }
  .app-sidebar .app-nav-link.is-current { box-shadow: inset 0 3px 0 var(--app-blue); }
  .app-sidebar .app-sidebar-nav { gap: 4px; }

  /* 设置：窄栏下图标化；菜单改为 rail 右侧固定弹出层 */
  .app-sidebar .app-sidebar-bottom { padding-top: 10px; }
  .app-sidebar .app-settings summary {
    flex-direction: column; justify-content: center; gap: 5px;
    min-height: 58px; padding: 8px 4px; border-radius: 12px;
  }
  .app-sidebar .app-settings summary .app-nav-icon { width: 26px; height: 26px; flex: 0 0 26px; }
  .app-sidebar .app-settings summary > span:last-of-type { font-size: 11px; letter-spacing: .04em; }
  .app-sidebar .app-settings .app-settings-arrow { position: absolute; top: 6px; right: 10px; margin: 0; font-size: 12px; }
  .app-sidebar .app-settings { position: relative; }
  .app-sidebar .app-settings[open] .app-settings-menu {
    position: fixed; left: 86px; bottom: 16px; width: 208px; margin: 0; z-index: 90;
    box-shadow: 0 18px 44px rgba(18, 44, 102, .18);
  }
  .app-sidebar .app-settings-menu a, .app-sidebar .app-settings-menu .app-logout-form button {
    flex-direction: row; justify-content: flex-start; text-align: left;
  }
}

/* ---------- 覆盖式展开面板（所有视口可用；不推挤主内容） ---------- */
.app-rail-panel[hidden] { display: none !important; }
.app-rail-panel {
  position: fixed; left: 86px; top: 14px; bottom: 14px; width: 216px; z-index: 95;
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 14px 14px; border: 1px solid #d7e1f2; border-radius: 18px;
  background: rgba(250, 252, 255, .98); backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(18, 44, 102, .22);
}
.app-rail-panel-brand { display: flex; align-items: center; gap: 11px; padding-bottom: 12px; border-bottom: 1px solid #e4ebf7; }
.app-rail-panel-brand .app-brand-copy { display: grid; gap: 1px; }
.app-rail-panel-brand .app-brand-copy strong { color: #16264d; font-size: 15px; letter-spacing: .04em; white-space: nowrap; }
.app-rail-panel-brand .app-brand-copy small { color: #8b9cbf; font-size: 8px; letter-spacing: .13em; white-space: nowrap; }
.app-rail-panel-nav { display: grid; gap: 2px; }
.app-rail-panel-nav a {
  display: flex; align-items: center; min-height: 40px; padding: 8px 12px;
  border-radius: 10px; color: #3a4a6e; font-size: 13px; font-weight: 700; text-decoration: none;
}
.app-rail-panel-nav a:hover, .app-rail-panel-nav a:focus-visible { background: #eef4ff; color: #1655f5; }
.app-rail-panel-account { margin-top: auto; display: grid; gap: 2px; padding-top: 12px; border-top: 1px solid #e4ebf7; }
.app-rail-panel-account a {
  display: flex; align-items: center; min-height: 40px; padding: 8px 12px;
  border-radius: 10px; color: #3a4a6e; font-size: 13px; font-weight: 700; text-decoration: none;
}
.app-rail-panel-account a:hover, .app-rail-panel-account a:focus-visible { background: #eef4ff; color: #1655f5; }
@media (max-width: 900px) {
  .app-rail-panel { left: 16px; right: 16px; width: auto; }
}

/* 汉堡按钮在桌面隐藏（既有行为），品牌按钮即展开入口 */
@media (min-width: 901px) {
  body.shell-unified.brand-site.app-workspace-page .app-menu-toggle { display: none; }
}

/* ============================================================
   窄栏几何 v2（2026-11-10）：统一左右/上下间距，禁止溢出与参差
   侧栏 76px，内边距 10px → 内容宽 56px；
   所有栏内按钮统一 56×60，图标 24px，标签 10.5px，间距 6px。
   ============================================================ */
@media (min-width: 901px) {
  body.brand-site.app-workspace-page .app-sidebar { padding: 12px 10px 14px !important; }

  /* 品牌：居中、44px 字标、高度随内容（不再固定 91px 左对齐） */
  body.brand-site.app-workspace-page .app-sidebar .app-brand {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 2px 0 12px !important;
    margin: 0 0 6px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    border: 0 !important;
    background: none !important;
  }
  body.brand-site.app-workspace-page .app-sidebar .app-brand-mark {
    width: 44px !important; height: 44px !important; flex: 0 0 44px !important;
    border-radius: 14px !important; font-size: 20px !important; line-height: 1 !important;
  }

  /* 导航与底部：统一满宽、统一间距 */
  body.brand-site.app-workspace-page .app-sidebar .app-sidebar-nav {
    width: 100% !important; gap: 6px !important; margin: 0 !important;
  }
  body.brand-site.app-workspace-page .app-sidebar .app-sidebar-bottom {
    width: 100% !important; gap: 6px !important; padding-top: 8px !important;
    border-top: 1px solid rgba(180, 199, 230, .38) !important;
  }

  /* 栏内每一个按钮统一 56×60 竖排（首页/产品/支持/我的/设置） */
  body.brand-site.app-workspace-page .app-sidebar .app-nav-link,
  body.brand-site.app-workspace-page .app-sidebar .app-settings summary {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 60px !important;
    min-height: 60px !important;
    max-height: 60px !important;
    margin: 0 !important;
    padding: 4px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    border-radius: 14px !important;
    overflow: hidden !important;
  }
  body.brand-site.app-workspace-page .app-sidebar .app-nav-link .app-nav-icon,
  body.brand-site.app-workspace-page .app-sidebar .app-settings summary .app-nav-icon {
    width: 24px !important; height: 24px !important; flex: 0 0 24px !important;
    border: 0 !important; background: transparent !important; border-radius: 0 !important;
  }
  body.brand-site.app-workspace-page .app-sidebar .app-nav-link .app-nav-icon svg,
  body.brand-site.app-workspace-page .app-sidebar .app-settings summary .app-nav-icon svg { width: 20px !important; height: 20px !important; }

  body.brand-site.app-workspace-page .app-sidebar .app-nav-link > span:last-child,
  body.brand-site.app-workspace-page .app-sidebar .app-settings summary > span:last-of-type {
    font-size: 10.5px !important; line-height: 1 !important; letter-spacing: .02em !important;
    text-align: center !important; width: 100% !important;
    overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important;
  }
  /* 选中态：顶部 3px 指示条 + 浅蓝底（与统一高度配合，不再用左侧条挤压内宽） */
  body.brand-site.app-workspace-page .app-sidebar .app-nav-link.is-current {
    background:
      linear-gradient(#1655f5, #1655f5) top 6px center / 22px 3px no-repeat,
      linear-gradient(180deg, rgba(224, 236, 255, .95), rgba(208, 226, 255, .72));
    box-shadow: 0 10px 22px -16px rgba(22, 85, 245, .6) !important;
  }
  /* 设置的小箭头在窄栏里会造成左右不对称，隐藏 */
  body.brand-site.app-workspace-page .app-sidebar .app-settings .app-settings-arrow { display: none !important; }

  /* 底部装饰光斑：原来的 340px 斜切圆在窄栏里像一块脏影，换成柔和底部辉光 */
  body.brand-site.app-workspace-page .app-sidebar::before {
    right: -160px !important;
    bottom: -170px !important;
    width: 300px !important;
    height: 300px !important;
    border-radius: 50% !important;
    background: radial-gradient(circle at 42% 42%, rgba(118, 163, 255, .20), rgba(118, 163, 255, 0) 62%) !important;
    transform: none !important;
    filter: blur(2px);
  }
}
