/* ============ JINASK 一站式工作智慧平台 样式（飞书设计系统 Feishu Design） ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

/* ============ 飞书设计系统 - 全局变量 ============ */
:root {
    /* 主色 - 飞书蓝 */
    --primary: #3370FF;
    --primary-hover: #2860E1;
    --primary-active: #1E4FC7;
    --primary-light: #E8F3FF;
    --primary-lighter: #F2F7FF;

    /* 功能色 */
    --success: #00B42A;
    --success-light: #E8FFEA;
    --warning: #FF7D00;
    --warning-light: #FFF7E8;
    --danger: #F53F3F;
    --danger-light: #FFECE8;
    --info: #86909C;

    /* 中性色 - 文字 */
    --text-primary: #1D2129;
    --text-secondary: #4E5969;
    --text-tertiary: #86909C;
    --text-placeholder: #C9CDD4;
    --text-disabled: #C9CDD4;

    /* 中性色 - 背景 */
    --bg-body: #F5F6F7;
    --bg-card: #FFFFFF;
    --bg-hover: #F2F3F5;
    --bg-active: #E8F3FF;
    --bg-disabled: #F2F3F5;

    /* 中性色 - 边框 */
    --border: #E5E6EB;
    --border-light: #F2F3F5;
    --border-dark: #C9CDD4;

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-xl: 0 8px 24px rgba(0,0,0,0.12);

    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;

    /* 间距 (8px基准) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;

    /* 字体 */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;

    /* 兼容旧变量 */
    --wd-blue: #3370FF;
    --wd-blue-dark: #1D2129;
    --wd-orange: #3370FF;
    --wd-orange-hover: #2860E1;
    --bg: #F5F6F7;
    --card: #FFFFFF;
    --text: #1D2129;
    --muted: #86909C;
    --ok: #00B42A;
    --err: #F53F3F;
    --pending: #FF7D00;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-body);
    font-size: var(--font-size-base);
    line-height: 1.57;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ============ 登录页 ============ */
.login-page { display: flex; min-height: 100vh; position: relative; }
.login-brand-side {
    flex: 0 0 45%;
    background: linear-gradient(135deg, #1F2933 0%, #323F4B 55%, var(--wd-orange) 135%);
    color: #fff; display: flex; align-items: center; justify-content: center; padding: 40px;
}
.login-brand-inner { max-width: 420px; }
.login-brand-image {
    width: 140px; height: 140px; margin: 0 auto 24px;
    border-radius: 24px; overflow: hidden;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    display: flex; align-items: center; justify-content: center;
}
.login-brand-image img { width: 100%; height: 100%; object-fit: contain; padding: 14px; box-sizing: border-box; }
.login-brand-image-fallback {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
}
.login-brand-logo { margin-bottom: 18px; }
.brand-mark {
    background: var(--wd-orange); color: #fff; font-weight: 700; letter-spacing: 1px;
    padding: 6px 12px; border-radius: 6px; font-size: 15px;
}
.login-brand-title { font-size: 38px; margin-bottom: 10px; letter-spacing: 4px; font-weight: 700; }
.login-brand-sub { font-size: 18px; opacity: .92; margin-bottom: 18px; }
.login-brand-line { width: 48px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, #FF8A3D, rgba(255,255,255,0.25)); margin: 0 auto 14px; }
.login-brand-desc { font-size: 13px; opacity: .6; letter-spacing: 3px; text-transform: uppercase; }
.login-form-side { flex: 1; background: #fff; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; }
.login-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.login-welcome { font-size: 26px; color: var(--text); }
.login-env { font-size: 12px; color: var(--muted); background: #F5F7FA; border: 1px solid var(--border); padding: 3px 8px; border-radius: 4px; }
.login-card label { display: block; margin-bottom: 18px; }
.login-card label > span { display: block; font-size: 14px; color: #52606D; margin-bottom: 7px; font-weight: 500; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input-icon { position: absolute; left: 12px; font-size: 15px; opacity: .55; }
.login-card input {
    width: 100%; padding: 12px 14px 12px 40px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 15px; transition: border .15s, box-shadow .15s; background: #FBFCFE;
}
.login-card input:focus { outline: none; border-color: var(--wd-orange); box-shadow: 0 0 0 3px rgba(255,109,0,.14); background: #fff; }
.login-card select {
    width: 100%; padding: 12px 14px 12px 40px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 15px; transition: border .15s, box-shadow .15s; background: #FBFCFE;
}
.login-card select:focus { outline: none; border-color: var(--wd-orange); box-shadow: 0 0 0 3px rgba(255,109,0,.14); background: #fff; }
.login-hint { font-size: 12px; color: var(--muted); margin-bottom: 14px; background: #FFF7ED; border: 1px dashed #FED7AA; border-radius: 6px; padding: 7px 10px; }
.login-error { color: var(--err); font-size: 13px; margin-bottom: 12px; padding: 8px 10px; background: #FEF2F2; border-radius: 6px; }
.btn {
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 7px 15px;
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-family);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary:active { background: var(--primary-active); }
.btn-default {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-primary);
}
.btn-default:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lighter); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #D93636; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-block { width: 100%; padding: 10px; font-size: var(--font-size-lg); }
.btn-sm { padding: 5px 12px; font-size: var(--font-size-sm); border-radius: var(--radius-sm); }
.btn-lg { padding: 10px 24px; font-size: var(--font-size-lg); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.login-footer { display: flex; gap: 8px; justify-content: center; margin-top: 26px; }
.login-version { color: #AEB6C0; font-size: 12px; letter-spacing: 1px; }
.login-copyright {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    white-space: nowrap;
    padding: 0 20px;
    z-index: 10;
}

/* ============ 登录表单（匹配 index.html 中的类名） ============ */
.login-form-box {
    width: 100%; max-width: 440px; background: #fff;
    padding: 44px 40px 32px; border-radius: 16px;
    box-shadow: 0 8px 32px rgba(31,41,55,.08);
}
.login-title-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 28px;
}
.login-title-row h2 {
    font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: 1px;
}
.login-env-tag {
    font-size: 12px; color: var(--muted); background: #F5F7FA;
    border: 1px solid var(--border); padding: 4px 10px; border-radius: 6px;
}
.login-field { margin-bottom: 20px; }
.login-field label {
    display: block; font-size: 14px; color: #52606D;
    margin-bottom: 8px; font-weight: 500;
}
.login-select-wrap, .login-input-wrap {
    position: relative; display: flex; align-items: center;
    background: #FBFCFE; border: 1px solid var(--border); border-radius: 10px;
    transition: border .15s, box-shadow .15s;
}
.login-select-wrap:focus-within, .login-input-wrap:focus-within {
    border-color: var(--wd-orange);
    box-shadow: 0 0 0 3px rgba(255,109,0,.12); background: #fff;
}
.login-select-icon, .login-input-icon {
    display: none;
}
.login-field select, .login-field input {
    flex: 1; min-width: 0; width: 100%;
    padding: 13px 14px;
    border: none; background: transparent; font-size: 15px;
    color: var(--text); outline: none;
}
.login-field select:focus, .login-field input:focus {
    outline: none;
}
.login-field input::placeholder { color: #9AA5B1; }
.login-submit {
    width: 100%; padding: 14px; font-size: 16px; font-weight: 600;
    background: var(--wd-orange); color: #fff; border: none;
    border-radius: 10px; cursor: pointer; transition: background .15s;
    margin-top: 8px; letter-spacing: 4px;
}
.login-submit:hover { background: var(--wd-orange-hover); }
.login-error {
    color: var(--err); font-size: 13px; margin-bottom: 14px;
    padding: 10px 12px; background: #FEF2F2; border-radius: 8px;
    border: 1px solid #FECACA;
}

/* ============ 主应用布局 ============ */
.app-shell { height: 100vh; display: flex; flex-direction: column; }
.topbar {
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 var(--space-6);
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; align-items: center; flex: 1; min-width: 0; gap: var(--space-4); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: var(--font-size-lg); white-space: nowrap; flex-shrink: 0; color: var(--text-primary); }
.brand em { font-style: normal; color: var(--text-tertiary); font-weight: 400; font-size: var(--font-size-sm); }
.topbar-right { display: flex; align-items: center; gap: var(--space-4); }
/* 文本徽章（标签、统计、状态） */
.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 500; background: #eef1f6; color: var(--text-secondary); white-space: nowrap; }
/* 连接状态小圆点（顶栏专用） */
.dot-badge { width: 8px; height: 8px; border-radius: 50%; background: var(--border-dark); display: inline-block; }
.dot-badge.ok { background: var(--success); }
.dot-badge.err { background: var(--danger); }
.user-box { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-md); transition: background 0.15s; }
.user-box:hover { background: var(--bg-hover); }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #5B8DEF);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: var(--font-size-sm);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.3; }
.user-name { font-size: var(--font-size-sm); font-weight: 600; color: var(--text-primary); }
.user-role { font-size: var(--font-size-xs); color: var(--text-tertiary); }

.layout { display: flex; flex: 1; min-height: 0; }
.sidenav {
    width: 320px;
    min-width: 240px;
    max-width: 640px;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: var(--space-3) var(--space-2);
    flex-shrink: 0;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
    height: calc(100vh - 56px);
    position: sticky;
    top: 56px;
    border-right: 1px solid var(--border);
}
/* 菜单内容不压缩，超宽时可横向滚动（长语言如高棉语） */
.sidenav .menu-tree { min-width: max-content; }
/* 侧边栏拖拽拉伸手柄 */
.sidenav-resizer {
    position: absolute; right: -5px; top: 0; bottom: 0; width: 9px;
    cursor: col-resize; z-index: 6;
}
.sidenav-resizer:hover, .sidenav-resizer.dragging { background: rgba(37,99,235,0.18); }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-md);
    cursor: pointer; color: var(--text-secondary);
    font-size: var(--font-size-sm); margin-bottom: 5px;
    transition: all 0.15s;
    font-weight: 500;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* ============ 动态菜单树（飞书风格） ============ */
.nav-search { padding: var(--space-2) var(--space-1) var(--space-3); }
.nav-search input {
    width: 100%; padding: 7px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    outline: none;
    transition: all 0.15s;
}
.nav-search input:focus { border-color: var(--primary); background: var(--bg-card); box-shadow: 0 0 0 3px var(--primary-light); }
.nav-search input::placeholder { color: var(--text-placeholder); }
.menu-tree { margin-top: 2px; }
.menu-group { margin-bottom: 2px; }
.menu-tree .menu-group { margin-bottom: 6px; }
#sideNav > .menu-group { margin-bottom: 6px; }
.menu-group-title {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; border-radius: var(--radius-md);
    cursor: pointer; color: var(--text-primary);
    font-size: var(--font-size-sm); font-weight: 600;
    margin-bottom: 4px;
    transition: all 0.15s;
}
.menu-group-title:hover { background: var(--bg-hover); }
.menu-group-title.open .mga { transform: rotate(180deg); }
.mgi { font-size: var(--font-size-base); }
.mgt { flex: 1; overflow: visible; text-overflow: clip; white-space: nowrap; }
.mga { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--text-tertiary); opacity: 0.7; transition: transform 0.18s; margin-left: 6px; flex-shrink: 0; }
.menu-group-body { padding-left: 4px; }
.menu-group-title .mgi { width: 18px; text-align: center; flex-shrink: 0; }
.menu-group-body .menu-group-title { font-weight: 500; }
.nav-item.sub {
    padding: 9px 10px 9px 30px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 2px;
    font-weight: 400;
    line-height: 1.5;
}
/* 三级/四级层级递进缩进（飞书风格） */
.nav-item.sub.sub2 { padding-left: 48px; }
.nav-item.sub.sub3 { padding-left: 62px; }
.nav-item.sub.sub4 { padding-left: 76px; }
.nav-item.sub .mi { width: 16px; text-align: center; flex-shrink: 0; font-size: 13px; line-height: 1; }
.nav-item.sub .nav-text { overflow: visible; text-overflow: clip; white-space: nowrap; }
.nav-item.sub:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.sub.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.main-content { flex: 1; min-height: 0; padding: var(--space-6); overflow-y: auto; }
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: var(--space-5);
    flex-wrap: wrap; gap: var(--space-3);
}
.page-head h2 { font-size: var(--font-size-xl); font-weight: 700; color: var(--text-primary); }
.muted { color: var(--text-tertiary); }
.center { text-align: center; }

/* ============ 首页 ============ */
.welcome-banner {
    background: linear-gradient(120deg, var(--wd-blue) 0%, #2D6BA8 60%, #3B82F6 100%);
    color: #fff; border-radius: 14px; padding: 26px 30px; margin-bottom: 22px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 6px 18px rgba(31,78,121,.22);
}
.welcome-banner h3 { font-size: 22px; margin-bottom: 6px; }
.welcome-banner p { opacity: .85; font-size: 14px; }
.wb-tag { display: flex; gap: 10px; }
.wb-tag span { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); padding: 6px 12px; border-radius: 20px; font-size: 12px; }
.wb-lang-wrap { display: inline-flex; align-items: center; gap: 6px; }
.wb-lang-select {
    background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35);
    border-radius: 16px; padding: 5px 28px 5px 10px; font-size: 13px; cursor: pointer;
    outline: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23fff'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
.wb-lang-select option { color: #1F2933; background: #fff; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-6); }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.stat-icon { font-size: 22px; margin-bottom: var(--space-2); }
.stat-num { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-label { color: var(--text-tertiary); font-size: var(--font-size-sm); margin-top: 2px; }

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-5) var(--space-6);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}
.panel:hover { box-shadow: var(--shadow-md); }
.panel-title {
    font-weight: 600;
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-primary);
}
.panel-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}

/* ============ 表格（飞书风格） ============ */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); text-align: left; }
.tbl th {
    background: var(--bg-body);
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.tbl tbody tr { transition: background 0.15s; }
.tbl tbody tr:hover { background: var(--primary-lighter); }

.data-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.data-table th, .data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    color: var(--text-primary);
}
.data-table th {
    background: var(--bg-body);
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    font-size: var(--font-size-xs);
}
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--primary-lighter); }

.st { display: inline-block; padding: 2px 10px; border-radius: var(--radius-sm); font-size: var(--font-size-xs); font-weight: 500; }
.st-ok { background: var(--success-light); color: var(--success); }
.st-warn { background: var(--warning-light); color: var(--warning); }
.st-err { background: var(--danger-light); color: var(--danger); }
.st-info { background: var(--primary-light); color: var(--primary); }

/* ============ 加载/提示（飞书风格） ============ */
.loading { text-align: center; padding: 60px; color: var(--text-tertiary); }
.toast {
    position: fixed; top: 74px; left: 50%; transform: translateX(-50%);
    background: var(--text-primary); color: #fff; padding: 10px 20px;
    border-radius: var(--radius-lg); font-size: var(--font-size-base);
    opacity: 0; pointer-events: none; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

/* ============ 弹窗（飞书风格） ============ */
.modal-mask {
    position: fixed; inset: 0;
    background: rgba(29, 33, 41, 0.5);
    backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    z-index: 500;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    width: 92%; max-width: 640px;
    max-height: 86vh; overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-light);
    position: sticky; top: 0; background: var(--bg-card);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}
.modal-head h3 { font-size: var(--font-size-lg); font-weight: 600; color: var(--text-primary); }
.modal-body { padding: var(--space-6); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-grid label {
    display: flex; flex-direction: column; gap: 6px;
    font-size: var(--font-size-sm); color: var(--text-secondary);
    font-weight: 500;
}
.form-grid input, .form-grid select, .form-grid textarea {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: all 0.15s;
    background: var(--bg-card);
    color: var(--text-primary);
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--bg-card);
}
.form-grid input::placeholder, .form-grid textarea::placeholder { color: var(--text-placeholder); }
.full { grid-column: 1 / -1; }
.row-gap { display: flex; gap: var(--space-3); }

/* 通用输入框样式 */
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="date"], input[type="month"], select, textarea {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 7px 12px;
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: all 0.15s;
    background: var(--bg-card);
    color: var(--text-primary);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
input::placeholder, textarea::placeholder { color: var(--text-placeholder); }

/* ============ 响应式设计（适配手机/平板/桌面） ============ */
/* 平板屏幕 */
@media (max-width: 1024px) {
    .sidenav { width: 280px; }
    .main-content { padding: 16px 18px; }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .stat-num { font-size: 22px; }
    .welcome-banner { padding: 20px 22px; }
    .welcome-banner h3 { font-size: 18px; }
    .panel { padding: 14px 16px; }
    .jn-quick-grid { grid-template-columns: repeat(4, 1fr) !important; }
}

/* 手机屏幕 */
@media (max-width: 768px) {
    /* 登录页 */
    .login-page { flex-direction: column; }
    .login-brand-side { flex: none; padding: 28px 20px; min-height: auto; }
    .login-brand-title { font-size: 24px; }
    .login-brand-slogan { font-size: 14px; }
    .login-form-side { padding: 20px 16px; }
    .login-form-box { padding: 28px 20px; }

    /* 主布局 - 侧边栏抽屉式 */
    .layout { position: relative; }
    .sidenav {
        position: fixed; left: -260px; top: 0; bottom: 0; z-index: 1000;
        width: 250px; transition: left 0.3s ease;
        height: 100vh;
        box-shadow: 2px 0 12px rgba(0,0,0,0.15);
    }
    .sidenav-resizer { display: none; }
    .sidenav.open { left: 0; }
    .sidenav-overlay {
        display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
        z-index: 999;
    }
    .sidenav-overlay.show { display: block; }

    /* 顶部栏添加菜单按钮 */
    .topbar { padding: 0 12px; }
    .mobile-menu-btn {
        display: flex !important; align-items: center; justify-content: center;
        width: 40px; height: 40px; border-radius: 8px; cursor: pointer;
        background: rgba(0,0,0,0.045); color: #444;
        margin-right: 8px; flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-menu-btn:hover { background: rgba(0,0,0,0.09); color: var(--primary, #3370ff); }
    .mobile-menu-btn:active { transform: scale(0.96); }
    /* 移动端顶部隐藏「首页」页签，给汉堡按钮腾空间 */
    .top-tabs { display: none; }

    /* 内容区域 */
    .main-content { padding: 12px; flex: 1; }
    .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
    .page-head h2 { font-size: 18px; }

    /* 卡片网格 */
    .card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-num { font-size: 20px; }
    .stat-label { font-size: 12px; }

    /* 工作台 */
    .welcome-banner { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; }
    .welcome-banner h3 { font-size: 16px; }
    .welcome-banner p { font-size: 13px; }
    .jn-quick-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 10px !important; }
    .jn-quick-card { padding: 14px 8px !important; }
    .jn-quick-icon { font-size: 24px !important; }
    .jn-quick-label { font-size: 12px !important; }
    .jn-overview-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* 面板 */
    .panel { padding: 12px 14px; margin-bottom: 14px; }
    .panel-title { font-size: 14px; }

    /* 表格 - 横向滚动 */
    .data-table, .tbl {
        display: block; width: 100%; overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table table, .tbl table { min-width: 600px; }

    /* 表单 */
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .full { grid-column: 1; }

    /* 分页 */
    .pagination { flex-direction: column; gap: 8px; align-items: stretch !important; }
    .pagination > div { justify-content: center; }

    /* 我的档案 - 基本信息内照片（小屏置顶居中） */
    .profile-photo-inner { width: 96px !important; height: 128px !important; margin: 0 auto 12px; }
    .profile-photo-inner + div { min-width: 100% !important; }

    /* 按钮 */
    .btn { padding: 8px 14px; font-size: 13px; }
    .btn-block { padding: 12px; font-size: 15px; }

    /* 弹窗 */
    .modal-box { width: 95%; max-height: 90vh; }
    .modal-body { padding: 16px; }

    /* 筛选条件 */
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar > div { width: 100%; }
    .filter-bar select, .filter-bar input { width: 100%; }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .card-grid { grid-template-columns: 1fr; }
    .jn-quick-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .jn-overview-grid { grid-template-columns: 1fr !important; }
    .stat-num { font-size: 18px; }
    .login-brand-title { font-size: 20px; }
    .pagination > div { flex-wrap: wrap; justify-content: center; }
    /* 手机端精简顶栏 */
    .brand em { display: none; }
    .brand { font-size: 15px; }
    .user-meta { display: none; }
    .topbar { gap: 6px; padding: 0 8px; }
    .topbar-left { gap: 4px; }
    .topbar-right { gap: 6px; }
    #logoutBtn { padding: 4px 8px; font-size: 12px; }
    .top-lang-select { max-width: 90px; }
    .dot-badge { display: none; }
    .top-tabs { display: none !important; }
    .topbar-left { flex: 0 1 auto; }
    .topbar { justify-content: flex-start; }
    .topbar-right { margin-left: auto; }
    .top-lang-select { background: transparent !important; border: none !important; margin-right: 0 !important; padding: 4px 20px 4px 4px !important; max-width: 120px !important; font-size: 12px !important; }
    #logoutBtn { width: 32px !important; height: 32px !important; padding: 0 !important; font-size: 0 !important; position: relative; }
    #logoutBtn::after { content: "⇤"; font-size: 16px; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
}

/* 桌面端隐藏移动端菜单按钮 */
.mobile-menu-btn { display: none; }

.ipt { width: 100%; padding: 8px 12px; border: 1px solid var(--border,#d1d5db); border-radius: 8px; font-size: 13px; background: #fff; color: #111; box-sizing: border-box; margin-top: 4px; }

/* ============ 筛选栏（飞书风格 - 横向紧凑排列） ============ */
.filter-bar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-3) var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
}
.filter-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-3) var(--space-4);
}
.filter-row > label,
.filter-bar > label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    font-weight: 500;
    margin: 0;
}
.filter-row > label > span:first-child,
.filter-bar > label > span:first-child {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}
.filter-row select, .filter-row input,
.filter-bar select, .filter-bar input {
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-family: var(--font-family);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.15s;
    min-width: 140px;
}
.filter-row select:focus, .filter-row input:focus,
.filter-bar select:focus, .filter-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.filter-row .btn, .filter-bar .btn {
    height: 32px;
    padding: 0 16px;
    font-size: var(--font-size-sm);
}
.filter-actions {
    display: flex;
    gap: var(--space-2);
    margin-left: auto;
}

/* ============ 菜单管理 ============ */
#mmTree { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.mm-row {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    border-bottom: 1px solid var(--border); font-size: 13px;
}
.mm-row:hover { background: #F8FAFC; }
.mm-fold { width: 16px; cursor: pointer; color: var(--muted); flex-shrink: 0; text-align: center; }
.mm-name { font-weight: 500; min-width: 140px; }
.mm-code { font-size: 12px; color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-ops { display: flex; gap: 4px; }
.mm-ops .btn-sm { padding: 3px 8px; font-size: 12px; }
.mm-body { border-left: 2px dashed #E4E7ED; margin-left: 18px; }


/* ============ 报表中心 ============ */
.report-tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}
.report-tab {
    padding: 8px 16px; border-radius: 8px 8px 0 0;
    font-size: 13px; cursor: pointer; color: var(--muted);
    background: transparent; border: 1px solid transparent;
    transition: all 0.15s; user-select: none;
}
.report-tab:hover { background: #F1F5F9; color: var(--text); }
.report-tab.active {
    background: #fff; color: var(--primary);
    border: 2px solid var(--border); border-bottom: none;
    font-weight: 600; margin-bottom: -2px;
}
.report-filters { padding: 4px 0; }
.filter-row {
    display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end;
}
.filter-row label {
    display: flex; flex-direction: column; gap: 4px;
    font-size: 12px; color: var(--muted);
}
.filter-row select, .filter-row input {
    padding: 6px 10px; border: 1px solid var(--border);
    border-radius: 6px; font-size: 13px; min-width: 140px;
    background: #fff; color: var(--text);
}
.filter-row select:focus, .filter-row input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(234,88,12,0.1);
}


/* ============ JINASK 风格首页 ============ */
.top-tabs { display: flex; gap: 0; margin-left: 30px; height: 60px; align-items: center; flex-shrink: 0; }
.top-tab {
    padding: 8px 18px; cursor: pointer; font-size: 15px; color: var(--muted);
    border-bottom: 2px solid transparent; transition: .2s; font-weight: 500;
    white-space: nowrap; height: 60px; display: flex; align-items: center;
}
.top-tab:hover { color: var(--text); }
.top-tab.active { color: var(--wd-blue); border-bottom-color: var(--wd-blue); font-weight: 600; }

.jn-welcome-banner {
    background: linear-gradient(120deg, #1E40AF 0%, #2563EB 50%, #3B82F6 100%);
    color: #fff; border-radius: 12px; padding: 22px 28px; margin-bottom: 20px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 6px 20px rgba(37,99,235,.22);
}
.jn-welcome-left h2 { font-size: 22px; margin-bottom: 6px; font-weight: 600; }
.jn-welcome-left p { opacity: .85; font-size: 13px; }
.jn-welcome-right { text-align: right; }
.jn-logo { font-size: 28px; font-weight: 800; letter-spacing: 2px; margin-bottom: 4px; }
.jn-welcome-right p { opacity: .8; font-size: 12px; }

.jn-section { margin-bottom: 24px; }
.jn-section-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
}
.jn-section-head h3 { font-size: 16px; font-weight: 600; color: var(--text); }
.jn-edit-btn {
    background: var(--card); border: 1px solid var(--border); border-radius: 8px;
    padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--text); transition: .15s;
}
.jn-edit-btn:hover { border-color: var(--wd-blue); color: var(--wd-blue); }

.jn-quick-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px; justify-content: start;
}
.jn-quick-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 10px;
    padding: 16px 10px; text-align: center; cursor: pointer; transition: .2s;
    max-width: 160px;
}
.jn-quick-card:hover {
    transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16,24,40,.1);
    border-color: var(--wd-blue);
}
.jn-quick-icon { font-size: 24px; margin-bottom: 6px; }
.jn-quick-label { font-size: 12px; color: var(--text); font-weight: 500; }

.jn-overview-grid {
    display: grid; 
    grid-template-columns: repeat(5, 1fr);
    gap: 16px; 
}
.jn-overview-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 24px 16px; text-align: center;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    min-height: 120px; transition: transform 0.2s, box-shadow 0.2s;
}
.jn-overview-card:hover {
    transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.jn-overview-num { 
    font-size: 32px; font-weight: 700; margin-bottom: 8px; line-height: 1.2;
    min-height: 40px; display: flex; align-items: center; justify-content: center;
}
.jn-overview-label { 
    font-size: 13px; color: var(--muted); line-height: 1.4;
    text-align: center; max-width: 100%; word-wrap: break-word;
}

/* 响应式布局 */
@media (max-width: 1200px) {
    .jn-overview-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .jn-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .jn-overview-grid {
        grid-template-columns: 1fr;
    }
}

.jn-chart-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
}
.jn-chart-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 20px; min-height: 220px;
}
.jn-chart-title { font-size: 14px; font-weight: 600; margin-bottom: 14px; color: var(--text); }
.jn-chart-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 160px; color: var(--muted);
}
.jn-chart-icon { font-size: 40px; margin-bottom: 8px; opacity: .5; }


/* 顶部语言切换 */
.top-lang-select {
    background: transparent; border: 1px solid transparent; border-radius: 8px;
    padding: 5px 24px 5px 8px; font-size: 12px; cursor: pointer; color: var(--text);
    outline: none; appearance: none; margin-right: 0; max-width: 130px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23667085'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center;
    transition: .15s;
}
.top-lang-select:hover { border-color: var(--wd-blue); }
.top-lang-select option { color: var(--text); background: var(--card); }


/* ============ 员工自助模块样式 ============ */
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-head h2 { font-size: 20px; font-weight: 600; }
.page-head .btn { margin-left: 8px; }

.panel-section { margin-bottom: 24px; }
.group-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.empty-tip { text-align: center; padding: 40px; color: var(--muted); font-size: 14px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { background: var(--bg); padding: 10px 12px; text-align: left; font-weight: 600; border-bottom: 2px solid var(--border); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-table tr:hover { background: rgba(0,0,0,.02); }
.table-wrap { overflow-x: auto; }

.stats { display: flex; gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; min-width: 120px; }
.stat-num { font-size: 24px; font-weight: 700; }
.stat-unit { font-size: 13px; color: var(--muted); margin-left: 4px; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge-green { background: #D1FAE5; color: #065F46; }
.badge-yellow { background: #FEF3C7; color: #92400E; }
.badge-red { background: #FEE2E2; color: #991B1B; }
.badge-blue { background: #DBEAFE; color: #1D4ED8; }
.badge-gray { background: #F3F4F6; color: #6B7280; }

/* 日程 */
.sched-wrap { display: flex; gap: 20px; }
.sched-left { flex: 1; }
.sched-right { width: 320px; }
.sched-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sched-nav span { font-weight: 600; font-size: 16px; min-width: 100px; text-align: center; }
.sched-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.sched-week div { text-align: center; font-size: 12px; color: var(--muted); padding: 6px; }
.sched-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.sched-cell { border: 1px solid var(--border); border-radius: 6px; padding: 6px; min-height: 70px; cursor: pointer; position: relative; transition: .15s; }
.sched-cell:hover { border-color: var(--wd-blue); background: #EFF6FF; }
.sched-cell.other { opacity: .4; }
.sched-cell.today { border-color: var(--wd-orange); background: #FFF7ED; }
.sched-cell.selected { border-color: var(--wd-blue); background: #DBEAFE; }
.sched-cell .d { font-size: 13px; font-weight: 600; }
.sched-cell .dot { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--wd-blue); }
.sched-cell .e { display: block; font-size: 11px; color: var(--wd-blue); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-ev { display: flex; justify-content: space-between; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.sched-ev .t { font-size: 13px; }
.sched-ev .r { color: var(--muted); font-size: 12px; }
.ev-ops { display: flex; gap: 6px; }

/* 出勤统计 */
.att-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }

/* 档案 */
.profile-header { display: flex; justify-content: space-between; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.profile-header-left { display: flex; align-items: center; gap: 20px; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--wd-blue), #3B82F6); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 32px; }
.profile-info h2 { font-size: 20px; margin-bottom: 6px; }
.dept-pos { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.meta { font-size: 13px; color: var(--muted); display: flex; gap: 16px; }
.profile-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.profile-tab { padding: 10px 20px; cursor: pointer; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.profile-tab.active { color: var(--wd-blue); border-bottom-color: var(--wd-blue); font-weight: 600; }
.profile-content { display: flex; gap: 20px; }
.profile-main { flex: 1; }
.profile-section-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.profile-info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0; }
.profile-info-row { display: flex; padding: 10px 0; border-bottom: 1px solid var(--border); }
.profile-info-label { width: 100px; color: var(--muted); font-size: 13px; flex-shrink: 0; }

/* 用户权限查询页面 */
.user-perm-layout { display: flex; gap: 16px; align-items: flex-start; }
.user-perm-left { width: 320px; flex-shrink: 0; }
.user-perm-right { flex: 1; min-width: 0; max-height: calc(100vh - 180px); overflow-y: auto; }
.user-search-row { display: flex; gap: 8px; margin-bottom: 12px; }
.user-search-row input { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.user-perm-list { max-height: calc(100vh - 280px); overflow-y: auto; }
.user-perm-item { padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.user-perm-item:hover { background: #f5f7fa; }
.user-perm-item.active { background: #e8f0fe; border-left: 3px solid var(--wd-blue); }
.upi-no { font-weight: 600; font-size: 14px; color: var(--wd-blue); }
.upi-desc { font-size: 13px; color: #374151; margin-top: 2px; }
.upi-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.user-info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; padding: 12px; background: #f9fafb; border-radius: 8px; }
.user-info-grid label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.user-info-grid span { font-size: 14px; font-weight: 500; }
.perm-section { margin-bottom: 24px; }
.perm-section-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table th { background: #f5f7fa; padding: 8px 10px; text-align: left; font-weight: 600; border-bottom: 2px solid var(--border); white-space: nowrap; }
.perm-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.perm-table tr:hover { background: #f9fafb; }
.badge-yes { display: inline-block; padding: 2px 8px; background: #dcfce7; color: #16a34a; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-no { display: inline-block; padding: 2px 8px; background: #f3f4f6; color: #9ca3af; border-radius: 10px; font-size: 11px; }
/* 权限区块折叠 */
.perm-section-title.perm-collapse { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; }
.perm-section-title.perm-collapse:hover { color: var(--wd-blue, #2563eb); }
.perm-section-title.perm-collapse.open { border-bottom-color: var(--wd-blue, #2563eb); }
.perm-chevron { display: inline-block; width: 14px; flex-shrink: 0; color: #86909c; transition: transform 0.15s; font-size: 12px; }
.perm-section-title.perm-collapse.open .perm-chevron { transform: rotate(90deg); }
.perm-section-body { padding: 4px 0 2px; }
/* JINASK 菜单权限勾选树 */
.askx-perm-tip { font-size: 12px; line-height: 1.7; margin-bottom: 8px; background: #f7f9fb; border: 1px dashed var(--border); border-radius: 8px; padding: 8px 10px; }
.askx-perm-groups { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.askx-perm-group { border: 1px solid var(--border, #e5e7eb); border-radius: 8px; overflow: hidden; background: #fff; flex-shrink: 0; }
.askx-perm-group-title { display: flex; align-items: center; gap: 7px; padding: 8px 12px; background: #f7f9fb; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-primary, #1f2937); user-select: none; transition: background .15s; }
.askx-perm-group-title:hover { background: #eef2f7; }
.askx-perm-group-title.open { background: #eef5ff; }
.askx-group-count { margin-left: auto; font-size: 12px; font-weight: 400; color: #86909c; }
.askx-group-all { font-size: 12px; font-weight: 400; color: var(--wd-blue, #2563eb); cursor: pointer; padding: 0 2px; border-radius: 4px; }
.askx-group-all:hover { background: #e8f0fe; }
.askx-perm-group-body { padding: 8px 12px; }
.askx-perm-subgroup { border: 1px solid var(--border, #e5e7eb); border-radius: 6px; margin: 6px 0; background: #fbfcfe; overflow: hidden; }
.askx-perm-subgroup-title { display: flex; align-items: center; gap: 7px; padding: 6px 10px; background: #f0f4f9; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-primary, #1f2937); user-select: none; transition: background .15s; }
.askx-perm-subgroup-title:hover { background: #e9eef6; }
.askx-perm-subgroup-title.open { background: #e9f1fd; }
.askx-perm-subgroup-body { padding: 6px 10px; }
.askx-subgroup-count { margin-left: auto; font-size: 11px; font-weight: 400; color: #86909c; }
.askx-subgroup-all { font-size: 11px; font-weight: 400; color: var(--wd-blue, #2563eb); cursor: pointer; padding: 0 2px; border-radius: 4px; }
.askx-subgroup-all:hover { background: #e8f0fe; }
.askx-perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 2px 14px; }
.askx-perm-item { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-primary, #1f2937); padding: 3px 2px; cursor: pointer; line-height: 1.4; }
.askx-perm-item:hover { background: #f5f7fa; border-radius: 4px; }
.askx-perm-item input { width: 15px; height: 15px; accent-color: var(--wd-blue, #2563eb); flex-shrink: 0; cursor: pointer; }
.askx-perm-actions { margin-top: 12px; display: flex; gap: 10px; align-items: center; }


/* 登录页设置按钮 */
.login-settings-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.login-settings-btn:hover { background: #f0f2f5; }

/* 模态对话框 */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.modal-box {
    background: #fff;
    border-radius: 12px;
    width: 480px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px 8px;
    border-radius: 4px;
}
.modal-close:hover { background: #f3f4f6; color: #374151; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

/* 数据库配置表单 */
.db-config-form { display: flex; flex-direction: column; gap: 14px; }
.db-field { display: flex; flex-direction: column; gap: 6px; }
.db-field label { font-size: 13px; font-weight: 500; color: #374151; }
.db-field input {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.15s;
}
.db-field input:focus { outline: none; border-color: var(--wd-blue); }
.db-field-row { display: flex; gap: 12px; }
.db-field-row .db-field { flex: 1; }
.db-config-msg {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 4px;
}
.db-config-msg.ok { background: #dcfce7; color: #16a34a; }
.db-config-msg.err { background: #fee2e2; color: #dc2626; }

.btn { padding: 8px 16px; border-radius: 6px; font-size: 14px; cursor: pointer; border: none; transition: all 0.15s; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--wd-blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--wd-blue-dark); }
.btn-secondary { background: #f3f4f6; color: #374151; }
.btn-secondary:hover:not(:disabled) { background: #e5e7eb; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.profile-info-value { font-size: 13px; color: var(--text); }
.profile-info-value.empty { color: var(--muted); }

/* 工资 */
.pay-year-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.pay-year-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; display: flex; gap: 12px; align-items: center; }
.pay-year-icon { font-size: 28px; }
.pay-year-label { font-size: 12px; color: var(--muted); }
.pay-year-val { font-size: 18px; font-weight: 700; margin-top: 2px; }
.pay-year-section-title { font-size: 15px; font-weight: 600; margin: 20px 0 12px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: #fff; border-radius: 12px; padding: 24px; width: 420px; max-width: 90vw; max-height: 80vh; overflow-y: auto; }
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.modal-body label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--text); }
.modal-body input, .modal-body select, .modal-body textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; margin-top: 4px; box-sizing: border-box; }
.modal-body textarea { resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.btn-danger { background: #DC2626; color: #fff; border: none; }
.btn-danger:hover { background: #B91C1C; }

/* 常用模块次数 */
.jn-quick-count { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* 天气预报 */
.weather-display { display: flex; align-items: center; gap: 12px; color: #fff; }
.weather-icon { font-size: 40px; line-height: 1; }
.weather-info { text-align: left; }
.weather-temp { font-size: 28px; font-weight: 700; line-height: 1.1; }
.weather-desc { font-size: 13px; opacity: .85; margin-top: 2px; }
.weather-loc { font-size: 12px; opacity: .75; margin-top: 3px; }

/* ============ 我的工资页面 ============ */
.salary-main-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    color: white;
    margin-bottom: 20px;
}
.salary-main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.salary-name {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
}
.salary-meta {
    font-size: 13px;
    opacity: 0.9;
}
.salary-period {
    text-align: right;
}
.salary-period-label {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 4px;
}
.salary-period-val {
    font-size: 16px;
    font-weight: 500;
}
.salary-main-numbers {
    display: flex;
    gap: 40px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.2);
}
.salary-num-item {
    flex: 1;
}
.salary-num-label {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 6px;
}
.salary-num-val {
    font-size: 24px;
    font-weight: 700;
}
.salary-num-val.add { color: #a8edea; }
.salary-num-val.dec { color: #ffd3a5; }
.salary-num-val.net { color: #fff; font-size: 28px; }

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 24px 0 12px;
    padding-left: 10px;
    border-left: 4px solid #667eea;
}

.salary-group {
    margin-bottom: 16px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.salary-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}
.salary-group-total {
    color: #667eea;
    font-weight: 600;
}

.text-add { color: #059669; font-weight: 500; }
.text-dec { color: #dc2626; font-weight: 500; }

.attendance-summary-bar {
    display: flex;
    gap: 20px;
    padding: 12px 16px;
    background: #f0f9ff;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #0369a1;
    flex-wrap: wrap;
}

/* ===================== AI 助手 ===================== */
.ai-assistant-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3370ff 0%, #6b8cff 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(51, 112, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.3s ease;
}

.ai-assistant-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(51, 112, 255, 0.5);
}

.ai-assistant-btn.active {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    box-shadow: 0 4px 16px rgba(255, 77, 79, 0.4);
}

.ai-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4d4f;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.ai-assistant-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 420px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-panel-header {
    background: linear-gradient(135deg, #3370ff 0%, #6b8cff 100%);
    color: white;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
}

.ai-panel-icon {
    font-size: 20px;
}

.ai-model-select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    max-width: 140px;
}

.ai-model-select option {
    color: #333;
    background: white;
}

.ai-panel-actions {
    display: flex;
    gap: 4px;
}

.ai-panel-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
}

.ai-panel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f7f8fa;
}

.ai-welcome {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.ai-welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.ai-welcome h3 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 18px;
}

.ai-welcome p {
    margin: 0 0 20px 0;
    font-size: 13px;
    line-height: 1.6;
}

.ai-quick-questions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 280px;
    margin: 0 auto;
}

.ai-quick-questions button {
    background: white;
    border: 1px solid #e5e6eb;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: #3370ff;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.ai-quick-questions button:hover {
    background: #f0f5ff;
    border-color: #3370ff;
}

.ai-message {
    display: flex;
    margin-bottom: 16px;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-message.user {
    flex-direction: row-reverse;
}

.ai-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.ai-message.assistant .ai-message-avatar {
    background: linear-gradient(135deg, #3370ff 0%, #6b8cff 100%);
    color: white;
}

.ai-message.user .ai-message-avatar {
    background: #e5e6eb;
    color: #666;
}

.ai-message-content {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.ai-message.assistant .ai-message-content {
    background: white;
    border: 1px solid #e5e6eb;
    border-top-left-radius: 4px;
}

.ai-message.user .ai-message-content {
    background: #3370ff;
    color: white;
    border-top-right-radius: 4px;
}

.ai-message-content code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

.ai-message.user .ai-message-content code {
    background: rgba(255, 255, 255, 0.2);
}

.ai-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.ai-typing span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

.ai-panel-input {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e6eb;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.ai-input {
    flex: 1;
    border: 1px solid #e5e6eb;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 100px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.ai-input:focus {
    border-color: #3370ff;
}

.ai-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #3370ff;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ai-send-btn:hover:not(:disabled) {
    background: #2860e0;
}

.ai-send-btn:disabled {
    background: #c9cdd4;
    cursor: not-allowed;
}

.ai-panel-footer {
    padding: 8px 16px;
    background: #f7f8fa;
    border-top: 1px solid #e5e6eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #999;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #52c41a;
}

.ai-status.thinking::before {
    background: #faad14;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* 响应式 */
@media (max-width: 768px) {
    .ai-assistant-panel {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        right: 16px;
        bottom: 80px;
    }

    .ai-assistant-btn {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
}

.salary-year-summary {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.year-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 12px;
}
.year-summary-item {
    text-align: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}
.ysi-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}
.ysi-val {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}
.ysi-val.highlight {
    color: #667eea;
    font-size: 22px;
}

/* ============ HR看板图表样式 ============ */
.chart-panel { padding: 16px 18px; }
.kpi-card { position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.kpi-trend { font-size: 11px; margin-top: 6px; padding-top: 6px; border-top: 1px solid #f3f4f6; }
.kpi-trend.up { color: #059669; }
.kpi-trend.down { color: #dc2626; }

/* 图例 */
.chart-legend-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; transition: background .15s; }
.chart-legend-item:hover { background: #f9fafb; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-name { flex: 1; font-size: 12px; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-value { font-size: 12px; color: #6b7280; font-weight: 500; }

/* 柱状图 */
.bar { width: 18px; border-radius: 4px 4px 0 0; transition: opacity .15s; min-height: 4px; }
.bar:hover { opacity: 0.8; }
.hire-bar { background: linear-gradient(180deg, #60a5fa, #3b82f6); }
.leave-bar { background: linear-gradient(180deg, #f87171, #ef4444); }

/* ============ AI助手 ============ */
.ai-assistant-panel {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 500px;
}
.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}
.ai-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.ai-icon { font-size: 20px; }
.ai-controls { display: flex; align-items: center; gap: 8px; }
.ai-model-select {
    padding: 4px 8px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    cursor: pointer;
}
.ai-model-select option { color: #333; }
.ai-btn-icon {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ai-btn-icon:hover { background: rgba(255,255,255,0.3); }
.ai-settings {
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.ai-settings-row { display: flex; align-items: center; gap: 8px; }
.ai-settings-row label { font-size: 13px; color: #374151; white-space: nowrap; }
.ai-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}
.ai-btn-small {
    padding: 6px 14px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.ai-btn-small:hover { background: #5a67d8; }
.ai-settings-hint { font-size: 11px; color: #9ca3af; margin-top: 6px; }
.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f9fafb;
}
.ai-message { display: flex; gap: 10px; max-width: 85%; }
.ai-bot { align-self: flex-start; }
.ai-user { align-self: flex-end; flex-direction: row-reverse; }
.ai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
}
.ai-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}
.ai-bot .ai-bubble { background: #fff; border: 1px solid #e5e7eb; border-top-left-radius: 4px; }
.ai-user .ai-bubble { background: #667eea; color: #fff; border-top-right-radius: 4px; }
.ai-typing { display: flex; gap: 4px; align-items: center; padding: 12px 14px; }
.ai-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: aiBounce 1.4s infinite ease-in-out both;
}
.ai-typing span:nth-child(1) { animation-delay: -0.32s; }
.ai-typing span:nth-child(2) { animation-delay: -0.16s; }
@keyframes aiBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
.ai-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}
.ai-textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    outline: none;
}
.ai-textarea:focus { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.1); }
.ai-send-btn {
    padding: 0 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.ai-send-btn:hover { opacity: 0.9; }

/* 横向条形图 */
.hbar-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.hbar-label { width: 70px; font-size: 12px; color: #374151; flex-shrink: 0; text-align: right; }
.hbar-track { flex: 1; height: 20px; background: #f3f4f6; border-radius: 4px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.hbar-value { width: 50px; font-size: 12px; color: #6b7280; font-weight: 500; flex-shrink: 0; }

/* 招聘漏斗 */
.funnel-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.funnel-bar { height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; color: #fff; font-size: 12px; min-width: 100px; transition: opacity .15s; }
.funnel-bar:hover { opacity: 0.85; }
.funnel-label { font-weight: 500; }
.funnel-count { font-weight: 700; }
.funnel-rate { font-size: 12px; color: #6b7280; width: 50px; text-align: right; flex-shrink: 0; }

/* 响应式 */
@media (max-width: 1024px) {
    .chart-panel { grid-column: 1 / -1 !important; }
}
@media (max-width: 768px) {
    .kpi-card { padding: 14px; }
    .kpi-trend { display: none; }
    .hbar-label { width: 55px; font-size: 11px; }
    .hbar-value { width: 40px; font-size: 11px; }
}

/* ===================== 作业流程图 ===================== */
.flow-page-container {
    background: white;
    border-radius: 8px;
    padding: 16px;
    height: calc(100vh - 180px);
    display: flex;
    flex-direction: column;
}

.flow-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f7f8fa;
    border-radius: 6px;
    margin-bottom: 12px;
}

.flow-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.flow-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
}

.flow-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 2px solid;
}

.flow-zoom-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.flow-zoom-controls button {
    width: 28px;
    height: 28px;
    border: 1px solid #e5e6eb;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.flow-zoom-controls button:hover {
    background: #f0f5ff;
    border-color: #3370ff;
    color: #3370ff;
}

.flow-zoom-level {
    font-size: 12px;
    color: #666;
    min-width: 45px;
    text-align: center;
}

.flow-canvas-container {
    flex: 1;
    overflow: hidden;
    background: #fafbfc;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    cursor: grab;
    position: relative;
}

.flow-canvas-container:active {
    cursor: grabbing;
}

.flow-node:hover rect {
    filter: brightness(0.95);
    stroke-width: 3;
}

.flow-connection {
    transition: stroke 0.2s;
}

.flow-node:hover ~ .flow-connection {
    stroke: #3370ff;
}

.flow-error {
    padding: 40px;
    text-align: center;
    color: #e74c3c;
    font-size: 14px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.page-header h2 {
    margin: 0;
    font-size: 18px;
    color: #1f2329;
}

.page-header-actions {
    display: flex;
    gap: 8px;
}

/* 面包屑导航（飞书风格） */
.breadcrumb-bar{display:flex;align-items:center;flex-wrap:wrap;gap:2px;padding:12px 16px 0;font-size:12px;color:#8a919f;line-height:1.5}
.bc-item{cursor:pointer;color:#8a919f;transition:color .15s}
.bc-item:hover{color:#3370ff}
.bc-link{color:#4e5969}
.bc-cur{color:#1d2129;font-weight:600}
.bc-sep{color:#c9cdd4;margin:0 4px}

/* ============ 首页待办中心 + 公告 ============ */
.jn-todo-tools { display: flex; align-items: center; gap: 8px; }
.jn-todo-psn {
    width: 120px; padding: 6px 10px; font-size: 12px; color: var(--text);
    border: 1px solid var(--border); border-radius: 8px; background: var(--card); outline: none;
}
.jn-todo-psn:focus { border-color: var(--wd-blue); }
.jn-todo-more { font-size: 13px; color: var(--wd-blue); cursor: pointer; white-space: nowrap; text-decoration: none; }
.jn-todo-more:hover { text-decoration: underline; }

.jn-todo-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 18px;
}
.jn-todo-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.jn-todo-tab {
    background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px 14px; font-size: 14px; color: var(--muted); cursor: pointer; transition: .15s;
    font-family: inherit;
}
.jn-todo-tab.active { color: var(--wd-blue); border-bottom-color: var(--wd-blue); font-weight: 600; }
.jn-todo-tab:hover { color: var(--wd-blue); }
.jn-todo-badge {
    display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 4px;
    font-size: 11px; line-height: 16px; text-align: center; border-radius: 9px;
    background: #eef2ff; color: var(--wd-blue); box-sizing: border-box;
}
.jn-todo-tab.active .jn-todo-badge { background: var(--wd-blue); color: #fff; }

.jn-todo-list { min-height: 40px; }
.jn-todo-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 4px; border-bottom: 1px dashed var(--border); }
.jn-todo-item:last-child { border-bottom: none; }
.jn-todo-tag {
    flex-shrink: 0; font-size: 11px; padding: 2px 8px; border-radius: 6px;
    background: #eef2ff; color: var(--wd-blue); margin-top: 2px;
}
.jn-todo-main { flex: 1; min-width: 0; }
.jn-todo-title { font-size: 13px; color: var(--text); font-weight: 500; }
.jn-todo-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.jn-todo-empty, .jn-notice-empty { padding: 24px 10px; text-align: center; color: var(--muted); font-size: 13px; }

.jn-notice-list { display: flex; flex-direction: column; }
.jn-notice-item {
    display: flex; align-items: center; gap: 8px; padding: 11px 4px; cursor: pointer;
    border-bottom: 1px dashed var(--border); transition: .15s;
}
.jn-notice-item:last-child { border-bottom: none; }
.jn-notice-item:hover .jn-notice-title { color: var(--wd-blue); }
.jn-notice-pin {
    flex-shrink: 0; font-size: 11px; padding: 1px 7px; border-radius: 6px;
    background: #fee2e2; color: #dc2626;
}
.jn-notice-title { flex: 1; min-width: 0; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jn-notice-meta { flex-shrink: 0; font-size: 12px; color: var(--muted); }

@media (max-width: 768px) {
    .jn-todo-tools { flex-wrap: wrap; }
    .jn-todo-psn { width: 104px; }
}
@media (max-width: 480px) {
    .jn-notice-meta { display: none; }
    .jn-todo-tab { padding: 8px 10px; font-size: 13px; }
}

/* ============ AI 助手语音输入 ============ */
.ai-mic-btn {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--border); background: #fff; color: #6b7280;
    cursor: pointer; font-size: 16px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s; padding: 0;
}
.ai-mic-btn:hover { color: var(--wd-blue); border-color: var(--wd-blue); }
.ai-mic-btn.listening, #aiAssistantBtn.listening {
    background: #ff4d4f !important; color: #fff !important;
    border-color: #ff4d4f !important;
    animation: ai-pulse 1.1s infinite;
}
@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, .5); }
    50% { box-shadow: 0 0 0 10px rgba(255, 77, 79, 0); }
}

/* ===== 考试组卷弹窗 ===== */
.modal-box.wide { width: min(1080px, 96vw); }
.lme-mode-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; padding: 6px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; background: #fff; }
.lme-mode-opt:has(input:checked) { border-color: var(--wd-blue, #2563eb); background: #eef5ff; color: var(--wd-blue, #2563eb); }
.lme-block { margin-top: 4px; }
.lme-pick-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.lme-pool { max-height: 230px; overflow-y: auto; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; padding: 6px 8px; background: #fff; }
.lme-pool-item { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 4px; cursor: pointer; border-radius: 6px; line-height: 1.35; }
.lme-pool-item:hover { background: #f5f7fa; }
.lme-pool-item input { width: 15px; height: 15px; accent-color: var(--wd-blue, #2563eb); flex-shrink: 0; cursor: pointer; }
.lme-picked-head { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 6px; }
.lme-picked { max-height: 200px; overflow-y: auto; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; padding: 6px 8px; background: #fff; }
.lme-picked-item { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 2px; border-bottom: 1px dashed #eef1f4; }
.lme-picked-item:last-child { border-bottom: none; }
.lme-picked-item .ipt { padding: 3px 6px; font-size: 13px; }
.lme-act { cursor: pointer; color: var(--wd-blue, #2563eb); padding: 0 5px; font-weight: 700; user-select: none; border-radius: 4px; }
.lme-act:hover { background: #e8f0fe; }
.lme-act.danger { color: #dc2626; }

/* ============ 错误日志查看器 ============ */
.errlog-box { width: 860px; max-width: 95vw; }
.errlog-body { padding: 14px 16px; }
.errlog-toolbar { display: flex; gap: 10px; margin-bottom: 10px; }
.errlog-toolbar input {
    flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
    font-size: 13px; outline: none;
}
.errlog-toolbar input:focus { border-color: var(--wd-blue); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.errlog-view {
    height: 420px; overflow-y: auto; background: #1e2530; border-radius: 8px;
    padding: 10px 12px; font-family: Consolas, 'Courier New', monospace; font-size: 12px;
}
.errlog-empty { color: #9ca3af; padding: 16px; text-align: center; font-family: inherit; }
.errlog-line { padding: 3px 6px; border-radius: 4px; color: #d1d5db; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }
.errlog-line:hover { background: rgba(255,255,255,0.06); }
.errlog-line .el-time { color: #7dd3fc; }
.errlog-line .el-trace { color: #fbbf24; }
.errlog-line .el-status { color: #86efac; font-weight: 600; }
.errlog-line .el-status.c4 { color: #fca5a5; }
.errlog-line .el-status.c5 { color: #f87171; font-weight: 700; }
.errlog-line .el-code { color: #c4b5fd; font-weight: 600; }
.errlog-line .el-path { color: #9ca3af; }
.errlog-line .el-detail { color: #e5e7eb; }

/* ============ 多选公司下拉 ============ */
.ms-wrap{position:relative;display:inline-block;min-width:180px;vertical-align:middle}
.ms-trigger{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:6px 10px;border:1px solid #d1d5db;border-radius:6px;font-size:12px;cursor:pointer;background:#fff;min-width:180px;user-select:none}
.ms-trigger:hover{border-color:var(--primary,#3b82f6)}
.ms-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px;color:#333}
.ms-caret{font-size:10px;color:#666;transition:transform .15s}
.ms-wrap.open .ms-caret{transform:rotate(180deg)}
.ms-dropdown{position:absolute;top:100%;left:0;margin-top:4px;background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.12);z-index:1000;min-width:240px;max-height:320px;overflow-y:auto;padding:6px}
.ms-opt{padding:6px 8px;border-radius:6px;font-size:12px;cursor:pointer}
.ms-opt:hover{background:#f3f4f6}
.ms-opt label{display:flex;align-items:center;gap:8px;cursor:pointer;white-space:nowrap}
.ms-opt input{accent-color:var(--primary,#3b82f6);cursor:pointer}



/* ============ 打印样式（BI 报表/看板 导出PDF）============ */
@media print {
  html, body { height: auto !important; overflow: visible !important; }
  .app-shell { height: auto !important; min-height: 0 !important; overflow: visible !important; display: block !important; }
  header.topbar, .sidenav, .sidenav-overlay, #toast, #modal, #askxToast, #askxErrorBanner, .ms-opt, .ms-caret, .ms-arrow, .loading { display: none !important; }
  .layout { display: block !important; height: auto !important; min-height: 0 !important; }
  .main-content { height: auto !important; min-height: 0 !important; padding: 0 !important; overflow: visible !important; }
  .btn { display: none !important; }
  canvas { max-width: 100% !important; }
  .panel { break-inside: avoid; }
}


/* ============ 移动端顶部栏/登录页精简（飞书UI适配） ============ */
@media (max-width: 768px) {
    .topbar .brand em { display: none; }
    .topbar .brand { gap: 6px; font-size: 14px; }
    .top-tab { padding: 6px 8px; font-size: 12px; white-space: nowrap; }
    .user-box .user-meta { display: none; }
    .user-box { gap: 6px; }
    .topbar .top-lang-select { max-width: 96px; }
    .login-brand-side { padding: 18px 16px; }
    .login-brand-desc, .login-brand-slogan { display: none; }
    .login-brand-image { margin-bottom: 4px; }
}
@media (max-width: 480px) {
    .topbar #logoutBtn { padding: 6px 10px; font-size: 12px; }
    .topbar .top-lang-select { max-width: 72px; font-size: 12px; padding: 4px 6px; }
    .topbar .avatar { width: 30px; height: 30px; font-size: 13px; }
}

/* ============ 手机端内联两列 grid 自动单列（飞书UI适配） ============ */
@media (max-width: 480px) {
    div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
    .ec-form-grid, .ec-summary { grid-template-columns: 1fr !important; }
}
@media (max-width: 900px) {
    .ec-form-grid, .ec-summary { grid-template-columns: 1fr; }
}

/* ===== 全屏模式：报表/看板/全厂出勤总览统一浅色背景 + 撑满视口（修复全屏黑底） ===== */
#mainContent:fullscreen,
#mainContent:-webkit-full-screen {
    background: #f4f5f7 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    padding: 18px 22px !important;
    overflow: auto !important;
    box-sizing: border-box !important;
}
#mainContent:fullscreen::backdrop,
#mainContent:-webkit-full-screen::-webkit-backdrop {
    background: #f4f5f7 !important;
}

/* ==== 全局弹窗增强：标题栏可拖动 + 右下角可缩放（2026-09-14） ==== */
.modal-box {
    position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
    display: flex; flex-direction: column;
    min-width: 360px; min-height: 220px;
    max-width: 94vw; max-height: 90vh;
    overflow: hidden; box-sizing: border-box; margin: 0;
}
.modal-box .modal-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-box .modal-title { flex: 0 0 auto; cursor: move; user-select: none; }
.modal-box .modal-actions { flex: 0 0 auto; }
.modal-resize-grip {
    position: absolute; right: 0; bottom: 0;
    width: 18px; height: 18px; cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 0 52%, #9ca3af 52% 62%, transparent 62% 74%, #9ca3af 74% 84%, transparent 84%);
    border-bottom-right-radius: 12px;
}
.modal-box.wide { max-width: 96vw; }

/* ============ 移动端全局补丁（全部页面通用组件，2026-09-17） ============ */
@media (max-width: 768px) {
    /* 页面容器/页头 */
    .page-container { padding: 10px !important; box-sizing: border-box; }
    .page-head { flex-direction: column; align-items: flex-start !important; gap: 8px !important; }
    .page-head h2 { font-size: 17px !important; }
    .page-head .btn-group, .page-head .toolbar-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
    .group-title { font-size: 15px; }

    /* 工具栏 / 按钮组换行 */
    .toolbar, .toolbar-actions, .btn-group { flex-wrap: wrap; gap: 8px; }
    .toolbar .btn, .btn-group .btn, .toolbar-actions .btn { flex: 0 0 auto; }

    /* 分段控件 / Tab 横向滚动 */
    .tab-bar, .seg, .rpt-tabs, .seg-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
    .tab-bar::-webkit-scrollbar, .seg::-webkit-scrollbar, .rpt-tabs::-webkit-scrollbar { display: none; }

    /* 弹窗：小屏去掉最小宽，撑满 */
    .modal-box { min-width: 0; width: 96vw; max-width: 96vw; }
    .modal-box.wide { max-width: 98vw; width: 98vw; }

    /* 抽屉内菜单间距收紧 */
    .sidenav { padding: 12px 8px; }
    .sidenav .menu-group, .sidenav .nav-item { padding-left: 8px; padding-right: 8px; }

    /* 统计卡/面板微调 */
    .stat-card { padding: 12px; }
    .panel { padding: 12px; }
    .panel-title { font-size: 14px; }

    /* 列表页操作按钮列 */
    .action-cell .btn, td .btn-sm { padding: 5px 10px; font-size: 12px; margin: 2px 0; white-space: nowrap; }

    /* 全宽控制，防横向溢出 */
    .main-content { overflow-x: hidden; }
    #mainContent { overflow-x: hidden; }
    body { overflow-x: hidden; }
}
@media (max-width: 480px) {
    .page-head h2 { font-size: 16px !important; }
    .btn { padding: 7px 12px; font-size: 12px; }
    .toolbar .btn { width: 100%; }
    .stat-card { padding: 10px; }
    .card-grid { gap: 8px; }
}

/* 全局禁止显示任何报错条 */
.error-bar, .error-toast, .notification-error, .global-error-bar, [class*="error-bar"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* 强制登录账号输入不自动大写 */
#loginUsername, input[type="text"] {
    text-transform: none !important;
}

input { text-transform: none !important; }

.mm-name { color: #1f2329 !important; }
.mm-code { color: #86909c !important; }

/* ============ 移动端增强 V10.0.2（2026-09-30，手机登录适配） ============ */
@media (max-width: 768px) {
    /* 表格：窄屏字号与内边距收紧，防列错位 */
    .page-container table th,
    .page-container table td,
    .table-wrap th,
    .table-wrap td {
        padding: 6px 8px !important;
        font-size: 12px !important;
    }
    .table-wrap { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
    .table-wrap table { min-width: 100%; }

    /* 输入控件：16px 防 iOS 自动缩放 + 不溢出 */
    input[type="text"], input[type="password"], input[type="number"],
    input[type="date"], input[type="email"], input[type="tel"], select, textarea {
        font-size: 16px !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* 表单栅格：小屏单列 */
    .form-row, .ec-form-grid, .jn-form-grid, .form-grid, .grid-2, .jn-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    /* 卡片与快捷入口收紧 */
    .card-grid { gap: 10px !important; }
    .jn-quick-grid { gap: 10px !important; }

    /* BI 图表容器自适应，不超宽 */
    .chart-box, .chart-panel, .kpi-chart, [class*="chart"] {
        max-width: 100% !important;
    }
    .kpi-card { min-width: 0 !important; }

    /* 按钮触控区最小高度，避免难点击 */
    .btn, button.btn, .icon-btn, .action-cell .btn {
        min-height: 34px;
    }

    /* 弹窗内长内容滚动 */
    .modal-box .table-wrap, .modal-body .table-wrap { max-height: 50vh; }

    /* 顶部栏：品牌区与操作区不挤压换行 */
    .topbar { flex-wrap: nowrap !important; }
    .topbar-left { min-width: 0 !important; }

    /* 列表操作列图标不换行 */
    .action-cell { white-space: nowrap; }

    /* 统计面板标题收紧 */
    .stat-card .stat-value { font-size: 22px !important; }
}

@media (max-width: 480px) {
    /* 超小屏：KPI/双列收两列或单列 */
    .kpi-row, .kpi-grid, .jn-overview-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .stat-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* 弹窗小屏贴边 */
    .modal-box { width: 98vw !important; max-width: 98vw !important; margin: 0 auto; }

    /* 日历/排班单元格紧凑 */
    .cal-cell, .sched-cell { padding: 2px !important; font-size: 11px !important; }
}
