/* ════════════════════════════════════════════════════════════════════════
   AMS 共享应用外壳 v1 · assets/ams-shell.css
   ────────────────────────────────────────────────────────────────────────
   配合 assets/ams-shell.js（<ams-shell> / <ams-footer> 自定义元素）：
   页头 · 模块导航 · 移动导航面板 · 外观弹层。所有颜色 / 尺度均取
   assets/ams-theme.css 的语义令牌，不写死 hex。各模块只需：

       <link rel="stylesheet" href="assets/ams-theme.css">
       <link rel="stylesheet" href="assets/ams-shell.css">
       <script src="assets/ams-theme.js"></script>
       <script src="assets/ams-shell.js" defer></script>

   页面里写 <ams-shell mod="overview"></ams-shell> 即可。
   ════════════════════════════════════════════════════════════════════════ */

ams-shell { display: block; flex: 0 0 auto; position: sticky; top: 0; z-index: var(--z-shell); }
ams-footer { display: block; flex: 0 0 auto; }

/* ─── 图标基线 ─────────────────────────────────────────────────────── */
.ic { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ─── 顶栏 ─────────────────────────────────────────────────────────── */
.appbar { height: 58px; background: var(--chrome-bg); color: var(--chrome-fg); display: flex; align-items: center; gap: 16px; padding-inline: 18px; position: relative; z-index: var(--z-shell); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { width: 30px; height: 30px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--accent); color: var(--accent-on); }
.brand .mark svg { width: 18px; height: 18px; stroke-width: 1.8; }
.brand b { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.srv { display: flex; align-items: center; gap: 8px; margin-left: 2px; background: var(--on-dark-soft); border: 1px solid transparent; color: var(--on-dark); border-radius: 999px; padding: 5px 12px 5px 10px; font-size: 13px; cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.srv:hover { border-color: var(--on-dark-dim); }
.srv:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.srv[aria-expanded="true"] { border-color: var(--on-dark-dim); background: color-mix(in oklch, var(--on-dark) 12%, transparent); }
.srv .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ok) 22%, transparent); }
.srv .zone { flex: 0 0 auto; display: block; height: auto; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--on-dark-dim); font-family: var(--font-mono); font-size: 12px; font-weight: 400; line-height: 1.5; letter-spacing: normal; }
.srv .site-short { display: none; font-family: var(--font-mono); font-size: 12px; letter-spacing: .02em; }
.appright { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.iconbtn { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 8px; display: grid; place-items: center; color: var(--on-dark-dim); position: relative; cursor: pointer; }
.iconbtn:hover { background: var(--on-dark-soft); color: var(--on-dark); }
.iconbtn .badge,
.iconbtn .badge-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: var(--danger); box-shadow: none; display: block; font-size: 0; line-height: 0; }
.avatar { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--on-dark-soft); color: var(--on-dark); display: grid; place-items: center; font-size: 13px; font-weight: 600; margin-left: 2px; padding: 0; cursor: pointer; transition: background .12s ease, box-shadow .12s ease; }
.avatar:hover { background: color-mix(in oklch, var(--on-dark) 18%, transparent); }
.avatar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.avatar[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--accent); }

/* ─── 模块导航（宽屏横向 / 滚动渐隐 / 移动面板） ──────────────────── */
.appnav { display: flex; align-items: center; gap: 2px; margin-left: 4px; min-width: 0; }
.appnav a { padding: 8px 12px; border-radius: var(--radius); font-size: 13.5px; line-height: 1; color: var(--on-dark-dim); border-bottom: 2px solid transparent; white-space: nowrap; transition: color .12s ease, background .12s ease; }
.appnav a:hover { color: var(--on-dark); background: var(--on-dark-soft); }
.appnav a.active { color: var(--on-dark); background: var(--on-dark-soft); border-bottom-color: var(--accent); border-radius: var(--radius) var(--radius) 0 0; }
.appnav a:focus-visible, .navsheet a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.navsep { flex: 0 0 auto; width: 1px; height: 14px; margin: 0 4px; background: var(--on-dark-soft); }
.navbtn { display: none; }

.appnav.is-scroll { overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.appnav.is-scroll::-webkit-scrollbar { display: none; }
.appnav.is-scroll.fade-r { -webkit-mask-image: linear-gradient(to right, black calc(100% - 20px), transparent); mask-image: linear-gradient(to right, black calc(100% - 20px), transparent); }
.appnav.is-scroll.fade-l { -webkit-mask-image: linear-gradient(to right, transparent, black 20px); mask-image: linear-gradient(to right, transparent, black 20px); }
.appnav.is-scroll.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent); mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent); }

@media (max-width: 1360px) {
  .appnav { gap: 1px; }
  .appnav a { padding-inline: 9px; font-size: 13px; }
  .navsep { margin: 0 3px; }
}
@media (max-width: 1180px) {
  .navsep { display: none; }
}

.navscrim, .navsheet { display: none; }
body.nav-open { overflow: hidden; }

@media (max-width: 1000px) {
  .appnav { display: none; }
  .navbtn { display: grid; }
  .appbar { gap: 10px; }
  .navscrim { display: block; position: fixed; inset: 58px 0 0; z-index: 56; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .16s ease; }
  .navscrim.on { opacity: 1; pointer-events: auto; }
  .navsheet { display: block; position: fixed; top: 58px; left: 0; right: 0; z-index: 57; padding: 10px 14px 18px; background: var(--chrome-bg); color: var(--on-dark); border-bottom: 1px solid var(--on-dark-soft); box-shadow: var(--shadow-pop); max-height: calc(100dvh - 58px); overflow-y: auto; overscroll-behavior: contain; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-8px); transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s; }
  .navsheet.on { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: opacity .16s ease, transform .16s ease, visibility 0s linear 0s; }
  .navsheet-in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 10px; max-width: 760px; margin: 0 auto; }
  .ns-group { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 11px 2px 4px; font-family: var(--font-mono); font-size: var(--fs-min); letter-spacing: .08em; color: color-mix(in oklch, var(--chrome-fg) 45%, transparent); }
  .ns-group:first-child { margin-top: 2px; }
  .ns-group::after { content: ""; flex: 1; height: 1px; background: var(--on-dark-soft); }
  .navsheet a { display: flex; align-items: center; min-height: 40px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 13.5px; color: var(--on-dark-dim); }
  .navsheet a:hover { background: var(--on-dark-soft); color: var(--on-dark); }
  .navsheet a.active { background: var(--on-dark-soft); color: var(--on-dark); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
}

/* ─── 外观弹层（AMS 主题系统） ─────────────────────────────────────── */
.themebtn .ic { transition: transform .22s ease; }
.themebtn[aria-expanded="true"] .ic { transform: rotate(-18deg); }
.themepop { position: absolute; top: 51px; right: 14px; z-index: var(--z-pop); width: 272px; background: var(--surface); color: var(--fg); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 12px; display: none; }
.themepop.on { display: block; animation: ams-popin .16s ease; }
@keyframes ams-popin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.tp-h { display: flex; align-items: center; gap: 8px; padding: 2px 2px 10px; border-bottom: 1px solid var(--border); margin-bottom: 11px; }
.tp-h .ic { width: 16px; height: 16px; color: var(--accent); }
.tp-h b { font-size: 13px; }
.tp-h span { margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-min); letter-spacing: .04em; color: var(--muted); }
.tp-row { margin-bottom: 11px; }
.tp-row:last-of-type { margin-bottom: 0; }
.tp-lbl { font-family: var(--font-mono); font-size: var(--fs-min); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.tpseg { display: flex; gap: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; }
.tpseg button { flex: 1; min-height: 28px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 12px; transition: background .12s ease, color .12s ease; }
.tpseg button:hover { color: var(--fg); }
.tpseg button.on { background: var(--surface); color: var(--fg); font-weight: 600; box-shadow: 0 1px 3px color-mix(in oklch, var(--n-1000) 16%, transparent); }
.tpswatches { display: flex; gap: 7px; }
.tpsw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); padding: 0; background: var(--accent); transition: border-color .12s ease, transform .12s ease; }
.tpsw:hover { border-color: var(--border-strong); transform: scale(1.06); }
.tpsw.on { border-color: var(--fg); }
.tp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.tp-foot a { font-size: 12.5px; color: var(--accent); }
.tp-foot a:hover { text-decoration: underline; }
.tp-reset { border: 0; background: transparent; color: var(--muted); font-size: 12.5px; padding: 0; }
.tp-reset:hover { color: var(--fg); }

/* ─── 账号菜单 ─────────────────────────────────────────────────────── */
.acctpop { position: absolute; top: 51px; right: 14px; z-index: var(--z-pop-raised); width: 242px; background: var(--surface); color: var(--fg); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 12px; display: none; }
.acctpop.on { display: block; animation: ams-popin .16s ease; }
.acct-head { display: flex; align-items: center; gap: 10px; padding: 1px 2px 11px; border-bottom: 1px solid var(--border); }
.acct-av { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
.acct-copy { min-width: 0; }
.acct-copy b { display: block; font-size: 13px; letter-spacing: -0.005em; }
.acct-copy span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-site { display: flex; align-items: center; gap: 7px; padding: 10px 2px; color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; border-bottom: 1px solid var(--border); }
.acct-site .ic { width: 14px; height: 14px; color: var(--accent); }
.acct-zone { margin-left: auto; padding: 1px 5px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 10px; }
.acct-logout { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; margin-top: 8px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--danger-text); font-family: var(--font-body); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.acct-logout .ic { width: 15px; height: 15px; }
.acct-logout:hover { background: var(--danger-soft); }
.acct-logout:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ─── 通知中心 ─────────────────────────────────────────────────────── */
.notifpop { position: absolute; top: 51px; right: 96px; z-index: var(--z-pop-raised); width: min(380px, calc(100vw - 24px)); background: var(--surface); color: var(--fg); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); display: none; overflow: hidden; }
.notifpop.on { display: block; animation: ams-popin .16s ease; }
.nf-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 11px; border-bottom: 1px solid var(--border); }
.nf-head > div { min-width: 0; }
.nf-head b { display: block; font-size: 14px; letter-spacing: -0.01em; }
.nf-head span { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.nf-read { margin-left: auto; flex: 0 0 auto; min-height: 28px; padding: 0 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--fg-2); font-family: var(--font-body); font-size: 11.5px; cursor: pointer; }
.nf-read:hover:not(:disabled) { border-color: var(--border-strong); color: var(--fg); }
.nf-read:disabled { opacity: .55; cursor: default; }
.nf-read:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nf-list { max-height: min(56vh, 420px); overflow-y: auto; overscroll-behavior: contain; padding: 5px; }
.nf-item { width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 10px 9px; border: 0; border-radius: var(--radius); background: transparent; color: var(--fg); text-align: left; cursor: pointer; }
.nf-item:hover, .nf-item:focus-visible { background: var(--fg-softer); outline: none; }
.nf-item.unread { background: color-mix(in oklch, var(--accent) 5%, var(--surface)); }
.nf-item.unread:hover, .nf-item.unread:focus-visible { background: color-mix(in oklch, var(--accent) 9%, var(--surface)); }
.nf-dot { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 6px; border-radius: 50%; background: var(--muted); }
.nf-dot.publish { background: var(--ok); }
.nf-dot.review { background: var(--warn); }
.nf-dot.warning { background: var(--danger); }
.nf-dot.git { background: var(--accent); }
.nf-dot.inquiry { background: var(--info, var(--accent)); }
.nf-copy { display: block; min-width: 0; flex: 1; }
.nf-copy b { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.nf-copy span { display: block; margin-top: 3px; font-size: 12px; line-height: 1.5; color: var(--fg-2); }
.nf-copy em { display: block; margin-top: 5px; font-family: var(--font-mono); font-size: 10.5px; font-style: normal; letter-spacing: .03em; color: var(--muted); }
.nf-unread { width: 6px; height: 6px; flex: 0 0 auto; margin-top: 7px; border-radius: 50%; background: var(--accent); }
.nf-foot { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11.5px; }
.nf-foot a { margin-left: auto; color: var(--accent); font-weight: 500; white-space: nowrap; }
.nf-foot a:hover { text-decoration: underline; }
@media (max-width: 560px) {
  .notifpop { position: fixed; top: 54px; right: 10px; left: 10px; width: auto; }
}

/* ─── 站点选择 ─────────────────────────────────────────────────────── */
.sitedlg {
  width: min(460px, calc(100vw - 28px));
  max-height: min(82dvh, 660px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 24px 70px color-mix(in oklch, var(--n-1000) 26%, transparent);
  overflow: hidden;
  font-family: var(--font-body);
}
.sitedlg[open] { display: flex; flex-direction: column; animation: ams-dialog-in .18s cubic-bezier(.2, 0, .2, 1); }
body.site-open { overflow: hidden; }
.sitedlg::backdrop { background: var(--scrim-strong); backdrop-filter: blur(2px); }
@keyframes ams-dialog-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

.sd-head { display: flex; align-items: flex-start; gap: 11px; padding: 18px 18px 14px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.sd-icon { width: 38px; height: 38px; border-radius: var(--radius); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: 0 0 auto; }
.sd-icon svg, .sd-x svg, .sd-radio svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sd-icon svg { width: 19px; height: 19px; }
.sd-htext { flex: 1; min-width: 0; padding-top: 1px; }
.sd-htext h2 { font-size: 16px; letter-spacing: -0.01em; }
.sd-htext p { margin-top: 4px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.sd-x { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; }
.sd-x:hover { background: var(--fg-soft); color: var(--fg); }
.sd-x svg { width: 16px; height: 16px; }

.sd-tools { flex: 0 0 auto; display: flex; flex-direction: column; gap: 9px; padding: 14px 18px 10px; border-bottom: 1px solid var(--border); }
.sd-search { position: relative; display: flex; align-items: center; }
.sd-search .sd-sic { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--muted); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.sd-search input {
  width: 100%; height: 36px; padding: 0 34px 0 32px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); color: var(--fg);
  font-family: var(--font-body); font-size: 13px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.sd-search input::placeholder { color: var(--muted); }
.sd-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.sd-search input::-webkit-search-cancel-button { display: none; }
.sd-clr { position: absolute; right: 6px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; }
.sd-clr:hover { background: var(--fg-soft); color: var(--fg); }
.sd-clr svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sd-clr[hidden] { display: none; }
.sd-clr:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.sd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sd-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--muted); font-family: var(--font-body); font-size: 12px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background .12s ease, border-color .12s ease, color .12s ease; }
.sd-chip b { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; color: var(--muted); }
.sd-chip:hover { border-color: var(--border-strong); color: var(--fg-2); }
.sd-chip.on { background: var(--accent-soft); border-color: color-mix(in oklch, var(--accent) 38%, var(--border)); color: var(--accent); }
.sd-chip.on b { color: var(--accent); }
.sd-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sd-body { padding: 8px 18px 4px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.sd-label { display: flex; align-items: center; gap: 6px; margin: 2px 2px 4px; color: var(--muted); font-family: var(--font-mono); font-size: var(--fs-min); letter-spacing: .07em; text-transform: uppercase; }
.sd-label b { color: var(--fg-2); font-weight: 600; }
.sd-list { display: flex; flex-direction: column; gap: 3px; padding-bottom: 10px; }
.sd-group { position: sticky; top: -8px; z-index: 1; display: flex; align-items: center; gap: 6px; margin: 4px -2px 2px; padding: 6px 2px 5px; background: var(--surface); color: var(--muted); font-family: var(--font-mono); font-size: var(--fs-min); letter-spacing: .06em; text-transform: uppercase; }
.sd-group:first-child { margin-top: 0; }
.sd-group b { padding: 0 4px; border-radius: 999px; background: var(--fg-soft); color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: 0; }
.sd-empty { display: flex; flex-direction: column; gap: 4px; padding: 34px 12px 40px; text-align: center; }
.sd-empty b { font-size: 13px; color: var(--fg-2); }
.sd-empty span { font-size: 12px; color: var(--muted); }
.sd-site { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.sd-site:hover { background: var(--fg-softer); }
.sd-site.on { background: var(--accent-soft); border-color: color-mix(in oklch, var(--accent) 36%, var(--border)); }
.sd-site input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sd-radio { width: 18px; height: 18px; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface); display: grid; place-items: center; flex: 0 0 auto; }
.sd-radio svg { width: 11px; height: 11px; stroke: var(--accent-on); stroke-width: 2.4; opacity: 0; }
.sd-site.on .sd-radio { background: var(--accent); border-color: var(--accent); }
.sd-site.on .sd-radio svg { opacity: 1; }
.sd-site input:focus-visible + .sd-radio { box-shadow: 0 0 0 3px var(--accent-ring); }
.sd-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sd-host { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-zone { flex: 0 0 auto; padding: 1px 5px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); font-family: var(--font-mono); font-size: 12px; font-weight: 500; line-height: 1.5; }
.sd-meta { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: var(--fs-min); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-dot { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--ok); }
.sd-state { flex: 0 0 auto; color: var(--muted); font-family: var(--font-mono); font-size: var(--fs-min); }
.sd-state.on { color: var(--accent); font-weight: 600; }

.sd-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px 14px; border-top: 1px solid var(--border); flex: 0 0 auto; }
.sd-hint { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-hint b { color: var(--fg-2); font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.sd-btn { height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--fg); font-family: var(--font-body); font-size: 12.5px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.sd-btn:hover { border-color: var(--border-strong); }
.sd-create { display: inline-flex; align-items: center; gap: 5px; border-color: color-mix(in oklch, var(--accent) 38%, var(--border)); color: var(--accent); }
.sd-create:hover { border-color: var(--accent); background: var(--accent-soft); }
.sd-create svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sd-x:focus-visible, .sd-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sd-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-on); font-weight: 600; }
.sd-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.sd-primary:disabled { opacity: .45; cursor: not-allowed; }

/* ─── 页面帮助抽屉 ─────────────────────────────────────────────────── */
body.help-open { overflow: hidden; }
.helpscrim { position: fixed; inset: 0; z-index: var(--z-help); background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.helpscrim.on { opacity: 1; pointer-events: auto; }
.helpdrawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-help-raised);
  width: min(420px, 100vw);
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--fg);
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 60px color-mix(in oklch, var(--n-1000) 22%, transparent);
  font-family: var(--font-body);
  visibility: hidden; pointer-events: none; transform: translateX(100%);
  transition: transform .22s cubic-bezier(.2, 0, .2, 1), visibility 0s linear .22s;
}
.helpdrawer.on { visibility: visible; pointer-events: auto; transform: none; transition: transform .22s cubic-bezier(.2, 0, .2, 1), visibility 0s linear 0s; }
.hd-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 16px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.hd-title { flex: 1; min-width: 0; }
.hd-kicker { display: block; margin-bottom: 5px; font-family: var(--font-mono); font-size: var(--fs-min); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hd-head h2 { font-size: 18px; line-height: 1.3; letter-spacing: -0.01em; }
.hd-x { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; }
.hd-x:hover { background: var(--fg-soft); color: var(--fg); }
.hd-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hd-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.hd-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 24px; }
.help-intro { margin: 0 0 18px; font-size: 13px; line-height: 1.65; color: var(--muted); }
.help-h { margin: 0 0 10px; font-family: var(--font-mono); font-size: var(--fs-min); font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.help-list { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; }
.help-list li { position: relative; padding-left: 18px; font-size: 13px; line-height: 1.65; color: var(--fg-2); }
.help-list li::before { content: ""; position: absolute; left: 2px; top: .66em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.help-list b { display: block; margin-bottom: 1px; color: var(--fg); font-weight: 600; }
.hd-foot { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 12px 20px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.hd-foot .ic { width: 14px; height: 14px; color: var(--accent); }

/* ─── 无页面 Toast 时的兜底提示 ─────────────────────────────────────── */
.ams-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(14px); z-index: var(--z-toast); padding: 10px 15px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop); font-size: 13px; color: var(--fg); opacity: 0; visibility: hidden; transition: opacity .2s ease, transform .2s ease, visibility .2s linear; }
.ams-toast.on { opacity: 1; visibility: visible; transform: translateX(-50%); }
.ams-toast.err { border-color: var(--danger); color: var(--danger-text); }

/* ─── 窄屏 ─────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .appbar { gap: 8px; padding-inline: 12px; }
  .srv .zone { display: none; }
}
@media (max-width: 560px) {
  .srv { padding: 6px 9px; gap: 6px; }
  .srv #siteName { display: none; }
  .srv .site-short { display: inline; }
  .sitedlg { width: calc(100vw - 20px); max-height: calc(100dvh - 28px); }
  .sd-head { padding: 15px 15px 12px; }
  .sd-tools { padding: 12px 15px 8px; gap: 8px; }
  .sd-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .sd-chips::-webkit-scrollbar { display: none; }
  .sd-chip { flex: 0 0 auto; }
  .sd-body { padding: 6px 15px 0; }
  .sd-list { padding-bottom: 8px; }
  .sd-foot { flex-wrap: wrap; padding: 10px 15px 12px; }
  .sd-hint { flex: 1 0 100%; margin-bottom: 2px; white-space: normal; }
  .sd-btn { flex: 1; }
  .acctpop { right: 12px; width: min(242px, calc(100vw - 24px)); }
  .helpdrawer { width: 100%; border-left: 0; }
  .hd-head { padding: 17px 16px 14px; }
  .hd-body { padding: 16px 16px 22px; }
  .hd-foot { padding: 11px 16px 13px; }
}
@media (max-width: 420px) {
  .appright { gap: 4px; }
  .appright .iconbtn[aria-label="通知"] { display: none; }
  .srv .ic { display: none; }
}
@media (max-width: 360px) {
  .appbar { gap: 6px; padding-inline: 10px; }
  .appright { gap: 2px; }
  .avatar { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .navscrim, .navsheet { transition: none !important; }
  .themepop.on, .acctpop.on { animation: none; }
  .themebtn .ic, .tpseg button, .tpsw, .avatar { transition: none !important; }
  .sitedlg[open] { animation: none; }
  .helpscrim, .helpdrawer { transition: none !important; }
}

/* 通用页头（健康 / 日志 / 设置等列表页共用） */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ph-main { min-width: 0; }
.ph-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-title h2 { margin: 0; font-size: 19px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; }
.ph-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
