:root{
  --blue-50:#E6F1FB; --blue-100:#B5D4F4; --blue-600:#185FA5; --blue-800:#0C447C;
  --bg:#F5F7FA; --card:#FFFFFF; --text:#1F2937; --muted:#6B7280; --border:#E5E7EB;
  --ok:#16A34A; --ok-bg:#ECFDF5; --warn:#D97706; --warn-bg:#FFFBEB; --danger:#DC2626;
  --radius:12px; --shadow:0 1px 3px rgba(15,23,42,.08);
}
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:"PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;background:var(--bg);color:var(--text);font-size:14px;line-height:1.65}
.hidden{display:none!important}
.muted{color:var(--muted)}
b{font-weight:600}

/* ---------- 按钮 ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:none;cursor:pointer;border-radius:8px;padding:9px 16px;font-size:14px;font-weight:500;font-family:inherit;transition:.18s;text-decoration:none}
.btn-primary{background:var(--blue-600);color:#fff}
.btn-primary:hover{background:var(--blue-800)}
.btn-outline{background:#fff;color:var(--blue-600);border:1px solid var(--blue-100)}
.btn-outline:hover{background:var(--blue-50)}
.btn-ghost{background:rgba(255,255,255,.08);color:#C7D2E5}
.btn-ghost:hover{background:rgba(255,255,255,.18);color:#fff}
.btn-sm{padding:6px 12px;font-size:13px}
.btn-block{width:100%;padding:11px}
.btn:disabled{opacity:.6;cursor:not-allowed}

/* ---------- 登录 ---------- */
/* 登录页（视频背景版）样式已迁移至 login.css；此处仅保留主应用与弹窗共用的基础样式 */
.brand-mark{width:42px;height:42px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex:none;overflow:hidden}
.brand-mark img{width:100%;height:100%;object-fit:contain;display:block}
.field{display:block;margin-bottom:14px}
.field>span{display:block;font-size:12px;color:var(--muted);margin-bottom:6px}
.field input,.field select{width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:9px;font-size:14px;font-family:inherit;background:#fff;color:var(--text);outline:none;transition:.18s}
.field input:focus,.field select:focus{border-color:var(--blue-100);box-shadow:0 0 0 3px rgba(24,95,165,.10)}
.login-err{color:var(--danger);font-size:12px;min-height:18px;margin:2px 0 8px}

/* ---------- 布局 ---------- */
.app{display:flex;min-height:100vh}
/* 左侧导航：#FFEDA0 底色，默认折叠，鼠标移到屏幕最左侧时滑出，移出后自动收回 */
.side{width:230px;flex:none;background:#FFFFFF;display:flex;flex-direction:column;position:fixed;top:0;left:0;bottom:0;z-index:30;
  transition:transform .22s ease;box-shadow:1px 0 8px rgba(122,92,0,.10);border-right:1px solid rgba(122,92,0,.10)}
body.nav-collapsed .side{transform:translateX(-100%)}
body.nav-collapsed .main{margin-left:0}
.side-hover-zone{position:fixed;left:0;top:0;bottom:0;width:16px;z-index:40;display:none}
body.nav-collapsed .side-hover-zone{display:block}
.side-brand{display:flex;align-items:center;gap:10px;padding:18px 16px 16px;border-bottom:1px solid rgba(122,92,0,.18)}
.side-brand .brand-mark{width:32px;height:32px;border-radius:9px}
.side-title b{display:block;color:#4A3500;font-size:13.5px;font-weight:700;line-height:1.3}
.side-title small{display:block;color:#9A8443;font-size:11px;margin-top:2px}
.side-nav{flex:1;overflow-y:auto;padding:12px 8px}
.nav-group{font-size:11px;color:#9A8443;padding:12px 12px 6px;letter-spacing:.5px}
.nav-item{display:block;padding:9px 12px;border-radius:8px;font-size:13.5px;color:#5B4A14;cursor:pointer;text-decoration:none;transition:.15s;margin-bottom:2px}
.nav-item:hover{background:rgba(122,92,0,.10);color:#2E2000}
.nav-item.on{background:rgba(185,28,28,.14);color:#B91C1C;font-weight:600}
.side-foot{padding:12px 16px 16px;border-top:1px solid rgba(122,92,0,.18)}
.who b{display:block;color:#4A3500;font-size:13px}
.who small{display:block;color:#9A8443;font-size:11px;margin-bottom:10px}
.side-foot .btn{width:100%}
.btn-ghost{background:rgba(122,92,0,.10);color:#5B4A14}
.btn-ghost:hover{background:rgba(122,92,0,.20);color:#2E2000}

/* ---------- 移动端顶栏汉堡与账号面板 ---------- */
.m-burger{display:none;align-items:center;justify-content:center;width:34px;height:34px;border:none;background:transparent;cursor:pointer;border-radius:8px;color:#4A3500;flex:none}
.m-burger svg{width:20px;height:20px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round}
.m-burger:active{background:rgba(122,92,0,.10)}
.m-sheet{display:none}
.m-sheet .m-user{padding:4px 2px 10px;border-bottom:1px solid var(--border);margin-bottom:8px}
.m-sheet .m-user b{display:block;font-size:14px;color:#4A3500}
.m-sheet .m-user small{display:block;font-size:11.5px;color:#9A8443;margin-top:2px}
.m-sheet button{display:flex;align-items:center;gap:8px;width:100%;padding:11px 10px;border:none;background:none;font-size:14px;font-family:inherit;color:#5B4A14;cursor:pointer;border-radius:8px;text-align:left}
.m-sheet button:hover{background:rgba(122,92,0,.08);color:#2E2000}
.m-sheet button + button{margin-top:2px}

.main{margin-left:230px;flex:1;min-width:0;display:flex;flex-direction:column;min-height:100vh;transition:margin-left .22s ease}
.topbar{height:56px;flex:none;background:rgba(255,255,255,.94);backdrop-filter:blur(8px);border-bottom:1px solid var(--border);
  display:flex;align-items:center;justify-content:space-between;padding:0 22px;position:sticky;top:0;z-index:20}
.crumb{font-size:13px;color:var(--muted);font-weight:500}
.top-right{display:flex;align-items:center;gap:10px}
.tag{font-size:11.5px;padding:3px 9px;border-radius:99px;background:var(--blue-50);color:var(--blue-800);font-weight:500}
.tag.admin{background:#FEF3C7;color:#92400E}
.tag.viewer{background:#F1F5F9;color:#475569}

#stage{flex:1;min-height:0;display:flex;flex-direction:column}
.view{padding:24px 26px 40px;flex:1}
.view.hidden{display:none}
.frame-view{padding:0;flex:1;display:flex}
#frame{width:100%;height:100%;min-height:calc(100vh - 56px);border:0;display:block;background:#fff}

.page-head{margin-bottom:18px}
.page-head h2{font-size:19px;font-weight:650}
.page-head p{font-size:12.5px;color:var(--muted);margin-top:4px}
.sec-title{font-size:13px;color:var(--muted);margin:24px 0 10px;font-weight:600}

/* ---------- KPI ---------- */
.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.kpi{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px 16px}
.kpi-label{font-size:12px;color:var(--muted)}
.kpi b{display:block;font-size:26px;font-weight:700;line-height:1.3;margin:2px 0 2px}
.kpi small{font-size:11.5px;color:#9AA8B8}

/* ---------- 入口卡 ---------- */
.entry-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.entry-card{text-align:left;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);
  padding:18px;cursor:pointer;font-family:inherit;transition:.18s}
.entry-card:hover{border-color:var(--blue-100);transform:translateY(-1px);box-shadow:0 6px 16px rgba(15,23,42,.08)}
.entry-card b{display:block;font-size:15px;margin-bottom:6px}
.entry-card p{font-size:12.5px;color:var(--muted);line-height:1.6;margin-bottom:10px}
.entry-card span{font-size:12.5px;color:var(--blue-600);font-weight:500}

.panel{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px 18px;margin-bottom:14px}
.panel h4{font-size:14px;margin-bottom:6px}
.panel p{font-size:13px;margin-bottom:6px}
.panel .btn{margin-top:8px}

/* ---------- 表格 ---------- */
.toolbar{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.table-wrap{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow:auto}
table{width:100%;border-collapse:collapse;font-size:13px;min-width:720px}
th,td{padding:11px 14px;text-align:left;border-bottom:1px solid var(--border);white-space:nowrap}
th{background:#FAFBFC;font-weight:600;color:var(--muted);font-size:12px}
tr:last-child td{border-bottom:none}
td select{padding:4px 8px;border:1px solid var(--border);border-radius:7px;font-size:12.5px;font-family:inherit;background:#fff}
.perm-pills{display:flex;flex-wrap:wrap;gap:5px}
.perm-pill{font-size:11.5px;padding:2px 8px;border-radius:99px;border:1px solid var(--border);color:#64748B;cursor:pointer;background:#fff}
.perm-pill.on{background:var(--blue-50);border-color:var(--blue-100);color:var(--blue-800);font-weight:600}
.row-ops{display:flex;gap:6px}
.row-ops button{font-size:12px;padding:4px 9px;border-radius:6px;border:1px solid var(--border);background:#fff;cursor:pointer;font-family:inherit;color:#475569}
.row-ops button:hover{background:#F8FAFC}
.row-ops button.danger{color:var(--danger);border-color:#FECACA}
.row-ops button.danger:hover{background:#FEF2F2}
.empty{padding:36px;text-align:center;color:var(--muted);font-size:13px}

/* ---------- 弹窗 ---------- */
.modal{position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:60;display:flex;align-items:center;justify-content:center;padding:20px}
.modal-card{width:100%;max-width:420px;background:#fff;border-radius:16px;padding:24px;box-shadow:0 24px 50px rgba(15,23,42,.22);max-height:88vh;overflow:auto}
.modal-card h3{font-size:16px;margin-bottom:16px}
.modal-ops{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}

/* ---------- 提示 ---------- */
.toast{position:fixed;left:50%;bottom:34px;transform:translate(-50%,20px);background:#0F172A;color:#fff;font-size:13px;
  padding:10px 18px;border-radius:10px;opacity:0;pointer-events:none;transition:.25s;z-index:80}
.toast.show{opacity:1;transform:translate(-50%,0)}

@media(max-width:1100px){
  .kpi-grid{grid-template-columns:repeat(2,1fr)}
  .entry-grid{grid-template-columns:1fr}
}
@media(max-width:760px){
  /* 移动端导航：固定顶栏（汉堡 + 横向滚动导航 + 账号），参照 app 顶栏样式 */
  .side-hover-zone{display:none!important}
  .side{position:fixed;top:0;left:0;right:0;bottom:auto;width:100%;height:56px;flex-direction:row;align-items:center;
    transform:none!important;background:#FFFFFF;border-bottom:1px solid var(--border);box-shadow:0 1px 4px rgba(15,23,42,.06);padding:0 4px;overflow:visible}
  .side-brand{border:none;padding:6px 6px 6px 8px;gap:6px}
  .side-title{display:none}
  .side-brand .brand-mark{width:30px;height:30px}
  .side-nav{display:flex;align-items:center;gap:2px;padding:6px 4px;overflow-x:auto;flex:1;min-width:0;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .side-nav::-webkit-scrollbar{display:none}
  .nav-item{white-space:nowrap;padding:7px 11px;font-size:13.5px;margin-bottom:0;flex:none;position:relative}
  .nav-item.on{background:none}
  .nav-item.on::after{content:'';position:absolute;left:11px;right:11px;bottom:1px;height:2px;background:#B91C1C;border-radius:2px}
  .nav-group{display:none}
  .side-foot{border:none;padding:4px 6px;display:flex;align-items:center}
  .side-foot .who{display:none}
  .side-foot .btn{width:auto;padding:6px 10px;font-size:12.5px}
  .m-burger{display:inline-flex}
  .main{margin-left:0!important;margin-top:56px}
  .topbar{top:56px;height:50px;padding:0 12px}
  #frame{min-height:calc(100vh - 106px)}
  .view{padding:14px 12px 32px}
  #stage .frame-view{padding:0}
  /* 汉堡展开的账号面板 */
  .m-sheet{display:block;position:fixed;top:56px;left:0;right:0;background:#fff;border-bottom:1px solid var(--border);
    box-shadow:0 12px 26px rgba(15,23,42,.14);z-index:70;padding:12px 14px 14px}
  .m-sheet.hidden{display:none}
  .top-right{gap:6px}
  .top-right .btn-sm{padding:5px 9px;font-size:12px}
}
@media(max-width:560px){
  .kpi-grid{grid-template-columns:repeat(2,1fr);gap:8px}
  .kpi b{font-size:21px}
  .page-head h2{font-size:17px}
  .toolbar{flex-wrap:wrap}
  .modal-card{padding:18px 16px;max-height:92vh}
  .tag{display:none}
  .crumb{font-size:12px}
  .top-right .btn-outline:first-child{display:none}
}
