/* /assets/oa.css */

/* ============ 基础变量 ============ */
:root{
  --bg0:#070a12;
  --bg1:#0b1020;
  --line:#1b2540;
  --text:#e7eaf3;
  --muted:#9aa4bd;
  --muted2:#7f8aa5;

  --primary:#6d5cff;
  --primary2:#4d8dff;
  --danger:#ff4d6d;
  --ok:#39d98a;

  --radius:14px;
  --shadow:0 18px 70px rgba(0,0,0,.45);
  --shadow2:0 10px 40px rgba(0,0,0,.35);

  --blur:14px;
  --maxw:1100px;
  --sidebar-w:260px;
}

/* ============ 全局 ============ */
*{ box-sizing:border-box; }

html,body{
  height:100%;
  margin:0;
}

body{
  margin:0;
  font-family:ui-sans-serif, system-ui, -apple-system, "PingFang SC","Microsoft YaHei", Arial, sans-serif;
  color:var(--text);
  background:
    radial-gradient(1200px 700px at 20% 10%, #16204a 0%, transparent 55%),
    radial-gradient(1200px 700px at 80% 20%, #2a1456 0%, transparent 55%),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg0) 100%);
  overflow:hidden;
}

/* ============ OA 双栏独立布局 ============ */
.shell{
  display:flex;
  height:100vh;
  overflow:hidden;
  position:relative;
  z-index:1;
}

.sidebar{
  width:var(--sidebar-w);
  height:100vh;
  flex-shrink:0;
  overflow-y:auto;
  overflow-x:hidden;
  border-right:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.04);
  backdrop-filter:blur(var(--blur));
}

.sidebar-inner{
  padding:20px 16px 24px;
  min-height:100%;
}

.main{
  flex:1;
  min-width:0;
  height:100vh;
  overflow-y:auto;
  overflow-x:hidden;
  display:flex;
  flex-direction:column;
}

.page{
  flex:1;
  min-height:0;
  padding:24px;
}

/* 背景层（兼容旧页面） */
.bg{ position:fixed; inset:0; pointer-events:none; z-index:-1; }
.glow{
  position:absolute;
  width:620px; height:620px;
  border-radius:50%;
  filter:blur(42px);
  opacity:.35;
  transform:translateZ(0);
}
.glow.g1{
  left:-180px; top:-220px;
  background:radial-gradient(circle at 30% 30%, #4d8dff, transparent 60%);
  animation:float1 10s ease-in-out infinite;
}
.glow.g2{
  right:-220px; top:-180px;
  background:radial-gradient(circle at 30% 30%, #6d5cff, transparent 60%);
  animation:float2 12s ease-in-out infinite;
}
.noise{
  position:absolute; inset:0;
  opacity:.06;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode:overlay;
}
@keyframes float1{
  0%,100%{ transform:translate(0,0) scale(1); }
  50%{ transform:translate(20px, 26px) scale(1.03); }
}
@keyframes float2{
  0%,100%{ transform:translate(0,0) scale(1); }
  50%{ transform:translate(-18px, 22px) scale(1.02); }
}

/* ============ 左侧品牌 ============ */
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:18px;
}

.mark{
  width:44px; height:44px;
  border-radius:12px;
  display:grid;
  place-items:center;
  font-weight:800;
  letter-spacing:.5px;
  color:#fff;
  background:radial-gradient(circle at 30% 30%, #7b6cff, #3b2cff 65%);
  box-shadow:0 10px 26px rgba(109,92,255,.28);
  border:1px solid rgba(255,255,255,.10);
}

.mark.logo{
  width:45px;
  height:45px;
  border-radius:8px;
  padding:5px 8px;
  overflow:hidden;
  background:rgba(255,255,255,0.06);
  box-shadow:none;
}

.mark.logo img{
  max-width:100%;
  max-height:100%;
  width:auto;
  height:auto;
  object-fit:contain;
  display:block;
  margin:auto;
}

.meta .title{
  font-size:16px;
  font-weight:800;
  line-height:1.1;
}

.meta .sub{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
}

/* ============ 侧边用户块 ============ */
.sidebar-user{
  margin-bottom:18px;
}

.sidebar-role{
  margin-top:10px;
  font-size:12px;
  color:var(--muted);
  padding-left:2px;
}

/* ============ 顶栏 ============ */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  padding:14px 18px;
  background:linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.18) 100%);
  backdrop-filter:blur(var(--blur));
  border-bottom:1px solid rgba(255,255,255,.06);
}

.topbar-inner{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.topbar-left{
  min-width:0;
}

.top-title{
  font-size:24px;
  font-weight:800;
  line-height:1.15;
}

.top-sub{
  font-size:13px;
  color:var(--muted);
  margin-top:4px;
}

.top-actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:nowrap;
  flex-shrink:0;
}

/* ============ 用户信息块 ============ */
.userchip{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border-radius:14px;
  background:rgba(15,22,42,.55);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:var(--shadow2);
}

.avatar{
  width:36px; height:36px;
  border-radius:12px;
  display:grid;
  place-items:center;
  font-weight:900;
  color:#fff;
  background:radial-gradient(circle at 30% 30%, #4d8dff, #20306a 70%);
  border:1px solid rgba(255,255,255,.10);
  flex-shrink:0;
}

.ud{ line-height:1.15; min-width:0; }
.uname{
  font-size:13px;
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.uinfo.email{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.muted{ color:var(--muted); }

/* ============ 左侧菜单 ============ */
.menu{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.menu a{
  display:block;
  text-decoration:none;
  color:#fff;
  padding:12px 14px;
  border-radius:12px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.05);
  transition:transform .12s ease, background .12s ease, border-color .12s ease;
  font-size:14px;
  font-weight:700;
}

.menu a:hover{
  background:rgba(255,255,255,.07);
  border-color:rgba(255,255,255,.10);
  transform:translateY(-1px);
}

.menu a.danger-link{
  background:rgba(255,77,109,.10);
  border-color:rgba(255,77,109,.18);
  color:#ffd0d8;
}

.menu a.danger-link:hover{
  background:rgba(255,77,109,.15);
  border-color:rgba(255,77,109,.28);
}

/* ============ 顶部按钮 ============ */
.nav{ display:flex; gap:10px; align-items:center; }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:42px;
  padding:0 16px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  color:var(--text);
  text-decoration:none;
  font-weight:800;
  font-size:12px;
  background:rgba(255,255,255,.06);
  transition:transform .12s ease, background .12s ease, border-color .12s ease;
  user-select:none;
  cursor:pointer;
}

.btn:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.08);
  border-color:rgba(255,255,255,.14);
}

.btn:active{ transform:translateY(0); }
.btn.ghost{ background:transparent; }

.btn.primary{
  background:linear-gradient(135deg, var(--primary) 0%, var(--primary2) 100%);
  border-color:rgba(255,255,255,.16);
  box-shadow:0 12px 30px rgba(109,92,255,.25);
}

.btn.primary:hover{ filter:brightness(1.03); }

.btn.danger{
  background:rgba(255,77,109,.12);
  border-color:rgba(255,77,109,.28);
  color:#ffd0d8;
}

.btn.danger:hover{ background:rgba(255,77,109,.16); }

/* ============ 表单 ============ */
.input,.select,.textarea{
  width:100%;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:#fff;
  padding:0 14px;
  outline:none;
}

.input,.select{ height:44px; }

.textarea{
  min-height:120px;
  padding:12px 14px;
  resize:vertical;
}

.select option{ color:#000; }

.form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

.field label{
  display:block;
  font-size:13px;
  color:rgba(255,255,255,.68);
  margin-bottom:8px;
}

.toolbar{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:16px;
}

/* ============ 卡片 ============ */
.card{
  position:relative;
  border-radius:var(--radius);
  background:linear-gradient(180deg, rgba(15,22,42,.78) 0%, rgba(10,14,30,.62) 100%);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:var(--shadow);
  backdrop-filter:blur(var(--blur));
  padding:20px;
  min-width:0;
}

.card::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  padding:1px;
  background:linear-gradient(135deg, rgba(77,141,255,.18), rgba(109,92,255,.16), rgba(255,255,255,.06));
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
  mask-composite:exclude;
  pointer-events:none;
}

.card.muted{
  background:linear-gradient(180deg, rgba(12,18,34,.72) 0%, rgba(10,14,30,.56) 100%);
}

/* ============ grid ============ */
.container{
  max-width:var(--maxw);
  margin:0 auto;
  padding:0;
}

.grid{
  margin-top:14px;
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
}

.grid-4{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
}

.grid-2{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

/* ============ Hero ============ */
.hero{
  display:grid;
  grid-template-columns:1.25fr .75fr;
  gap:18px;
  padding:20px;
  overflow:hidden;
  animation:pop .28s ease-out both;
}

.card.hero{ margin-bottom:14px; }

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

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:999px;
  background:rgba(57,217,138,.10);
  border:1px solid rgba(57,217,138,.24);
  color:#baf5da;
  font-weight:800;
  font-size:12px;
}

.dot{
  width:8px; height:8px;
  border-radius:50%;
  background:var(--ok);
  box-shadow:0 0 0 6px rgba(57,217,138,.14);
}

.h1{
  margin:14px 0 8px;
  font-size:24px;
  line-height:1.2;
  letter-spacing:.2px;
}

.lead{
  margin:0;
  color:var(--muted);
  line-height:1.6;
  font-size:13px;
  max-width:52ch;
}

.quick{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.hint{
  margin-top:12px;
  font-size:12px;
  color:var(--muted2);
}

.hero-right{
  display:flex;
  align-items:center;
  justify-content:center;
}

.ring{
  width:210px; height:210px;
  border-radius:50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 60%),
    conic-gradient(from 180deg, rgba(77,141,255,.9), rgba(109,92,255,.9), rgba(77,141,255,.9));
  padding:10px;
  filter:drop-shadow(0 24px 40px rgba(0,0,0,.45));
}

.ring-inner{
  width:100%; height:100%;
  border-radius:50%;
  background:radial-gradient(circle at 30% 30%, rgba(255,255,255,.10), rgba(10,14,30,.85) 70%);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,.08);
}

.big-num{ font-size:16px; font-weight:900; letter-spacing:.2px; }
.small{ margin-top:6px; font-size:12px; color:var(--muted); }

/* ============ KPI / stats ============ */
.kpi{ padding:16px 16px 14px; }

.kpi-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:12px;
}

.kpi-title{
  font-size:12px;
  color:var(--muted);
  font-weight:800;
  letter-spacing:.2px;
}

.kpi-icon{ font-size:16px; opacity:.9; }
.kpi-value{ font-size:16px; font-weight:900; }

.kpi-sub{
  margin-top:8px;
  font-size:12px;
  color:var(--muted2);
  line-height:1.5;
}

.stat{
  padding:18px;
  border-radius:18px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
  min-width:0;
}

.stat-label{
  font-size:13px;
  color:rgba(255,255,255,.62);
}

.stat-value{
  font-size:28px;
  font-weight:800;
  margin-top:8px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* ============ 面板 ============ */
.panel{ margin-top:14px; padding:16px; }

.panel-head h2{
  margin:0;
  font-size:14px;
  font-weight:900;
}

.panel-head p{
  margin:8px 0 0;
  font-size:12px;
  color:var(--muted);
}

.panel-grid{
  margin-top:12px;
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:12px;
}

.mini{
  padding:14px;
  border-radius:12px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
}

.mini-title{ font-size:13px; font-weight:900; }

.mini-desc{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
  line-height:1.5;
}

/* ============ 表格 ============ */
.table-wrap{ overflow:auto; }

table{
  width:100%;
  border-collapse:collapse;
  min-width:900px;
}

th,td{
  padding:14px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
  text-align:left;
  vertical-align:middle;
}

th{
  color:rgba(255,255,255,.68);
  font-size:13px;
  font-weight:600;
}

td{
  font-size:14px;
  color:#fff;
}

.badge{
  display:inline-flex;
  align-items:center;
  padding:5px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.08);
  font-size:12px;
}

/* ============ 页面级居中容器 ============ */
.page-center{
  max-width:920px;
  margin:0 auto;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:16px;
}

.page-center .grid{ justify-items:center; }
.page-center .card{ width:100%; }

/* ============ 响应式 ============ */
@media (max-width: 1100px){
  :root{ --sidebar-w:220px; }
  .grid-4{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 980px){
  .hero{ grid-template-columns:1fr; }
  .hero-right{ justify-content:flex-start; }
  .ring{ width:190px; height:190px; }
  .grid{ grid-template-columns:1fr; }
  .panel-grid{ grid-template-columns:1fr; }
  .nav{ display:none; }
}

@media (max-width: 860px){
  /* 隐藏桌面侧边栏 */
  .sidebar{ display:none !important; }

  /* shell 撑满整屏 */
  .shell{ display:flex; flex-direction:column; height:100vh; overflow:hidden; }

  /* main 占剩余空间，可滚动 */
  .main{
    flex:1; min-height:0;
    overflow-y:auto; overflow-x:hidden;
    display:flex; flex-direction:column;
    padding-bottom:64px; /* 底部 tab bar 高度留白 */
  }

  /* topbar 精简 */
  .topbar{ padding:10px 14px; }
  .topbar-inner{ gap:10px; }
  .top-sub{ display:none; }
  .top-title{ font-size:18px; }
  .uinfo.email{ display:none; }

  .page{ padding:12px; }
  .grid-4,.grid-2,.form-grid{ grid-template-columns:1fr; }

  /* ── 底部 Tab Bar ── */
  .mob-tabbar{
    display:flex; /* 手机端恢复显示 */
    position:fixed;
    bottom:0; left:0; right:0;
    height:64px;
    align-items:stretch;
    background:rgba(8,12,22,.96);
    border-top:1px solid rgba(255,255,255,.08);
    backdrop-filter:blur(16px);
    z-index:1000;
    padding-bottom:env(safe-area-inset-bottom);
  }

  .mob-tab{
    flex:1;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    text-decoration:none;
    color:rgba(255,255,255,.4);
    background:none;
    border:none;
    cursor:pointer;
    font-family:inherit;
    transition:color .15s;
    -webkit-tap-highlight-color:transparent;
    padding:0;
  }

  .mob-tab:hover,
  .mob-tab.mob-tab-active{
    color:#a89dff;
  }

  .mob-tab-icon{
    font-size:20px;
    line-height:1;
    transition:transform .15s;
  }

  .mob-tab:active .mob-tab-icon{
    transform:scale(.88);
  }

  .mob-tab-label{
    font-size:10px;
    font-weight:600;
    letter-spacing:.2px;
  }

  /* ── 抽屉遮罩 ── */
  .mob-drawer-ov{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.6);
    backdrop-filter:blur(4px);
    z-index:1001;
  }
  .mob-drawer-ov.open{ display:block; }

  /* ── 抽屉菜单 ── */
  .mob-drawer{
    display:flex; /* 手机端恢复，JS控制open状态 */
    position:fixed;
    bottom:0; left:0; right:0;
    background:rgba(10,14,24,.98);
    border-top:1px solid rgba(255,255,255,.1);
    border-radius:20px 20px 0 0;
    z-index:1002;
    transform:translateY(100%);
    transition:transform .28s cubic-bezier(.22,1,.36,1);
    max-height:80vh;
    overflow:hidden;
    display:flex;
    flex-direction:column;
  }
  .mob-drawer.open{ transform:translateY(0); }

  .mob-drawer-inner{
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    padding:0 0 env(safe-area-inset-bottom);
  }

  .mob-drawer-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:16px 18px 12px;
    border-bottom:1px solid rgba(255,255,255,.07);
    position:sticky;
    top:0;
    background:rgba(10,14,24,.98);
    z-index:1;
  }

  /* 拖拽指示条 */
  .mob-drawer-head::before{
    content:'';
    position:absolute;
    top:8px; left:50%;
    transform:translateX(-50%);
    width:36px; height:4px;
    border-radius:2px;
    background:rgba(255,255,255,.15);
  }

  .mob-drawer-menu{
    padding:8px 10px;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:6px;
  }

  .mob-drawer-item{
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px 14px;
    border-radius:12px;
    background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.06);
    text-decoration:none;
    color:rgba(255,255,255,.75);
    font-size:13px;
    font-weight:600;
    transition:.15s;
    -webkit-tap-highlight-color:transparent;
  }

  .mob-drawer-item:hover,
  .mob-drawer-item.mob-tab-active{
    background:rgba(109,92,255,.14);
    border-color:rgba(109,92,255,.25);
    color:#a89dff;
  }

  .mob-drawer-icon{ font-size:18px; flex-shrink:0; }

  .mob-drawer-user{
    display:flex;
    align-items:center;
    gap:12px;
    margin:10px 10px 12px;
    padding:14px 16px;
    background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.07);
    border-radius:14px;
  }
}



@media (max-width: 520px){
  .top-title{ font-size:16px; }
  .page{ padding:10px; }
}
/* ── 手机组件默认隐藏（桌面优先）── */
.mob-tabbar{ display:none; }
.mob-drawer{ display:none; position:fixed; }
.mob-drawer-ov{ display:none; }

/* ── Badge 语义颜色（状态/优先级）──────────────────────────── */
.badge-urgent,.badge-priority-urgent{background:rgba(239,68,68,.15);color:#ef4444;border:1px solid rgba(239,68,68,.25)}
.badge-high,.badge-priority-high{background:rgba(245,158,11,.13);color:#f59e0b;border:1px solid rgba(245,158,11,.22)}
.badge-normal,.badge-priority-normal{background:rgba(59,130,246,.12);color:#60a5fa;border:1px solid rgba(59,130,246,.2)}
.badge-low,.badge-priority-low{background:rgba(100,116,139,.12);color:#94a3b8;border:1px solid rgba(100,116,139,.18)}

.badge-new{background:rgba(59,130,246,.12);color:#60a5fa;border:1px solid rgba(59,130,246,.2)}
.badge-open{background:rgba(139,92,246,.12);color:#a78bfa;border:1px solid rgba(139,92,246,.2)}
.badge-pending_user,.badge-pending-user{background:rgba(245,158,11,.13);color:#f59e0b;border:1px solid rgba(245,158,11,.22)}
.badge-pending_internal,.badge-pending-internal{background:rgba(249,115,22,.13);color:#fb923c;border:1px solid rgba(249,115,22,.22)}
.badge-resolved{background:rgba(34,197,94,.12);color:#22c55e;border:1px solid rgba(34,197,94,.2)}
.badge-closed{background:rgba(100,116,139,.12);color:#94a3b8;border:1px solid rgba(100,116,139,.18)}
.badge-rejected{background:rgba(239,68,68,.12);color:#f87171;border:1px solid rgba(239,68,68,.2)}

.badge-paid,.badge-active,.badge-online{background:rgba(34,197,94,.12);color:#22c55e;border:1px solid rgba(34,197,94,.2)}
.badge-pending{background:rgba(245,158,11,.13);color:#f59e0b;border:1px solid rgba(245,158,11,.22)}
.badge-failed,.badge-rejected,.badge-blocked{background:rgba(239,68,68,.12);color:#f87171;border:1px solid rgba(239,68,68,.2)}
.badge-refunded,.badge-cancelled,.badge-suspended{background:rgba(100,116,139,.12);color:#94a3b8;border:1px solid rgba(100,116,139,.18)}
.badge-expired{background:rgba(239,68,68,.08);color:#fca5a5;border:1px solid rgba(239,68,68,.15)}
.badge-inactive,.badge-offline{background:rgba(100,116,139,.1);color:#64748b;border:1px solid rgba(100,116,139,.15)}
.badge-maintenance{background:rgba(245,158,11,.1);color:#d97706;border:1px solid rgba(245,158,11,.18)}

/* 桌面端强制隐藏手机组件（最高优先级）*/
@media (min-width: 861px){
  body .mob-tabbar,
  body .mob-drawer,
  body .mob-drawer-ov,
  body .mob-drawer.open,
  body .mob-drawer-inner,
  body #mob-drawer,
  body #mob-ov,
  body #mob-more-btn{
    display:none !important;
    transform:translateY(100%) !important;
    visibility:hidden !important;
    opacity:0 !important;
    pointer-events:none !important;
    max-height:0 !important;
    overflow:hidden !important;
  }
}
