:root {
  --auth-ink: #152033;
  --auth-muted: #64748b;
  --auth-line: rgba(148, 163, 184, 0.32);
  --auth-primary: #2563eb;
  --auth-primary-dark: #1d4ed8;
  --auth-bg: #eef3fb;
}

.auth-page {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  color: var(--auth-ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(37, 99, 235, 0.18), transparent 34%),
    radial-gradient(circle at 88% 82%, rgba(14, 165, 233, 0.16), transparent 36%),
    var(--auth-bg);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.auth-shell {
  width: min(420px, 100%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--auth-ink);
  text-decoration: none;
}

.auth-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #0ea5e9);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.auth-brand strong {
  display: block;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.auth-brand small {
  color: var(--auth-muted);
  font-size: 12px;
}

.auth-card {
  padding: 30px 28px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(12px);
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.25;
}

.auth-subtitle {
  margin: 0 0 24px;
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.auth-field label {
  font-size: 13px;
  font-weight: 650;
}

.auth-field input,
.auth-field select {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: #fff;
  color: var(--auth-ink);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input:focus,
.auth-field select:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.auth-submit {
  width: 100%;
  height: 46px;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--auth-primary), #0ea5e9);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.auth-submit:hover {
  filter: brightness(1.04);
}

.auth-submit:active {
  transform: translateY(1px);
}

.auth-remember {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--auth-muted, #667085);
}

.auth-remember label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #344054;
  cursor: pointer;
  user-select: none;
}

.auth-remember input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--auth-primary, #2563eb);
  cursor: pointer;
}

.auth-remember small {
  font-size: 12px;
  color: var(--auth-muted, #98a2b3);
}

.auth-error {
  margin: 0 0 16px;
  padding: 11px 13px;
  border: 1px solid rgba(239, 68, 68, 0.24);
  border-radius: 12px;
  background: rgba(254, 226, 226, 0.72);
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.55;
}

.auth-footnote {
  margin: 20px 0 0;
  color: var(--auth-muted);
  font-size: 12px;
  line-height: 1.65;
  text-align: center;
}

.auth-footnote a {
  color: var(--auth-primary);
  text-decoration: none;
  font-weight: 600;
}

/* 登录后的账号/用户管理页面 */
.app-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.app-section-head h1 {
  margin: 4px 0 6px;
  font-size: 24px;
  line-height: 1.25;
}

.app-section-head .app-breadcrumb {
  color: #64748b;
  font-size: 12px;
}

.app-section-head .panel-note {
  margin: 0;
}

.account-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}

.account-card {
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.account-card h2 {
  margin: 0 0 6px;
  font-size: 17px;
}

.account-card p {
  margin: 0 0 16px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.65;
}

.account-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.account-form-row .auth-field {
  flex: 1 1 190px;
  margin-bottom: 0;
}

.account-form-row button {
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #2563eb;
  font-weight: 650;
  cursor: pointer;
}

.account-form-row button.secondary {
  color: #1e293b;
  background: #e2e8f0;
}

.account-form-row button.danger {
  background: #dc2626;
}

.token-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: #f8fafc;
}

.token-row code {
  color: #334155;
  font-size: 13px;
}

.token-row small {
  display: block;
  margin-top: 3px;
  color: #94a3b8;
  font-size: 11px;
}

.token-row form {
  margin: 0;
}

.token-row button {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash-message {
  padding: 11px 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
}

.flash-message.is-error {
  border-color: rgba(239, 68, 68, 0.3);
  background: #fef2f2;
  color: #b91c1c;
}

.flash-message.is-success {
  border-color: rgba(34, 197, 94, 0.28);
  background: #f0fdf4;
  color: #15803d;
}

.flash-message.is-token {
  border-color: rgba(37, 99, 235, 0.28);
  background: #eff6ff;
  color: #1d4ed8;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  word-break: break-all;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.user-table th,
.user-table td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
  vertical-align: middle;
}

.user-table th {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.user-table td form {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0;
}

.user-table input[type="password"],
.user-table select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  font-size: 12px;
  background: #fff;
}

.user-table button {
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: #e2e8f0;
  color: #1e293b;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

.user-table button.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.user-table button.primary {
  background: #dbeafe;
  color: #1d4ed8;
}

.account-menu {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-menu form {
  margin: 0;
}

.account-menu button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.account-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.account-meta div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.24);
  font-size: 13px;
}

.account-meta dt {
  color: #64748b;
}

.account-meta dd {
  margin: 0;
  font-weight: 650;
  color: #1e293b;
  text-align: right;
  word-break: break-all;
}

.audit-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.audit-filter .auth-field {
  flex: 1 1 190px;
  margin-bottom: 0;
}

.audit-filter button {
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #2563eb;
  font-weight: 650;
  cursor: pointer;
}

.audit-time {
  white-space: nowrap;
  color: #475569;
}

.audit-action {
  display: block;
  font-weight: 650;
  color: #1e293b;
}

.audit-code {
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
}

.audit-detail {
  max-width: 360px;
  color: #475569;
  overflow-wrap: anywhere;
}

.audit-empty {
  padding: 24px 10px;
  color: #64748b;
  text-align: center;
}

.audit-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 14px;
  color: #64748b;
  font-size: 13px;
}

.audit-pagination a {
  padding: 6px 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 9px;
  color: #1d4ed8;
  text-decoration: none;
  background: #f8fafc;
}

.audit-pagination a:hover {
  border-color: rgba(37, 99, 235, 0.4);
  background: #eff6ff;
}

/* ---------- 统一授权登录（zlauth） ---------- */

.auth-notice {
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid rgba(22, 163, 74, 0.28);
  border-radius: 12px;
  color: #15803d;
  background: rgba(220, 252, 231, 0.72);
  font-size: 13px;
  line-height: 1.55;
}

.auth-device {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.9), rgba(248, 250, 252, 0.9));
}

.auth-device-label {
  color: #64748b;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.auth-device code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1e293b;
  overflow-wrap: anywhere;
}

.auth-copy {
  padding: 6px 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 9px;
  color: #1d4ed8;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.auth-copy:hover {
  border-color: rgba(37, 99, 235, 0.5);
  background: #eff6ff;
}

.auth-status {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  color: #92400e;
  font-size: 13px;
  line-height: 1.5;
}

.auth-status i {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
  animation: auth-pulse 1.8s ease-in-out infinite;
}

.auth-status[data-state="active"] {
  color: #15803d;
}

.auth-status[data-state="active"] i {
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.16);
  animation: none;
}

.auth-status[data-state="blocked"],
.auth-status[data-state="expired"] {
  color: #b91c1c;
}

.auth-status[data-state="blocked"] i,
.auth-status[data-state="expired"] i {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14);
  animation: none;
}

a.auth-submit {
  display: grid;
  place-items: center;
  text-decoration: none;
}

@keyframes auth-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* 密码显隐切换：输入框 + 右侧小按钮同一行。 */
.auth-password-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-password-row input {
  flex: 1;
  min-width: 0;
}

.auth-password-toggle {
  flex: none;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: #fff;
  color: #33475e;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.auth-password-toggle:hover {
  border-color: var(--auth-primary);
  background: #f4f8ff;
  color: var(--auth-primary);
}

.auth-password-toggle[aria-pressed="true"] {
  border-color: var(--auth-primary);
  background: #eaf1ff;
  color: var(--auth-primary);
}

.auth-submit:disabled {
  cursor: default;
  filter: saturate(0.6) brightness(0.98);
}

/* 登录页脚部的授权服务器信息 + 本地调试徽标。 */
.auth-server {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--auth-line);
  color: var(--auth-muted);
  font-size: 12px;
}

.auth-mode-badge {
  padding: 2px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #e8f0fe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}
