/* 登录页、改口令页、侧栏账号区、明文 HTTP 提示与管理页（F-09）。index.html 已引入本文件。 */

/* 明文 HTTP 部署（ALLOW_PLAIN_HTTP）的常驻提示：在页面最上方占一行，其余布局整体下移。 */
.security-warning { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--color-danger-border); background: var(--color-danger-bg); color: var(--color-danger); font-size: var(--font-size-sm); line-height: var(--line-height-sm); }
.security-warning svg { width: var(--icon-size); height: var(--icon-size); }
.shell.with-warning { grid-template-rows: auto minmax(0, 1fr); }
.shell.with-warning > .security-warning { grid-column: 1 / -1; }
.shell.with-warning .main, .shell.with-warning .workbench { height: 100%; }

/* 登录页与改口令页：不显示侧栏，表单居中。 */
.auth-page { display: flex; flex-direction: column; min-height: 100vh; }
.auth-main { display: flex; flex: 1; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 400px; max-width: 100%; padding: 32px; }
.auth-card .page-heading { display: block; margin-bottom: 20px; }
.auth-card .banner { margin-bottom: 16px; }
.auth-form > button[type=submit] { width: 100%; height: var(--control-height-lg); margin-top: 8px; }
.auth-form .small-note { margin-top: -8px; margin-bottom: 0; }
.auth-card > .small-note { margin-top: 16px; text-align: center; }

/* 侧栏底部的账号菜单（UI1，深色侧栏）：头像、显示名与角色合成一个按钮，点开向上弹出菜单；收起同其他 details.menu。 */
.account > summary { display: flex; gap: 10px; width: 100%; padding: 6px 8px; border: 0; background: none; color: #929aa6; }
.account > summary:hover, .account[open] > summary { background: var(--color-sidebar-active); color: var(--color-sidebar-ink-strong); }
.account > summary > svg { flex: none; width: 14px; height: 14px; }
.account-avatar { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--color-sidebar-active); color: var(--color-sidebar-ink-strong); font-size: var(--font-size-sm); font-weight: 600; }
.account-info { display: flex; flex: 1; flex-direction: column; min-width: 0; text-align: left; }
.account-name, .account-roles { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-name { color: #e4e6e9; font-size: var(--font-size); }
.account-roles { color: #858d99; font-size: var(--font-size-sm); line-height: var(--line-height-sm); }
.account-pop { top: auto; right: 0; bottom: calc(100% + 6px); left: 0; min-width: 0; color: var(--color-text); }
.account-pop button { color: var(--color-text); }
.account-pop hr { width: 100%; margin: 3px 0; border: 0; border-top: 1px solid var(--color-split); }
.feedback-entry + .account { margin-top: 4px; }
.account + .demo-entry { margin-top: 4px; }

/* 管理页 */
.admin-section + .admin-section { margin-top: 16px; }
.admin-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--color-split); }
.admin-section-head h2 { margin: 0; }
/* 标题行右端的一组按钮（用户分区：清除登录限制、新建账号），整组靠右。 */
.admin-section-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
/* 新建、登记类按钮紧跟分区标题放左（U-21，D-68）：用户、我方主体与账户 */
.admin-section.card-pad h2 { margin-bottom: 16px; }
.row-actions { display: flex; gap: 12px; }
.role-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.temporary-password { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.temporary-password code { padding: 6px 12px; border: 1px solid var(--color-line); border-radius: var(--radius); background: var(--color-fill); font-family: var(--font-mono); font-size: var(--font-size-lg); letter-spacing: .04em; user-select: all; }
.audit-filter-wrap { border-bottom: 1px solid var(--color-split); }
.audit-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.audit-filters .field { width: 200px; margin-bottom: 0; }
.audit-filter-actions { display: flex; gap: 8px; }
.audit-table td { vertical-align: top; }
.audit-detail { min-width: 240px; overflow-wrap: anywhere; color: var(--color-text-2); }

/* 56px 图标栏：只显示头像，菜单在侧栏右边弹出、底边对齐 */
@media (max-width: 1000px) {
  .account > summary { justify-content: center; width: 40px; height: 40px; margin: 0 auto; padding: 0; }
  .account-info, .account > summary > svg { display: none; }
  .account-pop { right: auto; bottom: 0; left: calc(100% + 8px); min-width: 168px; }
}
@media (max-width: 760px) {
  .shell.with-warning { grid-template-rows: auto 48px minmax(0, 1fr); }
  .sidebar-footer:has(> .account) { display: flex; align-items: center; gap: 2px; }
  .feedback-entry + .account, .account + .demo-entry { margin-top: 0; }
  /* 顶栏：菜单向下弹出、靠右 */
  .account-pop { top: calc(100% + 6px); right: 0; bottom: auto; left: auto; }
  .auth-card { padding: 24px 20px; }
  .audit-filters .field { width: 100%; }
}
.row-actions .link.danger { color: var(--color-danger); }
