/* ==========================================================================
   NZEP 资料库 · assets/subsite.css —— 子网站的共用外壳
   --------------------------------------------------------------------------
   哪些页用：联机棋牌 /games、网站引擎工作台 /sckn.html，以后新开的子站也用这一套。
   为什么要单独一个文件：这套样式最早只写在 sckn.html 的**内联 style** 里，
   棋牌页没加载它 —— 于是棋牌页的顶栏是没有样式的（一堆链接竖着堆，手机上
   顶栏 441px 高，占了半个屏幕），"手机端适配"根本无从谈起。现在抽成共用文件。

   规矩（与工作台一致）：
     · 整屏应用外壳：body 固定视口高、中间那条自己滚、页脚永远在最底下不压内容；
     · 顶栏只放"品牌 + 账号"，**不放「返回资料库」按钮** —— 回资料库走页脚那条
       「NZEP 资料库」（.st-foot .brandlink），这样手机上顶栏不会被按钮挤爆；
     · 手机：隐藏副标题、按钮给足 40px 高、账号名截断。
   ========================================================================== */
html, body { height: 100%; }
body.st-body {
  margin: 0; background: var(--bg-page); color: var(--text);
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;          /* dvh：手机地址栏收起时不跳 */
  overflow: hidden;
  font-family: var(--sans);
}

/* ---------------------------------------------------------------- 顶栏 */
.st-bar {
  position: sticky; top: 0; z-index: 30; flex: 0 0 auto;
  display: flex; align-items: center; gap: .5rem;
  min-height: 2.7rem; padding: 0 .9rem;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--bar); color: var(--bar-text);
  border-bottom: 1px solid var(--bar-2);
  font-size: .78rem;
}
.st-brand {
  display: flex; align-items: center; gap: .5rem; min-height: 40px;
  color: var(--bar-text); text-decoration: none;
  font-family: var(--serif); font-weight: 700; font-size: .95rem; letter-spacing: .03em;
  padding: .35rem .45rem; border-radius: 2px;
}
.st-brand:hover { text-decoration: none; background: var(--bar-2); color: #fff; }
.st-mark { width: 19px; height: 19px; flex: 0 0 auto; display: block; }
.st-sub {
  color: #a9a9a2; font-size: .74rem;
  border-left: 1px solid var(--bar-2); padding-left: .7rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.st-grow { flex: 1; }
.st-btn {
  appearance: none; border: 1px solid transparent; background: transparent; color: var(--bar-text);
  border-radius: 2px; padding: .38rem .6rem; font-size: .76rem; cursor: pointer;
  text-decoration: none; line-height: 1.6; white-space: nowrap; font-family: inherit;
  min-height: 36px; display: inline-flex; align-items: center;
}
.st-btn:hover { background: var(--bar-2); color: #fff; text-decoration: none; }
.st-who {
  font-size: .74rem; color: #a9a9a2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 26vw;
  min-width: 0;
}
.st-who b, .st-who strong { color: #fff; }

/* ------------------------------------------------------------ 主区与页脚 */
.st-main {
  flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
  padding: 1.1rem 1.1rem 1.6rem; max-width: 1800px; width: 100%; margin: 0 auto;
}
.st-foot {
  flex: 0 0 auto;
  padding: .6rem 1.1rem; padding-bottom: calc(.6rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-faint);
  color: var(--text-3); font-size: .75rem;
  display: flex; gap: .5rem; flex-wrap: wrap; align-items: center;
}
.st-foot a { color: var(--link); }
/* 回资料库的入口就在页脚这一条上：做得醒目一点、可点区域够大 */
.st-foot .brandlink {
  color: var(--text-2); font-family: var(--serif); font-weight: 700; font-size: .82rem;
  text-decoration: none; padding: .25rem .35rem; border-radius: 2px;
  display: inline-flex; align-items: center; min-height: 36px;
}
.st-foot .brandlink:hover { background: var(--bg-subtle); text-decoration: underline; }
.st-foot .grow { flex: 1; }

/* ---------------------------------------------------------------- 手机 */
@media (max-width: 760px) {
  .st-bar { gap: .35rem; padding: 0 .6rem; padding-top: env(safe-area-inset-top, 0px); }
  .st-sub { display: none; }                     /* 副标题会换行把顶栏撑高，手机上不显示 */
  .st-brand { font-size: .9rem; padding: .3rem .35rem; }
  .st-btn { padding: .42rem .5rem; min-height: 40px; }
  .st-who { max-width: 34vw; font-size: .72rem; }
  .st-main { padding: .8rem .6rem 1rem; }
  .st-foot { padding: .5rem .6rem; padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0px)); font-size: .72rem; }
}
@media (max-width: 420px) {
  .st-who { max-width: 30vw; }
  .st-bar { font-size: .74rem; }
  .st-foot .brandlink { font-size: .78rem; }
}
