/* ============================================================================
   shared/ui/components.css — 统一组件库（供桌面外壳与所有子应用复用）
   ----------------------------------------------------------------------------
   目标：收敛各 app 自己手搓的侧边栏/底栏/列表/按钮样式（apps/media、apps/noted、
   native/store、apps/hub、os/copilot… 各有一套近似实现），像 macOS 的左侧边栏、
   iOS 的底部标签栏一样提供【一份】标准实现。

   规则：
   · 只用 shared/design/tokens.css 的 --hp-* 令牌取色/取距——暗色模式、强调色、
     密度自动生效，组件本身零主题代码。
   · 类名前缀 hp-，与令牌同命名空间；不施加布局副作用（不动 body/html）。
   · iframe 子应用引入方式（同源绝对路径，两行）：
       <link rel="stylesheet" href="/shared/design/tokens.css">
       <link rel="stylesheet" href="/shared/ui/components.css">
     主题同步：宿主会向 iframe postMessage 主题变化，子应用把 data-theme 设到
     <html> 上即可（详见 docs/UI-ARCHITECTURE-AND-DESIGN-SYSTEM.md）。
   · 预览画廊：/shared/ui/gallery.html（dev 下直接打开，改样式即时可见）。

   ⚠️ 采用率与"两套尺度"问题（2026-07-30 实测，做迁移前必读）
   ----------------------------------------------------------------------------
   现状：本库在 desktop/ native/ apps/ os/ 里的真实调用点**只有一个**
   （desktop/mutation-confirm.js 的 .hp-btn）。也就是说它目前仍是"预备好但没人用"，
   有变成"又一套样式"的风险。

   但**不能直接把 native/settings 换成 hp-***：实测两者是两种尺度，不是同一组件的两份实现。
       组件            Settings(.st-*)                本库(.hp-*)
       列表行          min-height 56px, padding 14/18  min-height 44px, padding 6/12
       行标题字号      14px                            13px
       容器圆角/阴影   10px + 0 1px 2px rgba(0,0,0,.03) 6px，无阴影
       分段按钮        padding 6/14, 13px              height 24px, 12.5px
       卡片            .st-card 无内边距(行自带)        .hp-card 有 12px 内边距
                       ↑ 正确对位是 .hp-list（无内边距 + overflow:hidden），不是 .hp-card
   本库偏 iOS 紧凑，Settings 偏 Win11 宽松。直接替换会**整体收紧整个设置界面**——
   那是产品外观决策，不是重构，需要人眼确认后再定"哪一套是标准"。
   在定下来之前：新代码一律用 hp-*（scripts/create-app.mjs 生成的应用已经这样），
   老页面不要盲改。相关裁决见 docs/UPGRADE-2026-07-30.md §4「组件库迁移」。
   ============================================================================ */

/* ─── 侧边栏（macOS Finder 风格：分区标题 + 图标条目 + 强调色选中） ─────── */
.hp-sidebar {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: var(--hp-space-2);
    gap: 2px;
    background: var(--hp-surface-2);
    border-right: 1px solid var(--hp-border-soft);
    font: 13px/1.45 "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--hp-text-1);
    user-select: none;
}
.hp-sidebar-section { margin-top: var(--hp-space-3); }
.hp-sidebar-section:first-child { margin-top: 0; }
.hp-sidebar-title {
    padding: 2px var(--hp-space-2) 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .4px;
    color: var(--hp-text-2);
}
.hp-sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--hp-row-h);
    padding: 0 var(--hp-space-2);
    border-radius: var(--hp-radius-sm);
    color: var(--hp-text-1);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hp-sidebar-item:hover { background: var(--hp-hover); }
.hp-sidebar-item:active { background: var(--hp-press); }
.hp-sidebar-item.active {
    background: color-mix(in srgb, var(--hp-accent) 14%, transparent);
    color: var(--hp-accent);
    font-weight: 600;
}
.hp-sidebar-item > svg, .hp-sidebar-item > .hp-ic { width: 16px; height: 16px; flex-shrink: 0; }
.hp-sidebar-item .hp-badge { margin-left: auto; }

/* ─── 底部标签栏（iOS Tab Bar 风格：毛玻璃 + 图标上文字下 + 强调色选中） ── */
.hp-tabbar {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    height: 56px;
    flex-shrink: 0;
    background: var(--hp-acrylic-strong);
    -webkit-backdrop-filter: blur(var(--hp-material-blur)) saturate(var(--hp-material-sat));
    backdrop-filter: blur(var(--hp-material-blur)) saturate(var(--hp-material-sat));
    border-top: 1px solid var(--hp-border-soft);
    user-select: none;
}
.hp-tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10.5px;
    color: var(--hp-text-2);
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}
.hp-tabbar-item > svg, .hp-tabbar-item > .hp-ic { width: 22px; height: 22px; }
.hp-tabbar-item:active { opacity: .65; }
.hp-tabbar-item.active { color: var(--hp-accent); }

/* ─── 工具栏（窗口顶部一行工具按钮） ──────────────────────────────────── */
.hp-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 40px;
    flex-shrink: 0;
    padding: 0 var(--hp-space-2);
    background: var(--hp-surface);
    border-bottom: 1px solid var(--hp-border-soft);
}
.hp-toolbar .hp-spacer { flex: 1; }
.hp-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 28px;
    min-width: 28px;
    padding: 0 6px;
    border: none;
    border-radius: var(--hp-radius-sm);
    background: none;
    color: var(--hp-text-1);
    font: 12.5px "Segoe UI", "Microsoft YaHei", sans-serif;
    cursor: pointer;
}
.hp-tool:hover { background: var(--hp-hover); }
.hp-tool:active, .hp-tool.active { background: var(--hp-press); }
.hp-tool[disabled] { color: var(--hp-text-disabled); pointer-events: none; }
.hp-tool > svg { width: 16px; height: 16px; }

/* ─── 列表（iOS 设置风格的成组圆角列表） ─────────────────────────────── */
/* 尺寸全部走 tokens.css 的 --hp-list-* 令牌，**不要在这里写死数值**：
   写死的后果是设置里的「界面密度」开关对组件库完全无效（2026-07-30 之前就是这样）。 */
.hp-list {
    background: var(--hp-surface);
    border: 1px solid var(--hp-border-soft);
    border-radius: var(--hp-list-radius);
    overflow: hidden;
}
.hp-list + .hp-list { margin-top: 10px; }
.hp-list-item {
    display: flex;
    align-items: center;
    gap: var(--hp-list-gap);
    min-height: var(--hp-list-h);
    padding: var(--hp-list-pad-y) var(--hp-list-pad-x);
    border-bottom: 1px solid var(--hp-border-soft);
    color: var(--hp-text-1);
    font: var(--hp-list-fs)/1.45 "Segoe UI", "Microsoft YaHei", sans-serif;
}
.hp-list-item:last-child { border-bottom: none; }
.hp-list-item.tappable { cursor: pointer; }
.hp-list-item.tappable:hover { background: var(--hp-hover); }
.hp-list-item.tappable:active { background: var(--hp-press); }
.hp-list-item > svg, .hp-list-item > .hp-ic {
    width: var(--hp-list-icon); height: var(--hp-list-icon);
    flex-shrink: 0; color: var(--hp-text-2);
    display: flex; align-items: center; justify-content: center;
}
.hp-list-body { flex: 1; min-width: 0; }
.hp-list-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-list-desc { font-size: var(--hp-list-fs-desc); color: var(--hp-text-2); margin-top: 2px; line-height: 1.4; }
.hp-list-value { color: var(--hp-text-2); flex-shrink: 0; font-size: var(--hp-list-fs-desc); }
.hp-list-chevron { color: var(--hp-text-disabled); flex-shrink: 0; }
/* 列表分组小标题（Settings 的 .st-group-lbl 对位） */
.hp-list-group {
    font-size: 13px; font-weight: 600; color: var(--hp-text-2);
    margin: 22px 2px 8px;
}

/* ─── 按钮 / 输入框 / 搜索框 ─────────────────────────────────────────── */
.hp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 30px;
    padding: 0 14px;
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius);
    background: var(--hp-surface);
    color: var(--hp-text-1);
    font: 13px "Segoe UI", "Microsoft YaHei", sans-serif;
    cursor: pointer;
}
.hp-btn:hover { background: var(--hp-surface-2); }
.hp-btn:active { background: var(--hp-press); }
.hp-btn[disabled] { color: var(--hp-text-disabled); pointer-events: none; }
.hp-btn.primary {
    background: var(--hp-accent);
    border-color: var(--hp-accent);
    color: var(--hp-accent-fg);
}
.hp-btn.primary:hover { filter: brightness(1.08); }
.hp-btn.danger { color: var(--hp-danger); border-color: color-mix(in srgb, var(--hp-danger) 40%, transparent); }
.hp-btn.danger:hover { background: var(--hp-danger-bg); }

.hp-input, .hp-select {
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius);
    background: var(--hp-surface);
    color: var(--hp-text-1);
    font: 13px "Segoe UI", "Microsoft YaHei", sans-serif;
    outline: none;
}
.hp-input:focus, .hp-select:focus { border-color: var(--hp-focus); }
.hp-input::placeholder { color: var(--hp-text-disabled); }

.hp-searchbox {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    border-radius: 15px;
    background: var(--hp-surface-2);
    border: 1px solid transparent;
    color: var(--hp-text-2);
}
.hp-searchbox:focus-within { border-color: var(--hp-focus); background: var(--hp-surface); }
.hp-searchbox > svg { width: 14px; height: 14px; flex-shrink: 0; }
.hp-searchbox > input {
    flex: 1; min-width: 0; border: none; background: none; outline: none;
    color: var(--hp-text-1); font: 13px "Segoe UI", "Microsoft YaHei", sans-serif;
}

/* ─── 分段控件（segmented control） ──────────────────────────────────── */
.hp-seg {
    display: inline-flex;
    padding: 2px;
    gap: 2px;
    border-radius: var(--hp-radius);
    background: var(--hp-surface-2);
    border: 1px solid var(--hp-border-soft);
}
.hp-seg > button {
    height: 24px;
    padding: 0 12px;
    border: none;
    border-radius: var(--hp-radius-sm);
    background: none;
    color: var(--hp-text-2);
    font: 12.5px "Segoe UI", "Microsoft YaHei", sans-serif;
    cursor: pointer;
}
.hp-seg > button.on {
    background: var(--hp-surface);
    color: var(--hp-text-1);
    box-shadow: var(--hp-shadow-sm);
    font-weight: 600;
}

/* ─── 开关（与 settings 的 st-toggle 同规格，供子应用用） ─────────────── */
.hp-switch {
    width: 44px; height: 25px;
    border-radius: 13px;
    background: var(--hp-border);
    border: none;
    position: relative;
    cursor: pointer;
    transition: background var(--hp-dur);
    flex-shrink: 0;
}
.hp-switch.on { background: var(--hp-accent); }
.hp-switch::after {
    content: "";
    position: absolute; top: 3px; left: 3px;
    width: 19px; height: 19px; border-radius: 50%;
    background: #fff;
    transition: left var(--hp-dur);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.hp-switch.on::after { left: 22px; }

/* ─── 卡片 / 徽标 / 空态 ─────────────────────────────────────────────── */
.hp-card {
    background: var(--hp-surface);
    border: 1px solid var(--hp-border-soft);
    border-radius: var(--hp-radius);
    box-shadow: var(--hp-shadow-sm);
    padding: var(--hp-space-3);
}
.hp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--hp-accent);
    color: var(--hp-accent-fg);
    font-size: 11px;
    font-weight: 600;
}
.hp-badge.muted { background: var(--hp-surface-2); color: var(--hp-text-2); }
.hp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 16px;
    color: var(--hp-text-disabled);
    font: 13px "Segoe UI", "Microsoft YaHei", sans-serif;
    text-align: center;
}

/* ─── 移动端适配：窄视口下侧边栏收窄、底栏加高（安全区） ─────────────── */
@media (max-width: 768px) {
    .hp-sidebar { width: 200px; }
    .hp-tabbar { height: calc(56px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); }

    /* 触摸目标：WCAG 2.5.5 建议 ≥44px，iOS HIG 也是 44pt。桌面档的 50px 已达标，
       但紧凑档（40px）在触屏上就偏小了——移动端强制回到 44px 起，
       且忽略 data-density（手指精度不随用户偏好变化）。 */
    :root {
        --hp-list-h: 48px;
        --hp-list-pad-x: 14px;
        --hp-list-fs: 15px;          /* iOS 正文 17pt 的观感折中，避免移动端字太小 */
        --hp-list-fs-desc: 13px;
    }
    [data-density="compact"] { --hp-list-h: 44px; --hp-list-fs: 14px; }

    /* 输入类控件在移动端要 ≥40px，否则点不准；iOS 还会因 <16px 字号自动缩放页面 */
    .hp-btn, .hp-input, .hp-select, .hp-searchbox { height: 40px; font-size: 16px; }
    .hp-seg > button { height: 32px; padding: 0 14px; font-size: 14px; }
    .hp-switch { width: 50px; height: 30px; border-radius: 15px; }
    .hp-switch::after { width: 24px; height: 24px; }
    .hp-switch.on::after { left: 23px; }

    /* 窄屏下"标题 + 右侧控件"容易挤成一行读不了 → 允许换行堆叠 */
    .hp-list-item { flex-wrap: wrap; }
    .hp-list-item > .hp-list-body { flex-basis: 60%; }
}

/* 指针精度兜底：即使视口很宽（平板横屏/触屏一体机），粗指针也需要大目标。
   与上面的宽度断点是两个正交维度，不能只靠 max-width 判断。
   ⚠️ 不能写 `max(var(--hp-list-h,50px),48px)`——自定义属性自引用成环 = 整条
   invalid at computed-value time（CSS Variables L1 §3），实测把触屏行高从 48px
   砸到 36.3px（min-height 拿到空值塌成 0）。直接给定值。 */
@media (pointer: coarse) {
    :root { --hp-list-h: 48px; }
    .hp-btn, .hp-input, .hp-select { min-height: 40px; }
}

/* 减弱动画：系统级无障碍偏好，组件库必须尊重（此前完全没处理） */
@media (prefers-reduced-motion: reduce) {
    .hp-switch, .hp-switch::after, .hp-sidebar-item, .hp-list-item, .hp-btn, .hp-tabbar-item {
        transition: none !important;
    }
}

/* ============ F1 控件行为化（2026-08-06，对齐 mac/iOS 控件手感）============ */

/* 焦点环全覆盖（mac：3px 柔和 accent 外扩环；此前只有 input 有变色边） */
.hp-btn:focus-visible, .hp-seg > button:focus-visible, .hp-switch:focus-visible,
.hp-list-item:focus-visible, .hp-sidebar-item:focus-visible, .hp-tabbar-item:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hp-accent) 38%, transparent);
}
.hp-input:focus-visible, .hp-select:focus-visible {
    border-color: var(--hp-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hp-accent) 28%, transparent);
}

/* 开关：iOS 弹性节奏——knob 位移走 spring 过冲；按住时 knob 拉伸（iOS 按压反馈） */
.hp-switch { transition: background var(--hp-dur-2, 160ms) var(--hp-ease-out, ease-out); }
.hp-switch::after {
    transition: left var(--hp-dur-3, 240ms) var(--hp-spring-pop, ease-out),
                width var(--hp-dur-1, 100ms) var(--hp-ease-out, ease-out);
}
.hp-switch:active::after { width: 23px; }
.hp-switch.on:active::after { left: 18px; }

/* 分段控件：选中态白 thumb 弹入（真滑动 thumb 需测量布局，用逐钮弹入近似 mac 手感；
   选中块 scale 过冲 + 阴影，未选块无底） */
.hp-seg > button { transition: background var(--hp-dur-2, 160ms) var(--hp-ease-out, ease-out), color var(--hp-dur-2, 160ms); }
.hp-seg > button.on { animation: hpSegIn var(--hp-dur-2, 160ms) var(--hp-spring-pop, ease-out); }
@keyframes hpSegIn { from { transform: scale(.92); } to { transform: scale(1); } }

/* 按钮按压（mac：轻微下沉） */
.hp-btn { transition: background var(--hp-dur-1, 100ms) var(--hp-ease-out, ease-out), transform var(--hp-dur-1, 100ms) var(--hp-ease-out, ease-out); }
.hp-btn:active { transform: scale(.97); }

@media (prefers-reduced-motion: reduce) {
    .hp-seg > button.on { animation: none; }
    .hp-switch::after, .hp-btn { transition-duration: .01ms; }
}

/* ─── 玻璃表面结构类（kit/glass-surface 的骨架）──────────────────────────────
   只管四层+内容的**结构**（定位/圆角继承/指针穿透）；材质数值（blur/tint/sheen/
   位移滤镜）仍由 JS paint() 内联——那是渲染引擎的参数，不是样式表的事。
   .hp-glass--fill = 源照搬件的 "absolute inset-0 -z-10"（撑满宿主并沉到内容下）。 */
.hp-glass { position: relative; }
.hp-glass--fill { position: absolute; inset: 0; z-index: -10; }
.hp-glass-layer { pointer-events: none; position: absolute; inset: 0; border-radius: inherit; }
.hp-glass-content { position: relative; height: 100%; width: 100%; border-radius: inherit; }
.hp-glass-filter { position: absolute; width: 0; height: 0; display: block; }

/* ─── mac 菜单栏 chrome（desktop/mac-menubar.js 的唯一配方；salvage 移植）──────
   值逐字对照源编译产物；文字恒白压壁纸（源即如此，不随主题翻）。
   下拉菜单不在这里——第四面起菜单栏下拉**收编进 context-menu 引擎**（ctx-pop
   mac 档，键盘/焦点/外点/Esc 全套复用），菜单栏只剩触发钮与状态区 chrome。 */
:where(.hp-mbar, .hp-mbar *, .hp-mbar ::before, .hp-mbar ::after) { box-sizing: border-box; border: 0 solid; }
:where(.hp-mbar) { line-height: 1.5; }
:where(.hp-mbar button) { margin: 0; padding: 0; background: none; color: inherit; font: inherit; text-align: inherit; }
:where(.hp-mbar) :is(img, svg) { display: block; vertical-align: middle; }
.hp-mbar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--hp-z-chrome, 100040);  /* 栏层令牌：低于菜单/面板/锁屏（tokens.css z 表；裸 999998 压过锁屏正是 z 令牌化要防的事故） */
    display: flex;
    height: 1.75rem;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding-inline: 0.5rem;
    user-select: none;
    -webkit-user-select: none;
    color: #fff;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0));
}
.hp-mbar-left { display: flex; align-items: center; gap: 0; font-size: 14px; font-weight: 600; color: #fff; }
/* 悬停亮片（源 hoverStyle）：透明底 → 白 10% + 背景模糊 */
.hp-mbar-hot {
    border-radius: 0.25rem;
    background-color: transparent;
    padding-inline: 0.375rem;
    padding-block: 0.125rem;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
@media (hover: hover) {
    .hp-mbar-hot:hover { background-color: rgba(255, 255, 255, 0.1); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
}
.hp-mbar-apple { display: flex; height: 1.75rem; width: 2rem; cursor: pointer; align-items: center; justify-content: center; }
.hp-mbar-appname { cursor: default; font-size: 14px; font-weight: 600; }
.hp-mbar-menus { display: none; align-items: center; gap: 0.625rem; font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.9); }
@media (min-width: 640px) { .hp-mbar-menus { display: flex; } }
.hp-mbar-menus > button { cursor: pointer; }
.hp-mbar-fill { flex: 1; }
.hp-mbar-right { display: flex; align-items: center; gap: 0.25rem; padding-right: 0.5rem; font-size: 13px; font-weight: 500; color: #fff; }
.hp-mbar-icobtn {
    display: flex;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    padding: 0.25rem;
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}
@media (hover: hover) {
    .hp-mbar-icobtn:hover { background-color: rgba(255, 255, 255, 0.1); }
}
.hp-mbar-cc {
    display: flex;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background-color: transparent;
    padding-inline: 0.5rem;
    padding-block: 0.125rem;
    outline: none;
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}
@media (hover: hover) {
    .hp-mbar-cc:hover { background-color: rgba(255, 255, 255, 0.1); }
}
.hp-mbar-cc.is-open { background-color: rgba(255, 255, 255, 0.2); }
.hp-mbar-cc.is-open:hover { background-color: rgba(255, 255, 255, 0.2); }
.hp-mbar-clock { cursor: pointer; font-weight: 500; }
.hp-mbar-clock > span { font-size: 14px; font-weight: 600; }

/* ─── 控制中心（desktop/control-center.js 的唯一配方）──────────────────────────
   出身 = macos-web-simulator ControlCenter.jsx 的编译产物反查值（零视觉漂移），
   salvage 合流：假控件（AirDrop/台前调度/投屏/媒体卡/截屏/Edit Controls）的解剖
   已随控件一并删除；墨色走 --hp-on-material 角色（玻璃面板自带暗底 → 根上恒白覆写）。
   `.os-cc` 是集成层的定位壳（定位/入场/移动档在 control-center.js 的
   injectStyleOnce），下面第一组是 preflight——`:where()` 的零特异性形状必须保留
   （靠它让解剖类恒赢）。box-sizing 是硬前提：content-box 下 68px 的卡加 10px
   内边距会被算成 88px，整张面板全失真。
   状态类：.is-on（Wi-Fi 在线 / 蓝牙已连 / 勿扰 / 材质=毛玻璃）、
   .is-disabled（环境不支持蓝牙）。 */
:where(.os-cc, .os-cc *, .os-cc ::before, .os-cc ::after) { box-sizing: border-box; border: 0 solid; }
:where(.os-cc) { line-height: 1.5; }
:where(.os-cc button) { margin: 0; padding: 0; background: none; color: inherit; font: inherit; text-align: inherit; }
:where(.os-cc) :is(input, textarea, select) { font: inherit; color: inherit; }
:where(.os-cc) :is(img, svg) { display: block; vertical-align: middle; }
:where(.os-cc h1, .os-cc h2, .os-cc h3, .os-cc h4, .os-cc p, .os-cc pre) { margin: 0; }

/* ── 骨架 ── */
/* 玻璃面板自带暗底 → 恒白墨，由根局部覆写三元组（tokens.css F0-1b 契约：
   "自带暗底的材质由表面局部覆写"；将来做素档 CC 时删这行即回到随主题的系统角色） */
.hp-cc { --hp-on-material: 255, 255, 255; }
.hp-cc {
    display: flex;
    width: 330px;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.25rem;
    color: rgba(var(--hp-on-material), 1);
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-user-select: none;
    user-select: none;
}
.hp-cc-top { display: flex; gap: 0.75rem; }
.hp-cc-col { display: flex; width: 50%; flex-direction: column; gap: 0.75rem; }
.hp-cc-pair { display: flex; justify-content: space-between; padding-inline: 0.125rem; }

/* ── 玻璃卡（宿主 = .hp-glass--fill 的定位锚） ── */
.hp-cc-card { position: relative; overflow: hidden; transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1); }
.hp-cc-card--tile {
    display: flex;
    height: 68px;
    cursor: pointer;
    align-items: center;
    gap: 0.75rem;
    border-radius: 36px;
    padding: 0.625rem;
}
.hp-cc-card--slider {
    display: flex;
    height: 72px;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 28px;
    padding: 0.75rem;
}

/* ── 卡内图标圆 + 两行文字（Wi-Fi / 专注） ── */
.hp-cc-ic {
    display: flex;
    height: 2.5rem;
    width: 2.5rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background-color: rgba(var(--hp-on-material), 0.1);
}
.hp-cc-ic--wifi { color: rgba(var(--hp-on-material), 0.7); transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1); }
.hp-cc-ic--focus { color: rgba(var(--hp-on-material), 0.8); }
.hp-cc-ic.is-on { background-color: rgba(var(--hp-on-material), 1); }
.hp-cc-ic--wifi.is-on { color: #0a84ff; box-shadow: 0 2px 10px rgba(10, 132, 255, 0.3); }
.hp-cc-ic--focus.is-on { color: #ff9f0a; box-shadow: 0 2px 10px rgba(255, 159, 10, 0.3); }
.hp-cc-tt { display: flex; flex-direction: column; overflow: hidden; line-height: 1.25; }
.hp-cc-name { font-size: 12px; font-weight: 700; letter-spacing: 0.025em; }
.hp-cc-sub { width: 75px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: rgba(var(--hp-on-material), 0.5); }

/* ── 圆钮 ── */
.hp-cc-circle {
    position: relative;
    display: flex;
    height: 68px;
    width: 68px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 9999px;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hp-cc-circle--tog { color: rgba(var(--hp-on-material), 0.8); }

/* 只有颜色：源那句 `cursor-not-allowed` 从来没生效过——同特异性下工具类时代
   `.cursor-pointer` 排在 `.cursor-not-allowed` 之后，圆钮基类的 pointer 恒赢。
   实测计算值就是 pointer，这里照实抄；要改成真禁用手型是行为变更，另开一轮。 */
.hp-cc-circle.is-disabled { color: rgba(var(--hp-on-material), 0.35); }
.hp-cc-circle.is-on { position: static; overflow: visible; }
.hp-cc-circle--tog.is-on { background-color: rgba(var(--hp-on-material), 1); color: #0a84ff; box-shadow: 0 2px 10px rgba(10, 132, 255, 0.3); }

/* ── 滑杆卡（显示 / 声音） ── */
.hp-cc-lbl { margin-left: 0.25rem; font-size: 12px; font-weight: 700; letter-spacing: 0.025em; }
.hp-cc-slider-row { display: flex; align-items: center; gap: 0.75rem; }
.hp-cc-slider {
    position: relative;
    height: 1.5rem;
    flex: 1;
    cursor: pointer;
    overflow: hidden;
    border-radius: 9999px;
    border-style: solid;
    border-width: 1px;
    border-color: rgba(var(--hp-on-material), 0.05);
    background-color: rgba(var(--hp-on-material), 0.15);
}
.hp-cc-slider-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-radius: 9999px;
    background-color: rgba(var(--hp-on-material), 0.95);
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hp-cc-sic { flex-shrink: 0; }
.hp-cc-sic--lead { margin-left: 0.125rem; color: rgba(var(--hp-on-material), 0.6); }
.hp-cc-sic--tail { color: rgba(var(--hp-on-material), 0.7); }
.hp-cc-sic--tail-gap { margin-right: 0.125rem; }

/* transition-colors（tw 的属性清单逐字；`--tw-gradient-*` 是产物里的空转项，
   留着是为了计算值与源逐字相同）。时长 300ms 来自源根 `duration-300` 的
   `--tw-duration` **继承**——本条自己没写 duration，别按 150ms 默认值写。 */
.hp-cc-ic--focus {
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

@media (hover: hover) {
    .hp-cc-card--tile:hover,
    .hp-cc-card--slider:hover {
        background-color: rgba(var(--hp-on-material), 0.04);
    }
    .hp-cc-circle:not(.is-on):not(.is-disabled):hover { background-color: rgba(var(--hp-on-material), 0.04); }
}

/* ── 强调色点（主干第九轮能力块的玻璃语言版；theme-engine ACCENT_PRESETS） ── */
.hp-cc-dots { display: flex; gap: 0.5rem; padding-inline: 0.125rem; }
.hp-cc-dot {
    width: 22px; height: 22px; border-radius: 9999px; cursor: pointer;
    border: 2px solid transparent; padding: 0; flex-shrink: 0;
    transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hp-cc-dot.is-on { border-color: rgba(var(--hp-on-material), 0.95); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35); }
@media (hover: hover) { .hp-cc-dot:hover { transform: scale(1.12); } }
