/* 抽屉（docs/reference/10 §2.3.3）：右侧滑出，头部固定，锚点条 + 分段正文；≤760 全宽。
   ui.js 的 drawer() 生成结构：.drawer-bg > .drawer > .drawer-head（.drawer-title / .drawer-actions / .drawer-nav）+ .drawer-body > .section */
.drawer-bg { position: fixed; inset: 0; background: var(--scrim); z-index: var(--z-drawer); opacity: 0; transition: opacity var(--dur) ease; }
.drawer-bg.open { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--drawer-w), 100vw); background: var(--surface); box-shadow: var(--shadow-panel); border-radius: var(--r-panel) 0 0 var(--r-panel); z-index: var(--z-drawer); display: flex; flex-direction: column; transform: translateX(100%); transition: transform var(--dur) ease; overscroll-behavior: contain; outline: none; }
.drawer.open { transform: none; }
.drawer.left { left: 0; right: auto; width: min(280px, 100vw); transform: translateX(-100%); border-radius: 0 var(--r-panel) var(--r-panel) 0; }
.drawer.left.open { transform: none; }

.drawer-head { flex: none; padding: var(--sp-4) var(--sp-5) 0; border-bottom: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: var(--sp-3); background: var(--surface); }
.drawer-title { display: flex; align-items: flex-start; gap: var(--sp-3); }
.drawer-title h2 { font-size: var(--fs-h2); line-height: 1.4; overflow-wrap: anywhere; }
.drawer-title .meta { color: var(--muted); font-size: var(--fs-sub); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-1); }
.drawer-x { margin-left: auto; flex: none; width: var(--ctl-h); height: var(--ctl-h); border: none; border-radius: var(--r-ctl); background: none; color: var(--muted); cursor: pointer; font-size: var(--fs-h2); line-height: var(--ctl-h); }
.drawer-x:hover { background: var(--hover); color: var(--ink); }
.drawer-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.drawer-nav { display: flex; gap: var(--sp-4); overflow-x: auto; scrollbar-width: none; margin-top: var(--sp-1); }
.drawer-nav::-webkit-scrollbar { display: none; }
.drawer-nav a { padding: var(--sp-2) 0 var(--sp-3); color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-size: var(--fs-body); }
.drawer-nav a:hover { color: var(--ink); }
.drawer-nav a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }
.drawer-head:not(:has(.drawer-nav)) { padding-bottom: var(--sp-4); }

.drawer-body { flex: 1; overflow: auto; padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-6); overscroll-behavior: contain; }
.drawer-body > .loading { padding: 0; }

/* 抽屉与卡片内的分段：标题 16 + 内容，段间 24、段内 12；段内条目用 .item 而不是嵌套卡片 */
.section { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; scroll-margin-top: var(--sp-4); }
.section > .section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.section > .section-head .meta { color: var(--muted); font-size: var(--fs-sub); }
.section ul.plain { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--sp-2); }
.section ul.plain li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); }
.item { box-shadow: var(--sh-1); border-radius: var(--r-card); padding: var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.item .item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }
.item .item-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

@media (max-width: 760px) {
  .drawer { width: 100vw; border-radius: 0; }
  .drawer-head { padding: var(--sp-3) var(--sp-4) 0; }
  .drawer-body { padding: var(--sp-4); }
}
