/* ============================================================
   Auth Shell — 统一认证页面样式库（只依赖 /css/tokens.css）
   ------------------------------------------------------------
   设计基调：保守 · 克制 · 高级 · 现代 · 简洁 · 灵动 · 一体 · 贯穿式
   覆盖：登录/授权（index.php）、个人中心（profile.php）、账号管理（account.php）
   约定：body 上带 .auth-page 与页面标识（.auth-login / .auth-profile / .auth-account）
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body.auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text-primary);
  background:
    radial-gradient(1100px 560px at 50% -12%, rgba(123, 107, 224, 0.10), transparent 62%),
    radial-gradient(760px 460px at 88% 112%, rgba(217, 189, 122, 0.045), transparent 60%),
    var(--bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: var(--space-2xl) var(--space-md);
}

body.auth-page h1, body.auth-page h2, body.auth-page h3, body.auth-page h4 { font-family: var(--font-display); }
body.auth-page a { color: inherit; text-decoration: none; }
body.auth-page img { max-width: 100%; display: block; }
body.auth-page button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
body.auth-page input, body.auth-page select, body.auth-page textarea { font-family: inherit; }
body.auth-page ::selection { background: rgba(123, 107, 224, 0.3); color: #fff; }
body.auth-page ::-webkit-scrollbar { width: 6px; }
body.auth-page ::-webkit-scrollbar-thumb { background: var(--glass-border-hover); border-radius: 3px; }

/* ─── 面板（.card）─── */
body.auth-page .card {
  width: 100%;
  background: var(--glass-base);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 var(--glass-highlight);
  position: relative;
}
body.auth-login .card { max-width: 400px; margin: auto; }
body.auth-profile .card { max-width: 480px; margin: auto; }
body.auth-account .wrap { width: 100%; max-width: 860px; margin: auto; }
body.auth-account .card { padding: var(--space-lg) var(--space-lg) var(--space-md); margin-bottom: var(--space-md); }

/* ─── 品牌头 ─── */
.card .brand, .card .brand-block { text-align: center; margin-bottom: var(--space-lg); }
.card .brand img { width: 46px; height: 46px; border-radius: 12px; margin: 0 auto 12px; box-shadow: 0 6px 20px rgba(123, 107, 224, 0.18); }
.card .brand h1 { font-size: 1.12rem; font-weight: 700; letter-spacing: 0.01em; }
.card .brand p { font-size: 0.82rem; color: var(--text-secondary); margin-top: 3px; }

/* ─── 表单字段 ─── */
.field { margin-bottom: var(--space-md); }
.field-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.02em; }
.field-input, .edit-field input, .edit-field select {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(123, 107, 224, 0.03);
  color: var(--text-primary); font-size: 0.95rem; outline: none;
  transition: border-color .25s var(--smooth), box-shadow .25s var(--smooth), background .25s var(--smooth);
}
.field-input::placeholder, .edit-field input::placeholder { color: var(--text-muted); }
.field-input:focus, .edit-field input:focus, .edit-field select:focus {
  border-color: rgba(123, 107, 224, 0.45);
  box-shadow: 0 0 0 3px rgba(123, 107, 224, 0.12);
  background: rgba(123, 107, 224, 0.05);
}
.field-value {
  font-size: 0.95rem; padding: 11px 14px; border-radius: var(--radius-sm);
  background: rgba(123, 107, 224, 0.04); border: 1px solid var(--glass-border); color: var(--text-secondary);
}
.field-error { display: none; margin-top: 6px; font-size: 0.8rem; color: #f87171; }
.field-error.show { display: block; }
.field .hint, .hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }

/* ─── 按钮 ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px; border-radius: var(--radius-sm);
  font-size: 0.92rem; font-weight: 600;
  transition: transform .3s var(--spring-out), box-shadow .3s var(--smooth), background .3s var(--smooth), border-color .3s var(--smooth);
}
.btn:active { transform: scale(0.985); }
.btn-primary {
  background: linear-gradient(135deg, var(--dawn-700), var(--dawn-500));
  color: #fff; box-shadow: 0 6px 22px rgba(123, 107, 224, 0.24);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(123, 107, 224, 0.34); transform: translateY(-1px); }
.btn-primary:disabled { background: var(--glass-hover); color: var(--text-muted); box-shadow: none; cursor: not-allowed; transform: none; }
.btn-secondary { background: transparent; border: 1px solid var(--glass-border); color: var(--text-secondary); margin-top: var(--space-sm); }
.btn-secondary:hover { background: var(--glass-hover); color: var(--text-primary); border-color: var(--glass-border-hover); }
.btn-danger { background: rgba(248, 113, 113, 0.10); border: 1px solid rgba(248, 113, 113, 0.28); color: #f87171; }
.btn-danger:hover { background: rgba(248, 113, 113, 0.16); }
.btn-danger-light { background: transparent; border: 1px solid rgba(248, 113, 113, 0.28); color: #f87171; font-size: 0.78rem; padding: 6px 12px; width: auto; border-radius: var(--radius-sm); }
.btn-danger-light:hover { background: rgba(248, 113, 113, 0.10); }
.btn-link { display: inline-block; width: auto; color: var(--text-secondary); font-size: 0.82rem; margin-top: var(--space-sm); }
.btn-link:hover { color: var(--dawn-300); }
.btn-back { display: inline-flex; align-items: center; gap: 6px; width: auto; background: none; color: var(--text-secondary); font-size: 0.82rem; padding: 4px 2px; margin-bottom: var(--space-md); }
.btn-back:hover { color: var(--text-primary); }
.btn-back svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.btn svg { width: 14px; height: 14px; }
.btn-full { width: 100%; }

.check-row { display: flex; align-items: center; gap: 8px; margin-top: var(--space-md); font-size: 0.82rem; color: var(--text-secondary); cursor: pointer; user-select: none; }
.check-row input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--dawn-500); cursor: pointer; }

/* ─── 登录：步骤 / 验证 / 授权同意 ─── */
.step { display: none; }
.step.active { display: block; }
.step-enter { animation: authStepIn .34s var(--liquid-flow) both; }
@keyframes authStepIn { from { opacity: 0; filter: blur(8px); transform: translateY(10px); } to { opacity: 1; filter: blur(0); transform: translateY(0); } }

.verify-box { text-align: center; padding: var(--space-md) 0 0; }
.verify-status { font-size: 0.95rem; font-weight: 600; }
.verify-detail { font-size: 0.8rem; color: var(--text-secondary); margin-top: 3px; }
.progress-track { width: 100%; height: 2px; background: var(--glass-border); border-radius: 2px; overflow: hidden; margin: var(--space-xl) 0 var(--space-lg); }
.progress-fill { height: 100%; width: 30%; background: linear-gradient(90deg, var(--dawn-500), var(--gold-300)); border-radius: 2px; animation: authProgress 1.4s ease-in-out infinite; }
@keyframes authProgress { 0% { transform: translateX(-100%); } 100% { transform: translateX(430%); } }
.dots { display: flex; justify-content: center; gap: 5px; }
.dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted); animation: authDot 1.2s ease-in-out infinite; }
.dots span:nth-child(2) { animation-delay: .15s; } .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes authDot { 0%, 100% { background: var(--text-muted); } 50% { background: var(--dawn-400); } }
.verify-success { display: none; margin: 0 auto 16px; width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--dawn-700), var(--dawn-500)); align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(123, 107, 224, 0.3); }
.verify-success.show { display: flex; animation: authCheck .35s var(--spring-out) both; }
.verify-success svg { width: 22px; height: 22px; stroke: #fff; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
@keyframes authCheck { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }

.consent-client { text-align: center; padding-bottom: 2px; }
.consent-icon { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 14px; background: rgba(123, 107, 224, 0.07); border: 1px solid var(--glass-border); display: flex; align-items: center; justify-content: center; }
.consent-icon svg { width: 24px; height: 24px; stroke: var(--dawn-300); stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.consent-client h2 { font-size: 1.0rem; font-weight: 600; }
.consent-desc { font-size: 0.82rem; color: var(--text-secondary); margin-top: 4px; line-height: 1.5; }
.consent-userinfo { font-size: 0.82rem; color: var(--text-secondary); text-align: center; margin: var(--space-md) 0; }
.consent-userinfo strong { color: var(--text-primary); font-weight: 600; }
.consent-divider { height: 1px; background: var(--glass-border); margin: var(--space-lg) 0 var(--space-md); }
.consent-risk { font-size: 0.76rem; color: var(--text-muted); line-height: 1.6; margin-top: var(--space-lg); padding: 12px 14px; background: rgba(123, 107, 224, 0.03); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); }
.consent-risk strong { color: var(--text-secondary); font-weight: 600; }

/* ─── 页脚 ─── */
.footer { text-align: center; margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--glass-border); font-size: 0.78rem; color: var(--text-muted); }
.footer a { color: var(--text-secondary); }
.footer a:hover { color: var(--dawn-300); }
.card > .footer:last-child { border-top: none; }

/* ─── 个人中心：头像 / 分区 / Tabs ─── */
.brand .avatar-name { font-size: 1.1rem; }
.avatar-section { text-align: center; margin-bottom: var(--space-lg); }
.avatar-wrapper { position: relative; width: 92px; height: 92px; margin: 0 auto 12px; cursor: pointer; }
.avatar-img, .avatar-svg { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; background: var(--bg-surface); border: 2px solid var(--glass-border-hover); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); }
.avatar-svg { overflow: hidden; display: inline-block; }
.avatar-overlay { position: absolute; inset: 0; border-radius: 50%; background: rgba(4, 5, 10, 0.55); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s var(--smooth); color: #fff; font-size: 0.75rem; font-weight: 500; }
.avatar-wrapper:hover .avatar-overlay { opacity: 1; }
.avatar-name { font-size: 1.05rem; font-weight: 600; }
.avatar-role { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.avatar-email { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }
.avatar-actions { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 10px; flex-wrap: wrap; }

.section { margin-bottom: var(--space-lg); }
.section-title { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 12px; letter-spacing: 0.02em; }
.section-title svg { width: 14px; height: 14px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--glass-border); margin-bottom: var(--space-lg); }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; cursor: pointer; color: var(--text-secondary); border-bottom: 2px solid transparent; transition: all .2s var(--smooth); font-size: 0.85rem; font-weight: 500; }
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--text-primary); border-bottom-color: var(--dawn-400); }
.tab svg { width: 15px; height: 15px; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: authStepIn .3s var(--liquid-flow) both; }

/* ─── 账号管理：头部 / 操作条 / 列表 / 批量 ─── */
.wrap { width: 100%; }
.hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); flex-wrap: wrap; gap: 8px; }
.hdr-left { display: flex; align-items: center; gap: 9px; }
.hdr-left svg { color: var(--dawn-300); }
.hdr-left h1 { font-size: 1.0rem; font-weight: 600; }
.hdr-info { font-size: 0.78rem; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; }
.hdr-actions { display: flex; gap: 6px; align-items: center; }
.hdr-actions a, .hdr-actions button { display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: transparent; color: var(--text-secondary); transition: all .2s var(--smooth); }
.hdr-actions a:hover, .hdr-actions button:hover { background: var(--glass-hover); color: var(--text-primary); border-color: var(--glass-border-hover); }
.btn-logout { background: linear-gradient(135deg, var(--dawn-700), var(--dawn-500)) !important; color: #fff !important; border-color: transparent !important; }
.btn-logout:hover { box-shadow: 0 6px 18px rgba(123, 107, 224, 0.3); }

.actbar { display: flex; gap: 6px; margin-bottom: var(--space-sm); flex-wrap: wrap; }
.actbar button { display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: transparent; color: var(--text-secondary); transition: all .2s var(--smooth); }
.actbar button:hover { background: var(--glass-hover); color: var(--text-primary); border-color: var(--glass-border-hover); }
.actbar .btn-primary-act { background: linear-gradient(135deg, var(--dawn-700), var(--dawn-500)); color: #fff; border-color: transparent; }
.actbar .btn-danger-act { color: #f87171; border-color: rgba(248, 113, 113, 0.28); }
.actbar .btn-danger-act:hover { background: rgba(248, 113, 113, 0.10); }
.actbar .btn-danger-act:disabled { opacity: .3; }

.batch-bar { display: none; padding: 8px 0 12px; border-bottom: 1px solid var(--glass-border); margin-bottom: 8px; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-secondary); }
.batch-bar.show { display: flex; }
.batch-bar button { font-size: 0.75rem; padding: 4px 10px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: transparent; color: var(--text-secondary); transition: all .2s var(--smooth); }
.batch-bar button:hover { background: var(--glass-hover); color: var(--text-primary); }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.topbar .count { font-size: 0.78rem; color: var(--text-muted); }

.user-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--glass-border); }
.user-row:last-child { border-bottom: none; }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-surface); overflow: hidden; flex-shrink: 0; cursor: pointer; border: 1px solid var(--glass-border-hover); transition: box-shadow .2s var(--smooth); }
.user-avatar:hover { box-shadow: 0 0 0 3px rgba(123, 107, 224, 0.14); }
.user-avatar img, .user-avatar svg { width: 100%; height: 100%; object-fit: cover; }
.user-id { font-size: 0.88rem; font-weight: 600; min-width: 80px; }
.user-id small { display: block; font-size: 0.7rem; font-weight: 400; color: var(--text-muted); margin-top: 1px; }
.user-display { font-size: 0.78rem; color: var(--text-muted); min-width: 56px; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-year { font-size: 0.72rem; color: var(--text-muted); min-width: 34px; text-align: center; flex-shrink: 0; }
.user-title { font-size: 0.72rem; color: var(--text-secondary); min-width: 54px; text-align: center; flex-shrink: 0; }
.user-role { min-width: 80px; text-align: center; flex-shrink: 0; }
.user-actions { flex-shrink: 0; margin-left: auto; }
.btn-setup { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); background: transparent; color: var(--text-secondary); font-size: 0.74rem; transition: all .2s var(--smooth); }
.btn-setup:hover { background: var(--glass-hover); color: var(--text-primary); border-color: var(--glass-border-hover); }
.btn-setup:disabled { opacity: .3; cursor: not-allowed; }
.user-cb { width: 15px; height: 15px; flex-shrink: 0; accent-color: var(--dawn-500); cursor: pointer; margin-right: 4px; }
.empty { text-align: center; padding: 40px 0; color: var(--text-muted); font-size: 0.85rem; }

/* ─── 弹窗 ─── */
.modal { display: none; position: fixed; inset: 0; background: rgba(4, 5, 10, 0.5); backdrop-filter: blur(4px); z-index: var(--z-overlay); justify-content: center; align-items: center; }
.modal.active { display: flex; }
.modal-box { background: var(--bg-surface); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: var(--space-lg); width: 420px; max-width: 90vw; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); max-height: 80vh; overflow-y: auto; animation: authStepIn .3s var(--liquid-flow) both; }
.modal-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.modal-avatar { display: flex; align-items: center; gap: 10px; padding: 10px 0 14px; border-bottom: 1px solid var(--glass-border); margin-bottom: 14px; }
.modal-avatar img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--bg-surface); }
.modal-avatar .info { display: flex; flex-direction: column; }
.modal-avatar .info .name { font-size: 0.9rem; font-weight: 600; }
.modal-avatar .info .sub { font-size: 0.72rem; color: var(--text-muted); }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }
.modal-actions button, .modal-actions a { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; cursor: pointer; text-align: left; color: var(--text-primary); background: var(--glass-base); border: 1px solid var(--glass-border); transition: all .2s var(--smooth); }
.modal-actions button:hover, .modal-actions a:hover { background: var(--glass-hover); border-color: var(--glass-border-hover); }
.modal-actions .ma-danger { color: #f87171; }
.modal-actions .ma-danger:hover { background: rgba(248, 113, 113, 0.10); }
.modal-actions .ma-primary { color: var(--dawn-300); }
.edit-field { margin-bottom: 10px; }
.edit-field label { display: block; font-size: 0.75rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 3px; }
.edit-field select { appearance: auto; }

/* ─── 角色徽章（rb() 输出用内联色，此处仅统一外形）─── */
.card .badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: var(--radius-full); font-size: 0.72rem; font-weight: 500; }

/* ─── 轻提示 ─── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 10px 20px; border-radius: var(--radius-sm); color: #fff; font-size: 0.84rem; z-index: 1000; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4); animation: authToast .3s var(--spring-out) both; font-weight: 500; }
.toast-success, .toast-g { background: #27ae60; }
.toast-error, .toast-r { background: #c0392b; }
.toast-info { background: #2980b9; }
@keyframes authToast { from { opacity: 0; filter: blur(6px); transform: translateX(-50%) translateY(16px); } to { opacity: 1; filter: blur(0); transform: translateX(-50%) translateY(0); } }

.hidden { display: none; }
.card-actions { display: flex; flex-direction: column; gap: 8px; }

/* ─── 移动端 ─── */
@media (max-width: 560px) {
  body.auth-page { padding: var(--space-md) var(--space-sm); }
  body.auth-page .card { padding: var(--space-lg) var(--space-md) var(--space-md); }
  .hdr { align-items: flex-start; }
  .user-display, .user-year, .user-title { display: none; }
  .user-id { min-width: 64px; }
}

/* ─── 公开资料页（profile.php?user=）与登录页对齐微调 ─── */
body.auth-login { justify-content: center; }
body.auth-profile { align-items: flex-start; }
.pic { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; border: 3px solid var(--glass-border-hover); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); background: var(--bg-surface); display: inline-block; overflow: hidden; margin: 0 auto; }
.pic svg { width: 100%; height: 100%; display: block; }
.name { font-size: 1.3rem; font-weight: 700; margin-top: 16px; }
.role { display: inline-block; font-size: 0.74rem; font-weight: 600; padding: 4px 14px; border-radius: var(--radius-full); margin-top: 10px; background: rgba(123, 107, 224, 0.12); color: var(--dawn-300); border: 1px solid var(--glass-border); }
.info { color: var(--text-secondary); font-size: 0.86rem; margin-top: 12px; line-height: 1.8; }
.motto { color: var(--text-primary); font-size: 0.92rem; font-style: italic; margin-top: 14px; padding: 0 8px; opacity: 0.9; }
.back { display: inline-block; margin-top: 8px; padding: 9px 22px; background: rgba(123, 107, 224, 0.10); color: var(--dawn-300); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500; transition: background .2s var(--smooth); }
.back:hover { background: rgba(123, 107, 224, 0.16); }

/* ─── 暗色下的可读性微调（仅作用于认证页）─── */
body.auth-page {
  --text-secondary: rgba(182, 194, 206, 0.82);
  --text-muted: rgba(154, 167, 182, 0.62);
}
body.auth-page .field-input::placeholder { color: rgba(154, 167, 182, 0.5); }

/* ─── P2 打磨：自定义复选框 / 对比度 / 玻璃质 ─── */
.user-cb, .check-row input[type=checkbox] {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  width: 15px; height: 15px; border-radius: 4px; flex-shrink: 0;
  border: 1px solid var(--glass-border-hover);
  background: rgba(123, 107, 224, 0.05); cursor: pointer; position: relative;
  transition: background .2s var(--smooth), border-color .2s var(--smooth);
}
.user-cb:hover, .check-row input[type=checkbox]:hover { border-color: rgba(123, 107, 224, 0.4); }
.user-cb:checked, .check-row input[type=checkbox]:checked { background: var(--dawn-500); border-color: var(--dawn-500); }
.user-cb:checked::after, .check-row input[type=checkbox]:checked::after {
  content: ''; position: absolute; left: 4.5px; top: 1px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

body.auth-page { --text-secondary: rgba(188, 199, 210, 0.86); --text-muted: rgba(160, 172, 186, 0.68); }
body.auth-page .field-input::placeholder { color: rgba(160, 172, 186, 0.58); }

body.auth-page .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  border-color: rgba(123, 107, 224, 0.10);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(32px) saturate(1.7);
  -webkit-backdrop-filter: blur(32px) saturate(1.7);
}

/* ─── P3 服务门户 ─── */
.hero-card { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: rgba(123, 107, 224, 0.045); margin-bottom: var(--space-lg); }
.hero-avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex-shrink: 0; border: 2px solid var(--glass-border-hover); background: var(--bg-surface); }
.hero-avatar img, .hero-avatar svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-meta { min-width: 0; }
.hero-name { font-size: 1.05rem; font-weight: 700; }
.hero-sub { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
.hero-motto { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-group { margin-bottom: var(--space-lg); }
.svc-group-title { font-size: 0.74rem; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.06em; margin-bottom: 10px; }
.svc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.svc-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--glass-border); border-radius: var(--radius-sm); background: var(--glass-base); transition: transform .25s var(--spring-out), border-color .25s var(--smooth), background .25s var(--smooth); }
.svc-card:hover { border-color: var(--glass-border-hover); background: var(--glass-hover); transform: translateY(-2px); }
.svc-ic { width: 34px; height: 34px; border-radius: 9px; background: rgba(123, 107, 224, 0.08); display: flex; align-items: center; justify-content: center; color: var(--dawn-300); flex-shrink: 0; }
.svc-ic svg { width: 18px; height: 18px; }
.svc-body { min-width: 0; display: flex; flex-direction: column; }
.svc-name { font-size: 0.85rem; font-weight: 600; }
.svc-desc { font-size: 0.72rem; color: rgba(180, 192, 204, 0.72); line-height: 1.4; margin-top: 1px; }
.svc-auth { font-size: 0.64rem; padding: 1px 7px; border-radius: var(--radius-full); border: 1px solid var(--glass-border); color: var(--text-muted); margin-top: 5px; align-self: flex-start; }
.svc-auth.on { color: #8fd6bb; border-color: rgba(143, 214, 187, 0.25); background: rgba(143, 214, 187, 0.06); }
@media (max-width: 480px) { .svc-grid { grid-template-columns: 1fr; } }

/* ─── P4 授权管理 ─── */
.authz-list { display: flex; flex-direction: column; gap: 8px; }
.authz-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px solid var(--glass-border); border-radius: var(--radius-sm); background: var(--glass-base); }
.authz-name { font-size: 0.84rem; font-weight: 500; }
.authz-revoke { font-size: 0.72rem; padding: 4px 12px; border-radius: var(--radius-sm); border: 1px solid rgba(248, 113, 113, 0.28); background: transparent; color: #f87171; transition: background .2s var(--smooth); }
.authz-revoke:hover { background: rgba(248, 113, 113, 0.10); }

/* ─── P3/P4 去 AI 味：服务卡改「编年索引入口行」─── */
.svc-grid { display: block; counter-reset: svc; }
.svc-card { counter-increment: svc; display: grid; grid-template-columns: 2.4rem 1fr; column-gap: 12px; align-items: baseline; padding: 12px 0; border: 0; border-bottom: 1px solid rgba(123, 107, 224, 0.14); border-radius: 0; background: none; box-shadow: none; transition: border-color .3s var(--smooth); }
.svc-card::before { content: counter(svc, decimal-leading-zero); grid-column: 1; grid-row: 1 / span 4; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: rgba(185, 197, 209, 0.6); padding-top: 0.25rem; transition: color .3s var(--smooth); }
.svc-card:hover { transform: none; background: none; border-color: rgba(123, 107, 224, 0.3); }
.svc-card:hover::before { color: var(--dawn-300); }
.svc-ic { display: none; }
.svc-body { grid-column: 2; }
.svc-name { font-size: 0.92rem; font-weight: 600; color: var(--text-primary); }
.svc-card:hover .svc-name { color: var(--dawn-300); }
.svc-desc { font-size: 0.76rem; color: rgba(192, 203, 215, 0.8); margin-top: 1px; }
.svc-auth { font-size: 0.64rem; padding: 1px 7px; border-radius: var(--radius-full); border: 1px solid var(--glass-border); color: rgba(170,182,196,.8); margin-top: 5px; align-self: flex-start; }
.svc-auth.on { color: #8fd6bb; border-color: rgba(143, 214, 187, 0.25); background: rgba(143, 214, 187, 0.06); }
.authz-item { border: 0; border-bottom: 1px solid rgba(123, 107, 224, 0.14); border-radius: 0; background: none; padding: 10px 0; }


/* ─── 亮色主题（auth 三件套，去渐变）─── */
[data-theme="light"] body.auth-page { background: var(--bg-deep); color: var(--text-primary); }
[data-theme="light"] body.auth-page .card { background: #ffffff; border-color: rgba(22,20,26,0.08); box-shadow: 0 18px 50px rgba(20,16,30,0.08), inset 0 1px 0 #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-theme="light"] .field-input, [data-theme="light"] .edit-field input, [data-theme="light"] .edit-field select { background: #fff; border-color: rgba(22,20,26,0.14); color: var(--text-primary); }
[data-theme="light"] .field-value { background: rgba(22,20,26,0.03); border-color: rgba(22,20,26,0.08); }
[data-theme="light"] .btn-primary { background: #1b1922; box-shadow: 0 6px 18px rgba(27,25,34,0.16); }
[data-theme="light"] .btn-primary:hover { box-shadow: 0 10px 26px rgba(27,25,34,0.22); }
[data-theme="light"] .verify-success, [data-theme="light"] .progress-fill { background: #1b1922; }
[data-theme="light"] .btn-logout, [data-theme="light"] .actbar .btn-primary-act { background: #1b1922 !important; }
[data-theme="light"] .consent-icon { background: rgba(91,75,214,0.06); }
[data-theme="light"] .hero-card { background: rgba(91,75,214,0.045); }
[data-theme="light"] .modal-box { background: #ffffff; border-color: rgba(22,20,26,0.08); }
[data-theme="light"] .svc-card, [data-theme="light"] .authz-item { border-bottom-color: rgba(22,20,26,0.12); }
[data-theme="light"] .svc-card:hover { border-color: rgba(22,20,26,0.28); }

/* ─── 修复：auth 页通用 button 重置(color:inherit) 会盖过按钮自身白字 ─── */
body.auth-page .btn-primary,
body.auth-page .btn-primary:hover { color: #fff; }
body.auth-page .btn-logout,
body.auth-page .btn-logout:hover,
body.auth-page .actbar .btn-primary-act { color: #fff !important; }
