/* ============================================================
   SaleSmartly · 界面设计系统
   ============================================================ */
:root {
    --primary: #1762F6;
    --primary-hover: #0E47CC;
    --primary-active: #0B3AA8;
    --primary-light: #E8F0FF;
    --primary-light2: #F3F7FE;
    --success: #00B42A;
    --success-light: #E8FFEA;
    --warning: #FF7D00;
    --warning-light: #FFF7E8;
    --danger: #F53F3F;
    --danger-light: #FFECE8;
    --purple: #722ED1;
    --cyan: #0FC6C2;

    --text-1: #1D2129;
    --text-2: #4E5969;
    --text-3: #86909C;
    --text-4: #C9CDD4;
    --border: #E5E6EB;
    --border-light: #F2F3F5;
    --bg: #F7F8FA;
    --bg-2: #FAFBFC;
    --white: #FFFFFF;

    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 10px;
    --radius-xl: 14px;

    --shadow-1: 0 1px 2px rgba(29, 33, 41, .04);
    --shadow-2: 0 2px 8px rgba(29, 33, 41, .06);
    --shadow-3: 0 6px 24px rgba(29, 33, 41, .10);
    --shadow-pop: 0 8px 32px rgba(29, 33, 41, .14);

    --rail-w: 76px;
    --topbar-h: 56px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5715;
    color: var(--text-1);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; }
p { margin: 0; }
img { max-width: 100%; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D8DCE3; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #C2C7D0; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 布局骨架 ---------------- */
.app { display: flex; height: 100vh; overflow: hidden; }

.rail {
    width: var(--rail-w);
    flex: 0 0 var(--rail-w);
    background: #fff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0 12px;
    z-index: 30;
}
.rail-logo {
    width: 100%;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 8px;
}
.logo-mark {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1762F6 0%, #4E8CFF 100%);
    position: relative;
    box-shadow: 0 4px 12px rgba(23, 98, 246, .32);
}
.logo-mark::before {
    content: "";
    position: absolute;
    left: 9px; top: 10px;
    width: 16px; height: 12px;
    border: 2px solid #fff;
    border-radius: 4px;
}
.logo-mark::after {
    content: "";
    position: absolute;
    left: 12px; top: 21px;
    width: 0; height: 0;
    border: 3px solid transparent;
    border-top-color: #fff;
}
.rail-nav { flex: 1; width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 4px 8px; overflow-y: auto; }
.rail-nav::-webkit-scrollbar { width: 0; }
.rail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 58px;
    border-radius: 8px;
    color: var(--text-3);
    font-size: 11px;
    cursor: pointer;
    transition: background .16s, color .16s;
    text-decoration: none;
    position: relative;
}
.rail-item:hover { background: var(--bg); color: var(--text-1); }
.rail-item.active { color: var(--primary); background: var(--primary-light); }
.rail-item.active::before {
    content: "";
    position: absolute;
    left: -8px; top: 15px;
    width: 3px; height: 28px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
}
.rail-item .ico { width: 22px; height: 22px; }
.rail-badge {
    position: absolute;
    top: 8px; right: 12px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    font-weight: 600;
}
.rail-footer { padding-top: 8px; }
.rail-avatar { width: 34px; height: 34px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
    height: var(--topbar-h);
    flex: 0 0 var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    z-index: 20;
}
.topbar-title { font-size: 15px; font-weight: 600; color: var(--text-1); }
.topbar-project {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-3);
    padding: 4px 8px; border-radius: var(--radius);
    background: var(--bg);
}
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius);
    color: var(--text-2);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg); color: var(--text-1); }
.icon-btn .ico { width: 18px; height: 18px; }

.page { flex: 1; overflow: auto; padding: 20px 24px 28px; }
.page-flush { flex: 1; overflow: hidden; display: flex; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.page-head h1 { font-size: 20px; line-height: 28px; letter-spacing: -.2px; }
.page-head .desc { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.page-head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.subnav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.subnav a {
    padding: 6px 12px;
    border-radius: var(--radius);
    color: var(--text-2);
    font-size: 13px;
    transition: all .15s;
}
.subnav a:hover { background: #fff; color: var(--text-1); }
.subnav a.active { background: #fff; color: var(--primary); font-weight: 500; box-shadow: var(--shadow-1); }

/* ---------------- 卡片 ---------------- */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-1);
}
.card + .card { margin-top: 16px; }
.card-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}
.card-head h3 { font-size: 15px; }
.card-head .desc { font-size: 12px; color: var(--text-3); }
.card-head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 20px; }
.card-body-flush { padding: 0; }

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-1);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .16s;
    user-select: none;
    text-decoration: none;
}
.btn:hover { border-color: #C7CCD6; background: var(--bg-2); color: var(--text-1); }
.btn:active { background: var(--bg); }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(23, 98, 246, .22);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-primary:active { background: var(--primary-active); border-color: var(--primary-active); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #CB2634; border-color: #CB2634; color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg); border-color: transparent; }
.btn-text { border: none; background: none; color: var(--primary); padding: 0 4px; height: auto; }
.btn-text:hover { color: var(--primary-hover); background: none; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn .ico { width: 16px; height: 16px; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field-label .req { color: var(--danger); margin-right: 2px; }
.field-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.input, .select, .textarea {
    width: 100%;
    height: 34px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text-1);
    outline: none;
    transition: border-color .16s, box-shadow .16s;
}
.textarea { height: auto; min-height: 88px; padding: 8px 11px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:hover, .select:hover, .textarea:hover { border-color: #C7CCD6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 98, 246, .10); }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, #86909C 50%), linear-gradient(135deg, #86909C 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.input-group { display: flex; align-items: center; gap: 8px; }
.input-group > .input, .input-group > .select { flex: 1 1 auto; min-width: 0; }
.input-group > span { white-space: nowrap; }
.input-icon { position: relative; }
.input-icon .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-3); }
.input-icon .input { padding-left: 32px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.checkbox input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #C9CDD4; border-radius: 20px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(16px); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
    text-align: left;
    font-weight: 500;
    color: var(--text-3);
    background: var(--bg-2);
    padding: 10px 16px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border-light); color: var(--text-1); vertical-align: middle; }
.table tbody tr:hover { background: #FAFCFF; }
.table tbody tr:last-child td { border-bottom: none; }
.table .t-actions { display: flex; gap: 10px; align-items: center; }
.table .num { font-variant-numeric: tabular-nums; }
.table-empty { padding: 60px 0; }

/* ---------------- 标签 / 徽标 ---------------- */
.tag {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-2);
    font-size: 12px;
    white-space: nowrap;
}
.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-success { background: var(--success-light); color: #009A29; }
.tag-warning { background: var(--warning-light); color: #D25F00; }
.tag-danger { background: var(--danger-light); color: #CB2634; }
.tag-purple { background: #F5E8FF; color: var(--purple); }
.tag-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: var(--success-light); color: #009A29; }
.badge-gray { background: var(--bg); color: var(--text-3); }
.badge-orange { background: var(--warning-light); color: #D25F00; }

/* ---------------- 头像 ---------------- */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    text-transform: uppercase;
}
.avatar-sm { width: 24px; height: 24px; font-size: 11px; }
.avatar-lg { width: 44px; height: 44px; font-size: 17px; }
.avatar-xl { width: 64px; height: 64px; font-size: 24px; }
.avatar-group { display: flex; }
.avatar-group .avatar { margin-left: -8px; border: 2px solid #fff; }
.avatar-group .avatar:first-child { margin-left: 0; }
.avatar-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.avatar-status { position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; background: var(--text-4); }
.avatar-status.online { background: var(--success); }

/* ---------------- 工作表 / 统计 ---------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-1); }
.stat-label { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 600; line-height: 34px; margin-top: 8px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); margin-top: 6px; }
.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* ---------------- 空状态 ---------------- */
.empty { padding: 64px 20px; text-align: center; color: var(--text-3); }
.empty-icon { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: var(--bg); position: relative; }
.empty-icon::before { content: ""; position: absolute; left: 50%; top: 50%; width: 26px; height: 20px; margin: -10px 0 0 -13px; border: 2px solid var(--text-4); border-radius: 5px; }
.empty-icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: 6px 0 0 -8px; background: var(--text-4); border-radius: 2px; }
.empty-title { font-size: 14px; color: var(--text-2); font-weight: 500; margin-bottom: 6px; }
.empty-desc { font-size: 13px; color: var(--text-3); margin-bottom: 18px; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 14px 20px; }
.pager-total { font-size: 12px; color: var(--text-3); margin-right: auto; }
.pager-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; background: #fff; }
.pager-btn:hover { border-color: var(--primary); color: var(--primary); }
.pager-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-btn.disabled { opacity: .45; pointer-events: none; }

/* ---------------- 下拉 ---------------- */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute;
    right: 0; top: calc(100% + 6px);
    min-width: 168px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    border: 1px solid var(--border-light);
    padding: 6px;
    z-index: 200;
    display: none;
}
.dropdown.open .dropdown-menu { display: block; animation: dropIn .14s ease-out; }
.dropdown-menu.left { left: 0; right: auto; }
.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius); color: var(--text-2); font-size: 13px; cursor: pointer; }
.dropdown-item:hover { background: var(--bg); color: var(--text-1); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border-light); margin: 6px 4px; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
    position: fixed; inset: 0;
    background: rgba(29, 33, 41, .45);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(2px);
}
.modal-mask.open { display: flex; }
.modal {
    width: 520px;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-pop);
    display: flex;
    flex-direction: column;
    animation: modalIn .2s cubic-bezier(.2,.8,.3,1);
}
.modal-lg { width: 760px; }
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border-light); }
.modal-head h3 { font-size: 16px; }
.modal-close { margin-left: auto; cursor: pointer; color: var(--text-3); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); }
.modal-close:hover { background: var(--bg); color: var(--text-1); }
.modal-body { padding: 22px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------------- 提示 ---------------- */
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 10px 16px; font-size: 13px; color: var(--text-1); border: 1px solid var(--border-light); animation: toastIn .2s ease-out; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--primary); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------- 分段控件 / 标签页 ---------------- */
.segmented { display: inline-flex; background: var(--bg); border-radius: var(--radius); padding: 3px; gap: 2px; }
.segmented a, .segmented button {
    padding: 4px 12px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-2);
    border: none; background: transparent; cursor: pointer; white-space: nowrap;
}
.segmented a.active, .segmented button.active { background: #fff; color: var(--text-1); font-weight: 500; box-shadow: var(--shadow-1); }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); padding: 0 20px; }
.tabs a, .tabs button {
    position: relative; padding: 12px 0; font-size: 14px; color: var(--text-2);
    border: none; background: none; cursor: pointer; white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--text-1); }
.tabs a.active, .tabs button.active { color: var(--primary); font-weight: 500; }
.tabs a.active::after, .tabs button.active::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); border-radius: 2px;
}

/* ---------------- 工具条 ---------------- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border-light); flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px dashed var(--border); border-radius: var(--radius); font-size: 12px; color: var(--text-2); cursor: pointer; background: #fff; }
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }

/* ---------------- 图标（纯 CSS） ---------------- */
.ico { display: inline-block; width: 20px; height: 20px; position: relative; flex-shrink: 0; color: currentColor; }
.ico::before, .ico::after { content: ""; position: absolute; box-sizing: border-box; }

.ico-chat::before { left: 1px; top: 2px; width: 18px; height: 14px; border: 1.7px solid currentColor; border-radius: 5px; }
.ico-chat::after { left: 5px; top: 14px; width: 5px; height: 5px; border-left: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: rotate(-20deg) skewX(20deg); }

.ico-contact::before { left: 6px; top: 1px; width: 8px; height: 8px; border: 1.7px solid currentColor; border-radius: 50%; }
.ico-contact::after { left: 2px; top: 11px; width: 16px; height: 8px; border: 1.7px solid currentColor; border-bottom: none; border-radius: 9px 9px 0 0; }

.ico-megaphone::before { left: 2px; top: 6px; width: 9px; height: 9px; border: 1.7px solid currentColor; border-radius: 2px; transform: skewY(-12deg); }
.ico-megaphone::after { left: 11px; top: 3px; width: 8px; height: 15px; border: 1.7px solid currentColor; border-left: none; border-radius: 0 4px 4px 0; transform: skewY(-12deg); }

.ico-flow::before { left: 1px; top: 2px; width: 6px; height: 6px; border: 1.7px solid currentColor; border-radius: 2px; box-shadow: 12px 10px 0 -1.7px transparent, 12px 10px 0 0 currentColor; }
.ico-flow::after { left: 7px; top: 5px; width: 8px; height: 1.7px; background: currentColor; box-shadow: 0 9px 0 currentColor; }

.ico-chart::before { left: 2px; bottom: 3px; width: 4px; height: 8px; background: currentColor; border-radius: 1px; box-shadow: 6px 0 0 currentColor, 12px 0 0 currentColor; }
.ico-chart::after { left: 2px; bottom: 14px; width: 4px; height: 0; box-shadow: 6px 3px 0 currentColor, 12px -2px 0 currentColor; }
.ico-chart2::before { left: 2px; bottom: 3px; width: 4px; height: 8px; background: currentColor; border-radius: 1px; }
.ico-chart2::after { left: 8px; bottom: 3px; width: 4px; height: 13px; background: currentColor; border-radius: 1px; box-shadow: 6px 0 0 currentColor; }

.ico-plug::before { left: 2px; top: 6px; width: 9px; height: 9px; border: 1.7px solid currentColor; border-radius: 50%; border-right-color: transparent; }
.ico-plug::after { left: 9px; top: 6px; width: 9px; height: 9px; border: 1.7px solid currentColor; border-radius: 50%; border-left-color: transparent; }

.ico-team::before { left: 2px; top: 3px; width: 7px; height: 7px; border: 1.7px solid currentColor; border-radius: 50%; box-shadow: 8px 2px 0 -1px transparent; }
.ico-team::after { left: 1px; top: 12px; width: 12px; height: 7px; border: 1.7px solid currentColor; border-bottom: none; border-radius: 7px 7px 0 0; }

.ico-settings::before { left: 3px; top: 3px; width: 14px; height: 14px; border: 1.9px solid currentColor; border-radius: 50%; }
.ico-settings::after { left: 9px; top: 1px; width: 2px; height: 3px; background: currentColor; box-shadow: 0 15px 0 currentColor, 6px 6px 0 currentColor, -6px 6px 0 currentColor; }

.ico-search::before { left: 2px; top: 2px; width: 12px; height: 12px; border: 1.8px solid currentColor; border-radius: 50%; }
.ico-search::after { left: 13px; top: 13px; width: 6px; height: 1.8px; background: currentColor; transform: rotate(45deg); border-radius: 2px; }

.ico-bell::before { left: 4px; top: 2px; width: 12px; height: 12px; border: 1.7px solid currentColor; border-radius: 7px 7px 2px 2px; border-bottom: none; }
.ico-bell::after { left: 3px; top: 13px; width: 14px; height: 1.8px; background: currentColor; border-radius: 1px; box-shadow: 6.2px 3px 0 -0.2px currentColor; }

.ico-plus::before { left: 9px; top: 4px; width: 2px; height: 12px; background: currentColor; }
.ico-plus::after { left: 4px; top: 9px; width: 12px; height: 2px; background: currentColor; }

.ico-close::before { left: 4px; top: 9px; width: 13px; height: 1.8px; background: currentColor; transform: rotate(45deg); }
.ico-close::after { left: 4px; top: 9px; width: 13px; height: 1.8px; background: currentColor; transform: rotate(-45deg); }

.ico-check::before { left: 3px; top: 10px; width: 6px; height: 1.8px; background: currentColor; transform: rotate(45deg); }
.ico-check::after { left: 7px; top: 8px; width: 11px; height: 1.8px; background: currentColor; transform: rotate(-50deg); }

.ico-more::before { left: 2px; top: 9px; width: 4px; height: 4px; background: currentColor; border-radius: 50%; box-shadow: 6px 0 0 currentColor, 12px 0 0 currentColor; }

.ico-filter::before { left: 2px; top: 4px; width: 16px; height: 1.8px; background: currentColor; box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor; }
.ico-filter::after { left: 6px; top: 2px; width: 2px; height: 2px; background: transparent; }

.ico-send::before { left: 2px; top: 8px; width: 0; height: 0; border: 6px solid transparent; border-left-color: currentColor; border-right: none; }
.ico-send::after { left: 4px; top: 5px; width: 4px; height: 9px; background: transparent; }

.ico-emoji::before { left: 1px; top: 1px; width: 18px; height: 18px; border: 1.7px solid currentColor; border-radius: 50%; }
.ico-emoji::after { left: 6px; top: 7px; width: 2px; height: 2px; background: currentColor; border-radius: 50%; box-shadow: 6px 0 0 currentColor, 3px 6px 0 1px currentColor; }

.ico-attach::before { left: 7px; top: 2px; width: 8px; height: 14px; border: 1.7px solid currentColor; border-radius: 5px; border-top-color: transparent; transform: rotate(35deg); }
.ico-attach::after { left: 9px; top: 5px; width: 4px; height: 8px; border: 1.5px solid currentColor; border-radius: 3px; border-top-color: transparent; transform: rotate(35deg); }

.ico-arrow::before { left: 9px; top: 3px; width: 2px; height: 14px; background: currentColor; }
.ico-arrow::after { left: 5px; top: 4px; width: 8px; height: 8px; border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); }
.ico-arrow.down::after { transform: rotate(225deg); top: 8px; }

.ico-refresh::before { left: 3px; top: 3px; width: 14px; height: 14px; border: 1.8px solid currentColor; border-radius: 50%; border-right-color: transparent; }
.ico-refresh::after { left: 12px; top: 1px; width: 0; height: 0; border: 3px solid transparent; border-left-color: currentColor; }

.ico-edit::before { left: 3px; top: 3px; width: 12px; height: 12px; border: 1.7px solid currentColor; border-radius: 2px; }
.ico-edit::after { left: 8px; top: 5px; width: 9px; height: 1.8px; background: currentColor; transform: rotate(-45deg); }

.ico-trash::before { left: 4px; top: 6px; width: 12px; height: 12px; border: 1.7px solid currentColor; border-radius: 0 0 3px 3px; border-top: none; }
.ico-trash::after { left: 2px; top: 4px; width: 16px; height: 1.7px; background: currentColor; }

.ico-eye::before { left: 1px; top: 5px; width: 18px; height: 10px; border: 1.7px solid currentColor; border-radius: 50% 50% 50% 50% / 60% 60% 60% 60%; }
.ico-eye::after { left: 7px; top: 8px; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }

.ico-download::before { left: 9px; top: 2px; width: 2px; height: 11px; background: currentColor; }
.ico-download::after { left: 5px; top: 8px; width: 10px; height: 10px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }

.ico-link::before { left: 2px; top: 8px; width: 10px; height: 4px; background: currentColor; border-radius: 3px; transform: rotate(-45deg); }
.ico-link::after { left: 8px; top: 8px; width: 10px; height: 4px; background: currentColor; border-radius: 3px; transform: rotate(-45deg); }

.ico-clock::before { left: 2px; top: 2px; width: 16px; height: 16px; border: 1.7px solid currentColor; border-radius: 50%; }
.ico-clock::after { left: 9px; top: 7px; width: 1.7px; height: 5px; background: currentColor; }

.ico-file::before { left: 4px; top: 2px; width: 12px; height: 16px; border: 1.7px solid currentColor; border-radius: 2px; }
.ico-file::after { left: 7px; top: 8px; width: 6px; height: 1.7px; background: currentColor; box-shadow: 0 3px 0 currentColor; }

.ico-image::before { left: 2px; top: 4px; width: 16px; height: 13px; border: 1.7px solid currentColor; border-radius: 3px; }
.ico-image::after { left: 6px; top: 8px; width: 3px; height: 3px; background: currentColor; border-radius: 50%; }

.ico-star::before { left: 3px; top: 2px; width: 14px; height: 14px; border: 1.7px solid currentColor; transform: rotate(45deg); border-radius: 3px 0; }

.ico-globe::before { left: 2px; top: 2px; width: 16px; height: 16px; border: 1.7px solid currentColor; border-radius: 50%; }
.ico-globe::after { left: 9px; top: 2px; width: 1.6px; height: 16px; background: currentColor; border-radius: 1px; }

.ico-shield::before { left: 4px; top: 2px; width: 12px; height: 15px; border: 1.7px solid currentColor; border-radius: 3px 3px 8px 8px; }
.ico-shield::after { left: 7px; top: 8px; width: 6px; height: 4px; border-left: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: rotate(-45deg); }

.ico-key::before { left: 2px; top: 3px; width: 8px; height: 8px; border: 1.8px solid currentColor; border-radius: 50%; }
.ico-key::after { left: 9px; top: 10px; width: 9px; height: 1.8px; background: currentColor; transform: rotate(-45deg); }

.ico-wechat::before { left: 1px; top: 3px; width: 14px; height: 11px; border: 1.7px solid currentColor; border-radius: 6px; }
.ico-wechat::after { left: 6px; top: 13px; width: 5px; height: 5px; border-left: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: rotate(-30deg); }

/* ---------------- 会话列表 ---------------- */
.chat-shell { display: flex; height: 100%; width: 100%; background: #fff; }
.chat-list-pane { width: 316px; flex: 0 0 316px; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: #fff; }
.chat-list-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--border-light); }
.chat-list-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.chat-list-title h2 { font-size: 16px; }
.chat-filters { display: flex; gap: 2px; overflow-x: auto; }
.chat-filters::-webkit-scrollbar { height: 0; }
.chat-filter { padding: 4px 9px; border-radius: var(--radius); font-size: 12px; color: var(--text-3); cursor: pointer; white-space: nowrap; border: none; background: none; }
.chat-filter:hover { background: var(--bg); color: var(--text-1); }
.chat-filter.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.chat-list { flex: 1; overflow-y: auto; }
.conv-item { display: flex; gap: 10px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border-light); position: relative; transition: background .12s; }
.conv-item:hover { background: var(--bg-2); }
.conv-item.active { background: var(--primary-light2); }
.conv-item.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; align-items: center; gap: 6px; }
.conv-name { font-size: 13px; font-weight: 500; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { margin-left: auto; font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.conv-msg { font-size: 12px; color: var(--text-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { display: flex; align-items: center; gap: 5px; margin-top: 5px; }
.conv-unread { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 17px; text-align: center; margin-left: auto; font-weight: 500; }

.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }
.chat-head { height: 58px; flex: 0 0 58px; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.chat-head-info { min-width: 0; }
.chat-head-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.chat-head-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.chat-head-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.chat-body { flex: 1; overflow-y: auto; padding: 20px 24px; background: #fff; }
.msg-date { text-align: center; margin: 14px 0; }
.msg-date span { font-size: 11px; color: var(--text-3); background: var(--bg); padding: 3px 10px; border-radius: 10px; }
.msg-row { display: flex; gap: 10px; margin-bottom: 16px; max-width: 76%; }
.msg-row.out { flex-direction: row-reverse; margin-left: auto; }
.msg-bubble { padding: 9px 13px; border-radius: 10px; background: var(--bg); font-size: 13.5px; line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
.msg-row.in .msg-bubble { border-top-left-radius: 3px; }
.msg-row.out .msg-bubble { background: var(--primary); color: #fff; border-top-right-radius: 3px; }
.msg-meta { font-size: 11px; color: var(--text-4); margin-top: 4px; }
.msg-row.out .msg-meta { text-align: right; }
.msg-note { max-width: 100%; margin: 0 auto 16px; padding: 8px 12px; background: var(--warning-light); border: 1px dashed #FFD8A8; border-radius: var(--radius); font-size: 12px; color: #B25E00; }
.chat-composer { border-top: 1px solid var(--border); background: #fff; padding: 10px 16px 12px; }
.composer-tools { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.composer-input { width: 100%; border: none; outline: none; resize: none; min-height: 62px; max-height: 160px; font-size: 13.5px; line-height: 1.6; padding: 4px 2px; }
.composer-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.composer-hint { font-size: 11px; color: var(--text-4); }
.composer-foot .spacer { flex: 1; }

.chat-info-pane { width: 306px; flex: 0 0 306px; border-left: 1px solid var(--border); background: #fff; overflow-y: auto; }
.info-section { padding: 16px 18px; border-bottom: 1px solid var(--border-light); }
.info-section h4 { font-size: 12px; color: var(--text-3); font-weight: 500; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.info-row { display: flex; gap: 10px; font-size: 13px; margin-bottom: 9px; }
.info-row .k { color: var(--text-3); width: 62px; flex-shrink: 0; }
.info-row .v { color: var(--text-1); flex: 1; min-width: 0; word-break: break-all; }

.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; background: var(--bg-2); }

/* ---------------- 登录页 ---------------- */
.auth-wrap { display: flex; min-height: 100vh; background: #fff; }
.auth-visual {
    flex: 1; position: relative; overflow: hidden;
    background: linear-gradient(135deg, #0B3AA8 0%, #1762F6 52%, #4E8CFF 100%);
    color: #fff; padding: 56px 64px; display: flex; flex-direction: column;
}
.auth-visual::before, .auth-visual::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.08); }
.auth-visual::before { width: 520px; height: 520px; right: -180px; top: -160px; }
.auth-visual::after { width: 360px; height: 360px; left: -120px; bottom: -140px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; letter-spacing: .2px; position: relative; z-index: 2; }
.auth-hero { margin: auto 0; position: relative; z-index: 2; max-width: 480px; }
.auth-hero h1 { font-size: 40px; line-height: 1.25; letter-spacing: -1px; font-weight: 600; }
.auth-hero p { margin-top: 16px; font-size: 15px; line-height: 1.8; color: rgba(255,255,255,.82); }
.auth-features { display: flex; gap: 28px; margin-top: 40px; }
.auth-feature { font-size: 13px; color: rgba(255,255,255,.9); }
.auth-feature b { display: block; font-size: 24px; font-weight: 600; margin-bottom: 2px; }
.auth-foot { font-size: 12px; color: rgba(255,255,255,.6); position: relative; z-index: 2; }
.auth-panel { width: 480px; flex: 0 0 480px; display: flex; flex-direction: column; justify-content: center; padding: 48px 64px; }
.auth-panel h2 { font-size: 26px; letter-spacing: -.4px; }
.auth-panel .sub { color: var(--text-3); font-size: 13px; margin-top: 8px; margin-bottom: 28px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 24px; background: var(--bg); padding: 4px; border-radius: var(--radius); }
.auth-tabs a { flex: 1; text-align: center; padding: 7px 0; font-size: 13px; border-radius: var(--radius-sm); color: var(--text-2); }
.auth-tabs a.active { background: #fff; color: var(--text-1); font-weight: 500; box-shadow: var(--shadow-1); }
.auth-agree { font-size: 12px; color: var(--text-3); margin: 18px 0 0; text-align: center; }
.auth-error { background: var(--danger-light); color: #CB2634; font-size: 12px; padding: 8px 12px; border-radius: var(--radius); margin-bottom: 14px; display: none; }

/* ---------------- 工作流 ---------------- */
.wf-canvas { position: relative; background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border); min-height: 560px; padding: 32px; overflow: auto; background-image: radial-gradient(#E5E6EB 1px, transparent 1px); background-size: 18px 18px; }
.wf-node { position: relative; width: 240px; margin: 0 auto 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); }
.wf-node-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border-light); font-size: 13px; font-weight: 500; }
.wf-node-body { padding: 12px 14px; font-size: 12px; color: var(--text-3); }
.wf-connector { width: 2px; height: 28px; background: var(--border); margin: 0 auto; position: relative; }
.wf-connector::after { content: ""; position: absolute; left: -3px; bottom: 0; width: 0; height: 0; border: 4px solid transparent; border-top-color: var(--border); }

/* ---------------- 报告 ---------------- */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 12px; }
.chart-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; height: 100%; }
.chart-bar i { display: block; width: 100%; max-width: 34px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #4E8CFF, #1762F6); transition: height .4s ease; }
.chart-bar span { font-size: 11px; color: var(--text-3); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

/* ---------------- 设置页 ---------------- */
.setting-layout { display: flex; gap: 20px; align-items: flex-start; }
.setting-nav { width: 200px; flex: 0 0 200px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px; position: sticky; top: 0; }
.setting-nav a { display: block; padding: 8px 12px; border-radius: var(--radius); font-size: 13px; color: var(--text-2); margin-bottom: 2px; }
.setting-nav a:hover { background: var(--bg); color: var(--text-1); }
.setting-nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.setting-content { flex: 1; min-width: 0; }
.setting-row { display: flex; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--border-light); }
.setting-row:last-child { border-bottom: none; }
.setting-row .label { width: 200px; flex: 0 0 200px; }
.setting-row .label b { display: block; font-size: 13px; font-weight: 500; color: var(--text-1); }
.setting-row .label span { font-size: 12px; color: var(--text-3); }
.setting-row .control { flex: 1; min-width: 0; }

/* ---------------- 渠道卡片 ---------------- */
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.channel-card { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; transition: all .16s; }
.channel-card:hover { border-color: #C7CCD6; box-shadow: var(--shadow-2); transform: translateY(-1px); }
.channel-logo { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.channel-name { font-size: 14px; font-weight: 500; }
.channel-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------------- 其他 ---------------- */
.text-1 { color: var(--text-1); } .text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); }
.text-danger { color: var(--danger); } .text-success { color: var(--success); } .text-primary { color: var(--primary); }
.fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; }
.mt-0 { margin-top: 0 !important; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.ml-auto { margin-left: auto; }
.flex { display: flex; } .flex-center { display: flex; align-items: center; } .flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { height: 1px; background: var(--border-light); margin: 16px 0; }
.hide { display: none !important; }
.progress { height: 6px; border-radius: 3px; background: var(--border-light); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.list-item:last-child { border-bottom: none; }

@media (max-width: 1200px) {
    .chat-info-pane { display: none; }
}
@media (max-width: 900px) {
    .auth-visual { display: none; }
    .auth-panel { width: 100%; flex: 1; padding: 32px; }
    :root { --rail-w: 64px; }
    .rail-item { height: 52px; font-size: 10px; }
    .chat-list-pane { width: 260px; flex-basis: 260px; }
    .setting-row { flex-direction: column; gap: 10px; }
    .setting-row .label { width: 100%; flex: none; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
