/* =====================================================================
   SSO 中心 - 本地化设计系统 CSS（无任何外链依赖）
   风格：亮色 / 单一靛蓝主色 / 干净简洁
   ===================================================================== */

/* ---------------- 设计变量 ---------------- */
:root {
    --bg-0:        #f7f8fc;
    --bg-1:        #ffffff;
    --bg-2:        #f1f3f9;
    --surface:     #ffffff;
    --surface-2:   #f5f6fa;
    --border:      #e6e8ef;
    --border-2:    #d4d8e3;

    --text:        #1a1d29;
    --text-2:      #5a6178;
    --text-3:      #8b91a6;

    --brand:       #4f46e5;   /* 靛蓝主色 */
    --brand-2:     #6366f1;
    --brand-light: #eef2ff;
    --brand-dim:   #4338ca;

    --green:       #059669;
    --green-light: #ecfdf5;
    --red:         #dc2626;
    --red-light:   #fef2f2;
    --amber:       #d97706;
    --amber-light: #fffbeb;
    --cyan:        #0891b2;
    --cyan-light:  #ecfeff;

    --grad-brand:  linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);

    --radius:      12px;
    --radius-sm:   8px;
    --radius-lg:   16px;

    --shadow-1:    0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
    --shadow-2:    0 4px 16px -4px rgba(15,23,42,.08), 0 2px 6px -2px rgba(15,23,42,.05);
    --shadow-3:    0 12px 32px -8px rgba(15,23,42,.12);

    --font:        "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei",
                   "Segoe UI Variable", "Segoe UI", system-ui, -apple-system,
                   "Helvetica Neue", Arial, "Noto Sans CJK SC", sans-serif;
    --mono:        "JetBrains Mono", "Cascadia Code", "Consolas", "SF Mono", monospace;
}

/* ---------------- 重置 ---------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg-0);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
::selection { background: rgba(79,70,229,.18); color: var(--brand-dim); }

/* ---------------- 背景（纯净亮色，无装饰） ---------------- */
.aurora { display: none; }
.grain  { display: none; }

/* ---------------- 通用容器 ---------------- */
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap-sm { width: 100%; max-width: 460px; margin: 0 auto; padding: 0 24px; }

/* ---------------- 排版 ---------------- */
.grad-text { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; font-weight: 600; color: var(--text); }
.mono { font-family: var(--mono); }

/* ---------------- 卡片（白底+细边框+轻阴影，去掉玻璃模糊） ---------------- */
.glass {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 18px; border: 1px solid transparent; border-radius: 9px;
    font-weight: 500; font-size: 14px; cursor: pointer; transition: all .15s ease;
    white-space: nowrap; user-select: none; position: relative;
    background: transparent; color: var(--text);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
    background: var(--brand); color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-dim); }
.btn-ghost {
    background: var(--bg-1); border-color: var(--border-2); color: var(--text-2);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); border-color: var(--text-3); }
.btn-danger { background: var(--red-light); border-color: #fecaca; color: var(--red); }
.btn-danger:hover:not(:disabled) { background: #fee2e2; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn-block { width: 100%; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.input-wrap { position: relative; }
.input-wrap .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-wrap .ico + .input { padding-left: 38px; }
.input, .textarea, .select {
    width: 100%; padding: 10px 13px; background: var(--bg-1);
    border: 1px solid var(--border-2); border-radius: 9px; color: var(--text);
    transition: all .15s ease; outline: none; font-size: 14px;
}
.textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus, .select:focus {
    border-color: var(--brand); background: var(--bg-1);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.input-wrap .toggle-pw {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    color: var(--text-3); cursor: pointer; padding: 4px; background: none; border: none;
}
.input-wrap .toggle-pw:hover { color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.field-error { font-size: 12px; color: var(--red); margin-top: 6px; }

/* 密码强度条 */
.pw-strength { display: flex; gap: 5px; margin-top: 8px; }
.pw-strength span { flex: 1; height: 3px; border-radius: 2px; background: var(--border); transition: background .3s; }
.pw-strength.s1 span:nth-child(1) { background: var(--red); }
.pw-strength.s2 span:nth-child(-n+2) { background: var(--amber); }
.pw-strength.s3 span:nth-child(-n+3) { background: var(--brand); }
.pw-strength.s4 span { background: var(--green); }

/* 复选框 */
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-2); font-size: 14px; }
.check input { appearance: none; width: 17px; height: 17px; border: 1.5px solid var(--border-2); border-radius: 4px; background: var(--bg-1); cursor: pointer; position: relative; transition: all .15s; }
.check input:checked { background: var(--brand); border-color: transparent; }
.check input:checked::after { content: ""; position: absolute; left: 5px; top: 1px; width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* ---------------- 徽章 ---------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 5px; font-size: 12px; font-weight: 500; }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-red   { background: var(--red-light); color: var(--red); }
.badge-cyan  { background: var(--cyan-light); color: var(--cyan); }
.badge-brand { background: var(--brand-light); color: var(--brand); }
.badge-gray  { background: var(--bg-2); color: var(--text-2); }

/* =====================================================================
   认证页布局（注册/登录/授权）：左品牌 + 右表单
   ===================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg-0); }
.auth-brand {
    position: relative; padding: 56px; display: flex; flex-direction: column;
    justify-content: space-between; overflow: hidden;
    background: linear-gradient(160deg, #4f46e5 0%, #6366f1 60%, #4338ca 100%);
    color: #fff;
}
.auth-brand::before {
    content: ""; position: absolute; inset: 0; opacity: .12;
    background-image:
        linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 30% 40%, #000 30%, transparent 75%);
}
.auth-logo { display: flex; align-items: center; gap: 11px; font-weight: 600; font-size: 18px; position: relative; color: #fff; }
.auth-logo .mark {
    width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.18);
    backdrop-filter: blur(8px);
    display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25);
}
.auth-hero { position: relative; }
.auth-hero h1 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.2; margin-bottom: 14px; font-weight: 600; color: #fff; }
.auth-hero h1 .grad-text { color: #c7d2fe; }
.auth-hero p { color: rgba(255,255,255,.82); font-size: 15px; max-width: 440px; }
.auth-feats { display: flex; flex-direction: column; gap: 11px; margin-top: 26px; }
.auth-feat { display: flex; align-items: center; gap: 11px; color: rgba(255,255,255,.85); font-size: 13.5px; }
.auth-feat .dot { width: 6px; height: 6px; border-radius: 50%; background: #c7d2fe; }
.auth-foot { position: relative; color: rgba(255,255,255,.6); font-size: 12px; }

.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg-1); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .head { margin-bottom: 24px; }
.auth-card .head h2 { font-size: 24px; margin-bottom: 5px; font-weight: 600; }
.auth-card .head p { color: var(--text-2); font-size: 13.5px; }
.auth-alt { text-align: center; margin-top: 20px; color: var(--text-3); font-size: 13.5px; }
.auth-alt a { color: var(--brand); font-weight: 500; }
.auth-alt a:hover { text-decoration: underline; }

/* SSO 上下文提示条 */
.sso-ctx {
    display: flex; align-items: center; gap: 10px; padding: 11px 13px; margin-bottom: 18px;
    background: var(--brand-light); border: 1px solid #e0e7ff;
    border-radius: 9px; font-size: 13px; color: var(--text-2);
}
.sso-ctx .pill { padding: 2px 7px; border-radius: 5px; background: var(--brand); color: #fff; font-weight: 500; }

/* 授权同意页应用卡 */
.oauth-app {
    display: flex; align-items: center; gap: 13px; padding: 14px; margin: 18px 0;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px;
}
.oauth-app .ico { width: 44px; height: 44px; border-radius: 10px; background: var(--grad-brand); display: grid; place-items: center; font-weight: 600; font-size: 18px; color: #fff; flex-shrink: 0; }
.oauth-scope { display: flex; flex-direction: column; gap: 9px; margin: 16px 0; padding: 0; }
.oauth-scope li { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13.5px; list-style: none; }
.oauth-scope li svg { color: var(--green); flex-shrink: 0; }
.oauth-user {
    display: flex; align-items: center; gap: 11px; padding: 11px 13px; margin-bottom: 16px;
    background: var(--brand-light); border: 1px solid #e0e7ff; border-radius: 10px;
}
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad-brand); display: grid; place-items: center; font-weight: 600; font-size: 13px; color: #fff; flex-shrink: 0; }

/* =====================================================================
   用户中心布局：顶栏 + 内容
   ===================================================================== */
.app { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-0); }
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 26px; background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: var(--text); }
.topbar .brand .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--grad-brand); display: grid; place-items: center; }
.topbar nav { display: flex; align-items: center; gap: 3px; }
.topbar nav a { padding: 7px 12px; border-radius: 7px; color: var(--text-2); font-size: 13.5px; font-weight: 500; transition: all .15s; }
.topbar nav a:hover { color: var(--text); background: var(--surface-2); }
.topbar nav a.active { color: var(--brand); background: var(--brand-light); }

.user-menu { position: relative; }
.user-menu .trigger { display: flex; align-items: center; gap: 9px; padding: 5px 9px 5px 5px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; transition: all .15s; }
.user-menu .trigger:hover { background: var(--bg-2); }
.user-menu .trigger .avatar { width: 26px; height: 26px; font-size: 12px; }
.user-menu .trigger .name { font-size: 13.5px; font-weight: 500; padding-right: 3px; color: var(--text); }
.user-menu .dropdown {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px;
    background: #fff; border: 1px solid var(--border-2);
    border-radius: 10px; padding: 5px; box-shadow: var(--shadow-3); display: none;
}
.user-menu.open .dropdown { display: block; animation: fadeUp .16s ease; }
.user-menu .dropdown a { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 6px; color: var(--text-2); font-size: 13.5px; }
.user-menu .dropdown a:hover { background: var(--surface-2); color: var(--text); }
.user-menu .dropdown a.danger { color: var(--red); }
.user-menu .dropdown .sep { height: 1px; background: var(--border); margin: 4px 5px; }

.app-main { flex: 1; padding: 30px 26px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 24px; margin-bottom: 5px; font-weight: 600; }
.page-head p { color: var(--text-2); font-size: 14px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card { padding: 20px; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 13px; display: flex; align-items: center; gap: 8px; }

.stat-card { padding: 20px; }
.stat-card .label { font-size: 12.5px; color: var(--text-3); margin-bottom: 7px; }
.stat-card .num { font-size: 28px; font-weight: 700; line-height: 1; color: var(--text); }
.stat-card .ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 12px; }
.ico-brand { background: var(--brand-light); color: var(--brand); }
.ico-cyan  { background: var(--cyan-light); color: var(--cyan); }
.ico-green { background: var(--green-light); color: var(--green); }
.ico-amber { background: var(--amber-light); color: var(--amber); }

.kv { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-3); }
.kv .v { color: var(--text); font-weight: 500; }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; padding: 11px 13px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 600; border-bottom: 1px solid var(--border); }
.tbl td { padding: 12px 13px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--surface-2); }

/* 分页 */
.pager { display: flex; gap: 5px; justify-content: center; margin-top: 18px; }
.pager a, .pager span { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; font-size: 13.5px; border: 1px solid var(--border-2); color: var(--text-2); padding: 0 9px; background: #fff; }
.pager a:hover { background: var(--surface-2); color: var(--text); }
.pager .cur { background: var(--brand); color: #fff; border-color: transparent; }

/* 搜索栏 */
.search-bar { display: flex; gap: 9px; margin-bottom: 16px; }
.search-bar .input { max-width: 320px; }

/* =====================================================================
   管理后台布局：侧边栏 + 内容
   ===================================================================== */
.admin { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; background: var(--bg-0); }
.sidebar {
    background: #fff; border-right: 1px solid var(--border);
    padding: 22px 14px; display: flex; flex-direction: column; gap: 3px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; padding: 5px 9px 18px; color: var(--text); }
.sidebar .brand .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--grad-brand); display: grid; place-items: center; }
.sidebar a.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; font-weight: 500; transition: all .15s; }
.sidebar a.nav-item:hover { background: var(--surface-2); color: var(--text); }
.sidebar a.nav-item.active { background: var(--brand-light); color: var(--brand); }
.sidebar .nav-item svg { width: 17px; height: 17px; }
.sidebar .side-foot { margin-top: auto; padding: 13px 11px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); }

.admin-main { padding: 30px; min-width: 0; overflow-y: auto; height: 100vh; }
.admin-scroll { min-height: 100%; display: flex; flex-direction: column; }
.admin-scroll > .footer { margin-top: auto; }

/* 侧边栏分组标签 */
.side-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-3); padding: 0 11px; margin: 14px 0 6px;
}
.side-label:first-of-type { margin-top: 8px; }

/* 侧边栏底部用户信息 */
.side-user {
    display: flex; align-items: center; gap: 10px; padding: 10px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
    margin-bottom: 8px;
}
.side-user .avatar { width: 32px; height: 32px; font-size: 12px; }
.side-user-info { min-width: 0; flex: 1; }
.side-user-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-logout {
    display: flex; align-items: center; gap: 8px; padding: 8px 11px;
    border-radius: 8px; font-size: 13px; color: var(--red); font-weight: 500;
    transition: background .15s;
}
.side-logout:hover { background: var(--red-light); }

/* 侧边栏头像（真实图片） */
.side-avatar {
    width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    background: var(--grad-brand);
}

/* 个人资料卡（概览页顶部） */
.profile-card {
    display: flex; align-items: center; gap: 24px; padding: 22px;
    margin-bottom: 16px;
}
.profile-avatar-wrap {
    position: relative; flex-shrink: 0; width: 96px; height: 96px;
}
.profile-avatar {
    width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--bg-1); box-shadow: var(--shadow-1);
    background: var(--grad-brand);
}
.avatar-change {
    position: absolute; right: -2px; bottom: -2px;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--brand); color: #fff; border: 3px solid var(--bg-1);
    display: grid; place-items: center; cursor: pointer; transition: all .15s;
}
.avatar-change:hover { background: var(--brand-dim); transform: scale(1.05); }
.avatar-remove {
    position: absolute; left: -2px; top: -2px;
    width: 24px; height: 24px; border-radius: 50%;
    background: #fff; color: var(--red); border: 1px solid var(--border-2);
    display: grid; place-items: center; cursor: pointer; transition: all .15s;
}
.avatar-remove:hover { background: var(--red-light); }
.profile-body { flex: 1; min-width: 0; }
.profile-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.avatar-hint { font-size: 12px; color: var(--text-3); margin-top: 10px; }

/* 登录日志时间轴列表 */
.log-list {
    display: flex; flex-direction: column; gap: 0;
    max-height: 640px; overflow-y: auto; padding-right: 4px;
}
.log-item {
    display: flex; gap: 12px; padding: 13px 0;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.log-item:last-child { border-bottom: none; }
.log-dot {
    width: 9px; height: 9px; border-radius: 50%;
    margin-top: 6px; flex-shrink: 0;
    background: var(--text-3);
    box-shadow: 0 0 0 3px var(--bg-1);
}
.log-dot.badge-red   { background: var(--red); }
.log-dot.badge-cyan  { background: var(--cyan); }
.log-dot.badge-brand { background: var(--brand); }
.log-dot.badge-green { background: var(--green); }
.log-dot.badge-gray  { background: var(--text-3); }
.log-content { flex: 1; min-width: 0; }
.log-row1 {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 5px;
}
.log-row1 .badge { display: inline-flex; align-items: center; gap: 5px; }
.log-app {
    font-size: 13px; font-weight: 600; color: var(--text);
    padding: 2px 9px; background: var(--brand-light); border-radius: 5px;
}
.log-row2 {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    font-size: 12px; color: var(--text-3);
}
.log-row2 .mono { color: var(--text-2); }
.log-ua { color: var(--text-3); }
.log-time { color: var(--text-2); }
.log-ago { color: var(--text-3); }
/* 滚动条美化 */
.log-list::-webkit-scrollbar { width: 6px; }
.log-list::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
.log-list::-webkit-scrollbar-track { background: transparent; }

/* 设置页 - 策略行 + 开关 */
.policy-row {
    display: flex; align-items: center; gap: 18px;
    padding: 18px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 12px; margin-bottom: 16px;
}
.policy-info { flex: 1; min-width: 0; }
.policy-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.policy-desc { font-size: 13px; color: var(--text-3); line-height: 1.6; }

.switch { position: relative; display: inline-block; width: 50px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--border-2); border-radius: 28px; transition: .25s;
}
.switch .slider::before {
    content: ''; position: absolute; height: 20px; width: 20px;
    left: 4px; bottom: 4px; background: #fff; border-radius: 50%;
    transition: .25s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(22px); }

/* 页脚（全站通用，可编辑） */
.footer {
    padding: 20px 26px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 12.5px;
    text-align: center; white-space: pre-line; line-height: 1.7;
    background: #fff;
}

/* ---------------- Toast ---------------- */
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 9px; }
.toast {
    min-width: 250px; max-width: 360px; padding: 12px 14px; border-radius: 9px;
    background: #fff; border: 1px solid var(--border-2);
    box-shadow: var(--shadow-3); display: flex; align-items: center; gap: 11px; font-size: 13.5px;
    animation: slideIn .22s ease;
}
.toast.ok { border-left: 3px solid var(--green); }
.toast.err { border-left: 3px solid var(--red); }
.toast .ico { width: 20px; height: 20px; flex-shrink: 0; }
.toast.ok .ico { color: var(--green); }
.toast.err .ico { color: var(--red); }

/* ---------------- 模态框 ---------------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.show { display: flex; animation: fade .2s; }
.modal { width: 100%; max-width: 430px; padding: 24px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-3); }
.modal h3 { font-size: 18px; margin-bottom: 5px; font-weight: 600; }
.modal p { color: var(--text-2); font-size: 13.5px; margin-bottom: 18px; }
.modal .actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 20px; }

/* ---------------- 动画（克制） ---------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.anim-up { animation: fadeUp .3s ease backwards; }
.anim-up.d1 { animation-delay: .04s; }
.anim-up.d2 { animation-delay: .08s; }
.anim-up.d3 { animation-delay: .12s; }
.anim-up.d4 { animation-delay: .16s; }

/* 代码块（client_id 展示等） */
.code-box { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; font-family: var(--mono); font-size: 12.5px; word-break: break-all; color: var(--text-2); }
.code-box .copy { margin-left: auto; background: none; border: none; color: var(--text-3); cursor: pointer; padding: 4px; flex-shrink: 0; }
.code-box .copy:hover { color: var(--brand); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 960px) {
    .auth { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
    .admin { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 11px; gap: 5px; }
    .sidebar .brand, .sidebar .side-foot { display: none; }
    .sidebar a.nav-item { white-space: nowrap; }
    .admin-main { padding: 20px 16px; }
    .topbar { padding: 11px 15px; }
    .topbar nav { display: none; }
    .app-main { padding: 20px 15px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .auth-form-side { padding: 28px 18px; }
}
