/* =====================================================================
   六擎聚合登录 · 设计系统 v2
   配色策略：雾蓝灰底 + 云杉蓝主色 + 黛青辅助色，降低饱和度与渐变强度，
             卡片统一玻璃拟态（半透明 + 背景模糊），长时间浏览不刺眼。
   ===================================================================== */

:root {
    /* 主色 · 云杉蓝（替代原高饱和靛紫） */
    --brand: #3559c7;
    --brand-600: #2c4bb0;
    --brand-700: #24409a;
    --brand-soft: #ecf1fd;
    --brand-tint: rgba(53, 89, 199, .10);

    /* 辅助色 · 灰紫 / 静青（去掉霓虹感） */
    --violet: #6f6bc9;
    --cyan: #2f8fa8;
    --accent: #17897a;
    --accent-soft: #e7f4f1;

    /* 文本 */
    --ink: #0f1526;
    --text: #1c2233;
    --muted: #5a637a;
    --light: #8a92a6;

    /* 描边 */
    --border: rgba(15, 21, 38, .08);
    --border-strong: rgba(15, 21, 38, .14);

    /* 底色 */
    --bg: #ebeff5;
    --surface: #ffffff;
    --surface-2: #f5f7fb;

    /* 玻璃拟态 */
    --glass: rgba(255, 255, 255, .62);
    --glass-soft: rgba(255, 255, 255, .46);
    --glass-strong: rgba(255, 255, 255, .84);
    --glass-line: rgba(255, 255, 255, .72);
    --glass-blur: blur(18px) saturate(160%);

    /* 语义色 */
    --success: #1a8f63;
    --success-soft: #e6f6ef;
    --warn: #b97a12;
    --warn-soft: #fdf3e2;
    --danger: #c94a4a;
    --danger-soft: #fceceb;
    --info: #2a6fd0;
    --info-soft: #eaf2fd;

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

    --shadow-xs: 0 1px 2px rgba(15, 21, 38, .05);
    --shadow-sm: 0 2px 10px -4px rgba(15, 21, 38, .12);
    --shadow: 0 14px 34px -22px rgba(15, 21, 38, .30);
    --shadow-lg: 0 28px 64px -34px rgba(15, 21, 38, .38);
    --sidebar-w: 240px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    /* 极淡的色彩晕染层，为玻璃卡片提供可模糊的底层，同时避免高饱和 */
    background-image:
        radial-gradient(920px 620px at 4% -10%, rgba(53, 89, 199, .13), transparent 62%),
        radial-gradient(860px 580px at 100% 0%, rgba(23, 137, 122, .11), transparent 64%),
        radial-gradient(980px 640px at 50% 112%, rgba(111, 107, 201, .10), transparent 68%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; color: var(--ink); letter-spacing: -.012em; }
h1 { font-size: 2.3rem; line-height: 1.2; }
h2 { font-size: 1.58rem; line-height: 1.32; }
h3 { font-size: 1.18rem; }
h4 { font-size: 1.01rem; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
code, pre, .mono { font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace; }

::selection { background: #dbe4fb; }

/* 图标 */
.ico { display: inline-block; vertical-align: -0.18em; flex-shrink: 0; }

/* 品牌标记（前台 / 用户中心 / 后台共用） */
.brand-mark {
    width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
    background: linear-gradient(155deg, #4468d4 0%, #2f4fae 100%);
    color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -.5px;
    box-shadow: 0 8px 18px -10px rgba(53, 89, 199, .9), inset 0 1px 0 rgba(255, 255, 255, .22);
    flex-shrink: 0;
}
.brand-mark.lg { width: 46px; height: 46px; border-radius: 14px; font-size: 19px; }

/* ---------------- 玻璃拟态基础 ---------------- */
.glass {
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-line);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .9);
}
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
    .glass, .card, .panel, .kpi, .stat-card, .app-card, .plan-card,
    .uc-sidebar, .uc-topbar, .adm-side, .adm-top, .site-nav {
        background: rgba(255, 255, 255, .93);
    }
}

/* ---------------- 布局工具 ---------------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 880px; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.grow { flex: 1; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-muted { color: var(--muted); }
.text-light { color: var(--light); }
.text-brand { color: var(--brand); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px;
    padding: 0 18px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: var(--glass-strong);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease, transform .18s ease;
    white-space: nowrap;
    user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 8px 20px -12px rgba(53, 89, 199, .85), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.btn-primary:hover { background: var(--brand-600); box-shadow: 0 12px 26px -14px rgba(53, 89, 199, .9), inset 0 1px 0 rgba(255, 255, 255, .16); }
.btn-outline {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, .72);
    color: var(--text);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.btn-outline:hover { border-color: rgba(53, 89, 199, .45); color: var(--brand); background: rgba(255, 255, 255, .9); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(15, 21, 38, .045); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #f9dedd; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; }

/* ---------------- 卡片（玻璃） ---------------- */
.card {
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.card-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-head h3, .card-head h4 { font-size: 15px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 16px; }
.card-foot {
    padding: 14px 20px; border-top: 1px solid var(--border);
    background: rgba(245, 247, 251, .6);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.card.hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); transition: .2s; }

/* ---------------- 表单 ---------------- */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 7px;
}
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control {
    width: 100%;
    height: 42px;
    padding: 0 13px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: rgba(255, 255, 255, .78);
    outline: none;
    transition: border-color .16s, box-shadow .16s, background .16s;
}
textarea.form-control { height: auto; padding: 11px 13px; line-height: 1.6; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a637a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.form-control:focus { border-color: rgba(53, 89, 199, .55); background: #fff; box-shadow: 0 0 0 3px rgba(53, 89, 199, .10); }
.form-control::placeholder { color: var(--light); }
.form-control:disabled { background: rgba(245, 247, 251, .8); color: var(--muted); }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.input-icon { position: relative; }
.input-icon .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--light); }
.input-icon .form-control { padding-left: 38px; }
.input-group { display: flex; gap: 8px; }
.input-group .form-control { flex: 1; }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { display: none; }
.switch span {
    position: absolute; inset: 0; background: #cdd3e2; border-radius: 999px; cursor: pointer; transition: .2s;
}
.switch span::after {
    content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px;
    background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(15, 21, 38, .22);
}
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ---------------- 徽标 ---------------- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px; border-radius: 7px;
    font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .7); color: var(--muted);
    border: 1px solid var(--border);
}
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px;
    padding: 11px 16px; background: rgba(255, 255, 255, .52); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table th:first-child { border-radius: 10px 0 0 10px; }
.table th:last-child { border-radius: 0 10px 10px 0; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(53, 89, 199, .035); }

/* ---------------- 提示 ---------------- */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 15px; border-radius: 11px; font-size: 13.5px; line-height: 1.6;
    background: var(--info-soft); color: #1f5cab;
}
.alert-success { background: var(--success-soft); color: #0d6b4b; }
.alert-warn { background: var(--warn-soft); color: #8d5c0a; }
.alert-danger { background: var(--danger-soft); color: #972f2f; }
.alert-brand { background: var(--brand-soft); color: var(--brand-700); }

/* ---------------- 模态 ---------------- */
.modal {
    position: fixed; inset: 0; z-index: 900;
    display: none; align-items: flex-start; justify-content: center;
    padding: 48px 16px; overflow-y: auto;
    background: rgba(13, 18, 33, .38);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.modal.open { display: flex; }
.modal-dialog {
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    backdrop-filter: blur(24px) saturate(170%);
    border: 1px solid var(--glass-line);
    border-radius: var(--radius-lg); width: 100%; max-width: 520px;
    box-shadow: var(--shadow-lg); animation: modalIn .22s ease-out; margin: auto;
}
.modal-dialog.wide { max-width: 860px; }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 17px 22px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 22px; }
.modal-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 22px; border-top: 1px solid var(--border); background: rgba(245, 247, 251, .7);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.modal-close { background: none; border: 0; cursor: pointer; color: var(--light); padding: 4px; border-radius: 7px; }
.modal-close:hover { background: rgba(15, 21, 38, .05); color: var(--text); }
@keyframes modalIn { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------------- 提示条 ---------------- */
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; }
.toast {
    display: flex; align-items: center; gap: 9px;
    min-width: 220px; max-width: 380px;
    padding: 12px 16px; border-radius: 12px;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    backdrop-filter: blur(20px) saturate(170%);
    border: 1px solid var(--glass-line);
    box-shadow: var(--shadow-lg);
    font-size: 13.5px; font-weight: 500;
    border-left: 3px solid var(--brand);
    animation: toastIn .25s ease-out;
}
.toast.success { border-color: var(--success); color: #0d6b4b; }
.toast.error { border-color: var(--danger); color: #972f2f; }
.toast.info { border-color: var(--brand); color: var(--brand-700); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ---------------- 分页 ---------------- */
.pagination { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 34px; height: 34px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 9px; font-size: 13px; color: var(--muted);
    background: rgba(255, 255, 255, .7);
}
.pagination a:hover { border-color: rgba(53, 89, 199, .4); color: var(--brand); }
.pagination .active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pagination .disabled { opacity: .45; pointer-events: none; }

/* ---------------- 空状态 ---------------- */
.empty { padding: 54px 20px; text-align: center; color: var(--muted); }
.empty .empty-ico {
    width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-soft); color: var(--brand);
}
.empty h4 { margin-bottom: 6px; color: var(--text); }

/* ---------------- 平台图标 ---------------- */
.pbadge {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; color: #fff; font-weight: 700; letter-spacing: -.02em;
    flex-shrink: 0; user-select: none; overflow: hidden;
    background: #dbe2f0;
}
.pbadge img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pbadge.has-img { background: #fff; box-shadow: 0 0 0 1px rgba(15, 21, 38, .07), 0 2px 6px -3px rgba(15, 21, 38, .25); }

/* ---------------- 代码块 ---------------- */
.code-block {
    background: #151b2c; color: #e5e9f4; border-radius: 12px;
    padding: 18px 20px; overflow-x: auto; font-size: 13px; line-height: 1.75;
    font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}
.code-block .k { color: #b9c4f2; }
.code-block .s { color: #8fd7b4; }
.code-block .c { color: #7a829b; }
.code-block .v { color: #f0cf95; }

code.inline {
    background: var(--brand-soft); color: var(--brand-700);
    padding: 1px 6px; border-radius: 6px; font-size: 12.5px;
}

/* ---------------- 头像 ---------------- */
.avatar { border-radius: 50%; object-fit: cover; background: var(--brand-soft); }
.avatar-sq { border-radius: 10px; }

/* ---------------- 滚动条 ---------------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c8cede; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #b3bbcf; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 640px) {
    h1 { font-size: 1.82rem; }
    h2 { font-size: 1.34rem; }
    .container { padding: 0 18px; }
    .card-body { padding: 18px; }
}

/* ---------------- 柱状图（前后台通用） ---------------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding: 4px 4px 0; }
.bars .b { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bars .b i {
    display: block; width: 100%; max-width: 40px; border-radius: 8px 8px 3px 3px;
    background: linear-gradient(180deg, #6f8bd8, #4266c4); min-height: 4px;
    transition: .25s;
}
.bars .b:hover i { filter: brightness(1.06); }
.bars .b span { font-size: 10.5px; color: var(--light); white-space: nowrap; }
