/* ============================================================
   凌晨潜龙进销存系统 · Win11 Fluent Design
   ============================================================ */
:root {
    /* Win11 Fluent 调色板（浅色 Mica 基底） */
    --bg: #f3f3f3;
    --bg-alt: #fafafa;
    --card: #ffffff;
    --card-mica: rgba(252, 252, 252, 0.8);
    --text: #1a1a1a;
    --text-2: #5d5d5d;
    --text-3: #8b8b8b;
    --accent: #0067c0;
    --accent-hover: #0078d4;
    --accent-active: #005ba1;
    --accent-soft: rgba(0, 103, 192, 0.08);
    --accent-soft-2: rgba(0, 103, 192, 0.16);
    --green: #0f7b0f;
    --green-soft: rgba(15, 123, 15, 0.1);
    --red: #c42b1c;
    --red-soft: rgba(196, 43, 28, 0.1);
    --yellow: #9d5d00;
    --yellow-soft: rgba(157, 93, 0, 0.12);
    --purple: #744da9;
    --purple-soft: rgba(116, 77, 169, 0.1);
    --cyan: #007c8c;
    --cyan-soft: rgba(0, 124, 140, 0.1);
    --border: rgba(0, 0, 0, 0.0578);
    --border-strong: rgba(0, 0, 0, 0.1622);
    --radius: 8px;
    --radius-md: 8px;
    --radius-sm: 4px;
    --radius-lg: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.18);
    --ease: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --ease-fluent: 250ms cubic-bezier(0.2, 0, 0, 1);
    --sidebar-w: 248px;
    --topbar-h: 64px;
    /* Mica / Acrylic 材质 */
    --mica: rgba(250, 250, 250, 0.82);
    --mica-strong: rgba(252, 252, 252, 0.92);
    --acrylic: rgba(252, 252, 252, 0.86);
    --hover-fill: rgba(0, 0, 0, 0.0373);
    --pressed-fill: rgba(0, 0, 0, 0.0241);
    --subtle-fill: rgba(0, 0, 0, 0.0241);
    --divider: rgba(0, 0, 0, 0.0803);
    --topbar-border: rgba(0, 0, 0, 0.0578);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Segoe UI Variable', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
canvas { display: block; }
::selection { background: rgba(0, 120, 212, 0.2); }
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd6dd; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b4bec8; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ 登录 ============================ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 120, 212, 0.14) 0%, transparent 55%),
        radial-gradient(circle at 80% 75%, rgba(64, 196, 255, 0.14) 0%, transparent 55%),
        linear-gradient(160deg, #eaf3fb 0%, #f0f4f8 45%, #f5f5f5 100%);
}
.login-screen::before,
.login-screen::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(10px);
    pointer-events: none;
}
.login-screen::before {
    width: 520px; height: 520px; left: -160px; top: -180px;
    background: radial-gradient(circle, rgba(0, 120, 212, 0.12) 0%, transparent 70%);
}
.login-screen::after {
    width: 460px; height: 460px; right: -140px; bottom: -180px;
    background: radial-gradient(circle, rgba(0, 170, 244, 0.14) 0%, transparent 70%);
}
.login-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 24px 64px rgba(16, 42, 67, 0.16), 0 2px 6px rgba(0, 0, 0, 0.04);
    border-radius: 20px;
    padding: 40px 36px 32px;
    animation: loginIn 480ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes loginIn {
    from { opacity: 0; transform: translateY(18px) scale(0.985); }
    to { opacity: 1; transform: none; }
}
.login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 26px; }
.login-brand img {
    width: 64px; height: 64px; object-fit: cover; border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 120, 212, 0.22);
    margin-bottom: 14px;
}
.login-brand h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.login-brand p { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.login-form .field { margin-bottom: 16px; }
.login-form label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 14px; }
.input-icon input { padding-left: 38px !important; }
.login-form input {
    width: 100%; height: 44px; padding: 0 14px;
    border: 1px solid var(--border-strong); border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px; color: var(--text); outline: none;
    transition: border-color var(--ease), box-shadow var(--ease);
}
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.16); }
.login-form .btn-login {
    width: 100%; height: 44px; margin-top: 6px;
    background: var(--accent); color: #fff; border: none; border-radius: 10px;
    font-size: 15px; font-weight: 600; cursor: pointer; letter-spacing: 1px;
    box-shadow: 0 6px 16px rgba(0, 120, 212, 0.28);
    transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
}
.login-form .btn-login:hover { background: var(--accent-hover); transform: translateY(-1px); }
.login-form .btn-login:active { background: var(--accent-active); transform: none; }
.login-form .btn-login:disabled { opacity: 0.65; cursor: default; transform: none; }
.login-error { min-height: 20px; margin-top: 10px; color: var(--red); font-size: 13px; text-align: center; }
.login-hint {
    margin-top: 18px; padding: 10px 12px; border-radius: 10px;
    background: rgba(0, 120, 212, 0.06); border: 1px solid rgba(0, 120, 212, 0.12);
    font-size: 12px; color: var(--text-2); display: flex; gap: 8px; align-items: center;
}
.login-hint i { color: var(--accent); }
.login-register { margin-top: 12px; text-align: center; }
.login-register a {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 500; color: var(--accent);
}
.login-register a:hover { color: var(--accent-hover); }
.login-foot { margin-top: 22px; text-align: center; font-size: 12px; color: var(--text-3); }
.login-foot a { color: var(--text-2); }
.login-foot a:hover { color: var(--accent); }

/* 到期续费面板（01127 套餐到期后只展示续费入口） */
.renew-summary {
    margin: 0 0 18px;
    padding: 12px 16px;
    background: #F7FAFD;
    border: 1px solid #DCE7F2;
    border-radius: 10px;
    font-size: 13px;
}
.renew-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
}
.renew-summary > div + div { border-top: 1px dashed #E3ECF5; }
.renew-summary span { color: var(--text-2); }
.renew-summary b { color: var(--text-1, #1f1f1f); font-weight: 600; text-align: right; }

/* ============================ 布局 ============================ */
.app { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
    background: var(--card-mica);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 200;
    transition: transform var(--ease);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 18px; border-bottom: 1px solid var(--border);
    min-height: var(--topbar-h);
}
.sidebar-brand img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.sidebar-brand .txt { min-width: 0; }
.sidebar-brand .txt strong { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.2px; white-space: nowrap; }
.sidebar-brand .txt span { display: block; font-size: 11px; color: var(--text-3); letter-spacing: 0.4px; white-space: nowrap; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.nav-group { margin-top: 8px; }
.nav-group-title {
    padding: 10px 12px 6px; font-size: 11px; font-weight: 600;
    color: var(--text-3); text-transform: uppercase; letter-spacing: 0.8px;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; border-radius: 8px; margin-bottom: 2px;
    color: var(--text-2); font-size: 13.5px; font-weight: 500;
    cursor: pointer; position: relative;
    transition: background var(--ease), color var(--ease);
    border: 1px solid transparent;
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; opacity: 0.86; }
.nav-item:hover { background: rgba(0, 120, 212, 0.06); color: var(--text); }
.nav-item.active {
    background: var(--accent-soft); color: var(--accent);
    border-color: rgba(0, 120, 212, 0.12); font-weight: 600;
}
.nav-item .badge-dot {
    margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px;
    border-radius: 9px; background: var(--red); color: #fff;
    font-size: 11px; line-height: 18px; text-align: center; font-weight: 600;
}
.nav-item .badge-dot.blue { background: var(--accent); }

/* ---------- 分组式二级导航（业务域折叠） ---------- */
.nav-search { position: relative; margin: 2px 2px 10px; }
.nav-search > i {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    font-size: 12px; color: var(--text-3); pointer-events: none;
}
.nav-search input {
    width: 100%; height: 33px; padding: 0 10px 0 30px;
    border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg-alt); color: var(--text); font-size: 12.5px; outline: none;
    transition: border-color var(--ease), background var(--ease);
}
.nav-search input:focus { border-color: var(--accent); }
.nav-search input::-webkit-search-cancel-button { display: none; }
/* ---------- 平铺分组导航（分组标题为纯文字，菜单始终展开） ---------- */
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 4px; }
.nav-group-title {
    display: flex; align-items: center; cursor: default; user-select: none;
    text-transform: none; letter-spacing: 0.5px; font-size: 12px; font-weight: 600;
    padding: 0 12px 6px; color: var(--text-3);
}
.nav-group-title:hover { background: transparent; color: var(--text-3); }
.nav-sub {
    display: block; padding: 0; margin: 0;
}
.nav-group.is-open > .nav-sub { display: block; }
.nav-item.sub { padding: 8px 12px; font-size: 13px; font-weight: 500; gap: 10px; }
a.nav-item, a.nav-item:hover { text-decoration: none; }
.nav-item.sub > i { width: 18px; text-align: center; font-size: 14px; color: var(--text-3); opacity: 1; }
.nav-item.sub:hover > i { color: var(--text); }
.nav-item.sub.active > i { color: var(--accent); }
.nav-item.sub .badge-dot { min-width: 18px; height: 16px; line-height: 16px; font-size: 10.5px; }
.nav-item.sub.active::before { display: none; }
.sidebar-user {
    padding: 12px 14px; border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-user .avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #0078d4, #40c4ff); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
}
.sidebar-user .info { flex: 1; min-width: 0; }
.sidebar-user .info .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .info .role { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .logout {
    width: 30px; height: 30px; border-radius: 8px; border: none; background: transparent;
    color: var(--text-3); cursor: pointer; transition: all var(--ease);
    display: flex; align-items: center; justify-content: center;
}
.sidebar-user .logout:hover { background: var(--red-soft); color: var(--red); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 100;
    height: var(--topbar-h); padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title { font-size: 17px; font-weight: 650; letter-spacing: -0.2px; white-space: nowrap; }
.topbar-crumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.topbar-crumb i { font-size: 9px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-date {
    display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2);
    padding: 7px 11px; border-radius: 8px; background: #f5f8fb; border: 1px solid var(--border);
}
.menu-btn {
    display: none; width: 34px; height: 34px; border-radius: 8px;
    border: 1px solid var(--border); background: #fff; color: var(--text-2);
    cursor: pointer; align-items: center; justify-content: center;
}
.content { padding: 22px 24px 40px; max-width: 1680px; width: 100%; margin: 0 auto; }
.sidebar-mask { display: none; }

/* ============================ 通用组件 ============================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 36px; padding: 0 15px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
    border: 1px solid transparent; background: transparent; color: var(--text);
    transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
}
.btn i { font-size: 12.5px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 3px 10px rgba(0, 120, 212, 0.22); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 5px 14px rgba(0, 120, 212, 0.28); }
.btn-primary:active { background: var(--accent-active); }
.btn-ghost { background: #fff; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: rgba(0, 120, 212, 0.03); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: rgba(0, 120, 212, 0.15); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: rgba(209, 52, 56, 0.18); }
.btn-success { background: var(--green-soft); color: var(--green); }
.btn-success:hover { background: rgba(16, 124, 16, 0.18); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn-icon { width: 34px; padding: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.input, .select, textarea.input {
    height: 36px; padding: 0 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: #fff; color: var(--text);
    font-size: 13px; outline: none; font-family: inherit;
    transition: border-color var(--ease), box-shadow var(--ease);
    min-width: 0;
}
textarea.input { height: auto; padding: 9px 12px; line-height: 1.5; resize: vertical; min-height: 72px; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.13); }
.input::placeholder { color: #a3adb7; }
.select {
    appearance: none; padding-right: 32px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23616161' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center;
}
.field-label { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 500; margin-bottom: 6px; }
.field-label .req { color: var(--red); margin-left: 2px; }
.field-hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item { min-width: 0; }
.form-item .input, .form-item .select { width: 100%; }

.search-box { position: relative; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 13px; }
.search-box .input { padding-left: 34px; width: 230px; }

/* 面板 */
.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.panel + .panel { margin-top: 16px; }
.panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 15px 20px; border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fcfdff, #fafbfd);
}
.panel-title { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 600; letter-spacing: -0.1px; }
.panel-title i { color: var(--accent); font-size: 14px; }
.panel-sub { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 4px; }
.panel-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-body { padding: 20px; }
.panel-body.tight { padding: 0; }
.panel-foot {
    padding: 12px 20px; border-top: 1px solid var(--border); background: #fbfcfd;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* 表格 */
.table-wrap { width: 100%; overflow-x: auto; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.grid thead th {
    background: #f8fafc; color: var(--text-2); font-weight: 600;
    font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px;
    text-align: left; padding: 11px 16px; white-space: nowrap;
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1;
}
table.grid tbody td {
    padding: 12px 16px; border-bottom: 1px solid #f1f4f7;
    vertical-align: middle; color: var(--text);
}
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody tr { transition: background var(--ease); }
table.grid tbody tr:hover { background: #f8fbff; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td.actions { text-align: right; white-space: nowrap; }
table.grid .cell-main { font-weight: 500; }
table.grid .cell-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
table.grid .cell-mono { font-family: 'Cascadia Mono', Consolas, monospace; font-size: 12px; color: var(--text-2); }
table.grid tfoot td { padding: 12px 16px; background: #fafbfd; font-weight: 600; border-top: 1px solid var(--border); }
.table-actions { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.link-btn {
    border: none; background: transparent; color: var(--accent); font-size: 12.5px;
    cursor: pointer; padding: 4px 6px; border-radius: 6px; transition: background var(--ease);
}
.link-btn:hover { background: var(--accent-soft); }
.link-btn.danger { color: var(--red); }
.link-btn.danger:hover { background: var(--red-soft); }

/* 状态徽章 */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    height: 23px; padding: 0 9px; border-radius: 12px;
    font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge.success { background: var(--green-soft); color: var(--green); }
.badge.warning { background: var(--yellow-soft); color: var(--yellow); }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.badge.danger { background: var(--red-soft); color: var(--red); }
.badge.muted { background: #f0f2f5; color: var(--text-2); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.plain::before { display: none; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; background: #f2f4f7; color: var(--text-2); white-space: nowrap; }
table.grid td.cell-sub { white-space: nowrap; }

/* 工具栏 */
.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; padding: 14px 20px;
    border-bottom: 1px solid var(--border); background: #fbfcfe;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .select { height: 34px; }
.toolbar .input { height: 34px; }
.toolbar .search-box .input { width: 220px; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pager-info { font-size: 12.5px; color: var(--text-3); }
.pager-btns { display: flex; align-items: center; gap: 4px; }
.pager-btns button {
    min-width: 30px; height: 30px; padding: 0 8px; border-radius: 7px;
    border: 1px solid var(--border); background: #fff; color: var(--text-2);
    font-size: 12.5px; cursor: pointer; transition: all var(--ease);
}
.pager-btns button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pager-btns button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager-btns button:disabled { opacity: 0.4; cursor: default; }

/* 空态 / 加载 */
.empty {
    padding: 56px 20px; text-align: center; color: var(--text-3);
}
.empty .ico {
    width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px;
    background: #f2f6fa; display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #b6c2ce;
}
.empty p { font-size: 13px; }
.empty .sub { font-size: 12px; margin-top: 4px; color: #a8b2bd; }
.loading { padding: 56px 20px; text-align: center; color: var(--text-3); font-size: 13px; }
.spinner {
    width: 30px; height: 30px; margin: 0 auto 12px; border-radius: 50%;
    border: 3px solid #e8eef4; border-top-color: var(--accent);
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================ 仪表盘 ============================ */
.welcome {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.welcome h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.welcome p { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.welcome .quick { display: flex; gap: 8px; flex-wrap: wrap; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi {
    position: relative; background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 17px 18px; box-shadow: var(--shadow-sm);
    overflow: hidden; transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}
.kpi::after {
    content: ''; position: absolute; right: -30px; top: -40px; width: 120px; height: 120px;
    border-radius: 50%; background: radial-gradient(circle, rgba(0, 120, 212, 0.07), transparent 70%);
    pointer-events: none;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(0, 120, 212, 0.18); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kpi-icon {
    width: 38px; height: 38px; border-radius: 10px; display: flex;
    align-items: center; justify-content: center; font-size: 16px;
}
.kpi-icon.blue { background: var(--accent-soft); color: var(--accent); }
.kpi-icon.green { background: var(--green-soft); color: var(--green); }
.kpi-icon.purple { background: var(--purple-soft); color: var(--purple); }
.kpi-icon.orange { background: rgba(234, 126, 17, 0.12); color: #c96a0a; }
.kpi-icon.cyan { background: var(--cyan-soft); color: var(--cyan); }
.kpi-icon.red { background: var(--red-soft); color: var(--red); }
.kpi-trend { font-size: 11.5px; padding: 2px 7px; border-radius: 10px; background: #f4f6f9; color: var(--text-2); }
.kpi-trend.up { background: var(--green-soft); color: var(--green); }
.kpi-trend.down { background: var(--red-soft); color: var(--red); }
.kpi-val { font-size: 25px; font-weight: 700; letter-spacing: -0.6px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-val small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.kpi-label { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.kpi-foot { margin-top: 9px; padding-top: 9px; border-top: 1px dashed #eef2f6; font-size: 11.5px; color: var(--text-3); display: flex; justify-content: space-between; gap: 8px; }
.kpi-foot b { color: var(--text-2); font-weight: 600; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.chart-legend { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart-wrap { position: relative; width: 100%; height: 250px; }
.chart-wrap canvas { width: 100%; height: 100%; }

.top-list { display: flex; flex-direction: column; }
.top-item { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px dashed #eef2f6; }
.top-item:last-child { border-bottom: none; }
.top-item .rank {
    width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
    background: #f2f5f9; color: var(--text-2); font-size: 11.5px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
}
.top-item .rank.r1 { background: rgba(234, 179, 8, 0.16); color: #a16207; }
.top-item .rank.r2 { background: rgba(148, 163, 184, 0.2); color: #475569; }
.top-item .rank.r3 { background: rgba(180, 83, 9, 0.14); color: #9a3412; }
.top-item .top-main { flex: 1; min-width: 0; }
.top-item .name { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-item .bar { height: 4px; border-radius: 2px; background: #f0f4f8; margin-top: 5px; overflow: hidden; }
.top-item .bar span { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #0078d4, #40c4ff); }
.top-item .val { font-size: 12.5px; font-weight: 600; color: var(--text); text-align: right; white-space: nowrap; }
.top-item .val small { display: block; font-size: 10.5px; color: var(--text-3); font-weight: 400; }

.warn-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #eef2f6; }
.warn-item:last-child { border-bottom: none; }
.warn-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); flex-shrink: 0; }
.warn-item .nm { flex: 1; min-width: 0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warn-item .qty { font-size: 12px; font-weight: 600; color: var(--red); }
.warn-item .qty.ok { color: var(--green); }

.todo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.todo {
    border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px;
    background: #fbfcfe; cursor: pointer; transition: all var(--ease);
}
.todo:hover { border-color: rgba(0, 120, 212, 0.3); background: #f7fbff; }
.todo .num { font-size: 21px; font-weight: 700; letter-spacing: -0.5px; }
.todo .lbl { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.todo .num.warn { color: var(--yellow); }
.todo .num.danger { color: var(--red); }
.todo .num.blue { color: var(--accent); }

/* ============================ 单据 / 表单 ============================ */
.doc-type-tabs { display: flex; gap: 6px; }
.doc-head-card {
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.06), rgba(64, 196, 255, 0.05));
    border: 1px solid rgba(0, 120, 212, 0.16);
    border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
}
.doc-head-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.doc-head-top .no { font-size: 12.5px; color: var(--text-2); font-family: 'Cascadia Mono', Consolas, monospace; }
.doc-head-top h3 { font-size: 17px; font-weight: 650; letter-spacing: -0.2px; display: flex; align-items: center; gap: 8px; }
.doc-head-top h3 i { color: var(--accent); }
.doc-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.doc-meta .form-item { min-width: 0; }
.doc-meta .input, .doc-meta .select { width: 100%; background: #fff; }

.items-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.items-table thead th {
    background: #f7f9fc; color: var(--text-2); font-size: 11.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px; padding: 10px 12px;
    border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap;
}
.items-table td { padding: 8px 10px; border-bottom: 1px solid #f2f5f8; vertical-align: middle; }
.items-table .input, .items-table .select { width: 100%; height: 34px; }
.items-table .prod-cell { min-width: 260px; }
.items-table .num-cell { width: 120px; }
.items-table .del-cell { width: 42px; text-align: center; }
.items-table .line-amt { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; padding-right: 14px; }
.items-table .stock-hint { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.items-table .stock-hint.low { color: var(--red); }
.items-empty { padding: 28px; text-align: center; color: var(--text-3); font-size: 13px; }
.doc-summary {
    display: flex; align-items: center; justify-content: flex-end; gap: 28px;
    padding: 16px 20px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.doc-summary .item { text-align: right; }
.doc-summary .item .lbl { font-size: 11.5px; color: var(--text-3); }
.doc-summary .item .val { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.doc-summary .item.total .val { color: var(--accent); font-size: 22px; }
.doc-summary .upper { font-size: 12px; color: var(--text-2); padding-right: 4px; }

/* 单据详情 / 打印 */
.doc-view { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.doc-view-head { padding: 26px 30px 18px; border-bottom: 1px solid var(--border); }
.doc-view-head .brand-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.doc-view-head .brand { display: flex; align-items: center; gap: 10px; }
.doc-view-head .brand img { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; }
.doc-view-head .brand strong { font-size: 15px; display: block; line-height: 1.3; }
.doc-view-head .brand span { font-size: 11px; color: var(--text-3); }
.doc-view-head h1 { text-align: center; font-size: 24px; letter-spacing: 6px; font-weight: 650; margin: 18px 0 4px; }
.doc-view-head .doc-no { text-align: center; font-size: 12px; color: var(--text-2); font-family: 'Cascadia Mono', Consolas, monospace; }
.doc-info-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 30px;
    padding: 18px 30px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.doc-info-grid .row { display: flex; gap: 10px; }
.doc-info-grid .row .k { color: var(--text-3); width: 78px; flex-shrink: 0; }
.doc-info-grid .row .v { color: var(--text); font-weight: 500; }
.doc-items { padding: 4px 30px 0; }
.doc-items table.grid thead th { position: static; }
.doc-view-foot { padding: 18px 30px 28px; }
.sign-row { display: flex; justify-content: space-between; gap: 20px; margin-top: 30px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.sign-row span { border-bottom: 1px solid #cfd8e3; min-width: 150px; padding-bottom: 4px; }

/* 时间线 */
.timeline { list-style: none; padding-left: 4px; }
.timeline li { position: relative; padding: 0 0 18px 22px; border-left: 2px solid #e8eef5; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
    content: ''; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px;
    border-radius: 50%; background: #fff; border: 2px solid #b9c6d4;
}
.timeline li.done::before { border-color: var(--green); background: var(--green); }
.timeline li.current::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline .t { font-size: 12.5px; font-weight: 600; }
.timeline .d { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

/* ============================ 弹窗 ============================ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(15, 30, 45, 0.38);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center; padding: 24px;
    opacity: 0; visibility: hidden; transition: opacity var(--ease), visibility var(--ease);
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal-card {
    width: 100%; max-width: 560px; max-height: 88vh; background: #fff;
    border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, 0.6);
    display: flex; flex-direction: column; transform: translateY(12px) scale(0.985);
    transition: transform 240ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.modal-overlay.show .modal-card { transform: none; }
.modal-card.lg { max-width: 760px; }
.modal-card.xl { max-width: 1000px; }
.modal-head {
    padding: 18px 22px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0;
}
.modal-head h3 { font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 9px; }
.modal-head h3 i { color: var(--accent); }
.modal-close {
    width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent;
    color: var(--text-3); cursor: pointer; font-size: 15px; transition: all var(--ease);
}
.modal-close:hover { background: var(--red-soft); color: var(--red); }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-foot {
    padding: 14px 22px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 10px; background: #fbfcfe;
    border-radius: 0 0 18px 18px; flex-shrink: 0;
}
.modal-note {
    background: #f7fafd; border: 1px solid #e6eef7; border-radius: 10px;
    padding: 12px 14px; font-size: 12.5px; color: var(--text-2); line-height: 1.6;
}
.modal-note.warn { background: #fffaf0; border-color: #f6e3c0; }

/* 轻提示 */
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
    min-width: 240px; max-width: 380px; padding: 12px 16px; border-radius: 10px;
    background: #fff; box-shadow: 0 10px 30px rgba(15, 30, 45, 0.16);
    border: 1px solid var(--border); border-left: 4px solid var(--accent);
    font-size: 13px; color: var(--text); display: flex; align-items: flex-start; gap: 10px;
    animation: toastIn 260ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--yellow); }
.toast i { margin-top: 2px; }
.toast.success i { color: var(--green); }
.toast.error i { color: var(--red); }
.toast.warning i { color: var(--yellow); }
.toast.info i { color: var(--accent); }
.toast.out { animation: toastOut 220ms ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

/* 标签页 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 20px; background: #fbfcfe; flex-wrap: wrap; }
.tab {
    padding: 12px 14px; font-size: 13px; color: var(--text-2); cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all var(--ease);
    display: flex; align-items: center; gap: 7px; font-weight: 500;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* 汇总条 */
.summary-strip { display: flex; gap: 26px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.summary-strip .item .lbl { font-size: 11.5px; color: var(--text-3); }
.summary-strip .item .val { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; font-variant-numeric: tabular-nums; }
.summary-strip .item .val.green { color: var(--green); }
.summary-strip .item .val.red { color: var(--red); }
.summary-strip .item .val.blue { color: var(--accent); }

/* 报表 */
.report-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.mini-kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 13px 15px; }
.mini-kpi .lbl { font-size: 11.5px; color: var(--text-3); }
.mini-kpi .val { font-size: 19px; font-weight: 700; letter-spacing: -0.3px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.mini-kpi .val.blue { color: var(--accent); }
.mini-kpi .val.green { color: var(--green); }
.mini-kpi .val.orange { color: #c96a0a; }

.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row .top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; gap: 10px; }
.bar-row .top .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .top .vl { color: var(--text-2); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.bar-track { height: 6px; border-radius: 3px; background: #f0f4f8; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #0078d4, #40c4ff); }
.bar-fill.green { background: linear-gradient(90deg, #107c10, #4ade80); }
.bar-fill.orange { background: linear-gradient(90deg, #c96a0a, #fbbf24); }

/* 提示条 */
.notice {
    display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px;
    border-radius: 10px; font-size: 12.5px; line-height: 1.6;
    background: var(--accent-soft); color: var(--text-2); border: 1px solid rgba(0, 120, 212, 0.14);
    margin-bottom: 14px;
}
.notice i { color: var(--accent); margin-top: 2px; }

/* 页脚 */
.page-foot { text-align: center; padding: 24px 0 8px; font-size: 11.5px; color: #aab4bf; }

/* ============================ 响应式 ============================ */
@media (max-width: 1280px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid, .report-grid { grid-template-columns: 1fr; }
    .doc-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; }
    body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar-mask {
        display: block; position: fixed; inset: 0; z-index: 190;
        background: rgba(15, 30, 45, 0.32); backdrop-filter: blur(2px);
    }
    .main { margin-left: 0; }
    .menu-btn { display: flex; }
    .topbar-date { display: none; }
}
@media (max-width: 768px) {
    .content { padding: 16px 14px 32px; }
    .topbar { padding: 0 14px; }
    .topbar-crumb { display: none; }
    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .kpi { padding: 14px; }
    .kpi-val { font-size: 21px; }
    .panel-body { padding: 16px; }
    .toolbar { padding: 12px 14px; }
    .toolbar .search-box { flex: 1; }
    .toolbar .search-box .input { width: 100%; }
    .toolbar-left, .toolbar-right { width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
    .doc-meta { grid-template-columns: 1fr 1fr; gap: 10px; }
    .doc-info-grid { grid-template-columns: 1fr; padding: 16px 18px; }
    .doc-view-head, .doc-items, .doc-view-foot { padding-left: 16px; padding-right: 16px; }
    .doc-items { overflow-x: auto; }
    .doc-summary { gap: 16px; }
    .toast-stack { left: 14px; right: 14px; }
    .toast { max-width: none; }
    .welcome h2 { font-size: 19px; }
    .welcome .quick { width: 100%; }
    .mini-kpis { grid-template-columns: 1fr; }
    .todo-grid { grid-template-columns: 1fr 1fr; }
    .modal-overlay { padding: 12px; }
    .modal-body { padding: 16px; }
    .login-card { padding: 30px 22px 24px; }
}
@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .doc-meta { grid-template-columns: 1fr; }
    .summary-strip { gap: 16px; }
}

/* ============================ 打印 ============================ */
@media print {
    body { background: #fff; }
    .sidebar, .topbar, .page-foot, .toast-stack, .no-print { display: none !important; }
    .main { margin-left: 0 !important; }
    .content { padding: 0 !important; max-width: none; }
    .doc-view { border: none; box-shadow: none; }
    .doc-view-head { padding-top: 0; }
    table.grid thead th { background: #f5f5f5 !important; -webkit-print-color-adjust: exact; }
}

/* ============================ 状态标签 ============================ */
.tag-green { background: rgba(34, 160, 107, 0.14); color: #1f8a5b; }
.tag-red { background: rgba(192, 57, 43, 0.14); color: #c0392b; }
.tag-gold { background: rgba(198, 150, 52, 0.16); color: #b8860b; }
.tag-blue { background: rgba(0, 120, 212, 0.12); color: #0078d4; }

/* ============================ 动效层 ============================ */
@keyframes erpFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}
@keyframes erpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes erpPop {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to { opacity: 1; transform: none; }
}
@keyframes erpShine {
    from { transform: translateX(-130%) skewX(-18deg); }
    to { transform: translateX(240%) skewX(-18deg); }
}
@keyframes erpFloatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes erpBarGrowX {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}
@keyframes erpPulseRing {
    0% { box-shadow: 0 0 0 0 rgba(0, 120, 212, 0.34); }
    70% { box-shadow: 0 0 0 9px rgba(0, 120, 212, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 120, 212, 0); }
}
@keyframes erpOrbA {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(36px, 28px, 0) scale(1.08); }
}
@keyframes erpOrbB {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-30px, -24px, 0) scale(1.1); }
}

/* 路由切换：内容区逐块上浮 */
.content > * { animation: erpFadeUp 0.44s cubic-bezier(0.22, 1, 0.36, 1) both; }
.content > *:nth-child(1) { animation-delay: 0.02s; }
.content > *:nth-child(2) { animation-delay: 0.07s; }
.content > *:nth-child(3) { animation-delay: 0.12s; }
.content > *:nth-child(4) { animation-delay: 0.17s; }
.content > *:nth-child(5) { animation-delay: 0.21s; }
.content > *:nth-child(6) { animation-delay: 0.25s; }
.content > *:nth-child(7) { animation-delay: 0.28s; }
.content > *:nth-child(8) { animation-delay: 0.31s; }

/* KPI 卡片：依次浮现 + 悬停光泽 + 图标轻弹 */
.kpi { animation: erpFadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.kpi:nth-child(1) { animation-delay: 0.08s; }
.kpi:nth-child(2) { animation-delay: 0.15s; }
.kpi:nth-child(3) { animation-delay: 0.22s; }
.kpi:nth-child(4) { animation-delay: 0.29s; }
.kpi:nth-child(5) { animation-delay: 0.35s; }
.kpi:nth-child(6) { animation-delay: 0.4s; }
.kpi::before {
    content: ''; position: absolute; top: 0; left: 0; width: 46%; height: 100%;
    pointer-events: none; opacity: 0;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.75) 50%, transparent 100%);
    transform: translateX(-130%) skewX(-18deg);
}
.kpi:hover::before { opacity: 1; animation: erpShine 0.85s ease; }
.kpi-icon { transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s var(--ease); }
.kpi:hover .kpi-icon { transform: translateY(-3px) scale(1.07); }
.kpi:hover .kpi-val { color: var(--accent); transition: color 0.25s var(--ease); }

/* 面板 */
.panel { animation: erpFadeUp 0.46s cubic-bezier(0.22, 1, 0.36, 1) both; transition: box-shadow var(--ease), border-color var(--ease); }
.panel:hover { box-shadow: var(--shadow-md); border-color: rgba(0, 120, 212, 0.14); }

/* 表格行渐入与悬停高亮 */
table.grid tbody tr { animation: erpFadeIn 0.32s ease both; }
table.grid tbody tr:nth-child(1) { animation-delay: 0.02s; }
table.grid tbody tr:nth-child(2) { animation-delay: 0.05s; }
table.grid tbody tr:nth-child(3) { animation-delay: 0.08s; }
table.grid tbody tr:nth-child(4) { animation-delay: 0.11s; }
table.grid tbody tr:nth-child(5) { animation-delay: 0.14s; }
table.grid tbody tr:nth-child(6) { animation-delay: 0.16s; }
table.grid tbody tr:nth-child(7) { animation-delay: 0.18s; }
table.grid tbody tr:nth-child(8) { animation-delay: 0.2s; }

/* 图表条形生长 */
.bar-fill { transform-origin: left center; animation: erpBarGrowX 0.85s cubic-bezier(0.22, 1, 0.36, 1) both; }
.bar-row:nth-child(2) .bar-fill { animation-delay: 0.06s; }
.bar-row:nth-child(3) .bar-fill { animation-delay: 0.12s; }
.bar-row:nth-child(4) .bar-fill { animation-delay: 0.18s; }
.bar-row:nth-child(5) .bar-fill { animation-delay: 0.24s; }

/* 侧边栏导航 */
.nav-item { transition: background var(--ease), color var(--ease); }
.nav-item:hover { transform: none; }
.nav-item:active { transform: scale(0.99); }
.badge-dot { animation: erpPulseRing 2.4s ease-out infinite; }

/* 按钮：按下回弹 + 主按钮流光 */
.btn { transition: background var(--ease), color var(--ease), border-color var(--ease), transform 0.16s var(--ease), box-shadow var(--ease); }
.btn:active { transform: scale(0.97); }
.btn-primary, .login-form .btn-login { position: relative; overflow: hidden; }
.btn-primary::after {
    content: ''; position: absolute; top: 0; left: 0; width: 42%; height: 100%;
    pointer-events: none; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: translateX(-130%) skewX(-18deg);
}
.btn-primary:hover::after { animation: erpShine 0.75s ease; }

/* 弹窗 */
.modal-overlay.show .modal-card { animation: erpPop 0.28s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* 列表项 */
.top-item, .todo-item, .bar-row { animation: erpFadeIn 0.36s ease both; }

/* 标签 */
.tag { transition: transform 0.2s var(--ease), background var(--ease); }
.tag:hover { transform: translateY(-1px); background: var(--accent-soft); color: var(--accent); }

/* 登录页：缓慢漂移光斑 */
.login-screen::before,
.login-screen::after {
    content: ''; position: absolute; border-radius: 50%; pointer-events: none;
    filter: blur(56px); z-index: 0;
}
.login-screen::before {
    width: 420px; height: 420px; top: -90px; left: -70px;
    background: rgba(0, 120, 212, 0.2); animation: erpOrbA 11s ease-in-out infinite;
}
.login-screen::after {
    width: 360px; height: 360px; bottom: -100px; right: -60px;
    background: rgba(64, 196, 255, 0.2); animation: erpOrbB 13s ease-in-out infinite;
}
.login-card { z-index: 1; }
.login-brand img { animation: erpFloatY 5.5s ease-in-out infinite; }

/* 数字/图标点缀 */
.kpi-val { transition: color 0.25s var(--ease); }

/* 无障碍：尊重系统减少动效设置 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ============================================================
   个性化设置（我的偏好）
   ============================================================ */
.pref-section { margin-bottom: 20px; }
.pref-section:last-of-type { margin-bottom: 0; }
.pref-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.pref-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.pref-grid.mode { max-width: 560px; }
.pref-grid.bg { max-width: 660px; }
.pref-tile {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 13px; min-width: 104px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-md);
    background: var(--card); color: var(--text-2); font-size: 13px;
    cursor: pointer; user-select: none;
    transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease), background var(--ease), color var(--ease);
}
.pref-tile:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pref-tile.active {
    border-color: var(--accent); background: var(--accent-soft); color: var(--accent);
    font-weight: 600; box-shadow: 0 0 0 2px var(--accent-soft);
}
.pref-tile .pv { width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto; border: 1px solid var(--border); }
.pv-light { background: linear-gradient(135deg, #ffffff, #e9eff5); }
.pv-dark { background: linear-gradient(135deg, #3a4249, #101418); }
.pv-auto { background: linear-gradient(135deg, #ffffff 0 50%, #23292f 50% 100%); }
.pv-default { background: linear-gradient(135deg, #eef3f8, #f8fafc); }
.pv-aurora { background: linear-gradient(135deg, #d9ecff, #e9ddff 50%, #ffe4f0); }
.pv-mesh {
    background-color: #fdfefe;
    background-image: linear-gradient(#e2e9f0 1px, transparent 1px), linear-gradient(90deg, #e2e9f0 1px, transparent 1px);
    background-size: 7px 7px;
}
.pv-paper { background: repeating-linear-gradient(45deg, #f8f2e2, #f8f2e2 4px, #f2ebd8 4px, #f2ebd8 8px); }
.pv-warm { background: linear-gradient(135deg, #fff5e6, #ffe0bd); }

.pref-colors { display: flex; flex-wrap: wrap; gap: 10px; }
.pref-color {
    width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
    border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border-strong);
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.pref-color:hover { transform: scale(1.09); }
.pref-color.active { box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-soft); }

.pref-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.pref-switch input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* ---------------- 背景主题 ---------------- */
html[data-bg="aurora"] body {
    background-color: #f2f6fb;
    background-image:
        radial-gradient(circle at 12% 8%, rgba(160, 210, 255, 0.55) 0%, transparent 42%),
        radial-gradient(circle at 88% 14%, rgba(208, 190, 255, 0.5) 0%, transparent 44%),
        radial-gradient(circle at 62% 92%, rgba(255, 214, 232, 0.55) 0%, transparent 46%);
    background-attachment: fixed;
}
html[data-bg="mesh"] body {
    background-color: #f4f7fa;
    background-image:
        linear-gradient(rgba(15, 42, 67, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 42, 67, 0.045) 1px, transparent 1px);
    background-size: 26px 26px;
}
html[data-bg="paper"] body {
    background-color: #fbf7ee;
    background-image: repeating-linear-gradient(0deg, rgba(140, 110, 60, 0.05) 0 1px, transparent 1px 28px);
}
html[data-bg="warm"] body {
    background-color: #fff7ec;
    background-image: radial-gradient(circle at 82% 0%, rgba(255, 206, 140, 0.45) 0%, transparent 52%);
    background-attachment: fixed;
}

/* ---------------- 深色模式 ---------------- */
html[data-theme="dark"] {
    --bg: #202020;
    --bg-alt: #272727;
    --card: #2b2b2b;
    --card-mica: rgba(43, 43, 43, 0.82);
    --text: #ffffff;
    --text-2: #c8c8c8;
    --text-3: #9a9a9a;
    --border: rgba(255, 255, 255, 0.0698);
    --border-strong: rgba(255, 255, 255, 0.16);
    --mica: rgba(32, 32, 32, 0.84);
    --mica-strong: rgba(38, 38, 38, 0.92);
    --acrylic: rgba(44, 44, 44, 0.9);
    --hover-fill: rgba(255, 255, 255, 0.0605);
    --pressed-fill: rgba(255, 255, 255, 0.0419);
    --subtle-fill: rgba(255, 255, 255, 0.0419);
    --divider: rgba(255, 255, 255, 0.0837);
    --topbar-border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.62);
    color-scheme: dark;
}
html[data-theme="dark"] body { background: var(--bg); color: var(--text); }
html[data-theme="dark"] .topbar { background: rgba(24, 28, 32, 0.85); border-bottom-color: var(--border); }
html[data-theme="dark"] .panel-head { background: linear-gradient(180deg, #23282e, #1f2429); }
html[data-theme="dark"] .panel-foot { background: #1b2025; }
html[data-theme="dark"] table.grid thead th { background: #23282f; }
html[data-theme="dark"] table.grid tbody tr:hover { background: #23282f; }
html[data-theme="dark"] .input,
html[data-theme="dark"] .select,
html[data-theme="dark"] textarea.input { background: #1a1e23; color: var(--text); }
html[data-theme="dark"] .input::placeholder { color: #6b7480; }
html[data-theme="dark"] .modal-card { background: var(--card); color: var(--text); }
html[data-theme="dark"] .btn-ghost { background: #242a30; }
html[data-theme="dark"] .tag { background: #2a3037; }
html[data-theme="dark"] .kpi-trend { background: #262c32; }
html[data-theme="dark"] .pref-color { border-color: #1e2328; }
html[data-theme="dark"] .pref-tile.active { background: rgba(255, 255, 255, 0.08); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06); }

/* ---------------- 紧凑模式 ---------------- */
html.compact table.grid thead th,
html.compact table.grid tbody td { padding: 6px 9px; }
html.compact .panel-body { padding: 14px; }
html.compact .panel-head { padding: 11px 16px; }
html.compact .kpi { padding: 12px 14px; }
html.compact .kpi-val { font-size: 21px; }
html.compact .form-grid { gap: 10px 12px; }
html.compact { --topbar-h: 54px; }

/* ============================================================
   系统设置（左侧导航 + 内容区）
   ============================================================ */
.sys-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.sys-side {
    position: sticky; top: calc(var(--topbar-h) + 12px);
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px; box-shadow: var(--shadow-sm);
}
.sys-side-head {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; color: var(--text-2);
    padding: 6px 8px 10px;
}
.sys-nav {
    display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
    padding: 9px 10px; border: 0; border-radius: 10px; background: transparent;
    color: var(--text-2); cursor: pointer; transition: background var(--ease), color var(--ease);
}
.sys-nav i { font-size: 13px; margin-top: 2px; color: var(--text-3); transition: color var(--ease); }
.sys-nav span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sys-nav b { font-size: 13px; font-weight: 600; }
.sys-nav small { font-size: 11px; color: var(--text-3); }
.sys-nav:hover { background: var(--accent-soft); color: var(--accent); }
.sys-nav:hover i, .sys-nav:hover small { color: var(--accent); }
.sys-nav.active { background: var(--accent-soft); color: var(--accent); }
.sys-nav.active i { color: var(--accent); }
.sys-nav.active b { font-weight: 700; }
.sys-main { min-width: 0; }

.sys-tip {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 11px 14px; margin-bottom: 14px;
    border-radius: 10px; background: var(--accent-soft);
    font-size: 12.5px; line-height: 1.75; color: var(--text-2);
}
.sys-tip > i { color: var(--accent); font-size: 13px; margin-top: 3px; flex: 0 0 auto; }
.sys-tip b { color: var(--text); }
.sys-tip.warn { background: var(--yellow-soft); }
.sys-tip.warn > i { color: var(--yellow); }
.sys-inline-btn { margin-left: 8px; vertical-align: middle; }

.sys-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 12px; }
.sys-card {
    border: 1px solid var(--border); border-radius: 12px; padding: 14px;
    background: var(--card); transition: box-shadow var(--ease), border-color var(--ease), transform var(--ease);
}
.sys-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }
.sys-card-wide { grid-column: 1 / -1; }
.sys-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sys-avatar {
    width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px;
    display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent);
    font-size: 15px; font-weight: 700;
}
.sys-avatar.admin { background: var(--purple-soft); color: var(--purple); }
.sys-card-id { min-width: 0; }
.sys-card-title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.sys-card-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.sys-card-meta {
    display: flex; flex-wrap: wrap; gap: 4px 14px;
    font-size: 12px; color: var(--text-2); margin-bottom: 10px;
}
.sys-card-meta i { color: var(--text-3); margin-right: 5px; font-size: 11px; }
.sys-bar { height: 6px; border-radius: 4px; background: var(--bg-alt); overflow: hidden; margin-bottom: 12px; }
.sys-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width 0.3s var(--ease); }
.sys-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sys-card-note { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-3); }

.sys-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sys-step {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg-alt); font-size: 12.5px;
}
.sys-step.off { opacity: 0.62; }
.sys-step-no { font-weight: 600; color: var(--accent); }
.sys-step-role { color: var(--text); }
.sys-step-arrow { color: var(--text-3); font-size: 10px; transform: rotate(-90deg); }

.sys-empty { text-align: center; padding: 42px 20px 34px; color: var(--text-3); }
.sys-empty > i { font-size: 34px; color: var(--border-strong); margin-bottom: 12px; display: block; }
.sys-empty h4 { font-size: 14.5px; color: var(--text-2); margin-bottom: 6px; }
.sys-empty p { font-size: 12.5px; line-height: 1.75; max-width: 460px; margin: 0 auto 16px; }

.sys-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.sys-choice-item {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px;
    cursor: pointer; transition: border-color var(--ease), background var(--ease);
}
.sys-choice-item input { margin-top: 3px; accent-color: var(--accent); }
.sys-choice-item b { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.sys-choice-item small { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.sys-choice-item.active { border-color: var(--accent); background: var(--accent-soft); }

.sys-perm { display: grid; gap: 10px; }
.sys-perm-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 12px; border: 1px dashed var(--border-strong); border-radius: 9px;
    background: var(--bg-alt);
}
.sys-perm-total { font-size: 12px; color: var(--text-3); }
.sys-perm-bulk {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    font-size: 12.5px; font-weight: 600; color: var(--text-2); user-select: none;
}
.sys-perm-bulk input { accent-color: var(--accent); cursor: pointer; margin: 0; }
.sys-perm-groups { display: grid; gap: 10px; }
.sys-perm-group { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.sys-perm-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 9px;
}
.sys-perm-all { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; font-size: 12px; color: var(--text-3); cursor: pointer; }
.sys-perm-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(188px, 1fr)); gap: 8px 12px; }
.sys-perm-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.sys-perm-item input, .sys-perm-all input { accent-color: var(--accent); cursor: pointer; }
.sys-perm-foot { margin-top: 14px; font-size: 12.5px; color: var(--text-2); }
.sys-perm-foot b { color: var(--accent); }

@media (max-width: 900px) {
    .sys-layout { grid-template-columns: 1fr; }
    .sys-side { position: static; display: flex; gap: 6px; overflow-x: auto; padding: 8px; }
    .sys-side-head { display: none; }
    .sys-nav { flex: 0 0 auto; min-width: 132px; }
    .sys-nav small { display: none; }
}
html[data-theme="dark"] .sys-step { background: #23282f; }
html[data-theme="dark"] .sys-bar { background: #23282f; }
html[data-theme="dark"] .sys-tip { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .sys-nav:hover,
html[data-theme="dark"] .sys-nav.active,
html[data-theme="dark"] .sys-choice-item.active { background: rgba(255, 255, 255, 0.08); }

/* ============================ AI 低代码 · 功能工厂 ============================ */
.lc-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    padding: 26px 28px;
    margin-bottom: 16px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 12%, rgba(120, 220, 255, 0.42) 0%, transparent 46%),
        radial-gradient(circle at 8% 88%, rgba(124, 58, 237, 0.55) 0%, transparent 52%),
        linear-gradient(135deg, #0b5cab 0%, #0078d4 46%, #5b2ec4 100%);
    box-shadow: 0 14px 34px rgba(0, 78, 160, 0.24);
}
.lc-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: 0.5;
    pointer-events: none;
}
.lc-hero-main { position: relative; z-index: 1; max-width: 920px; }
.lc-pill {
    display: inline-flex; align-items: center; gap: 6px;
    height: 26px; padding: 0 12px; border-radius: 20px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 12px; letter-spacing: 0.4px;
}
.lc-hero h2 { margin: 12px 0 6px; font-size: 23px; font-weight: 650; letter-spacing: 0.2px; }
.lc-hero p { font-size: 13px; line-height: 1.7; color: rgba(255, 255, 255, 0.86); max-width: 760px; }
.lc-ask { margin-top: 16px; background: rgba(255, 255, 255, 0.97); border-radius: 14px; padding: 10px; box-shadow: 0 8px 26px rgba(4, 40, 80, 0.22); }
.lc-ask textarea {
    width: 100%; border: 0; outline: 0; resize: vertical; min-height: 62px;
    font-family: inherit; font-size: 14px; line-height: 1.7; color: #1f1f1f; background: transparent;
    padding: 6px 8px;
}
.lc-ask textarea::placeholder { color: #9aa4ae; }
.lc-ask-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 4px 6px 2px; border-top: 1px solid rgba(0, 0, 0, 0.06); margin-top: 4px; }
.lc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.lc-chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 28px; padding: 0 11px; border-radius: 16px; cursor: pointer;
    border: 1px solid rgba(0, 120, 212, 0.22); background: rgba(0, 120, 212, 0.07);
    color: #0b5cab; font-size: 12.5px; transition: all var(--ease);
}
.lc-chip:hover { background: rgba(0, 120, 212, 0.14); transform: translateY(-1px); }
.lc-chip i { font-size: 11.5px; }
.lc-ask-btns { display: flex; gap: 8px; }
.lc-ask-btns .btn-ghost { color: #0b5cab; border-color: rgba(0, 120, 212, 0.24); background: rgba(0, 120, 212, 0.04); }
.lc-hint { margin-top: 12px; font-size: 12.5px; color: rgba(255, 255, 255, 0.82); }
.lc-hint b { color: #fff; }
.lc-hint i { margin-right: 5px; }

.lc-ai-wait { display: flex; align-items: center; gap: 16px; padding: 10px 4px; }
.lc-ai-orb {
    width: 52px; height: 52px; border-radius: 50%; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 20px;
    background: linear-gradient(135deg, #0078d4, #7c3aed);
    box-shadow: 0 0 0 6px rgba(0, 120, 212, 0.12);
    animation: lcPulse 1.6s ease-in-out infinite;
}
@keyframes lcPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 120, 212, 0.12); }
    50% { transform: scale(1.06); box-shadow: 0 0 0 14px rgba(124, 58, 237, 0.08); }
}
.lc-ai-wait h4 { font-size: 14.5px; margin-bottom: 4px; }
.lc-ai-wait p { font-size: 12.5px; color: var(--text-3); }
.lc-ai-fail { display: flex; gap: 14px; align-items: flex-start; }
.lc-ai-fail > i { color: var(--yellow); font-size: 20px; margin-top: 2px; }
.lc-ai-fail h4 { font-size: 14px; margin-bottom: 4px; }
.lc-ai-fail p { font-size: 12.5px; color: var(--text-2); line-height: 1.7; }

.lc-empty { text-align: center; padding: 34px 10px; }
.lc-empty > i { font-size: 30px; color: var(--accent); opacity: 0.55; }
.lc-empty h4 { margin: 12px 0 4px; font-size: 15px; }
.lc-empty p { font-size: 12.5px; color: var(--text-3); }

.lc-app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.lc-app-card {
    display: flex; gap: 13px; align-items: flex-start;
    padding: 14px; border: 1px solid var(--border); border-radius: 14px;
    background: var(--bg-alt); transition: all var(--ease);
}
.lc-app-card:hover { border-color: rgba(0, 120, 212, 0.36); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.lc-app-icon {
    width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; color: #fff;
    background: linear-gradient(135deg, #0078d4, #5b8def);
}
.lc-app-icon.sm { width: 34px; height: 34px; font-size: 14px; border-radius: 10px; }
.lc-app-icon.lg { width: 52px; height: 52px; font-size: 21px; border-radius: 15px; }
.lc-app-body { min-width: 0; flex: 1; }
.lc-app-name { display: flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 620; }
.lc-app-intro { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-app-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 11.5px; color: var(--text-3); }
.lc-app-meta i { margin-right: 4px; }
.lc-app-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; flex: 0 0 auto; }
.lc-app-actions .btn { white-space: nowrap; }

.lc-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.lc-tpl {
    display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
    padding: 14px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--bg-alt); cursor: pointer; text-align: left; transition: all var(--ease);
}
.lc-tpl:hover { border-color: var(--accent); background: var(--accent-soft); }
.lc-tpl i { color: var(--accent); font-size: 17px; }
.lc-tpl b { font-size: 13.5px; }
.lc-tpl small { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }

.lc-draft { margin-bottom: 16px; }
.lc-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 16px; margin-bottom: 6px; }
.lc-icon-row { display: flex; align-items: center; gap: 10px; }
.lc-icon-row .input { flex: 1; }
.lc-section-title {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: 18px 0 10px; padding-top: 14px; border-top: 1px dashed var(--border);
    font-size: 13px; font-weight: 620;
}
.lc-section-title > i { color: var(--accent); }
.lc-section-title > span { font-weight: 400; font-size: 12px; color: var(--text-3); }
.lc-section-title .btn { margin-left: auto; }
.lc-field-table .input, .lc-field-table .select { height: 32px; font-size: 12.5px; }
.lc-field-table td { vertical-align: middle; }
.lc-opt-col { min-width: 150px; }
.lc-roles { display: flex; gap: 16px; flex-wrap: wrap; }
.lc-check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.lc-check input { accent-color: var(--accent); cursor: pointer; }
.lc-refine {
    display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--bg-alt);
}
.lc-refine > i { color: var(--accent); }
.lc-refine .input { flex: 1; border: 0; background: transparent; }
.lc-save-tip { margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.lc-danger { color: var(--red); }
.lc-muted { color: var(--text-3); }

.lc-nav-count {
    margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9px; background: var(--accent-soft); color: var(--accent);
    font-size: 10.5px; font-weight: 600;
}

.lc-app-head {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.lc-app-head-main { display: flex; align-items: center; gap: 14px; }
.lc-app-head h2 { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 650; }
.lc-app-head p { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.lc-app-head-actions { display: flex; gap: 8px; }

.lc-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.lc-kpi-card {
    position: relative; padding: 14px 16px; border-radius: 14px;
    background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.lc-kpi-icon {
    width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    font-size: 13px; margin-bottom: 9px;
}
.lc-kpi-icon.blue { background: var(--accent-soft); color: var(--accent); }
.lc-kpi-icon.green { background: var(--green-soft); color: var(--green); }
.lc-kpi-icon.orange { background: var(--yellow-soft); color: var(--yellow); }
.lc-kpi-value { font-size: 21px; font-weight: 640; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.lc-kpi-label { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.lc-kpi-foot { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.lc-kpi-card.bars { display: flex; flex-direction: column; justify-content: space-between; }
.lc-bars { display: flex; align-items: flex-end; gap: 6px; height: 56px; margin-top: 8px; }
.lc-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.lc-bar > i { display: block; width: 100%; max-width: 22px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #5b8def, #0078d4); min-height: 6px; }
.lc-bar > span { font-size: 9.5px; color: var(--text-3); white-space: nowrap; }

@media (max-width: 900px) {
    .lc-hero { padding: 20px 16px; }
    .lc-hero h2 { font-size: 19px; }
    .lc-app-grid { grid-template-columns: 1fr; }
    .lc-app-card { flex-wrap: wrap; }
    .lc-app-actions { flex-direction: row; width: 100%; }
    .lc-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lc-ask-btns { width: 100%; justify-content: flex-end; }
}
html[data-theme="dark"] .lc-ask { background: rgba(30, 35, 40, 0.98); }
html[data-theme="dark"] .lc-ask textarea { color: var(--text); }
html[data-theme="dark"] .lc-chip { color: #7cc3ff; }

/* ============================ 官网商城联动 ============================ */
.mall-section { padding: 18px 20px; }
.mall-section-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin: 4px 0 12px;
}
.mall-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mall-stat {
    display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
    border-radius: 14px; background: #f3f6f9; color: var(--text-2);
    font-size: 12.5px; white-space: nowrap; border: 1px solid transparent;
}
.mall-stat b { color: var(--text); font-weight: 640; font-variant-numeric: tabular-nums; }
.mall-stat.success { background: var(--green-soft); color: var(--green); }
.mall-stat.success b { color: var(--green); }
.mall-stat.warning { background: var(--yellow-soft); color: var(--yellow); }
.mall-stat.warning b { color: var(--yellow); }
.mall-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mall-alert { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 16px; }
.mall-alert > i { margin-top: 2px; }
.mall-note {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 12px 20px 16px; font-size: 12px; line-height: 1.65; color: var(--text-3);
}
.mall-note > i { margin-top: 3px; color: var(--accent); flex: none; }
table.grid th.pick-col, table.grid td.pick-col { width: 44px; padding-left: 16px; padding-right: 4px; text-align: center; }
input.pick { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
table.grid tbody tr.is-selected { background: var(--accent-soft); }
table.grid tbody tr.is-selected:hover { background: var(--accent-soft-2); }
.pick-summary { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.pick-summary b {
    color: var(--accent); font-weight: 640;
    font-variant-numeric: tabular-nums; padding: 0 1px;
}
.tabs .tab i { margin-right: 6px; font-size: 12px; }

@media (max-width: 900px) {
    .mall-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mall-section { padding: 14px 12px; }
    .mall-note { padding: 10px 12px 14px; }
}
html[data-theme="dark"] .mall-stat { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .mall-alert { background: rgba(157, 93, 0, 0.16); border-color: rgba(157, 93, 0, 0.35); }
html[data-theme="dark"] table.grid tbody tr.is-selected { background: rgba(0, 120, 212, 0.16); }

/* 联动范围说明 */
.mall-scope-note {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; margin-bottom: 16px; border-radius: 10px;
    background: var(--accent-soft); border: 1px solid var(--accent-soft-2);
    color: var(--text-2); font-size: 12.5px; line-height: 1.75;
}
.mall-scope-note > i { margin-top: 4px; color: var(--accent); flex: none; }
.mall-scope-note b { color: var(--text); }
.mall-scope-tag {
    display: inline-block; margin: 0 4px 2px 0; padding: 1px 8px;
    border-radius: 10px; background: var(--card); border: 1px solid var(--border);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px; color: var(--text);
}
.mall-scope-sub { margin-top: 5px; font-size: 12px; color: var(--text-3); }
html[data-theme="dark"] .mall-scope-note { background: rgba(0, 120, 212, 0.12); border-color: rgba(0, 120, 212, 0.3); }
html[data-theme="dark"] .mall-scope-tag { background: rgba(255, 255, 255, 0.06); }
