/* =====================================================================
 *  在线客服系统 · 全局设计系统
 *  纯手写 CSS，无任何框架依赖
 * ===================================================================== */

/* ---------------------------------------------------------------------
 *  1. 设计令牌
 * ------------------------------------------------------------------- */
:root {
    /* 品牌色 */
    --c-primary: #2b6cff;
    --c-primary-600: #1c5bf0;
    --c-primary-700: #1548c4;
    --c-primary-50: #eef3ff;
    --c-primary-100: #dce6ff;

    --c-ink: #0f1729;
    --c-ink-2: #354053;
    --c-muted: #6b7789;
    --c-muted-2: #97a1b0;

    --c-line: #e8ecf3;
    --c-line-2: #f1f4f9;
    --c-bg: #f5f7fb;
    --c-bg-2: #eef1f7;
    --c-white: #ffffff;

    --c-nav: #1e2a45;
    --c-nav-2: #172136;
    --c-nav-active: #2b6cff;

    --c-success: #12b886;
    --c-success-50: #e7f8f1;
    --c-warn: #f59f00;
    --c-warn-50: #fff6e5;
    --c-danger: #f03e3e;
    --c-danger-50: #feecec;
    --c-violet: #7c5cff;
    --c-cyan: #0ca678;

    /* 圆角 */
    --r-xs: 6px;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 22px;
    --r-full: 999px;

    /* 阴影 */
    --sh-xs: 0 1px 2px rgba(15, 23, 41, .06);
    --sh-sm: 0 2px 8px rgba(15, 23, 41, .07);
    --sh-md: 0 8px 24px rgba(15, 23, 41, .10);
    --sh-lg: 0 18px 50px rgba(15, 23, 41, .16);
    --sh-ring: 0 0 0 3px rgba(43, 108, 255, .16);

    /* 字号 */
    --f-xs: 12px;
    --f-sm: 13px;
    --f-md: 14px;
    --f-lg: 16px;
    --f-xl: 20px;
    --f-2xl: 26px;
    --f-3xl: 34px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
            "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

    --header-h: 58px;
    --nav-w: 232px;
}

/* ---------------------------------------------------------------------
 *  2. 基础重置
 * ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--f-md);
    line-height: 1.6;
    color: var(--c-ink);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; border: 0; }

a { color: var(--c-primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--c-primary-700); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

table { border-collapse: collapse; width: 100%; }

/* =====================================================================
 *  SVG 图标基础规则（iOS / Safari 关键修复）
 *
 *  背景：内联 SVG 只写 viewBox 而不写 width/height 时，
 *    · Chrome / 安卓：默认按 100%×100%（或继承字号）渲染，看起来「正常」
 *    · iOS Safari ：会退化成 CSS 初始尺寸（300×150）或撑满容器，
 *                   结果是图标过大被裁剪 / 溢出 / 显示为空白区域。
 *  这就是「安卓和电脑正常，苹果手机进去一片空白、但按钮还能点」的根因。
 *
 *  修复：这里给所有内联 SVG 兜一层安全默认值，任何页面漏写 width/height
 *        都不会再失控；具体容器再用更高优先级覆写尺寸。
 * ===================================================================== */
svg {
    flex: none;                 /* 不被 flex 容器压缩变形 */
    max-width: 100%;
    box-sizing: content-box;
}
/* 兜底规则：只对「没写 width 属性」的 SVG 生效，跟随字号（视觉最稳）。
   写了 width/height 属性的 SVG 一律尊重原值，不被这条规则覆盖。 */
svg[viewBox]:not([width]) {
    width: 1em;
    height: 1em;
    vertical-align: -0.14em;    /* 与文字基线对齐，避免把行高顶高 */
    overflow: visible;
}
/* 写了 width 但容器可能把它压扁的场景，补一条防压缩 */
svg[viewBox][width] {
    flex: none;
    overflow: visible;
}
/* 页面上真正当作「图标」使用的 SVG（按钮 / 列表 / 卡片内）统一块级居中 */
.cs-tool > svg,
.cs-head-act > svg,
.csl-tool > svg,
.cs-btn > svg,
.cs-emoji-it > svg,
.adm-icon-btn > svg,
.cs-menu-it > .mi > svg,
.cs-empty .ic > svg,
.adm-stat .ic > svg {
    display: block;
}

code, pre { font-family: var(--mono); font-size: .92em; }
code {
    background: var(--c-bg-2);
    padding: 1px 6px;
    border-radius: var(--r-xs);
    color: #b13389;
    word-break: break-all;
}
pre {
    background: var(--c-nav);
    color: #d6e2ff;
    padding: 14px 16px;
    border-radius: var(--r-md);
    overflow: auto;
    margin: 0;
    line-height: 1.7;
}
pre code { background: none; color: inherit; padding: 0; }

::selection { background: rgba(43, 108, 255, .18); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #ccd4e2;
    border-radius: var(--r-full);
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #aeb9cb; background-clip: content-box; }

/* ---------------------------------------------------------------------
 *  3. 按钮
 * ------------------------------------------------------------------- */
.cs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    font-size: var(--f-md);
    font-weight: 500;
    line-height: 1;
    color: var(--c-ink-2);
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: var(--r-sm);
    white-space: nowrap;
    user-select: none;
    transition: all .16s ease;
    box-shadow: var(--sh-xs);
}
.cs-btn:hover { border-color: #d3dbe8; background: #fbfcfe; color: var(--c-ink); }
.cs-btn:active { transform: translateY(1px); }
.cs-btn:disabled, .cs-btn.is-disabled {
    opacity: .55; cursor: not-allowed; transform: none;
}
.cs-btn:focus-visible { outline: none; box-shadow: var(--sh-ring); }

.cs-btn-primary {
    color: #fff;
    background: linear-gradient(180deg, #3d7bff, var(--c-primary));
    border-color: var(--c-primary-600);
    box-shadow: 0 2px 8px rgba(43, 108, 255, .28);
}
.cs-btn-primary:hover {
    background: linear-gradient(180deg, #2f70ff, var(--c-primary-600));
    border-color: var(--c-primary-700);
    color: #fff;
}

.cs-btn-success { color: #fff; background: var(--c-success); border-color: #0ca678; }
.cs-btn-success:hover { background: #0ca678; color: #fff; }

.cs-btn-danger { color: #fff; background: var(--c-danger); border-color: #e03131; }
.cs-btn-danger:hover { background: #e03131; color: #fff; }

.cs-btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.cs-btn-ghost:hover { background: var(--c-bg-2); border-color: transparent; }

.cs-btn-soft {
    color: var(--c-primary);
    background: var(--c-primary-50);
    border-color: transparent;
    box-shadow: none;
}
.cs-btn-soft:hover { background: var(--c-primary-100); border-color: transparent; }

.cs-btn-sm { height: 30px; padding: 0 11px; font-size: var(--f-sm); border-radius: var(--r-xs); }
.cs-btn-lg { height: 46px; padding: 0 24px; font-size: var(--f-lg); border-radius: var(--r-md); }
.cs-btn-block { width: 100%; }
.cs-btn-icon { width: 38px; padding: 0; }
.cs-btn-icon.cs-btn-sm { width: 30px; }

/* ---------------------------------------------------------------------
 *  4. 表单
 * ------------------------------------------------------------------- */
.cs-input, .cs-select, .cs-textarea {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    font-size: var(--f-md);
    color: var(--c-ink);
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: var(--r-sm);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.cs-textarea {
    height: auto;
    min-height: 88px;
    padding: 10px 12px;
    line-height: 1.65;
    resize: vertical;
}
.cs-input:focus, .cs-select:focus, .cs-textarea:focus {
    border-color: var(--c-primary);
    box-shadow: var(--sh-ring);
}
.cs-input::placeholder, .cs-textarea::placeholder { color: var(--c-muted-2); }
.cs-input:disabled, .cs-select:disabled { background: var(--c-bg-2); color: var(--c-muted); }

.cs-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7789' d='M6 8.5 1.8 4.3l1-1L6 6.5l3.2-3.2 1 1z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 30px;
}

.cs-field { margin-bottom: 16px; }
.cs-label {
    display: block;
    font-size: var(--f-sm);
    font-weight: 600;
    color: var(--c-ink-2);
    margin-bottom: 6px;
}
.cs-label .cs-req { color: var(--c-danger); margin-left: 2px; }
.cs-help { font-size: var(--f-xs); color: var(--c-muted); margin-top: 5px; line-height: 1.6; }

.cs-input-group { display: flex; gap: 8px; align-items: center; }
.cs-input-group .cs-input { flex: 1; min-width: 0; }

/* 开关 */
.cs-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.cs-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cs-switch-track {
    position: relative;
    width: 42px; height: 24px;
    background: #cdd5e2;
    border-radius: var(--r-full);
    transition: background .2s;
    flex: none;
}
.cs-switch-track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--sh-xs);
    transition: transform .2s;
}
.cs-switch input:checked + .cs-switch-track { background: var(--c-primary); }
.cs-switch input:checked + .cs-switch-track::after { transform: translateX(18px); }
.cs-switch input:focus-visible + .cs-switch-track { box-shadow: var(--sh-ring); }
.cs-switch-text { font-size: var(--f-md); color: var(--c-ink-2); }

/* 复选 / 单选 */
.cs-check { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; user-select: none; }
.cs-check input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--c-primary); flex: none; cursor: pointer; }
.cs-check-text { font-size: var(--f-md); color: var(--c-ink-2); line-height: 1.6; }
.cs-check-text b { display: block; color: var(--c-ink); }
.cs-check-text small { color: var(--c-muted); font-size: var(--f-xs); }

/* 单选卡组 */
.cs-radios { display: flex; flex-wrap: wrap; gap: 10px; }
.cs-radio-card {
    position: relative;
    flex: 1 1 200px;
    min-width: 0;
    padding: 13px 15px;
    border: 1.5px solid var(--c-line);
    border-radius: var(--r-md);
    background: var(--c-white);
    cursor: pointer;
    transition: all .16s;
}
.cs-radio-card:hover { border-color: var(--c-primary-100); background: #fbfcff; }
.cs-radio-card input { position: absolute; opacity: 0; }
.cs-radio-card .t { font-weight: 600; color: var(--c-ink); display: flex; align-items: center; gap: 7px; }
.cs-radio-card .d { font-size: var(--f-xs); color: var(--c-muted); margin-top: 4px; line-height: 1.55; }
.cs-radio-card.is-active {
    border-color: var(--c-primary);
    background: var(--c-primary-50);
    box-shadow: 0 0 0 3px rgba(43, 108, 255, .09);
}
.cs-radio-card.is-active .t { color: var(--c-primary-700); }

/* ---------------------------------------------------------------------
 *  5. 卡片 / 面板
 * ------------------------------------------------------------------- */
.cs-panel {
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    padding: 20px;
    box-shadow: var(--sh-xs);
}
.cs-panel + .cs-panel { margin-top: 16px; }
.cs-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--c-line-2);
}
.cs-panel-title {
    font-size: var(--f-lg);
    font-weight: 700;
    color: var(--c-ink);
    display: flex;
    align-items: center;
    gap: 8px;
}
.cs-panel-title::before {
    content: '';
    width: 3px; height: 15px;
    background: var(--c-primary);
    border-radius: var(--r-full);
    flex: none;
}
.cs-panel-desc { font-size: var(--f-sm); color: var(--c-muted); margin-top: 3px; }
.cs-panel-tip {
    margin-top: 14px;
    padding: 11px 13px;
    font-size: var(--f-sm);
    color: var(--c-muted);
    background: var(--c-bg-2);
    border-radius: var(--r-sm);
    line-height: 1.7;
}

.cs-card {
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    padding: 16px;
    box-shadow: var(--sh-xs);
    transition: box-shadow .18s, transform .18s;
}
.cs-card.is-hover:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }

/* 键值列表 */
.cs-kv { display: flex; flex-direction: column; }
.cs-kv li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--c-line-2);
    font-size: var(--f-md);
}
.cs-kv li:last-child { border-bottom: 0; }
.cs-kv li > span { color: var(--c-muted); flex: none; }
.cs-kv li > b { color: var(--c-ink); font-weight: 600; text-align: right; word-break: break-all; }
.cs-ok { color: var(--c-success) !important; }
.cs-bad { color: var(--c-danger) !important; }

/* 步骤列表 */
.cs-steps { counter-reset: st; }
.cs-steps li {
    position: relative;
    counter-increment: st;
    padding: 0 0 16px 38px;
    color: var(--c-ink-2);
    line-height: 1.75;
}
.cs-steps li::before {
    content: counter(st);
    position: absolute;
    left: 0; top: 1px;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: var(--f-xs);
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #4d86ff, var(--c-primary));
    border-radius: 50%;
}
.cs-steps li::after {
    content: '';
    position: absolute;
    left: 11.5px; top: 28px; bottom: 4px;
    width: 1px;
    background: var(--c-line);
}
.cs-steps li:last-child { padding-bottom: 0; }
.cs-steps li:last-child::after { display: none; }
.cs-steps li b { color: var(--c-ink); }

/* ---------------------------------------------------------------------
 *  6. 表格
 * ------------------------------------------------------------------- */
.cs-table-wrap {
    overflow: auto;
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    background: var(--c-white);
}
.cs-table { min-width: 100%; font-size: var(--f-sm); }
.cs-table thead th {
    position: sticky; top: 0;
    z-index: 1;
    padding: 11px 13px;
    text-align: left;
    font-weight: 600;
    color: var(--c-ink-2);
    background: #f8fafd;
    border-bottom: 1px solid var(--c-line);
    white-space: nowrap;
}
.cs-table tbody td {
    padding: 11px 13px;
    border-bottom: 1px solid var(--c-line-2);
    color: var(--c-ink-2);
    vertical-align: middle;
}
.cs-table tbody tr:last-child td { border-bottom: 0; }
.cs-table tbody tr:hover td { background: #fafcff; }
.cs-table .t-mono { font-family: var(--mono); font-size: var(--f-xs); color: var(--c-muted); }
.cs-table .t-nowrap { white-space: nowrap; }
.cs-table .t-actions { white-space: nowrap; text-align: right; }

/* ---------------------------------------------------------------------
 *  7. 徽标 / 标签
 * ------------------------------------------------------------------- */
.cs-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 21px;
    padding: 0 8px;
    font-size: var(--f-xs);
    font-weight: 500;
    line-height: 1;
    border-radius: var(--r-xs);
    background: var(--c-bg-2);
    color: var(--c-muted);
    white-space: nowrap;
}
.cs-badge-primary { background: var(--c-primary-50); color: var(--c-primary-700); }
.cs-badge-success { background: var(--c-success-50); color: #0a7f5c; }
.cs-badge-warn    { background: var(--c-warn-50); color: #a86100; }
.cs-badge-danger  { background: var(--c-danger-50); color: #c92a2a; }
.cs-badge-violet  { background: #f1ecff; color: #5b3fd1; }

.cs-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--c-muted-2);
    flex: none;
    display: inline-block;
}
.cs-dot-on { background: var(--c-success); box-shadow: 0 0 0 2.5px rgba(18, 184, 134, .18); }
.cs-dot-off { background: #c2cad8; }
.cs-dot-busy { background: var(--c-warn); }
.cs-dot-pulse { animation: cs-pulse 1.8s infinite; }
@keyframes cs-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(18, 184, 134, .45); }
    50%      { box-shadow: 0 0 0 5px rgba(18, 184, 134, 0); }
}

/* 未读角标 */
.cs-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: var(--c-danger);
    border-radius: var(--r-full);
}

/* ---------------------------------------------------------------------
 *  8. 头像
 * ------------------------------------------------------------------- */
.cs-avatar {
    position: relative;
    width: 40px; height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex: none;
    background: var(--c-bg-2);
}
.cs-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cs-avatar-xs { width: 26px; height: 26px; }
.cs-avatar-sm { width: 32px; height: 32px; }
.cs-avatar-lg { width: 56px; height: 56px; }
.cs-avatar-xl { width: 84px; height: 84px; }
.cs-avatar .cs-status-dot {
    position: absolute;
    right: 0; bottom: 0;
    width: 11px; height: 11px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--c-muted-2);
}
.cs-avatar .cs-status-dot.on { background: var(--c-success); }

/* 头像组 */
.cs-avatars { display: flex; }
.cs-avatars .cs-avatar { border: 2px solid #fff; margin-left: -9px; }
.cs-avatars .cs-avatar:first-child { margin-left: 0; }

/* ---------------------------------------------------------------------
 *  9. 弹层 / 模态
 * ------------------------------------------------------------------- */
.cs-modal-mask {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 41, .48);
    backdrop-filter: blur(3px);
    animation: cs-fade .18s ease;
}
@keyframes cs-fade { from { opacity: 0; } to { opacity: 1; } }

.cs-modal {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: var(--c-white);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-lg);
    overflow: hidden;
    animation: cs-pop .22s cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes cs-pop {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
.cs-modal-sm { max-width: 420px; }
.cs-modal-lg { max-width: 800px; }
.cs-modal-xl { max-width: 1080px; }

.cs-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--c-line-2);
    flex: none;
}
.cs-modal-title { font-size: var(--f-lg); font-weight: 700; }
.cs-modal-body { padding: 20px; overflow: auto; flex: 1 1 auto; }
.cs-modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--c-line-2);
    background: #fbfcfe;
    flex: none;
}
.cs-modal-close {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    font-size: 19px;
    color: var(--c-muted);
    border-radius: var(--r-xs);
    transition: all .15s;
}
.cs-modal-close:hover { background: var(--c-bg-2); color: var(--c-ink); }

/* 抽屉 */
.cs-drawer-mask {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(15, 23, 41, .42);
    animation: cs-fade .18s ease;
}
.cs-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(520px, 100vw);
    z-index: 9001;
    display: flex;
    flex-direction: column;
    background: var(--c-white);
    box-shadow: var(--sh-lg);
    animation: cs-slide-l .24s cubic-bezier(.2, .9, .3, 1);
}
@keyframes cs-slide-l { from { transform: translateX(100%); } to { transform: none; } }

/* ---------------------------------------------------------------------
 *  10. Toast 提示
 * ------------------------------------------------------------------- */
.cs-toasts {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 9px;
    align-items: center;
    pointer-events: none;
}
.cs-toast {
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: min(460px, 92vw);
    padding: 10px 16px;
    font-size: var(--f-md);
    color: var(--c-ink);
    background: var(--c-white);
    border-radius: var(--r-full);
    box-shadow: var(--sh-md);
    border: 1px solid var(--c-line);
    animation: cs-toast-in .24s cubic-bezier(.2, .9, .3, 1.1);
    pointer-events: auto;
}
.cs-toast.leaving { animation: cs-toast-out .2s forwards; }
@keyframes cs-toast-in  { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes cs-toast-out { to { opacity: 0; transform: translateY(-10px); } }
.cs-toast .i { font-size: 15px; flex: none; }
.cs-toast-success .i { color: var(--c-success); }
.cs-toast-error   .i { color: var(--c-danger); }
.cs-toast-warn    .i { color: var(--c-warn); }
.cs-toast-info    .i { color: var(--c-primary); }

/* ---------------------------------------------------------------------
 *  11. 提示条
 * ------------------------------------------------------------------- */
.cs-alert {
    display: flex;
    gap: 10px;
    padding: 12px 15px;
    font-size: var(--f-md);
    border-radius: var(--r-sm);
    line-height: 1.7;
    background: var(--c-primary-50);
    color: var(--c-primary-700);
    border: 1px solid var(--c-primary-100);
}
.cs-alert-danger  { background: var(--c-danger-50);  color: #b02525; border-color: #fbc9c9; }
.cs-alert-warn    { background: var(--c-warn-50);    color: #96610a; border-color: #ffe3ad; }
.cs-alert-success { background: var(--c-success-50); color: #0a7f5c; border-color: #b6ecd7; }

/* ---------------------------------------------------------------------
 *  12. 加载 / 空态
 * ------------------------------------------------------------------- */
.cs-spinner {
    width: 18px; height: 18px;
    border: 2px solid var(--c-primary-100);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: cs-spin .7s linear infinite;
    flex: none;
}
.cs-spinner-lg { width: 30px; height: 30px; border-width: 3px; }
@keyframes cs-spin { to { transform: rotate(360deg); } }

.cs-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 36px 20px;
    color: var(--c-muted);
    font-size: var(--f-md);
}

.cs-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 46px 20px;
    color: var(--c-muted-2);
    text-align: center;
}
.cs-empty .ico { font-size: 38px; opacity: .5; line-height: 1; }
.cs-empty .t { font-size: var(--f-md); color: var(--c-muted); }
.cs-empty .d { font-size: var(--f-sm); }

/* 骨架屏 */
.cs-skeleton {
    background: linear-gradient(90deg, #eef1f7 25%, #e4e9f2 37%, #eef1f7 63%);
    background-size: 400% 100%;
    animation: cs-shimmer 1.3s ease infinite;
    border-radius: var(--r-xs);
}
@keyframes cs-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------------------------------------------------------------
 *  13. 分页
 * ------------------------------------------------------------------- */
.cs-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.cs-pager button {
    min-width: 34px; height: 34px;
    padding: 0 10px;
    font-size: var(--f-sm);
    color: var(--c-ink-2);
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: var(--r-xs);
    transition: all .15s;
}
.cs-pager button:hover:not(:disabled) { border-color: var(--c-primary); color: var(--c-primary); }
.cs-pager button.active {
    color: #fff;
    background: var(--c-primary);
    border-color: var(--c-primary);
    font-weight: 600;
}
.cs-pager button:disabled { opacity: .45; cursor: not-allowed; }
.cs-pager .info { font-size: var(--f-sm); color: var(--c-muted); margin: 0 6px; }

/* ---------------------------------------------------------------------
 *  14. 选项卡
 * ------------------------------------------------------------------- */
.cs-tabs {
    display: flex;
    gap: 3px;
    padding: 3px;
    background: var(--c-bg-2);
    border-radius: var(--r-sm);
    overflow-x: auto;
    scrollbar-width: none;
}
.cs-tabs::-webkit-scrollbar { display: none; }
.cs-tabs button {
    padding: 7px 14px;
    font-size: var(--f-sm);
    font-weight: 500;
    color: var(--c-muted);
    border-radius: var(--r-xs);
    white-space: nowrap;
    transition: all .15s;
}
.cs-tabs button:hover { color: var(--c-ink-2); }
.cs-tabs button.active {
    color: var(--c-ink);
    background: var(--c-white);
    box-shadow: var(--sh-xs);
    font-weight: 600;
}

/* 下划线式选项卡 */
.cs-tabs-line {
    display: flex;
    gap: 2px;
    background: none;
    padding: 0;
    border-bottom: 1px solid var(--c-line);
    border-radius: 0;
    overflow-x: auto;
}
.cs-tabs-line button {
    position: relative;
    padding: 11px 15px;
    border-radius: 0;
    background: none !important;
    box-shadow: none !important;
}
.cs-tabs-line button.active { color: var(--c-primary); }
.cs-tabs-line button.active::after {
    content: '';
    position: absolute;
    left: 12px; right: 12px; bottom: -1px;
    height: 2px;
    background: var(--c-primary);
    border-radius: var(--r-full);
}

/* ---------------------------------------------------------------------
 *  15. 登录页
 * ------------------------------------------------------------------- */
.cs-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(1100px 620px at 12% -12%, #dbe6ff 0%, transparent 55%),
        radial-gradient(900px 560px at 106% 108%, #e6dcff 0%, transparent 52%),
        linear-gradient(150deg, #f7f9fd 0%, #eef2fa 100%);
}
.cs-auth-box {
    width: 100%;
    max-width: 940px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--c-white);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-lg);
    overflow: hidden;
}
.cs-auth-side {
    position: relative;
    padding: 44px 38px;
    color: #fff;
    background: linear-gradient(158deg, #2f6bff 0%, #4c3df0 55%, #6d3ae0 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cs-auth-side::before {
    content: '';
    position: absolute;
    width: 320px; height: 320px;
    right: -130px; top: -130px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
}
.cs-auth-side::after {
    content: '';
    position: absolute;
    width: 220px; height: 220px;
    left: -90px; bottom: -80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
}
.cs-auth-side > * { position: relative; z-index: 1; }
.cs-auth-logo svg,
.cs-home-logo svg { display: block; }
.cs-auth-logo {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    color: #fff;                 /* 线性图标跟随文字色 */
    flex: none;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: var(--r-md);
    backdrop-filter: blur(6px);
}
.cs-auth-side h2 { font-size: var(--f-2xl); margin: 22px 0 8px; letter-spacing: -.4px; }
.cs-auth-side > p { color: rgba(255, 255, 255, .82); font-size: var(--f-md); line-height: 1.75; }
.cs-auth-feats { margin-top: auto; padding-top: 30px; display: flex; flex-direction: column; gap: 11px; }
.cs-auth-feats li {
    display: flex; align-items: center; gap: 9px;
    font-size: var(--f-sm);
    color: rgba(255, 255, 255, .9);
}
.cs-auth-feats .ic {
    width: 21px; height: 21px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    background: rgba(255, 255, 255, .17);
    border-radius: 50%;
    flex: none;
}
.cs-auth-main { padding: 44px 38px; display: flex; flex-direction: column; justify-content: center; }
.cs-auth-main h1 { font-size: var(--f-2xl); letter-spacing: -.4px; }
.cs-auth-main .sub { color: var(--c-muted); margin: 7px 0 26px; font-size: var(--f-md); }
.cs-auth-foot { margin-top: 22px; font-size: var(--f-xs); color: var(--c-muted-2); text-align: center; line-height: 1.8; }
.cs-auth-back { display: inline-flex; align-items: center; gap: 5px; font-size: var(--f-sm); color: var(--c-muted); margin-bottom: 20px; }
.cs-auth-back:hover { color: var(--c-primary); }

/* ---------------------------------------------------------------------
 *  16. 首页 / 落地页
 * ------------------------------------------------------------------- */
.cs-page {
    background:
        radial-gradient(1000px 560px at 8% -10%, #e2eaff 0%, transparent 52%),
        radial-gradient(900px 520px at 104% 106%, #ece4ff 0%, transparent 50%),
        var(--c-bg);
}
.cs-home { max-width: 1020px; margin: 0 auto; padding: 52px 22px 40px; }
.cs-home-head { text-align: center; margin-bottom: 34px; }
.cs-home-logo {
    width: 66px; height: 66px;
    margin: 0 auto 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    color: #fff;                 /* 线性图标跟随文字色 */
    background: linear-gradient(158deg, #3d7bff, #6d3ae0);
    border-radius: var(--r-lg);
    box-shadow: 0 12px 30px rgba(43, 108, 255, .3);
}
.cs-home-head h1 { font-size: var(--f-3xl); letter-spacing: -.9px; }
.cs-home-head > p { color: var(--c-muted); margin-top: 11px; font-size: var(--f-lg); line-height: 1.7; }
.cs-home-actions { display: flex; gap: 11px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.cs-home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.cs-home-foot { text-align: center; color: var(--c-muted-2); font-size: var(--f-sm); margin-top: 30px; }

/* ---------------------------------------------------------------------
 *  17. 工具类
 * ------------------------------------------------------------------- */
.cs-flex     { display: flex; }
.cs-flex-col { display: flex; flex-direction: column; }
.cs-between  { justify-content: space-between; }
.cs-center   { align-items: center; }
.cs-jcenter  { justify-content: center; }
.cs-wrap     { flex-wrap: wrap; }
.cs-flex-1   { flex: 1; min-width: 0; }
.cs-gap-4  { gap: 4px; }
.cs-gap-6  { gap: 6px; }
.cs-gap-8  { gap: 8px; }
.cs-gap-10 { gap: 10px; }
.cs-gap-12 { gap: 12px; }
.cs-gap-16 { gap: 16px; }
.cs-gap-20 { gap: 20px; }

.cs-mt-4  { margin-top: 4px; }
.cs-mt-8  { margin-top: 8px; }
.cs-mt-12 { margin-top: 12px; }
.cs-mt-16 { margin-top: 16px; }
.cs-mt-20 { margin-top: 20px; }
.cs-mt-24 { margin-top: 24px; }
.cs-mb-8  { margin-bottom: 8px; }
.cs-mb-12 { margin-bottom: 12px; }
.cs-mb-16 { margin-bottom: 16px; }
.cs-mb-20 { margin-bottom: 20px; }

.cs-t-xs { font-size: var(--f-xs); }
.cs-t-sm { font-size: var(--f-sm); }
.cs-t-lg { font-size: var(--f-lg); }
.cs-t-xl { font-size: var(--f-xl); }
.cs-muted { color: var(--c-muted); }
.cs-muted-2 { color: var(--c-muted-2); }
.cs-bold { font-weight: 700; }
.cs-semi { font-weight: 600; }
.cs-danger-t { color: var(--c-danger); }
.cs-success-t { color: var(--c-success); }
.cs-primary-t { color: var(--c-primary); }
.cs-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cs-break { word-break: break-all; }
.cs-hidden { display: none !important; }
.cs-text-center { text-align: center; }
.cs-text-right { text-align: right; }
.cs-nowrap { white-space: nowrap; }
.cs-mono { font-family: var(--mono); }
.cs-pointer { cursor: pointer; }

.cs-sr {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------------
 *  18. 响应式
 * ------------------------------------------------------------------- */
@media (max-width: 860px) {
    .cs-auth-box { grid-template-columns: minmax(0, 1fr); max-width: 460px; }
    .cs-auth-side { display: none; }
    .cs-auth-main { padding: 34px 24px; }
    .cs-home-head h1 { font-size: 27px; }
    .cs-home { padding-top: 34px; }
}

@media (max-width: 560px) {
    .cs-home-actions .cs-btn { flex: 1 1 auto; }
    .cs-radios { flex-direction: column; }
    .cs-radio-card { flex: 1 1 auto; }
    .cs-modal { max-height: calc(100vh - 24px); }
    .cs-modal-foot { flex-wrap: wrap; }
    .cs-modal-foot .cs-btn { flex: 1 1 auto; }
}

/* 打印 */
@media print {
    .cs-btn, .cs-tabs, .cs-pager { display: none !important; }
}
