/* 内部后台的混合导航外壳。按混合导航、查询表格、分区表单的设计规范实现，组件服务于内部管理任务。 */
:root { --sidebar:208px; --header-height:52px; --primary:#2864ad; }
/* 混合导航：固定蓝色顶栏、分组侧栏、可横向滚动的工作标签。 */
.topbar { left:0; right:0; height:var(--header-height); position:sticky; top:0; z-index:40; display:flex; align-items:center; background:#2860a2; color:#fff; gap:8px; padding:0 16px 0 20px; }
.topbar-start, .topbar-end { display:flex; align-items:center; gap:10px; flex-shrink:0; min-width:0; }
.topbar-start { width:180px; }
.console-brand { font-weight:750; color:#fff; text-decoration:none; white-space:nowrap; letter-spacing:.3px; }
.console-brand span { display:block; font-size:10px; font-weight:400; letter-spacing:2px; opacity:.8; line-height:1.2; }
.topbar button { white-space:nowrap; }
.topbar .secondary, .header-button { background:transparent; border-color:#ffffff40; color:#fff; padding:4px 8px; font-size:12px; }
.topbar .secondary:hover, .header-button:hover { background:#ffffff20; }
#toggle-nav { display:flex; align-items:center; justify-content:center; padding:6px; border:0; }
#toggle-nav svg { width:18px; height:18px; }
#primary-nav { display:flex; align-items:stretch; align-self:stretch; flex:1; min-width:0; overflow:auto; scrollbar-width:thin; scrollbar-color:#ffffff60 transparent; }
#primary-nav button { display:flex; align-items:center; gap:6px; background:transparent; color:#e4edfa; border-radius:0; border:0; border-bottom:3px solid transparent; padding:0 12px; font-size:13px; flex-shrink:0; }
#primary-nav button:hover { background:#ffffff12; }
#primary-nav button.active { background:#ffffff16; color:#fff; border-bottom-color:#b8d9ff; }
#primary-nav svg { width:16px; height:16px; }
#identity { color:#fff; font-size:12px; max-width:130px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#sidebar { position:fixed; inset:var(--header-height) auto 0 0; width:var(--sidebar); background:#2e4055; color:#d7e0eb; z-index:30; display:flex; flex-direction:column; }
.sidebar-heading { display:flex; flex-direction:column; padding:20px 20px 16px; border-bottom:1px solid #ffffff12; }
.sidebar-heading span { font-size:15px; font-weight:600; color:#fff; }
.sidebar-heading small { color:#aab9cb; font-size:11px; margin-top:3px; }
#nav { flex:1; min-height:0; overflow-y:auto; padding:12px 0; scrollbar-width:thin; scrollbar-color:#64788e #2e4055; }
.nav-items { display:grid; gap:2px; }
.nav-items button { display:flex; align-items:center; gap:12px; text-align:left; padding:10px 20px; min-height:42px; border:0; border-radius:0; background:transparent; color:#d7e0eb; font-size:14px; }
.nav-items button:hover { background:#ffffff0c; }
.nav-items button.active { color:#fff; background:#ffffff12; box-shadow:inset 3px 0 #6eb4ff; }
.nav-items svg { width:17px; height:17px; flex-shrink:0; opacity:.8; }
.aside-bottom { border-top:1px solid #ffffff16; padding:16px 20px; text-decoration:none; color:#c6d6e9; font-size:12px; white-space:nowrap; overflow:hidden; }
.workspace-tabs { margin-left:var(--sidebar); display:flex; align-items:center; gap:8px; background:#fff; border-bottom:1px solid var(--border); height:40px; padding:0 12px; position:sticky; top:var(--header-height); z-index:20; }
#page-tabs { display:flex; gap:4px; overflow:auto; flex:1; min-width:0; scrollbar-width:thin; }
.page-tab { display:flex; flex-shrink:0; align-items:center; border:1px solid var(--border); border-radius:3px; height:28px; }
.page-tab button { background:transparent; color:var(--muted); border:0; border-radius:0; min-height:26px; padding:2px 10px; font-size:12px; white-space:nowrap; }
.page-tab button[data-close-page] { padding:2px 7px; font-size:16px; }
.page-tab.active { background:#edf4ff; border-color:#b7d2f3; }
.page-tab.active button { color:#2463ad; }
.page-tab button:hover { background:#e7eef8; }
#close-other-tabs { min-height:26px; padding:2px 8px; font-size:12px; white-space:nowrap; }
.workspace-heading { margin-left:var(--sidebar); padding:16px 20px 12px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.workspace-heading > div { display:flex; flex-direction:column; gap:2px; }
#breadcrumb { font-size:12px; color:var(--muted); }
#title { font-size:20px; margin:0; font-weight:600; }
#workspace { margin-left:var(--sidebar); padding:0 20px 32px; min-width:0; }
.brand { display:flex; gap:10px; font-weight:700; }

.topbar-start { flex-direction:row-reverse; justify-content:space-between; padding-right:20px; }
.topbar #identity { color:#fff; }

.account-menu > div { z-index:50; background:#fff; }
.account-menu > div button { color:#2864ad; }
#identity .account-label { max-width:130px; }
#nav .nav-items { display:grid; }
#nav .nav-items button::before { display:none; }
/* 菜单必须固定左对齐，覆盖通用图标按钮的居中规则；收起态在下方单独居中。 */
#nav .nav-items button { display:flex; justify-content:flex-start; gap:12px; padding:10px 20px; }
#content { min-width:0; }
#content > .table-wrap, #content > .filters, #content > .access-table-wrap { background:#fff; }
button { min-height:34px; border-radius:4px; padding:6px 14px; }
input,select,textarea { min-height:36px; border-radius:4px; padding:7px 10px; }
label,.platform-view,.platform-view input,.platform-view select,.platform-view textarea { font-size:14px; }
.card,.panel,.filters { border-radius:5px; }
.filters { padding:16px; gap:12px; background:#fff; }
.table-wrap { max-height:62vh; background:#fff; border-radius:5px; }
table { font-size:14px; }
th,td { padding:10px 14px; }
thead th { position:sticky; top:0; z-index:1; background:#f5f7fa; }
.access-page-header { margin:0 0 16px; }
.access-page-header h2,.access-page-icon { display:none; }
.access-page-header p { font-size:13px; }
.access-metrics { grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:16px; }
.access-metric { border-radius:5px; padding:18px; }
.access-metric > span { font-size:13px; }
.hosting-service-form { margin-top:20px; }
.hosting-service-form form { max-width:600px; display:grid; gap:16px; }
.hosting-service-form button { justify-self:start; }
.hosting-service-form h3 { margin-top:0; }
.platform-view .access-table { font-size:14px; }
.ops-cards .card { border-radius:5px; }
.ops-panel h2,.card h2 { font-size:17px; }
.ops-panel .table-wrap { max-height:50vh; }
.ops-notes { background:#fff; border:1px solid var(--border); border-radius:5px; }
#modal { background:#fff; }
#modal input,#modal select,#modal textarea { background:#fff; }
#modal label { font-size:14px; }
#modal-body { overflow-wrap:anywhere; }
#nav-backdrop { z-index:29; }
.nav-collapsed #nav { overflow-y:auto; padding:12px 0; }
.nav-collapsed #nav .nav-items { position:static; display:grid; min-width:0; border:0; padding:0; box-shadow:none; background:transparent; }
.nav-collapsed .sidebar-heading,.nav-collapsed #nav .nav-items span,.nav-collapsed .aside-bottom { display:none; }
.nav-collapsed #nav .nav-items button { justify-content:center; padding:12px; }
@media(max-width:1300px) {
 :root { --header-height:94px; }
 .topbar { display:grid; grid-template-columns:190px minmax(0,1fr); grid-template-rows:52px 42px; gap:0; }
 #primary-nav { grid-column:1/-1; grid-row:2; }
 .topbar-end { justify-content:flex-end; }
}
@media(max-width:760px) {
 :root,.nav-collapsed { --sidebar:208px; }
 #sidebar { transform:translateX(-100%); width:228px; }
 .nav-open #sidebar { transform:translateX(0); }
 #workspace,.workspace-heading,.workspace-tabs { margin-left:0; }
 #workspace { padding:0 14px 24px; }
 .workspace-heading { padding:14px; }
 .topbar { left:0; padding:0 12px; }
 .nav-collapsed .sidebar-heading { display:flex; }
 .nav-collapsed #nav .nav-items span { display:inline; }
 .nav-collapsed #nav .nav-items button { justify-content:flex-start; padding:10px 20px; }
 .nav-collapsed .aside-bottom { display:flex; }
 #identity .account-label { max-width:90px; }
 .cards,.ops-cards,.access-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .filters { padding:12px; }
 .filters input { max-width:100%; }
}
@media(max-width:540px) {
 :root { --header-height:138px; }
 .topbar { grid-template-columns:minmax(0,1fr); grid-template-rows:44px 50px 44px; }
 .topbar-start { width:100%; padding:0; }
 .console-brand span { display:inline; margin-left:8px; }
 .topbar-end { grid-row:2; justify-content:space-between; width:100%; }
 #primary-nav { grid-row:3; }
 #primary-nav button { padding:0 12px; }

 #identity .account-label { max-width:140px; }
}
/* 行内操作与表单页脚分开：避免每条记录继承分隔线和大块留白。 */
.access-table .access-actions { margin:0; padding:0; border:0; justify-content:flex-start; flex-wrap:nowrap; }
.platform-view .access-table td { padding:14px 20px; }
.access-stack strong { font-size:14px; }
.access-stack small,.access-stack code,.access-badge { font-size:12px; }
.topbar #toggle-nav { color:#fff; }
/* 接入申请、合作商和投递记录与通用列表采用同一滚动容器，分页始终在列表外。 */
.access-table-wrap { max-height:62vh; border:1px solid var(--border); border-radius:5px; background:#fff; }
.platform-view .access-table thead th { position:sticky; top:0; z-index:2; }
.access-badge.success { color:#147d55; background:#eaf7f0; border-color:#b5dfcc; }
.access-badge.warning { color:#8c6419; background:#fffbef; border-color:#eadbb9; }
.access-badge.danger { color:#b42332; background:#fff1f0; border-color:#efc3c6; }

/* 查询页：一块连续工作区承载操作、筛选、记录和分页，统计卡片仍独立分区。 */
#content.record-workspace { background:#fff; border:1px solid var(--border); border-radius:5px; padding:20px; }
.record-workspace > .filters,.record-workspace > .access-filters { border:0; border-radius:0; padding:0 0 20px; margin:0 0 20px; border-bottom:1px solid var(--border); box-shadow:none; }
.record-workspace > .table-wrap,.record-workspace > .access-table-wrap { border:0; border-radius:0; }
.record-workspace > .pagination,.record-workspace > .access-pagination { margin-bottom:0; }
.page-actions { display:flex; justify-content:flex-end; gap:8px; margin-bottom:16px; }
.filters,.access-filters { align-items:flex-end; }
.filters > .query-field,.access-filters > .query-field { display:flex; flex-direction:column; flex:0 1 180px; min-width:140px; gap:6px; margin:0; }
.query-field > span { font-size:13px; color:#526176; }
.query-field input,.query-field select { width:100%; max-width:none; height:36px; margin:0; box-sizing:border-box; }
.filters > button { flex:none; align-self:flex-end; height:36px; margin-bottom:0; }
.access-filters .access-field { margin:0; gap:6px; }
.access-filters input,.access-filters select,.access-filters button { height:36px; min-height:36px; }
.record-workspace .empty { border:0; background:transparent; padding:48px 16px; }
/* 详情与短表单采用不同容器；原生 dialog 保留焦点锁定、Escape 和可访问性。 */
#modal.compact-dialog { inset:0; margin:auto; width:min(560px,calc(100vw - 32px)); height:fit-content; max-height:85dvh; border:1px solid var(--border); border-radius:8px; padding:24px; box-shadow:0 20px 70px #15243b40; }
#modal.compact-dialog .modal-head { top:-24px; background:#fff; }
#modal.compact-dialog .modal-head h2 { font-size:18px; }
#modal.compact-dialog form { display:grid; gap:16px; }
#modal.compact-dialog form > label { margin:0; }
#modal.compact-dialog .access-review-form { padding:0; border:0; background:transparent; }
@media(max-width:760px) {
 #content.record-workspace { padding:14px; }
 .filters > .query-field,.access-filters > .query-field { flex:1 1 130px; min-width:0; }
 .query-field > span { font-size:12px; }
 .page-actions { justify-content:flex-start; }
 #modal.compact-dialog { padding:18px; }
 #modal.compact-dialog .modal-head { top:-18px; }
}
@media(max-width:540px) {
 .record-workspace > .pagination { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
 .record-workspace > .pagination > span { grid-column:1/-1; grid-row:1; text-align:center; }
 .record-workspace > .pagination > button:last-child { justify-self:end; }
}
