* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #409eff;
    --primary-dark: #337ecc;
    --primary-light: rgba(64, 158, 255, .08);
    --bg: #f0f2f5;
    --sidebar: #ffffff;
    --sidebar-hover: #f5f7fa;
    --sidebar-text: #595959;
    --sidebar-text-active: #409eff;
    --text: #595959;
    --muted: #8c8c8c;
    --border: #f0f0f0;
    --danger: #ff4d4f;
    --success: #52c41a;
    --grid-head: #fafafa;
    --hover: #f5f7fa;
}

body {
    font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

/* ===================== 登录页 ===================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f4f8;
    padding: 24px;
}
.login-box {
    display: flex;
    width: 1120px;
    max-width: 100%;
    min-height: 580px;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(85, 102, 232, .18);
}

/* 左侧插画区 */
.login-left {
    position: relative;
    flex: 1.15;
    min-width: 0;
    overflow: hidden;
}
.login-illus { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-intro {
    position: absolute;
    z-index: 2;
    left: 14%;
    top: 50%;
    transform: translateY(-50%);
    color: #2b3358;
}
.login-intro .welcome { font-size: 32px; font-weight: 700; letter-spacing: 2px; margin-bottom: 24px; }
.login-intro .sys-name { font-size: 30px; font-weight: 700; color: #2b3358; margin-bottom: 18px; }
.login-intro .sys-desc { font-size: 14px; line-height: 1.9; color: #8a93b5; }

/* 右侧表单区 */
.login-right {
    flex: 1;
    min-width: 0;
    padding: 56px 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.login-logo {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    margin-bottom: 34px;
    background: radial-gradient(circle at 35% 30%, #a9b6f8, #5566e8 70%);
    box-shadow: 0 10px 24px rgba(85, 102, 232, .4), inset 0 -6px 12px rgba(0,0,0,.12);
}
.login-form { width: 100%; max-width: 360px; }
.login-form .field {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 18px;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid #e3e7f3;
    border-radius: 26px;
    transition: border-color .15s, box-shadow .15s;
}
.login-form .field:focus-within { border-color: #6d80f0; box-shadow: 0 0 0 3px rgba(109, 128, 240, .12); }
.login-form .field-ic { display: inline-flex; color: #9aa3c7; flex-shrink: 0; }
.login-form .field-ic svg { width: 18px; height: 18px; }
.login-form .field-eye { display: inline-flex; color: #9aa3c7; flex-shrink: 0; cursor: pointer; }
.login-form .field-eye svg { width: 18px; height: 18px; }
.login-form .field-eye:hover { color: #6d80f0; }
.login-form .field-eye .ic-eye-off { display: none; }
.login-form .field-eye.showing .ic-eye { display: none; }
.login-form .field-eye.showing .ic-eye-off { display: inline; }
.login-form .field input {
    flex: 1;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    height: 100%;
    font-size: 14px;
    outline: none;
    color: #2b3358;
}
/* 覆盖浏览器自动填充的蓝色/黄色背景 */
.login-form .field input:-webkit-autofill,
.login-form .field input:-webkit-autofill:hover,
.login-form .field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #2b3358;
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    box-shadow: 0 0 0 1000px #fff inset;
    transition: background-color 9999s ease-in-out 0s;
    caret-color: #2b3358;
}
.login-form .remember {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #8a93b5;
    margin: 2px 4px 0;
    cursor: pointer;
}
.login-form .remember input { width: auto; accent-color: #6d80f0; }
.login-form .tip { text-align: left; padding-left: 4px; }
.login-btn {
    width: 100%;
    height: 46px;
    margin-top: 14px;
    border: none;
    border-radius: 26px;
    background: linear-gradient(90deg, #6d80f0, #8a7bec);
    color: #fff;
    font-size: 15px;
    letter-spacing: 4px;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(109, 128, 240, .35);
    transition: filter .15s;
}
.login-btn:hover { filter: brightness(1.05); }

@media (max-width: 720px) {
    .login-box { flex-direction: column; width: 420px; }
    .login-left { min-height: 220px; flex: none; }
    .login-right { padding: 36px 32px; }
}

.form-item { margin-bottom: 16px; }
.form-item label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
input, select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

/* 自定义日期选择器：输入框（带日历图标，点击即弹出） */
.dt-input {
    cursor: pointer; padding-right: 32px !important;
    background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}
.dtp { position: fixed; z-index: 3000; background: #fff; border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.18); font-size: 13px; user-select: none; }
.dtp-main { display: flex; }
.dtp-cal { padding: 12px; width: 280px; }
.dtp-cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dtp-cal-head .dtp-title { flex: 1; text-align: center; font-weight: 600; color: #333; }
.dtp-nav { cursor: pointer; color: #64748b; padding: 2px 6px; border-radius: 6px; }
.dtp-nav:hover { background: #eef2f7; color: var(--primary); }
.dtp-week { display: grid; grid-template-columns: repeat(7, 1fr); color: #94a3b8; }
.dtp-week span { text-align: center; padding: 4px 0; }
.dtp-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.dtp-day { text-align: center; padding: 7px 0; cursor: pointer; border-radius: 6px; color: #334155; }
.dtp-day:hover { background: #eef2ff; color: var(--primary); }
.dtp-day.out { color: #cbd5e1; }
.dtp-day.today { color: var(--primary); font-weight: 600; }
.dtp-day.sel { background: var(--primary); color: #fff; }
.dtp-time { width: 154px; border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.dtp-time-head { text-align: center; padding: 10px 6px; border-bottom: 1px solid var(--border); color: var(--primary); font-weight: 600; }
.dtp-tcols { display: flex; height: 232px; }
.dtp-col { flex: 1; overflow-y: auto; position: relative; padding-bottom: 100px; }
.dtp-col + .dtp-col { border-left: 1px solid #f1f5f9; }
.dtp-col::-webkit-scrollbar { width: 5px; }
.dtp-col::-webkit-scrollbar-thumb { background: #dbe1ea; border-radius: 3px; }
.dtp-tcell { display: block; text-align: center; padding: 6px 0; cursor: pointer; color: #475569; }
.dtp-tcell:hover { background: #eef2ff; }
.dtp-tcell.sel { background: #e0e7ff; color: var(--primary); font-weight: 600; }
.dtp-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-top: 1px solid var(--border); }
.dtp-now { color: var(--primary); cursor: pointer; }
.dtp-now:hover { text-decoration: underline; }
.dtp-ok { background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 6px 16px; cursor: pointer; font-size: 13px; }
.dtp-ok:hover { background: var(--primary-dark); }
.dtp-dateonly .dtp-time { display: none; }
input:focus, select:focus { border-color: var(--primary); }

/* 密码框显隐切换 */
.pwd-field { position: relative; }
.pwd-field input { padding-right: 38px; }
.pwd-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; border-radius: 6px; }
.pwd-eye:hover { color: var(--primary); background: var(--hover); }
.pwd-eye.on { color: var(--primary); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); }
.btn.primary { background: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { background: #f8fafc; }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.tip { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 4px; }

/* ===================== 应用外壳 ===================== */
.app { display: flex; flex-direction: column; min-height: 100vh; }

/* 顶部主色栏：品牌 + 顶级菜单 + 右侧工具 */
header.app-top { height: 62px; background: var(--primary); display: flex; align-items: center; padding: 0 16px 0 20px; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,.08); position: relative; z-index: 20; }
.app-brand { font-size: 17px; font-weight: 700; color: #fff; white-space: nowrap; margin-right: 22px; display: flex; align-items: center; gap: 8px; }
.app-brand .brand-logo { height: 26px; border-radius: 4px; }
.app-topmenu { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0; height: 100%; overflow: visible; flex-wrap: nowrap; }
.app-topright { display: flex; align-items: center; gap: 10px; margin-left: 14px; flex-shrink: 0; }

/* 顶级菜单项 */
.tm-item { position: relative; display: flex; align-items: center; gap: 6px; height: 62px; padding: 0 12px; color: rgba(255,255,255,.66); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; }
.tm-item:hover { color: #fff; background: rgba(0,0,0,.1); }
.tm-item.active { color: #fff; border-bottom-color: #fff; }
.tm-item .nav-ic { width: auto; }
.tm-arrow { font-size: 11px; opacity: .8; }
.tm-dropdown { display: none; position: absolute; top: 100%; left: 0; min-width: 190px; background: #fff; border: 1px solid var(--border); border-radius: 0 0 8px 8px; box-shadow: 0 12px 28px rgba(0,0,0,.18); z-index: 60; padding: 4px 0; }
.tm-group.open .tm-dropdown { display: block; }
.tm-sub-item { padding: 10px 18px; color: var(--text); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tm-sub-item:hover { background: var(--hover); color: var(--primary); }

/* 顶级菜单溢出折叠：更多菜单 */
.tm-more .tm-dropdown { left: auto; right: 0; }
.tm-more-menu { max-height: 72vh; overflow-y: auto; }
.tm-more-row { position: relative; }
.tm-more-parent { justify-content: space-between; }
.tm-more-parent .tm-arrow { margin-left: auto; }
.tm-more-sub { display: none; position: absolute; left: 100%; top: 0; min-width: 180px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 28px rgba(0,0,0,.18); z-index: 61; padding: 4px 0; }
.tm-more-row:hover .tm-more-sub { display: block; }

/* 主体：侧边栏 + 主区 */
.app-body { flex: 1; display: flex; min-height: 0; }
.sidebar { width: 220px; background: var(--sidebar); flex-shrink: 0; overflow-y: auto; border-right: 1px solid var(--border); }
.nav { padding: 8px 0; }
.nav-ic { width: 18px; text-align: center; flex-shrink: 0; }
.nav-ic svg { width: 16px; height: 16px; display: block; margin: 0 auto; }
.tm-item > .nav-ic svg, .tm-sub-item > .nav-ic svg { width: 15px; height: 15px; }
/* 图标选择器（下拉弹层） */
.icon-select { position: relative; max-width: 340px; }
.icon-select-input { display: flex; align-items: center; gap: 8px; height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; cursor: pointer; background: #fff; }
.icon-select-input:hover, .icon-select.open .icon-select-input { border-color: var(--primary); }
.ips-preview { display: inline-flex; color: #595959; }
.ips-preview:empty { display: none; }
.ips-preview svg { width: 18px; height: 18px; }
.ips-text { flex: 1; font-size: 14px; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ips-text.placeholder { color: var(--muted); }
.ips-caret { color: var(--muted); font-size: 12px; transition: transform .2s; }
.icon-select.open .ips-caret { transform: rotate(180deg); }
.icon-panel { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 60; width: 372px; max-height: 264px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 28px rgba(0,0,0,.16); padding: 10px; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.icon-select.open .icon-panel { display: grid; }
.icon-select.up .icon-panel { top: auto; bottom: calc(100% + 4px); }
.icon-opt { width: 100%; aspect-ratio: 1; min-height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; color: #595959; transition: all .12s; }
.icon-opt svg { width: 18px; height: 18px; }
.icon-opt:hover { border-color: var(--primary); color: var(--primary); }
.icon-opt.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 20px; cursor: pointer; white-space: nowrap; color: var(--sidebar-text, #595959); border-left: 3px solid transparent; }
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active, #409eff); }
.nav-item.active { background: var(--primary-light); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

/* 可折叠分组（侧边模式） */
.nav-group-head { display: flex; align-items: center; gap: 10px; padding: 11px 20px; cursor: pointer; white-space: nowrap; color: var(--sidebar-text, #cbd5e1); }
.nav-group-head:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active, #fff); }
.nav-group-head .nav-txt { flex: 1; }
.nav-group-head .nav-arrow { font-size: 11px; opacity: .7; transition: transform .2s; }
.nav-group.open > .nav-group-head .nav-arrow { transform: rotate(180deg); }
.nav-group.has-active > .nav-group-head { color: var(--sidebar-text-active, #fff); }
.nav-sub { display: none; }
.nav-group.open .nav-sub { display: block; }
.nav-sub .nav-item { padding-left: 48px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content { padding: 20px; flex: 1; overflow: auto; }

/* 标签导航栏（顶部/混合模式），样式对齐参考系统 */
.tabbar { display: none; align-items: stretch; height: 40px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 0; flex-shrink: 0; position: relative; z-index: 10; }
.tab-strip { display: flex; align-items: stretch; flex: 1; min-width: 0; height: 100%; overflow-x: auto; scrollbar-width: none; }
.tab-strip::-webkit-scrollbar { display: none; }
.tab-nav { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); border: none; background: #fff; font-size: 16px; flex-shrink: 0; }
.tab-nav:hover { background: rgba(0,0,0,.02); }
.tabbar > .tab-nav[data-scroll="-1"] { border-right: 1px solid #f4f4f4; }
.tabbar > .tab-nav[data-scroll="1"] { border-left: 1px solid #f4f4f4; }
.tab-ops { flex-shrink: 0; border-left: 1px solid #f4f4f4; margin-right: 5px; }
.tab-home { width: 42px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); border-right: 1px solid #f4f4f4; flex-shrink: 0; }
.tab-home:hover { color: #262626; background: rgba(0,0,0,.02); }
.tab-home.active { color: var(--primary); background: var(--primary-light); }
.nav-tab { display: flex; align-items: center; height: 40px; padding: 0 15px; color: #8c8c8c; cursor: pointer; white-space: nowrap; font-size: 13px; border-right: 1px solid #f4f4f4; }
.nav-tab::before { content: ""; width: 9px; height: 9px; margin-right: 8px; display: inline-block; background: #ddd; border-radius: 50%; flex-shrink: 0; }
.nav-tab:hover { color: #262626; background: rgba(0,0,0,.02); }
.nav-tab.active { color: var(--primary); background: var(--primary-light); }
.nav-tab.active::before { background: var(--primary); }
.nav-tab .tab-close { font-size: 15px; line-height: 1; margin-left: 8px; opacity: .55; border-radius: 3px; width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; }
.nav-tab .tab-close:hover { opacity: 1; color: #fff; background: #ff4d4f; }

/* 模式差异 */
.app-side .app-topmenu { visibility: hidden; }
.app-top .sidebar { display: none; }
.app-top .tabbar, .app-mix .tabbar { display: flex; }

/* 顶部深色栏右侧工具（浅色文字） */
.top-search { position: relative; display: flex; align-items: center; height: 34px; width: 210px; background: #fff; border-radius: 4px; padding: 0 12px; gap: 6px; }
.top-search .ts-ic { color: #8c8c8c; font-size: 13px; }
.top-search input { border: none; background: transparent; height: 100%; width: 100%; outline: none; font-size: 13px; padding: 0; color: #333; }
.top-search input::placeholder { color: #bfbfbf; }
.top-icon { position: relative; width: 36px; height: 36px; border: none; background: transparent; border-radius: 6px; cursor: pointer; font-size: 17px; color: rgba(255,255,255,.85); display: inline-flex; align-items: center; justify-content: center; }
.top-icon:hover { background: rgba(0,0,0,.1); color: #fff; }
.notify-badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; align-items: center; justify-content: center; }
.top-user { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 8px; border-radius: 20px; color: #fff; }
.top-user:hover { background: rgba(0,0,0,.1); }
.top-user .avatar { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.top-user #userName { font-size: 14px; color: #fff; }
.top-user .caret { color: rgba(255,255,255,.7); font-size: 12px; }

.top-dropdown { position: relative; }
.top-menu { display: none; position: absolute; right: 0; top: 44px; min-width: 180px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 6px; z-index: 60; }
.top-dropdown.open .top-menu { display: block; }
.top-menu .menu-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text); }
.top-menu .menu-item:hover { background: var(--hover); }
.menu-head { font-size: 13px; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-empty { color: var(--muted); text-align: center; font-size: 13px; padding: 18px 0; }
.search-menu { left: 0; right: auto; width: 210px; max-height: 320px; overflow: auto; }
.notify-menu { width: 290px; }
.notify-list { max-height: 340px; overflow: auto; }
.notify-item { display: flex; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.notify-item:hover { background: var(--hover); }
.ni-ic { width: 32px; height: 32px; border-radius: 8px; background: #eef1fb; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.ni-title { font-size: 13px; margin-bottom: 2px; }
.ni-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; }

.card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 18px;
    margin-bottom: 16px;
}
.card h3 { margin-bottom: 14px; font-size: 15px; }
.toolbar { margin-bottom: 14px; display: flex; gap: 8px; }

/* 普通表格（弹窗/监控内使用） */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; background: #f8fafc; }
tr:hover td { background: #f8fafc; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge.on { background: #dcfce7; color: var(--success); }
.badge.off { background: #fee2e2; color: var(--danger); }
.badge.warn { background: #fef9c3; color: #a16207; }

.actions { display: flex; gap: 6px; }

/* 使用手册页 */
.manual { line-height: 1.7; max-width: 900px; }
.manual h2 { font-size: 20px; }
.manual h3 { margin: 22px 0 8px; font-size: 16px; padding-left: 10px; border-left: 3px solid var(--primary); }
.manual p { margin: 6px 0; }
.manual ul { margin: 6px 0 6px 22px; }
.manual li { margin: 4px 0; }
.manual .muted { color: var(--muted); }
.manual code { background: #f1f5f9; color: #b91c1c; padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.manual table { margin: 8px 0; }
.manual table th { white-space: nowrap; }

/* ===================== 列表页版式（标题栏 / 筛选卡 / 翻页） ===================== */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title { font-size: 18px; font-weight: 700; color: var(--text); }
.page-title .sel-count { margin-left: 10px; font-size: 13px; font-weight: 400; }
.page-actions { display: flex; gap: 8px; }

/* 列表顶部工具条：操作按钮在左、图标在右（搜索行在其下方） */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.toolbar-actions .sel-count { margin-left: 4px; }
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* 查询/工具卡片：条件居左，工具居右 */
.list-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 20px 24px; margin-bottom: 16px; flex-wrap: wrap; }
.list-bar-left { flex: 1 1 auto; min-width: 0; display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.list-bar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.filter-card { padding: 22px 24px; margin-bottom: 16px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px 24px; }
.filter-item { display: flex; flex-direction: column; gap: 8px; }
.filter-item label { font-size: 13px; color: #6b7280; }
.filter-item input, .filter-item select { width: 220px; height: 40px; border-radius: 8px; background: #fff; }
.filter-item input[type=date] { width: 175px; }
.filter-actions { display: flex; gap: 12px; margin-left: auto; }
.filter-actions .btn { height: 40px; padding: 0 24px; }

/* 合并式工具栏（筛选在左、操作在右）+ 同卡片内可展开的高级筛选 */
.list-bar.combined { display: block; padding: 0; }
.list-bar.combined .lb-main { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; flex-wrap: wrap; }
.list-bar.combined .filter-row { align-items: center; gap: 12px; }
.list-bar.combined .filter-row .btn { height: 40px; }
.list-bar.combined .filter-item input, .list-bar.combined .filter-item select { height: 40px; }
.list-bar.combined .filter-actions { margin-left: 0; }
.filter-row .btn { display: inline-flex; align-items: center; gap: 5px; }
.filter-row .btn svg { width: 15px; height: 15px; }
.adv-caret { font-size: 11px; transition: transform .2s; display: inline-block; margin-left: 2px; }
.adv-btn.open .adv-caret { transform: rotate(180deg); }
.list-adv { padding: 14px 24px 16px; border-top: 1px solid var(--border); }
.list-adv .filter-row { align-items: center; gap: 16px 24px; }
.list-adv .filter-item { flex-direction: row; align-items: center; gap: 8px; }
.list-adv .filter-item label { flex-shrink: 0; }
.list-adv .filter-item select { width: 160px; }

.pager-info { color: var(--muted); font-size: 13px; }
.pager { display: flex; align-items: center; gap: 6px; }
.pg-btn { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text); }
.pg-btn:hover:not(:disabled):not(.active) { border-color: var(--primary); color: var(--primary); }
.pg-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pg-btn:disabled { opacity: .5; cursor: not-allowed; }
.pg-gap { padding: 0 4px; color: var(--muted); }

/* ===================== 通用数据表格（列表页统一风格） ===================== */
.grid-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.grid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.tb-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tb-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-filters input, .tb-filters select { width: auto; height: 32px; padding: 0 10px; }
.tb-filters input[type=date] { min-width: 140px; }
.sel-count { color: var(--muted); font-size: 13px; }

.tb-search { display: flex; align-items: center; flex-shrink: 0; }
.tb-search-input {
    width: 220px; height: 40px;
    border: 1px solid var(--border); border-right: none;
    border-radius: 8px 0 0 8px; padding: 0 14px; font-size: 14px;
}
.tb-search-btn {
    height: 40px; display: inline-flex; align-items: center; justify-content: center;
    padding: 0 22px; background: var(--primary); color: #fff;
    border-radius: 0 8px 8px 0; cursor: pointer; font-size: 14px; white-space: nowrap;
}
.tb-search-btn:hover { background: var(--primary-dark); }

.tb-tools { display: flex; align-items: center; gap: 6px; }
.tb-icon {
    height: 32px; min-width: 32px; padding: 0 10px;
    border: 1px solid var(--border); background: #fff;
    border-radius: 8px; cursor: pointer; color: var(--muted);
    font-size: 14px; display: inline-flex; align-items: center; gap: 4px;
}
.tb-icon:hover { color: var(--primary); border-color: var(--primary); }

.density-seg { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.density-seg span {
    padding: 0 10px; height: 32px; display: flex; align-items: center;
    cursor: pointer; font-size: 13px; color: var(--muted);
}
.density-seg span + span { border-left: 1px solid var(--border); }
.density-seg span.active { background: var(--primary); color: #fff; }

.tb-dropdown { position: relative; }
.tb-menu {
    position: absolute; right: 0; top: 38px;
    background: #fff; border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; min-width: 150px;
    z-index: 50; display: none; max-height: 320px; overflow: auto;
}
.tb-dropdown.open .tb-menu { display: block; }
.tb-menu label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.tb-menu label:hover { background: var(--hover); }
.tb-menu input { width: auto; }

.grid-scroll { overflow: auto; }
.grid-table { width: 100%; border-collapse: collapse; }
.grid-table th, .grid-table td {
    text-align: left; padding: 15px 18px;
    border-bottom: 1px solid #f0f2f5; white-space: nowrap;
}
.grid-table thead th {
    background: #fbfcfd; color: #8a94a6;
    font-weight: 500; font-size: 13px;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1;
}
.grid-table tbody td { color: #33384a; font-size: 14px; }
.grid-table tbody tr:hover td { background: #f7faf9; }
.grid-table tbody tr:last-child td { border-bottom: none; }
.grid-table th.col-check, .grid-table td.col-check { width: 40px; text-align: center; padding-right: 0; }
.grid-table th.col-avatar, .grid-table td.col-avatar { width: 46px; padding-right: 0; }
.grid-avatar {
    width: 30px; height: 30px; border-radius: 50%; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.grid-check, .grid-check-all { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.col-actions { text-align: left; }
.tree-name { display: inline-flex; align-items: center; gap: 8px; }
.tree-toggle { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; background: #fff; }
.tree-toggle.placeholder { border: none; background: transparent; cursor: default; }
.tree-toggle:not(.placeholder):hover { border-color: var(--primary); color: var(--primary); background: var(--hover); }
/* 层级区分 */
.tree-name.lvl-DIR .tree-label { font-weight: 700; }
.tree-name.lvl-MENU .tree-label { font-weight: 500; }
.tree-name.lvl-BUTTON .tree-label { color: var(--muted); }
.tree-name.lvl-BUTTON::before { content: '└'; color: var(--border); margin-right: -2px; }
.row-act { color: var(--primary); cursor: pointer; font-size: 13px; margin-right: 12px; }
.row-act:hover { text-decoration: underline; }
.row-act.danger { color: var(--danger); }
.grid-empty { text-align: center; color: var(--muted); padding: 40px 0; }
.grid-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }

/* 密度 */
.grid-table.dense-compact th, .grid-table.dense-compact td { padding: 8px 18px; }
.grid-table.dense-loose th, .grid-table.dense-loose td { padding: 21px 18px; }

/* 全屏（整页列表全屏，工具栏与表格都在） */
.list-page:fullscreen { background: var(--bg); padding: 20px; overflow: auto; }

/* ===================== 工作台 ===================== */
.dash { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-left, .dash-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash .dash-card { margin-bottom: 0; }
.dash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dash-head h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.head-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 600; }
.head-link { color: var(--muted); font-size: 13px; cursor: pointer; }
.head-link:hover { color: var(--primary); }
.dash-empty { color: var(--muted); text-align: center; padding: 28px 0; font-size: 13px; }

/* 轮播图 */
.carousel { position: relative; height: 190px; border-radius: 12px; overflow: hidden; }
.carousel-track { display: flex; height: 100%; transition: transform .5s ease; }
.carousel-slide { position: relative; flex: 0 0 100%; height: 100%; display: flex; align-items: center; padding: 0 40px; color: #fff; overflow: hidden; }
.carousel-slide .cs-text { z-index: 2; max-width: 70%; }
.carousel-slide .cs-title { font-size: 26px; font-weight: 700; margin-bottom: 12px; }
.carousel-slide .cs-desc { font-size: 14px; opacity: .92; line-height: 1.7; }
.carousel-slide .cs-emoji { position: absolute; right: 46px; font-size: 96px; opacity: .85; z-index: 1; }
.car-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: none; border-radius: 50%; background: rgba(255,255,255,.25); color: #fff; font-size: 20px; cursor: pointer; z-index: 3; }
.car-btn:hover { background: rgba(255,255,255,.4); }
.car-prev { left: 14px; } .car-next { right: 14px; }
.carousel-dots { position: absolute; bottom: 12px; left: 40px; display: flex; gap: 6px; z-index: 3; }
.carousel-dots .dot { width: 18px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.45); cursor: pointer; }
.carousel-dots .dot.active { background: #fff; }

/* 通知中心 */
.notice-list { display: flex; flex-direction: column; }
.notice-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.notice-item:last-child { border-bottom: none; }
.notice-no { width: 20px; height: 20px; flex-shrink: 0; text-align: center; color: var(--muted); font-weight: 700; }
.notice-item:nth-child(1) .notice-no { color: var(--danger); }
.notice-title { font-size: 14px; margin-bottom: 4px; }
.notice-sub { font-size: 12px; color: var(--muted); }

/* 数据统计 */
.dstat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dstat { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; }
.dstat-val { font-size: 26px; font-weight: 700; }
.dstat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 审批中心 / 待办 */
.todo-list { display: flex; flex-direction: column; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.todo-item:last-child { border-bottom: none; }
.todo-ic { width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: #eef1fb; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-size: 14px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-sub { font-size: 12px; color: var(--muted); }
.todo-act { color: var(--primary); font-size: 13px; cursor: pointer; white-space: nowrap; }
.todo-act:hover { text-decoration: underline; }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.quick-item { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; border-radius: 10px; transition: background .15s; }
.quick-item:hover { background: var(--hover); }
.quick-ic { width: 54px; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; box-shadow: 0 6px 14px rgba(0,0,0,.12); }
.quick-label { font-size: 13px; color: var(--text); }

/* 日历 */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { font-size: 14px; font-weight: 600; }
.cal-nav { width: 28px; height: 28px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 16px; }
.cal-nav:hover { color: var(--primary); border-color: var(--primary); }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 6px; }
.cal-week span { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell { display: flex; align-items: center; justify-content: center; height: 34px; font-size: 13px; border-radius: 8px; }
.cal-cell:not(.empty):hover { background: var(--hover); }
.cal-cell.today { background: var(--primary); color: #fff; font-weight: 600; }

@media (max-width: 1100px) {
    .dash { grid-template-columns: 1fr; }
    .dash-2col { grid-template-columns: 1fr; }
    .quick-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===================== 系统设置 ===================== */
.theme-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
/* 选项卡（参照 recruit/template 下划线样式） */
.set-tabs { display: flex; gap: 28px; padding: 0 20px; margin: 0 -20px 20px; border-bottom: 1px solid #dcdfe6; }
.set-tab { position: relative; padding: 10px 0 12px; font-size: 14px; color: var(--muted); cursor: pointer; }
.set-tab:hover { color: var(--text); }
.set-tab.active { color: var(--primary); font-weight: 600; }
.set-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); }
.set-panel { display: none; }
.set-panel.active { display: block; }
.set-empty { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 14px; }
.set-empty > span { font-size: 44px; }
.field-hint { color: var(--muted); font-size: 12px; margin-left: 12px; }
/* 开关（toggle） */
.switch { position: relative; display: inline-flex; width: 46px; height: 24px; vertical-align: middle; cursor: pointer; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #dcdfe6; border-radius: 24px; transition: background .3s ease; }
.switch .slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 2px; top: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.28); transition: transform .3s cubic-bezier(.34,1.2,.64,1); }
.switch:hover .slider { background: #c8ccd4; }
.switch input:checked + .slider { background: var(--primary); }
.switch:hover input:checked + .slider { background: var(--primary-dark); }
.switch input:checked + .slider::before { transform: translateX(22px); }
/* 全局水印 */
#appWatermark { position: fixed; inset: 0; pointer-events: none; z-index: 9998; background-repeat: repeat; }

/* 系统设置：卡片 + 行（参照参考图，标题带蓝条，行内左标题右控件） */
.set-footer { display: flex; justify-content: center; padding: 6px 0 4px; }
.set-footer .btn { min-width: 140px; }
.set-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 16px; }
.set-card-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: #1f2329; padding: 16px 24px 4px; }
.set-card-title::before { content: ""; width: 4px; height: 15px; background: var(--primary); border-radius: 2px; }
.set-card-body { padding: 12px 24px 20px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 24px; min-height: 68px; }
.set-row-main { min-width: 0; }
.set-row-main .t { font-size: 14px; color: #1f2329; }
.set-row-main .d { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.set-row-ctrl { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.set-row-ctrl .ctrl-input { width: 260px; }
.set-row-ctrl .ctrl-input.wide { width: 480px; }
.set-row-ctrl .ctrl-num { width: 110px; }
.set-row-ctrl .ctrl-select { width: 260px; }
/* 数据备份面板：控件统一宽度（含端口+加密并排合计 260），视觉整齐 */
.set-panel[data-panel="backup"] .set-row-ctrl .ctrl-input,
.set-panel[data-panel="backup"] .set-row-ctrl .ctrl-input.wide,
.set-panel[data-panel="backup"] .set-row-ctrl .ctrl-select { width: 260px; }
.set-panel[data-panel="backup"] .set-row-ctrl .ctrl-num { width: 90px; }
.set-panel[data-panel="backup"] .set-row-ctrl #setBkSsl { width: 162px; }
.ctrl-suffix { color: var(--muted); font-size: 13px; }
.set-row-ctrl .upload-zone { min-width: 300px; width: 300px; margin: 0; }
.theme-sec { padding: 4px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.theme-sec:last-child { border-bottom: none; margin-bottom: 0; }
.theme-sec h4 { font-size: 15px; margin-bottom: 14px; }
.layout-cards { display: flex; gap: 22px; }
.layout-card { cursor: pointer; text-align: center; }
.layout-mini { width: 58px; height: 42px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; display: flex; }
.layout-mini.mini-top { flex-direction: column; }
.layout-mini.mini-mix { flex-direction: column; }
.layout-mini.mini-mix .mini-mix-body { flex: 1; display: flex; }
.layout-name { font-size: 12px; color: var(--muted); margin-top: 6px; }
.layout-dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; margin: 6px auto 0; }
.layout-card.active .layout-mini { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(64,158,255,.25); }
.layout-card.active .layout-dot { background: var(--primary); }
.color-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 22px; height: 22px; border-radius: 5px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.swatch.light { border: 1px solid #d0d5dd; box-shadow: none; }
.theme-field { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.theme-field:last-child { margin-bottom: 0; }
.theme-field > label { width: 80px; text-align: right; color: var(--muted); flex-shrink: 0; }
.theme-field input[type=text] { width: 360px; }
.upload-zone { display: flex; align-items: center; gap: 10px; min-width: 360px; height: 40px; border: 1px dashed var(--border); border-radius: 8px; padding: 0 12px; cursor: pointer; color: var(--muted); font-size: 13px; }
.upload-zone .pick { color: var(--primary); }
.upload-zone.drag { border-color: var(--primary); background: var(--hover); }
.logo-preview { height: 28px; border-radius: 4px; margin-left: auto; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 22px; font-weight: 700; margin-top: 6px; }

/* 弹窗 */
.modal-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
    width: 70%; max-width: 1000px; max-height: 88vh; overflow-y: auto;
    background: #fff; border-radius: 12px; padding: 22px;
}
.modal h3 { margin-bottom: 16px; }
/* 底部按钮吸底：内容再多也始终可见 */
.modal-footer {
    position: sticky; bottom: -22px; z-index: 5;
    display: flex; justify-content: flex-end; gap: 8px;
    margin: 18px -22px -22px; padding: 13px 22px;
    background: #fff; border-top: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
}
/* 弹窗尺寸变体 */
.modal.xl { width: 82%; max-width: 1200px; }

/* 下拉多选（客户标签等） */
.multi-select { position: relative; }
.multi-select .ms-input { display: flex; align-items: center; gap: 8px; height: 40px; border: 1px solid var(--border);
    border-radius: 8px; padding: 0 12px; cursor: pointer; background: #fff; }
.multi-select .ms-input:hover, .multi-select.open .ms-input { border-color: var(--primary); }
.ms-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: #333; }
.ms-text.placeholder { color: #94a3b8; }
.ms-caret { color: var(--muted); flex-shrink: 0; transition: transform .15s; }
.multi-select.open .ms-caret { transform: rotate(180deg); }
.ms-panel { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60;
    background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14);
    padding: 6px; max-height: 240px; overflow-y: auto; }
.multi-select.open .ms-panel { display: block; }
.ms-opt { display: block; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.ms-opt:hover { background: #f1f5f9; }
.ms-opt input { width: auto; margin-right: 6px; }

/* 联系人列表项（表单内） */
.ct-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.ct-item .ct-nm { font-weight: 500; }

/* 弹窗内两列表单：一行显示 2 个字段 */
.mform { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; }
.mform .form-item { margin-bottom: 14px; }
.mform .form-item.full { grid-column: 1 / -1; }
.mform .form-item > label { display: block; margin-bottom: 6px; color: #595959; font-size: 13px; }
.mform .req { color: var(--danger); font-style: normal; margin-right: 3px; }
.mform textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-family: inherit; font-size: 14px; outline: none; resize: vertical; }
.mform textarea:focus { border-color: var(--primary); }
.mform .field-hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* 客户详情弹窗 */
.cd-title { font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.cd-meta { color: var(--muted); font-size: 13px; margin-top: 6px; }
.cd-steps { display: flex; gap: 3px; margin: 16px 0; flex-wrap: wrap; }
.cd-step { flex: 1 1 0; min-width: 88px; text-align: center; padding: 9px 6px; background: #eef1f5; color: #64748b;
    font-size: 13px; clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%, 13px 50%); }
.cd-step:first-child { clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%); }
.cd-step.active { background: var(--primary); color: #fff; font-weight: 600; }
.cd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cd-sec { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.cd-sec h4 { margin: 0 0 10px; font-size: 14px; }
.cd-kv { display: grid; grid-template-columns: 84px 1fr; gap: 6px 10px; font-size: 13px; }
.cd-kv .k { color: var(--muted); }
.cd-timeline { max-height: 420px; overflow-y: auto; }
@media (max-width: 900px) { .cd-cols { grid-template-columns: 1fr; } }

/* 客户详情：窗口化布局（标题栏 + 滚动区 + 吸底操作栏） */
.modal.cd-modal { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.modal.cd-modal.maximized { width: 96vw; max-width: 96vw; height: 94vh; max-height: 94vh; }
.cd-winbar { display: flex; align-items: center; justify-content: space-between; height: 44px;
    padding: 0 6px 0 18px; background: #f7f9fc; border-bottom: 1px solid var(--border);
    border-radius: 12px 12px 0 0; flex-shrink: 0; }
.cd-wintitle { font-weight: 600; font-size: 14px; color: #333; }
.cd-winbtns { display: flex; align-items: center; }
.cd-winbtn { width: 36px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; color: #64748b; border-radius: 6px; font-size: 14px; user-select: none; }
.cd-winbtn:hover { background: #e5e9f0; }
.cd-winbtn.close:hover { background: #ef4444; color: #fff; }
.cd-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px; }
.cd-actionbar { flex-shrink: 0; display: flex; gap: 4px; justify-content: center; flex-wrap: wrap;
    padding: 8px 12px; border-top: 1px solid var(--border); background: #fff; border-radius: 0 0 12px 12px; }
.cd-act { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 62px;
    padding: 6px 10px; border-radius: 8px; cursor: pointer; color: #475569; font-size: 12px; }
.cd-act:hover { background: #f1f5f9; color: var(--primary); }
.cd-act.danger:hover { color: var(--danger); }
.cd-act.success:hover { color: var(--success); }
.cd-act-ic svg { width: 20px; height: 20px; }
/* 窗口化弹窗底部按钮栏（新建/编辑等表单，右对齐） */
.cd-winfoot { flex-shrink: 0; display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 22px; border-top: 1px solid var(--border); background: #fff; border-radius: 0 0 12px 12px; }

/* 状态条可点击 */
.cd-step.clickable { cursor: pointer; }
.cd-step.clickable:hover { background: #dbe4ff; color: var(--primary); }

/* 联系人头像 */
.cd-contacts { display: flex; gap: 18px; flex-wrap: wrap; }
.cd-contact { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; width: 56px; }
.cd-avatar { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 15px; font-weight: 600; }
.cd-avatar.cd-add { background: #f1f5f9; color: #94a3b8; border: 1px dashed #cbd5e1; font-size: 22px; font-weight: 400; }
.cd-avatar.lg { width: 64px; height: 64px; border-radius: 12px; font-size: 20px; }
.cd-cname { font-size: 12px; color: #475569; max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 联系人详情抽屉 */
.cd-drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1360; display: flex; justify-content: flex-end; }
.cd-drawer { width: 420px; max-width: 92vw; background: #fff; height: 100%; display: flex; flex-direction: column;
    box-shadow: -8px 0 30px rgba(0,0,0,.15); animation: drawerIn .18s ease; }
@keyframes drawerIn { from { transform: translateX(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.cd-drawer-head { display: flex; align-items: center; justify-content: space-between; height: 48px;
    padding: 0 8px 0 18px; border-bottom: 1px solid var(--border); font-weight: 600; }
.cd-drawer-body { flex: 1; overflow-y: auto; padding: 18px; }
.cd-drawer-foot { flex-shrink: 0; display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); }
.cd-contact-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.cd-hero-name { font-size: 17px; font-weight: 600; }

/* 最小化悬浮条 */
.detail-min-bar { position: fixed; right: 20px; bottom: 20px; z-index: 1500; display: flex; align-items: center; gap: 4px;
    background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.16); padding: 8px 10px; }
.detail-min-bar .dmb-title { font-size: 13px; cursor: pointer; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-min-bar .dmb-btn { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: #64748b; border-radius: 6px; }
.detail-min-bar .dmb-btn:hover { background: #eef2f7; }
.hidden { display: none !important; }
.checks { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.check-row input { width: auto; }

.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    padding: 10px 18px; border-radius: 8px; color: #fff; z-index: 200;
    box-shadow: 0 8px 20px rgba(0,0,0,.2);
}
.toast.ok { background: var(--success); }
.toast.err { background: var(--danger); }

/* ============ 通用树形选择器（人员 / 部门） ============ */
.picker-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 1200; }
.picker { width: 840px; max-width: 94vw; background: #fff; border-radius: 12px; padding: 20px 24px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.picker-head { display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 600; color: #262626; margin-bottom: 14px; }
.picker-x { cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; }
.picker-x:hover { color: var(--text); }
.picker-search { display: flex; margin-bottom: 14px; }
.picker-search .pk-kw { flex: 1; height: 38px; border: 1px solid var(--border); border-right: none; border-radius: 8px 0 0 8px; padding: 0 14px; outline: none; }
.picker-search .pk-kw:focus { border-color: var(--primary); }
.picker-search .pk-kw-btn { width: 44px; border: 1px solid var(--border); border-left: none; border-radius: 0 8px 8px 0; background: #fafafa; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.picker-search .pk-kw-btn svg { width: 16px; height: 16px; }
.picker-body { display: flex; gap: 16px; }
.picker-col { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.picker-col-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: #f7f9fc; border-bottom: 1px solid var(--border); font-size: 13px; color: #595959; }
.pk-count b { color: var(--danger); margin: 0 2px; }
.pk-tree, .pk-sel { height: 340px; overflow: auto; padding: 6px; }
.pk-row { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px; border-radius: 6px; cursor: default; white-space: nowrap; }
.pk-row:hover { background: var(--hover); }
.pk-arrow { width: 16px; text-align: center; color: var(--muted); font-size: 10px; cursor: pointer; flex-shrink: 0; }
.pk-arrow.pk-hide { visibility: hidden; cursor: default; }
.pk-chk, .pk-chk-ph { width: 15px; height: 15px; flex-shrink: 0; }
.pk-ic { display: inline-flex; flex-shrink: 0; color: var(--muted); }
.pk-ic svg { width: 15px; height: 15px; }
.pk-ic-user { color: var(--primary); }
.pk-ic-dept { color: #f5a623; }
.pk-label { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.pk-sel { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; }
.pk-tag { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; background: var(--primary-light); color: var(--primary); border-radius: 4px; font-size: 13px; }
.pk-tag-x { cursor: pointer; font-size: 15px; line-height: 1; opacity: .7; }
.pk-tag-x:hover { opacity: 1; }
.pk-empty { color: var(--muted); font-size: 13px; padding: 10px; width: 100%; }
.picker-foot { display: flex; justify-content: center; gap: 12px; margin-top: 16px; }
.picker-foot .btn { min-width: 96px; }
/* 点击弹出选择器的输入框样式 */
.picker-field { display: flex; align-items: center; gap: 8px; height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; cursor: pointer; background: #fff; }
.picker-field:hover { border-color: var(--primary); }
.picker-field-text { flex: 1; font-size: 14px; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-field-text.placeholder { color: var(--muted); }
.picker-field-ic { color: var(--muted); display: inline-flex; flex-shrink: 0; }
.picker-field-ic svg { width: 16px; height: 16px; }

/* 标签式多选下拉 */
.multi-select { position: relative; }
.ms-control { display: flex; align-items: center; gap: 6px; min-height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; cursor: pointer; background: #fff; }
.ms-control:hover, .multi-select.open .ms-control { border-color: var(--primary); }
.ms-tags { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.ms-tag { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 6px 0 10px; background: #f0f2f5; border-radius: 4px; font-size: 13px; color: #333; }
.ms-tag-x { cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; }
.ms-tag-x:hover { color: var(--danger); }
.ms-ph { color: var(--muted); font-size: 14px; line-height: 30px; }
.ms-arrow { color: var(--muted); font-size: 12px; margin-left: auto; transition: transform .2s; flex-shrink: 0; }
.multi-select.open .ms-arrow { transform: rotate(180deg); }
.ms-panel { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 28px rgba(0,0,0,.15); padding: 4px; }
.multi-select.open .ms-panel { display: block; }
.ms-opt { padding: 9px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--text); display: flex; align-items: center; justify-content: space-between; }
.ms-opt:hover { background: var(--hover); }
.ms-opt.active { color: var(--primary); font-weight: 600; }
.ms-opt.active::after { content: "✓"; color: var(--primary); }
.ms-empty { padding: 12px; color: var(--muted); font-size: 13px; }

/* ============ 角色编辑：整页表单 ============ */
.role-form { }
.rf-topbar { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 14px; margin: 0 -20px 16px; border-bottom: 1px solid #dcdfe6; }
.rf-card { padding: 0; }
.rf-section { font-weight: 700; font-size: 15px; color: #262626; padding: 13px 20px; background: #f7f9fc; border-bottom: 1px solid var(--border); border-radius: 10px 10px 0 0; position: relative; }
.rf-section::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 4px; background: var(--primary); border-radius: 0 2px 2px 0; }
.rf-body { padding: 24px 24px 6px; }
.rf-row { display: flex; align-items: flex-start; padding: 0 0 20px; }
.rf-label { width: 96px; flex-shrink: 0; text-align: right; padding-right: 14px; padding-top: 9px; color: #595959; font-size: 14px; }
.rf-label .req { color: var(--danger); font-style: normal; margin-right: 3px; }
.rf-ctrl { flex: 1; min-width: 0; }
.rf-ctrl > input, .rf-ctrl > textarea, .rf-ctrl > select { width: 100%; }
.rf-ctrl.inline { display: flex; align-items: center; gap: 12px; padding-top: 5px; }
.rf-ctrl textarea { border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-family: inherit; font-size: 14px; outline: none; resize: vertical; }
.rf-ctrl textarea:focus { border-color: var(--primary); }
.rf-picker { display: flex; align-items: center; gap: 8px; min-height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 5px 12px; cursor: pointer; }
.rf-picker:hover { border-color: var(--primary); }
.rf-user-ic { margin-left: auto; color: var(--muted); }
.rf-link { color: var(--primary); cursor: pointer; font-size: 14px; }
.rf-link:hover { text-decoration: underline; }
.rf-info { color: var(--primary); cursor: help; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 4px; font-size: 13px; background: #f0f2f5; color: #595959; }
.chip.blue { background: var(--primary-light); color: var(--primary); }
.chip.orange { background: #fff7e8; color: #fa8c16; }
.chip-empty { color: var(--muted); font-size: 13px; }

/* ============ 管理范围弹窗 ============ */
.modal:has(.scope-pop) { width: 900px; max-width: 94vw; }
.modal:has(.auth-pop) { width: 980px; max-width: 94vw; }
.scope-pop .rf-row { padding: 0 0 20px; }
.rf-label2 { width: 110px; flex-shrink: 0; text-align: right; padding-right: 12px; padding-top: 4px; color: #595959; }
.rf-radios { display: flex; flex-wrap: wrap; gap: 22px; padding-top: 4px; }
.rf-radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.rf-radio input { width: auto; }
.checks.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
.rf-ptable { flex: 1; }
.rf-table { width: 100%; border-collapse: collapse; }
.rf-table th { text-align: left; background: #f5f7fa; padding: 10px 14px; font-weight: 600; color: #262626; }
.rf-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.rf-table select { width: 240px; }

/* ============ 配置授权弹窗 ============ */
.auth-tabs { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.auth-tab { padding: 8px 14px; cursor: pointer; color: #595959; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px; }
.auth-tab:hover { color: var(--primary); }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.auth-expand { margin-left: auto; padding: 5px 12px; }
.auth-body { max-height: 60vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.auth-empty { padding: 40px; text-align: center; color: var(--muted); }
.auth-table { width: 100%; border-collapse: collapse; }
.auth-table thead th { position: sticky; top: 0; background: #f5f7fa; text-align: left; padding: 10px 14px; font-weight: 600; color: #262626; z-index: 1; }
.auth-table .c-name { width: 240px; }
.auth-table .c-node { width: 44px; text-align: center; }
.auth-table td { padding: 9px 14px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.auth-table .c-node { text-align: center; }
.auth-dir > .c-name { cursor: pointer; font-weight: 600; color: #262626; }
.auth-caret { display: inline-block; width: 16px; color: var(--muted); font-size: 11px; }
.auth-menu .menu-name { padding-left: 30px; color: #595959; }
.auth-table .c-perm { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.perm-all, .perm-item { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13px; color: #595959; white-space: nowrap; }
.perm-all { color: var(--primary); }
.perm-all input, .perm-item input, .auth-dircheck, .menu-self { width: auto; }
