:root{
  --bg:#f0f0f1;
  --panel:#fff;
  --text:#1d2327;
  --muted:#646970;
  --line:#dcdcde;
  --primary:#2271b1;
  --primary2:#135e96;
  --sidebar:#1d2327;
  --sidebarText:#c3c4c7;

  --sidebarW:220px;

  /* 质感变量 */
  --radius:12px;
  --radiusSm:10px;
  --shadowSm:0 1px 2px rgba(0,0,0,.06);
  --shadowMd:0 10px 24px rgba(0,0,0,.10);
  --shadowLg:0 16px 46px rgba(0,0,0,.14);

  --ring:0 0 0 3px rgba(34,113,177,.15);
  --focus:rgba(34,113,177,.28);

  --success:#00a32a;
  --danger:#d63638;

  --ease:cubic-bezier(.2,.8,.2,1);

  /* ✅ 新增：右侧舒适底色（低刺激） */
  --mainBg: rgba(255,255,255,.52);
  --mainBg2: rgba(255,255,255,.34);
  --mainBorder: rgba(220,220,222,.55);
}

*{box-sizing:border-box;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;}
html,body{height:100%;}

/* =========================
   全局背景（后台）：柔光渐变，不影响阅读
========================= */
body{
  margin:0;
  color:var(--text);
  overflow-x:hidden;

  background:
    radial-gradient(circle at 18% 18%, rgba(34,113,177,.08), transparent 42%),
    radial-gradient(circle at 82% 82%, rgba(19,94,150,.06), transparent 44%),
    radial-gradient(circle at 70% 16%, rgba(0,163,42,.04), transparent 40%),
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 38%),
    var(--bg);
}

/* ✅ 全局滚动条更舒服 */
*::-webkit-scrollbar{width:10px;height:10px}
*::-webkit-scrollbar-thumb{background:rgba(0,0,0,.12);border-radius:999px;border:2px solid rgba(255,255,255,.55)}
*::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,.18)}

/* 链接 */
a{color:var(--primary);text-decoration:none}
a:hover{color:var(--primary2)}

/* =========================
   登录页动态背景（需要 body.login-page）
========================= */
body.login-page{
  min-height:100vh;
  position:relative;
  overflow:hidden;

  background: linear-gradient(-45deg,#0f2027,#203a43,#2c5364,#1d2671);
  background-size:400% 400%;
  animation: loginGradient 18s ease infinite;
}
@keyframes loginGradient{
  0%{background-position:0% 50%;}
  50%{background-position:100% 50%;}
  100%{background-position:0% 50%;}
}

/* 漂浮光斑 */
body.login-page::before,
body.login-page::after{
  content:"";
  position:absolute;
  width:680px;
  height:680px;
  border-radius:50%;
  background: radial-gradient(circle,rgba(255,255,255,.10),transparent 70%);
  animation: floatLight 26s linear infinite;
  pointer-events:none;
}
body.login-page::before{top:-240px;left:-240px;}
body.login-page::after{bottom:-260px;right:-260px;animation-duration:36s;}
@keyframes floatLight{
  0%{transform:translateY(0) rotate(0deg);}
  50%{transform:translateY(44px) rotate(180deg);}
  100%{transform:translateY(0) rotate(360deg);}
}

/* 登录页卡片：玻璃拟态 */
.login-card{
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.26);
  box-shadow: 0 22px 70px rgba(0,0,0,.35);
  border-radius:16px;
  animation: loginFadeIn .6s ease both;
}
@keyframes loginFadeIn{
  from{opacity:0; transform:translateY(18px);}
  to{opacity:1; transform:translateY(0);}
}
body.login-page .input,
body.login-page select{
  background:rgba(255,255,255,.92);
}

/* =========================
   布局：左侧固定 + 右侧内容
========================= */
.wrap{min-height:100vh;}

.sidebar{
  position:fixed;
  left:0; top:0; bottom:0;
  width:var(--sidebarW);
  background:linear-gradient(180deg,#1d2327 0%, #151a1e 100%);
  color:var(--sidebarText);
  padding:16px 12px;
  overflow-y:auto;
  overscroll-behavior:contain;
  z-index:999;
  box-shadow: 10px 0 28px rgba(0,0,0,.12);
}

/* 左侧滚动条更细 */
.sidebar::-webkit-scrollbar{width:8px}
.sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.12);border-radius:999px;border:0}
.sidebar::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.18)}

.sidebar .brand{
  font-weight:800;
  letter-spacing:.2px;
  color:#fff;
  margin:4px 8px 12px;
  font-size:16px;
  display:flex;
  align-items:center;
  gap:10px;
}
.sidebar .brand::before{
  content:"";
  width:10px;height:10px;border-radius:50%;
  background:var(--primary);
  box-shadow:0 0 0 3px rgba(34,113,177,.18);
}

.sidebar a{
  display:block;
  padding:16px 18px;
  margin:8px 0;
  border-radius:16px;
  color:#d7e8f7;
  text-decoration:none;
  background:transparent !important;
  box-shadow:none !important;
  border:1px solid transparent;
  transition:all .2s ease;
}

.sidebar a:hover{
  background:rgba(255,255,255,.05) !important;
  color:#ffffff;
  border-color:rgba(255,255,255,.04);
}

.sidebar a.active{
  background:linear-gradient(180deg,#1c4f73 0%, #143d59 100%) !important;
  color:#ffffff !important;
  border-color:rgba(87,168,255,.22) !important;
  box-shadow:inset 0 0 0 1px rgba(87,168,255,.12), 0 8px 18px rgba(0,0,0,.18) !important;
}

.sidebar a:not(.active){
  background:transparent !important;
}

.sidebar a:not([href]){
  padding:0 !important;
  margin-top:6px !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  border:none !important;
  color:rgba(255,255,255,.55) !important;
}

.main{
  margin-left:var(--sidebarW);
  min-height:100vh;
  padding:18px;
  animation: pageIn .28s var(--ease) both;

  /* ✅ 右侧整体“舒适底” */
  background: linear-gradient(180deg, var(--mainBg) 0%, var(--mainBg2) 100%);
  border-left: 1px solid var(--mainBorder);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.40);
}
@keyframes pageIn{
  from{opacity:0; transform:translateY(6px)}
  to{opacity:1; transform:translateY(0)}
}

/* ✅ 给右侧内容再加一层轻微纹理，低刺激 */
.main::before{
  content:"";
  position:fixed;
  left:var(--sidebarW);
  top:0; right:0; bottom:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.35), transparent 45%),
    radial-gradient(circle at 85% 30%, rgba(255,255,255,.22), transparent 50%);
  opacity:.45;
  z-index:0;
}
.main > *{ position:relative; z-index:1; }

/* =========================
   顶部栏：更像 WP
========================= */
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:14px;

  position:sticky;
  top:0;
  z-index:900;

  background:rgba(240,240,241,.72);
  backdrop-filter:saturate(160%) blur(10px);
  -webkit-backdrop-filter:saturate(160%) blur(10px);

  padding:10px 0;
  border-bottom: 1px solid rgba(220,220,222,.55);
}
.topbar > div:first-child{
  font-weight:800;
  letter-spacing:.2px;
  font-size:16px;
}

/* =========================
   卡片：更立体 + 柔和高光条
========================= */
.card{
  background:rgba(255,255,255,.92);
  border:1px solid rgba(220,220,222,.85);
  border-radius:var(--radius);
  padding:14px;
  margin-bottom:14px;
  box-shadow: var(--shadowSm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
  position:relative;
  overflow:hidden;
}

/* ✅ 卡片顶部淡淡的“高光” */
.card::before{
  content:"";
  position:absolute;
  left:-20%;
  top:-18px;
  width:140%;
  height:44px;
  background: linear-gradient(90deg, transparent, rgba(34,113,177,.10), transparent);
  opacity:.55;
  transform: skewX(-14deg);
  pointer-events:none;
}

.card:hover{
  box-shadow: var(--shadowMd);
  border-color: rgba(34,113,177,.18);
  transform: translateY(-1px);
}

/* =========================
   表格：更清爽 + hover 行 + 表格区域浅底
========================= */
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius: var(--radiusSm);
  background: rgba(255,255,255,.70);
}
.table th,.table td{
  border-bottom:1px solid rgba(220,220,222,.85);
  padding:10px;
  text-align:left;
  font-size:14px;
}
.table th{
  color:var(--muted);
  font-weight:700;
  background:linear-gradient(180deg,#fbfbfc 0%, #f7f7f8 100%);
  position:sticky;
  top:0;
  z-index:1;
}
.table tr:hover td{
  background:#fbfcff;
}
.table td{
  transition: background .15s var(--ease);
}
.table tr:last-child td{border-bottom:0}

/* =========================
   按钮：微动效 + 阴影（不刺眼）
========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:linear-gradient(180deg,var(--primary) 0%, var(--primary2) 100%);
  color:#fff;
  padding:8px 12px;
  border-radius:10px;
  border:0;
  cursor:pointer;
  box-shadow: 0 6px 16px rgba(19,94,150,.16);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease), filter .14s var(--ease);
  user-select:none;
}
.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(19,94,150,.18);
  filter:saturate(1.04);
}
.btn:active{
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(19,94,150,.14);
}
.btn.secondary{
  background:#f6f7f7;
  color:var(--text);
  border:1px solid var(--line);
  box-shadow:none;
}
.btn.secondary:hover{
  background:#f1f2f3;
  transform: translateY(-1px);
}

/* 危险按钮（可选） */
.btn.danger{
  background:linear-gradient(180deg,#e0484a 0%, #d63638 100%);
  box-shadow:0 8px 18px rgba(214,54,56,.16);
}

/* =========================
   输入框：focus 发光（柔和）
========================= */
.input,select{
  width:100%;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  transition: box-shadow .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease);
}
.input:focus,select:focus{
  outline:none;
  border-color: rgba(34,113,177,.55);
  box-shadow: var(--ring);
  transform: translateY(-1px);
}

/* =========================
   Grid
========================= */
.grid{display:grid;grid-template-columns:repeat(12,1fr);gap:12px}
.col-3{grid-column:span 3}
.col-4{grid-column:span 4}
.col-6{grid-column:span 6}
.col-12{grid-column:span 12}

/* =========================
   提示条：更柔和
========================= */
.notice{
  padding:10px;
  border-radius:12px;
  margin-bottom:12px;
  box-shadow: var(--shadowSm);
}
.notice.err{background:#fff5f5;border:1px solid rgba(214,54,56,.35);color:#8a2424}
.notice.ok{background:#f0fff4;border:1px solid rgba(0,163,42,.35);color:#0f5132}
.small{color:var(--muted);font-size:12px}

/* =========================
   弹窗：更像 WP（不改结构）
========================= */
#wpModal .btn.secondary{border-radius:10px}
#wpModal input.input, #wpModal select.input{border-radius:10px}
#wpModal #wpModalTitle{font-size:16px}
#wpModal .wp-modal-overlay{backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px)}
#wpDelModal .wp-modal-overlay{backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px)}

/* =========================
   小屏幕适配
========================= */
@media (max-width: 980px){
  .sidebar{
    position:static;
    width:auto;
    height:auto;
    overflow:visible;
    box-shadow:none;
    border-bottom:1px solid rgba(255,255,255,.08);
  }
  .main{
    margin-left:0;
    background:transparent;
    border-left:0;
  }
  .main::before{display:none;}
  .topbar{position:static;background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;padding:0;}
}
/* 防止弹窗打开时页面滚动 */
html.modal-open, html.modal-open body{overflow:hidden;}

/* 通用弹窗：删除弹窗专用结构 */
#wpDelModal{
  position:fixed;
  inset:0;
  z-index:99999;
}
#wpDelModal .wp-modal-overlay{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
#wpDelModal .wp-modal-box{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:520px;
  max-width:92vw;
  background:#fff;
  border:1px solid #dcdcde;
  border-radius:12px;
  box-shadow:0 10px 40px rgba(0,0,0,.2);
  padding:14px;
}
#wpDelModal .wp-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}
#wpDelModal .wp-modal-title{font-weight:800;}
#wpDelModal .wp-modal-foot{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top:14px;
}
/* =========================
   Modal 通用样式（编辑 + 删除）
   解决：弹窗不居中 / 需要滑动才看到
========================= */

/* 打开弹窗时禁止页面滚动（JS 会加 html.modal-open） */
html.modal-open, html.modal-open body { overflow: hidden !important; }

/* 删除弹窗容器：全屏 fixed */
#wpDelModal{
  position: fixed;
  inset: 0;
  z-index: 99999;
}

/* 遮罩 */
#wpDelModal .wp-modal-overlay{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* 弹窗盒子：绝对居中 */
#wpDelModal .wp-modal-box{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 520px;
  max-width: 92vw;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 14px;
  box-shadow: 0 16px 46px rgba(0,0,0,.18);
  padding: 14px;
}

/* 头/尾布局 */
#wpDelModal .wp-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 10px;
}
#wpDelModal .wp-modal-title{
  font-weight: 800;
  font-size: 16px;
}
#wpDelModal .wp-modal-foot{
  display:flex;
  gap: 10px;
  justify-content:flex-end;
  margin-top: 14px;
}

/* danger 按钮兜底（你已经有 btn danger 也不冲突） */
.btn.danger{
  background: linear-gradient(180deg,#e0484a 0%, #d63638 100%);
  box-shadow:0 8px 18px rgba(214,54,56,.18);
  color:#fff;
  border:0;
}
/* =========================
   通用弹窗样式（用于 wpDelModal）
========================= */
#wpDelModal{
  position: fixed;
  inset: 0;
  z-index: 9999;
}

#wpDelModal .wp-modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#wpDelModal .wp-modal-box{
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  width: 520px;
  max-width: 92vw;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
  padding: 14px;
}

#wpDelModal .wp-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 10px;
}

#wpDelModal .wp-modal-title{
  font-weight: 800;
  font-size: 16px;
}

#wpDelModal .wp-modal-foot{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top: 14px;
}
/* 弹窗容器 */
#wpModal,
#wpDelModal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

/* 背景遮罩 */
.wp-modal-overlay{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
}

/* 弹窗主体 */
.wp-modal-box{
  position: relative;
  width: 520px;
  max-width: 92vw;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #ddd;
  padding: 18px;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
  animation: modalPop .18s ease;
}

/* 动画 */
@keyframes modalPop{
  from{
    opacity:0;
    transform: translateY(-20px) scale(.96);
  }
  to{
    opacity:1;
    transform: translateY(0) scale(1);
  }
  /* Sidebar + modal fixes patch */
/* Append this at the END of your existing wp-admin-like.css, or merge/replace the matching blocks. */

.sidebar a{
  display:block;
  padding:16px 18px;
  margin:8px 0;
  border-radius:16px;
  color:#d7e8f7;
  text-decoration:none;
  background:transparent !important;
  box-shadow:none !important;
  border:1px solid transparent;
  transition:all .2s ease;
}

.sidebar a:hover{
  background:rgba(255,255,255,.05) !important;
  color:#ffffff;
  border-color:rgba(255,255,255,.04);
}

.sidebar a.active{
  background:linear-gradient(180deg,#1c4f73 0%, #143d59 100%) !important;
  color:#ffffff !important;
  border-color:rgba(87,168,255,.22) !important;
  box-shadow:
    inset 0 0 0 1px rgba(87,168,255,.12),
    0 8px 18px rgba(0,0,0,.18) !important;
}

.sidebar a:not(.active){
  background:transparent !important;
}

.sidebar a:not([href]){
  padding:0 !important;
  margin-top:6px !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  border:none !important;
  color:rgba(255,255,255,.55) !important;
}

#wpModal,
#wpDelModal{
  display:none;
  align-items:center;
  justify-content:center;
  position:fixed;
  inset:0;
  z-index:9999;
  pointer-events:none;
}

#wpModal .wp-modal-overlay,
#wpDelModal .wp-modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:none;
  pointer-events:none;
}
/* ========= 通用弹窗修复：始终在屏幕可视区域内 ========= */
#wpModal,
#wpDelModal{
  position: fixed !important;
  inset: 0 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
  box-sizing: border-box;
}

#wpModal .wp-modal-overlay,
#wpDelModal .wp-modal-overlay{
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0,0,0,.45) !important;
}

/* 编辑弹窗盒子 */
#wpModal > div:last-child{
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  width: min(720px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100vh - 32px) !important;
  overflow: auto !important;
  margin: 0 auto !important;
  z-index: 10000 !important;
  box-sizing: border-box;
  border-radius: 14px;
}

/* 删除弹窗盒子 */
#wpDelModal > div:last-child{
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  width: min(520px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100vh - 32px) !important;
  overflow: auto !important;
  margin: 0 auto !important;
  z-index: 10000 !important;
  box-sizing: border-box;
  border-radius: 14px;
}

/* 表单内容过长时也能滚 */
#wpModalForm,
#wpModalBody{
  max-width: 100%;
  box-sizing: border-box;
}

#wpModalBody{
  overflow-x: hidden;
}

/* 小屏再收窄一点 */
@media (max-width: 768px){
  #wpModal,
  #wpDelModal{
    padding: 12px;
  }

  #wpModal > div:last-child,
  #wpDelModal > div:last-child{
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 24px) !important;
    border-radius: 12px;
  }
}
.wp-modal-box{
  background:#fff;
  border:1px solid #dcdcde;
  box-shadow:0 10px 40px rgba(0,0,0,.2);
  padding:14px;
}
.col-20{
  width:20%;
  box-sizing:border-box;
  padding:8px;
}

@media (max-width: 1200px){
  .col-20{
    width:50%;
  }
}

@media (max-width: 768px){
  .col-20{
    width:100%;
  }
}
}