/* ════════════════════════════════════════════════════════════
   开心格 · 超级管理员后台
   侧栏只放管理员要盯的（概览 / 用户 / 系统 / 应用），具体应用从「全部应用」进。
   颜色、圆角对应 Design System「开心格」的 token（dark、light、yellow、muted、line、pill-*）。
   ════════════════════════════════════════════════════════════ */
:root {
  --muted: #5B6B7C;
  --line: #E3E8EF;
  --link: #2563C9;
  --pill-public-bg: #E3F7EA; --pill-public-fg: #00692A;
  --pill-dev-bg: #EDEFF2;    --pill-dev-fg: #46535F;
}
body { background: var(--light); }

/* 顶栏 */
.adm-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 10px 24px; background: #fff; border-bottom: 2px solid var(--dark); }
.adm-brand { display: flex; align-items: center; gap: 10px; color: var(--dark); text-decoration: none; }
.adm-brand b { font-size: 17px; }
.adm-logo { width: 32px; height: 32px; border-radius: 8px; background: var(--yellow); border: 2px solid var(--dark); display: flex; align-items: center; justify-content: center; font-weight: 900; }
.adm-role { font-size: 13px; color: var(--muted); font-weight: 600; }
.adm-top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-user { font-size: 14px; font-weight: 600; }
.adm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 2px solid var(--dark); background: #fff; color: var(--dark); font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; }
.adm-btn:hover { background: var(--light); }

/* 布局 */
.adm { display: flex; flex-wrap: wrap; min-height: calc(100vh - 64px); }
.adm-side { flex: 1 1 232px; max-width: 260px; background: #fff; border-right: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 2px; box-sizing: border-box; }
.adm-main { flex: 999 1 560px; min-width: 0; padding: 24px 32px 48px; box-sizing: border-box; }
@media (max-width: 820px) {
  .adm-side { max-width: none; flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .adm-main { padding: 20px 16px 40px; }
}

/* 侧栏 */
.adm-ns { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 1px; padding: 14px 10px 6px; }
.adm-nav { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--dark); text-decoration: none; }
.adm-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.adm-nav:hover { background: var(--light); }
.adm-nav.active { background: var(--yellow); box-shadow: inset 0 0 0 2px var(--dark); }
.adm-badge { margin-left: auto; font-size: 11px; font-weight: 800; background: var(--red); color: #fff; border-radius: 999px; padding: 1px 7px; }
.adm-count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.adm-nav.active .adm-count { color: var(--dark); }
.adm-recent { padding: 4px 10px 0 38px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.adm-recent a { color: var(--link); }

/* 页头 */
.adm-pagehead { margin-bottom: 20px; }
.adm-crumb { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.adm-crumb a { color: var(--link); font-weight: 700; text-decoration: none; }
.adm-pagehead h1 { margin: 0; font-size: 26px; font-weight: 900; color: var(--dark); }
.adm-sub { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.adm-sub:empty { display: none; }

/* 卡片、通用 */
.adm-card { background: #fff; border: 2px solid var(--dark); border-radius: 14px; padding: 20px; box-sizing: border-box; }
.adm-h2 { margin: 0; font-size: 17px; font-weight: 900; color: var(--dark); }
.adm-cardhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.adm-cardhead a { font-size: 14px; font-weight: 700; color: var(--link); text-decoration: none; }
.adm-muted { font-size: 13px; color: var(--muted); }
.adm-path { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); }
.adm-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.adm-pill.public { background: var(--pill-public-bg); color: var(--pill-public-fg); }
.adm-pill.developer { background: var(--pill-dev-bg); color: var(--pill-dev-fg); }
.adm-pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.adm-tablewrap { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 12px; border-bottom: 2px solid var(--line); }
.adm-table td { padding: 12px; border-bottom: 1px solid #EEF1F5; }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-table a { color: var(--dark); font-weight: 700; text-decoration: none; }
.adm-table a:hover { color: var(--link); }

/* 分段选择（谁能用、筛选） */
.adm-seg { display: inline-flex; flex-wrap: wrap; border: 2px solid var(--dark); border-radius: 10px; overflow: hidden; }
.adm-seg button { min-height: 36px; padding: 0 14px; border: 0; background: #fff; font: inherit; font-size: 14px; font-weight: 700; color: var(--dark); cursor: pointer; }
.adm-seg button.on { background: var(--dark); color: #fff; }

/* 概览 */
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.adm-kpi-l { font-size: 13px; color: var(--muted); font-weight: 700; }
.adm-kpi-v { font-size: 32px; font-weight: 900; margin-top: 6px; color: var(--dark); }
.adm-kpi-s { font-size: 13px; color: var(--muted); }
.adm-kpi-warn { background: #FFF4C2; }
.adm-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }
.adm-todo-item { display: flex; align-items: center; gap: 14px; padding: 14px 2px; border-bottom: 1px solid #EEF1F5; }
.adm-todo-item:last-child { border-bottom: 0; }
.adm-todo-item b { font-size: 14px; }
.adm-todo-item .adm-btn { margin-left: auto; flex: none; }
.adm-todo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); flex: none; }
.adm-todo-ok { padding: 14px 2px; color: var(--pill-public-fg); font-weight: 700; font-size: 14px; }

/* 全部应用 */
.adm-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 22px; }
.adm-search { display: flex; align-items: center; gap: 8px; border: 2px solid var(--dark); border-radius: 10px; padding: 0 12px; min-height: 40px; flex: 1 1 220px; max-width: 320px; background: #fff; }
.adm-search svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2.2; }
.adm-search input { border: 0; outline: none; background: transparent; font: inherit; font-size: 14px; width: 100%; }
.adm-group { margin-bottom: 26px; }
.adm-grouphead { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.adm-appgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.adm-appcard { background: #fff; border: 2px solid var(--dark); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--dark); min-height: 170px; box-sizing: border-box; transition: box-shadow .15s, transform .15s; }
.adm-appcard:hover { box-shadow: 5px 5px 0 var(--dark); transform: translate(-1px, -1px); }
.adm-appcard[hidden] { display: none; }
.adm-appcard-top { display: flex; gap: 12px; align-items: center; }
.adm-appname { font-size: 16px; font-weight: 900; }
.adm-appsum { font-size: 13px; color: #46535F; line-height: 1.6; flex: 1; }
.adm-appcard-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.adm-go { font-size: 13px; font-weight: 700; color: var(--link); white-space: nowrap; }
.adm-newapp { border: 2px dashed #8795A3; border-radius: 14px; padding: 16px; text-align: center; }

/* 应用详情页头 */
.adm-apphead { margin-bottom: 20px; display: flex; flex-direction: column; gap: 16px; }
.adm-apphead-row { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.adm-apphead-id { display: flex; gap: 14px; align-items: center; }
.adm-appname-lg { margin: 0; font-size: 24px; font-weight: 900; }
.adm-apphead-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.adm-switch-app { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.adm-switch-app select { min-height: 40px; border: 2px solid var(--dark); border-radius: 10px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--dark); background: #fff; }
.adm-apphead-ctrl { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; padding-top: 16px; border-top: 1px solid #EEF1F5; }
.adm-ctrl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.adm-ctrl > span:first-child { font-size: 14px; font-weight: 700; }
.adm-saved { font-size: 13px; color: var(--pill-public-fg); font-weight: 700; }
.adm-empty { color: var(--muted); font-size: 14px; }

/* 按钮变体 */
.adm-btn-primary { background: var(--blue); color: #fff; }
.adm-btn-primary:hover { background: #3A7FEF; }
.adm-btn-yellow { background: var(--yellow); }
.adm-btn-yellow:hover { background: #F5CC1F; }
.adm-btn-quiet { border-color: var(--line); }
.adm-btn-danger { border-color: #F3B0B0; color: #B42318; }
.adm-btn-danger:hover { background: #FFF1F1; }
.adm-btn:disabled { opacity: .6; cursor: default; }
.adm-link { border: 0; background: none; padding: 0; min-height: 32px; font: inherit; font-size: 14px; font-weight: 700; color: var(--link); cursor: pointer; text-decoration: none; }
.adm-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.adm-wrap { flex-wrap: wrap; gap: 12px; }
.adm-stack { display: flex; flex-direction: column; gap: 12px; }
.adm-pill.bad { background: #FFECEC; color: #9B2C2C; }
.adm-pill.dev-on { background: #EEF4FF; color: #1B4A99; }
.adm-ok { color: var(--pill-public-fg); font-weight: 700; }

/* 左内容 + 右侧栏 */
.adm-split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.adm-split > :first-child { flex: 999 1 460px; min-width: 0; }
.adm-aside { flex: 1 1 300px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.adm-flush { padding: 6px; }
.adm-pad { padding: 0 12px 8px; margin: 6px 0 0; }

/* 输入 */
.adm-input { width: 100%; box-sizing: border-box; border: 2px solid var(--dark); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.6; background: #fff; color: var(--dark); }
textarea.adm-input { resize: vertical; }
.adm-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(74,144,255,0.25); }

/* 每日挑战：步骤 */
.adm-steps { display: flex; flex-direction: column; gap: 26px; }
.adm-step { display: flex; gap: 16px; }
.adm-num { width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--dark); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 14px; flex: none; }
.adm-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.adm-step-body p { margin: 0; }
.adm-step-title { display: block; font-size: 16px; font-weight: 900; margin-top: 3px; color: var(--dark); }
.adm-drop { border: 2px dashed #8795A3; border-radius: 12px; padding: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--light); font-size: 14px; }
.adm-drop input[type=file] { font-size: 13px; max-width: 100%; }
.adm-media-prev { max-width: 320px; max-height: 200px; border: 2px solid var(--dark); border-radius: 10px; object-fit: contain; background: #fff; }
.adm-iframe { width: 100%; max-width: 480px; aspect-ratio: 16 / 9; max-height: none; background: #000; }
.adm-vblock { display: flex; flex-direction: column; gap: 8px; }
.adm-vnote:empty { display: none; }
.adm-publish { display: flex; flex-direction: column; gap: 14px; }
.adm-toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; cursor: pointer; }
.adm-missing { font-size: 13px; color: var(--muted); border-top: 1px solid #EEF1F5; padding-top: 10px; }
.adm-missing b { color: var(--dark); }
.adm-kidprev { border: 2px solid var(--dark); border-radius: 14px; padding: 16px; background: var(--light); display: flex; flex-direction: column; gap: 10px; }
.adm-kidprev-q { font-size: 15px; font-weight: 700; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.adm-kidprev-media { aspect-ratio: 16 / 9; border-radius: 10px; background: var(--dark); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.adm-kidprev-media[hidden] { display: none; }
.adm-kidprev-ans { display: flex; gap: 8px; }
.adm-kidprev-ans span { flex: 1; border: 2px solid var(--dark); border-radius: 8px; background: #fff; min-height: 36px; }
.adm-kidprev-ans b { border: 2px solid var(--dark); border-radius: 8px; background: var(--yellow); padding: 0 14px; display: flex; align-items: center; font-size: 14px; }

/* 派对游戏：二级标签、AI 对比、最近被踩 */
.adm-subtabs { display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.adm-subtabs [data-sub] { min-height: 44px; padding: 0 2px; border: 0; border-bottom: 3px solid transparent; background: none; font: inherit; font-size: 15px; font-weight: 700; color: var(--muted); cursor: pointer; }
.adm-subtabs [data-sub].on { color: var(--dark); border-bottom-color: var(--dark); }
.adm-subtabs-end { margin-left: auto; min-height: 34px; }
.adm-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; background: var(--light); border-radius: 12px; padding: 14px; }
.adm-compare-h { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 6px; letter-spacing: 1px; }
.adm-compare-t { font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
div.adm-compare-t { background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 120px; }
.adm-compare-actions { grid-column: 1 / -1; }
.adm-recentfb-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #EEF1F5; }
.adm-recentfb-item:last-child { border-bottom: 0; }
.adm-table tr[hidden] { display: none; }
.adm-table td .btn { margin: 2px; }

/* 家庭、账号 */
.adm-table-click tbody tr { cursor: pointer; }
.adm-table-click tbody tr:hover td { background: var(--light); }
.adm-table tr.sel td { background: #FFF4C2; }
.adm-detail { display: flex; flex-direction: column; gap: 12px; border-width: 3px; box-shadow: 5px 5px 0 var(--dark); }
.adm-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.adm-facts > div { background: var(--light); border-radius: 10px; padding: 12px; }
.adm-code { font-family: ui-monospace, Menlo, monospace; font-size: 18px; font-weight: 800; letter-spacing: 2px; margin-top: 2px; }
.adm-mem { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #EEF1F5; }
.adm-mem > div { flex: 1; min-width: 0; }
.adm-av { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--dark); background: #EEF4FF; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex: none; object-fit: cover; box-sizing: border-box; }
.adm-who { display: flex; align-items: center; gap: 10px; }
.adm-actions { white-space: nowrap; text-align: right; }
.adm-actions .adm-btn { margin-left: 6px; min-height: 34px; padding: 0 12px; }

/* 手机：侧栏收成菜单 */
.adm-menu-btn { display: none; }
@media (max-width: 820px) {
  .adm-menu-btn { display: inline-flex; }
  .adm-side { display: none; }
  .adm-side.open { display: flex; }
  .adm-top { padding: 10px 16px; }
  .adm-user { display: none; }
}

/* hidden 属性永远优先（上面不少类设了 display） */
.adm [hidden], .adm-top [hidden] { display: none !important; }
