/* ============================================================================
 * 星穹 · 统一权限控制台
 * ==========================================================================*/
.admin { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 0 26px 70px; }
@media (max-width: 720px) { .admin { padding: 0 12px 44px; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(26px, 2.6vw, 36px); letter-spacing: .06em; }
.page-head .sub { font-size: 13px; color: var(--text-3); margin-top: 8px; max-width: 720px; line-height: 1.9; }

.ro-flag {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; margin-bottom: 18px;
  border-radius: var(--r-md);
  border: 1px solid rgba(234,184,106,.35);
  background: rgba(234,184,106,.08);
  font-size: 12.5px; color: #f0d59a;
}

/* 标签页 */
.tabbar {
  position: sticky; top: 62px; z-index: 40;
  display: flex; gap: 4px; padding: 5px; margin-bottom: 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(6, 10, 23, 0.82);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  overflow-x: auto; scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tabbar button {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: 999px; flex: none;
  font-size: 13px; color: var(--text-3); letter-spacing: .04em;
  transition: all .26s var(--ease);
}
.tabbar button:hover { color: var(--text); background: rgba(255,255,255,.05); }
.tabbar button.on { color: #0c0c14; font-weight: 600; background: linear-gradient(120deg, var(--gold-bright), var(--gold)); box-shadow: 0 8px 24px -10px rgba(230,197,136,.8); }
.tabbar button .n { font-family: var(--font-mono); font-size: 10px; opacity: .7; }

/* 面板 */
.panel { padding: 24px 26px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head h2 { font-family: var(--font-display); font-size: 20px; letter-spacing: .06em; }
.panel-head .desc { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; }

/* 权限矩阵 */
.matrix-wrap { overflow: auto; max-height: 62vh; border-radius: var(--r-md); border: 1px solid var(--line); }
table.matrix { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
table.matrix th, table.matrix td { padding: 0; }
table.matrix thead th {
  position: sticky; top: 0; z-index: 3;
  background: rgba(9, 14, 30, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-strong);
  padding: 11px 8px; text-align: center;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: var(--text-3); font-weight: 400;
}
table.matrix thead th .zh { display: block; font-family: var(--font-sans); font-size: 11px; letter-spacing: .04em; color: var(--text-2); margin-top: 3px; }
table.matrix th.corner { position: sticky; left: 0; z-index: 5; text-align: left; padding-left: 16px; min-width: 230px; }
table.matrix tbody th {
  position: sticky; left: 0; z-index: 2;
  background: rgba(9, 14, 30, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(158,178,255,.08);
  text-align: left; padding: 9px 14px 9px 16px; font-weight: 500; color: var(--text-2);
  white-space: nowrap;
}
table.matrix tbody th .sg { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; margin-right: 9px; font-family: var(--font-mono); font-size: 9px; color: #fff; vertical-align: middle; }
table.matrix tbody td { border-bottom: 1px solid rgba(158,178,255,.07); text-align: center; height: 42px; }
table.matrix tbody tr:hover th, table.matrix tbody tr:hover td { background: rgba(115,103,240,.08); }
.cell {
  width: 24px; height: 24px; border-radius: 7px;
  border: 1px solid var(--line);
  display: inline-grid; place-items: center;
  cursor: pointer; transition: all .2s var(--ease);
  color: transparent; background: rgba(255,255,255,.02);
}
.cell:hover { border-color: rgba(230,197,136,.6); transform: scale(1.08); }
.cell.on { color: #0c0c14; border-color: transparent; }
.cell.on.view { background: linear-gradient(140deg, #8ce9ff, #45b7e8); }
.cell.on.edit { background: linear-gradient(140deg, #c5bcff, #7b6ef2); }
.cell.on.publish { background: linear-gradient(140deg, #ffe6ad, #e0b768); }
.cell.on.admin { background: linear-gradient(140deg, #ffb0c0, #e2547a); }
.cell.inherit { background: rgba(230,197,136,.14); border-color: rgba(230,197,136,.4); color: var(--gold-bright); }
.cell.ro { cursor: not-allowed; opacity: .7; }

/* 用户表 */
.u-cell { display: flex; align-items: center; gap: 11px; }
.u-cell .n { font-size: 13.5px; }
.u-cell .a { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-4); }
.tag-line { display: flex; gap: 5px; flex-wrap: wrap; }

/* 审批卡 */
.req {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  padding: 16px 18px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: rgba(255,255,255,.028);
  margin-bottom: 12px; transition: all .26s var(--ease);
}
.req:hover { border-color: rgba(230,197,136,.34); background: rgba(230,197,136,.05); }
.req.done { opacity: .62; }
.req .rt { font-size: 13.5px; }
.req .rm { font-size: 11.5px; color: var(--text-3); margin-top: 5px; line-height: 1.7; }
.req .rid { font-family: var(--font-mono); font-size: 10px; color: var(--text-4); }

/* 审计时间线 */
.tl { position: relative; padding-left: 26px; }
.tl::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(180deg, rgba(230,197,136,.4), rgba(115,103,240,.3), transparent); }
.tl-item { position: relative; padding: 9px 0 9px 4px; }
.tl-item::before {
  content: ''; position: absolute; left: -23px; top: 15px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--void-2); border: 1px solid var(--line-strong);
}
.tl-item.info::before { border-color: rgba(115,103,240,.8); box-shadow: 0 0 10px rgba(115,103,240,.8); }
.tl-item.warn::before { border-color: rgba(230,197,136,.9); box-shadow: 0 0 10px rgba(230,197,136,.9); }
.tl-item.risk::before { border-color: rgba(255,107,129,.9); box-shadow: 0 0 12px rgba(255,107,129,.9); background: rgba(255,107,129,.3); }
.tl-item .ta { font-family: var(--font-mono); font-size: 10px; color: var(--text-4); }
.tl-item .tm { font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.7; }
.tl-item .tu { color: var(--gold); }

/* 风险 / 清单 */
.risk-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed rgba(158,178,255,.12); font-size: 12.5px; }
.risk-row:last-child { border-bottom: 0; }
.risk-row .lvl { width: 3px; align-self: stretch; border-radius: 3px; background: var(--risk); flex: none; }
.risk-row .lvl.mid { background: var(--warn) } .risk-row .lvl.low { background: var(--ok) }

.dist { display: flex; flex-direction: column; gap: 11px; }
.dist .d-row { display: grid; grid-template-columns: 96px 1fr 42px; align-items: center; gap: 10px; font-size: 12px; color: var(--text-3); }
.dist .track { height: 8px; border-radius: 6px; background: rgba(255,255,255,.06); overflow: hidden; display: flex; }
.dist .track i { display: block; height: 100%; transition: width .8s var(--ease); }
.dist .cnt { font-family: var(--font-mono); text-align: right; color: var(--text-2); }

.mini-scope { display: inline-flex; gap: 3px; }

/* 响应式 */
@media (max-width: 1080px) {
  .tabbar { top: 62px; }
  .panel { padding: 18px 16px; }
  .req { grid-template-columns: 1fr; }
}
