/* ============================================================
   Glass Social — 商用级管理后台样式（延续玻璃拟态）
   ============================================================ */

/* ---------- 登录页 ---------- */
.login-wrap {
  position: relative; z-index: 1; min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 880px; display: grid; grid-template-columns: 1.05fr .95fr;
  border-radius: 30px; overflow: hidden;
  background: var(--glass-3);
  backdrop-filter: blur(var(--blur-l)) saturate(200%);
  -webkit-backdrop-filter: blur(var(--blur-l)) saturate(200%);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--sd-3);
  animation: blurIn .6s var(--ease-out) both;
}
.login-brand {
  padding: 44px 40px; position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(150deg, #46d1ec 0%, #2f7cf6 55%, #7a5cff 100%);
  display: flex; flex-direction: column;
}
.login-brand::after {
  content: ""; position: absolute; width: 320px; height: 320px; right: -110px; bottom: -140px;
  border-radius: 50%; background: rgba(255, 255, 255, .18); filter: blur(6px);
}
.login-brand h1 { font-size: 27px; letter-spacing: .5px; }
.lb-feature { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; position: relative; }
.lb-feature .d { width: 30px; height: 30px; border-radius: 10px; background: rgba(255,255,255,.22); display: grid; place-items: center; flex: none; }
.login-form { padding: 44px 40px; }
.login-form h2 { font-size: 20px; }
.form-label { font-size: 12.5px; color: var(--t-3); font-weight: 600; margin: 14px 0 6px; display: block; }
.captcha {
  width: 96px; height: 40px; border-radius: var(--r-s); flex: none; cursor: pointer;
  background: linear-gradient(115deg, #dff0ff, #e8dcff);
  border: 1px solid var(--glass-brd);
  display: grid; place-items: center;
  font-size: 17px; font-weight: 800; letter-spacing: 3px; color: #2f5f9e;
  font-style: italic; user-select: none;
}

/* ---------- 后台主框架 ---------- */
.admin { position: relative; z-index: 1; display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 232px; flex: none; margin: 12px 0 12px 12px;
  border-radius: 24px; padding: 16px 12px;
  display: flex; flex-direction: column;
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-l)) saturate(190%);
  -webkit-backdrop-filter: blur(var(--blur-l)) saturate(190%);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--sd-2);
  transition: width var(--dur-m) var(--ease-out);
}
.sidebar.mini { width: 74px; }
.sidebar.mini .menu-text, .sidebar.mini .brand-txt, .sidebar.mini .menu-caret, .sidebar.mini .sub-menu { display: none; }
.sidebar.mini .menu-item { justify-content: center; padding: 0; }

.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.side-brand .logo {
  width: 36px; height: 36px; border-radius: 12px; flex: none;
  background: var(--grad-primary); display: grid; place-items: center;
  box-shadow: var(--sd-glow); color: #fff;
}
.side-brand b { font-size: 15px; display: block; line-height: 1.2; }
.side-brand span { font-size: 10.5px; color: var(--t-3); }

.side-menu { flex: 1; overflow-y: auto; padding-right: 2px; }
.side-menu::-webkit-scrollbar { width: 4px; }
.side-menu::-webkit-scrollbar-thumb { background: rgba(47,124,246,.2); border-radius: 99px; }
.menu-item {
  height: 40px; padding: 0 12px; border-radius: 13px; margin-bottom: 3px;
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--t-2);
  transition: all var(--dur-f) var(--ease-out); position: relative;
}
.menu-item:hover { background: rgba(255,255,255,.6); color: var(--c-blue); }
.menu-item.open { color: var(--c-blue); }
.menu-item.active {
  background: var(--grad-primary); color: #fff;
  box-shadow: var(--sd-glow);
}
.menu-caret { margin-left: auto; transition: transform var(--dur-m) var(--ease-out); opacity: .6; }
.menu-item.open .menu-caret { transform: rotate(180deg); }
.sub-menu { overflow: hidden; padding-left: 12px; }
.sub-item {
  height: 34px; padding: 0 12px; border-radius: 10px; margin-bottom: 2px;
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 12.5px; color: var(--t-3); transition: all var(--dur-f);
  animation: fadeUp .3s var(--ease-out) both;
}
.sub-item::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .45; flex: none; }
.sub-item:hover { background: rgba(255,255,255,.6); color: var(--c-blue); }
.sub-item.active { background: var(--grad-primary-soft); color: var(--c-blue); font-weight: 700; }
.side-foot { padding-top: 10px; border-top: 1px solid var(--glass-line); }

/* 主区 */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 12px; gap: 12px; }
.topbar {
  height: 58px; flex: none; padding: 0 16px; border-radius: 20px;
  display: flex; align-items: center; gap: 12px;
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-l)) saturate(190%);
  -webkit-backdrop-filter: blur(var(--blur-l)) saturate(190%);
  border: 1px solid var(--glass-brd); box-shadow: var(--sd-1);
}
.crumb { font-size: 13px; color: var(--t-3); display: flex; align-items: center; gap: 6px; }
.crumb b { color: var(--t-1); font-size: 15px; }
.top-search {
  width: 220px; height: 34px; border-radius: 11px; padding: 0 12px;
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--t-3);
  background: var(--glass-3); border: 1px solid var(--glass-brd-soft);
}
.admin-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
  border-radius: 99px; background: var(--glass-3); border: 1px solid var(--glass-brd-soft);
  cursor: pointer; transition: all var(--dur-f);
}
.admin-chip:hover { box-shadow: var(--sd-2); }

.content {
  flex: 1; min-height: 0; overflow-y: auto; border-radius: 22px;
  padding: 4px; position: relative;
}
.page { animation: blurIn .45s var(--ease-out) both; }

/* ---------- 卡片 / 统计 ---------- */
.card {
  border-radius: 20px; padding: 18px;
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-m)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-m)) saturate(180%);
  border: 1px solid var(--glass-brd); box-shadow: var(--sd-1);
  transition: box-shadow var(--dur-m) var(--ease-out), transform var(--dur-m) var(--ease-out);
}
.card:hover { box-shadow: var(--sd-2); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title .bar { width: 3px; height: 14px; border-radius: 2px; background: var(--grad-primary); }

.grid { display: grid; gap: 12px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g23 { grid-template-columns: 2fr 1fr; }

/* 业务总览：Hero 卡片 */
.hero-card {
  position: relative; overflow: hidden; padding: 24px; border-radius: 22px;
  background: linear-gradient(135deg, rgba(70,209,236,.18), rgba(47,124,246,.12), rgba(168,107,255,.16));
  border: 1px solid rgba(255,255,255,.6);
  margin-bottom: 16px;
  box-shadow: var(--sd-2);
}
.hero-glow {
  position: absolute; right: -90px; top: -100px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(70,209,236,.45), transparent 70%);
  filter: blur(20px); pointer-events: none;
}
.hero-icon {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--grad-primary); color: #fff; box-shadow: var(--sd-glow);
  flex: none;
}

/* 业务总览：分类入口卡片 */
.portal-card {
  display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 18px;
  background: var(--glass-3); border: 1px solid var(--glass-brd); cursor: pointer;
  box-shadow: var(--sd-1); transition: all var(--dur-m) var(--ease-out);
  position: relative; overflow: hidden;
}
.portal-card:hover { transform: translateY(-4px); box-shadow: var(--sd-2); border-color: var(--c-blue); }
.portal-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--grad-primary); transform: scaleY(0); transform-origin: top;
  transition: transform var(--dur-m) var(--ease-spring);
}
.portal-card:hover::before { transform: scaleY(1); }
.pc-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  color: #fff; box-shadow: var(--sd-1); flex: none;
}

/* 业务总览：快速入口 */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 6px; border-radius: 14px; background: rgba(255,255,255,.5);
  border: 1px solid var(--glass-brd-soft); cursor: pointer; transition: all var(--dur-f);
  color: var(--t-1);
}
.quick-btn:hover { background: var(--grad-primary); color: #fff; border-color: transparent; box-shadow: var(--sd-glow); }
.quick-btn:hover svg { color: #fff !important; }

.stat {
  border-radius: 20px; padding: 16px 18px; position: relative; overflow: hidden;
  background: var(--glass-2); border: 1px solid var(--glass-brd);
  backdrop-filter: blur(var(--blur-m)); -webkit-backdrop-filter: blur(var(--blur-m));
  box-shadow: var(--sd-1); transition: all var(--dur-m) var(--ease-out);
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--sd-2); }
.stat .sv { font-size: 27px; font-weight: 800; letter-spacing: -.5px; animation: countUp .5s var(--ease-out) both; font-variant-numeric: tabular-nums; }
.stat .sl { font-size: 12px; color: var(--t-3); }
.stat .si {
  position: absolute; right: 14px; top: 14px; width: 38px; height: 38px; border-radius: 13px;
  display: grid; place-items: center; color: #fff; background: var(--grad-primary); box-shadow: var(--sd-glow);
}
.stat.v2 .si { background: linear-gradient(135deg,#ff9a76,#f4525f); box-shadow: 0 6px 16px rgba(244,82,95,.3); }
.stat.v3 .si { background: linear-gradient(135deg,#7bdcb5,#1fbf7a); box-shadow: 0 6px 16px rgba(31,191,122,.3); }
.stat.v4 .si { background: var(--grad-vip); color: #4a2b00; box-shadow: var(--sd-vip); }
.trend { font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.trend.up { color: #e0344a; }   /* 中国市场惯例：涨=红 */
.trend.down { color: #12996b; } /* 跌=绿 */

/* ---------- 工具栏 / 表格 ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .field { width: auto; min-width: 132px; height: 34px; font-size: 12.5px; }
.toolbar .btn { height: 34px; }

.table-wrap { border-radius: 16px; overflow: hidden; border: 1px solid var(--glass-brd-soft); }
table.tb { width: 100%; border-collapse: collapse; font-size: 12.8px; background: rgba(255,255,255,.35); }
table.tb th {
  text-align: left; padding: 11px 12px; font-weight: 700; color: var(--t-2); font-size: 12px;
  background: rgba(255,255,255,.62); white-space: nowrap;
  border-bottom: 1px solid var(--glass-line);
  position: sticky; top: 0; z-index: 2;
  backdrop-filter: blur(var(--blur-s)); -webkit-backdrop-filter: blur(var(--blur-s));
}
table.tb td { padding: 10px 12px; border-bottom: 1px solid rgba(31,74,140,.05); vertical-align: middle; }
table.tb tbody tr { transition: background var(--dur-f); animation: fadeUp .35s var(--ease-out) both; }
table.tb tbody tr:hover { background: rgba(255,255,255,.6); }
table.tb tbody tr:last-child td { border-bottom: none; }
.tb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.link { color: var(--c-blue); font-weight: 600; cursor: pointer; font-size: 12.5px; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--c-danger); }
.link.warn { color: #b57608; }

.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 12.5px; color: var(--t-3); }
.pager-btns { display: flex; gap: 5px; }
.pg {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 9px;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 600;
  background: var(--glass-3); border: 1px solid var(--glass-brd-soft); color: var(--t-2);
  transition: all var(--dur-f);
}
.pg:hover { color: var(--c-blue); }
.pg.on { background: var(--grad-primary); color: #fff; border-color: transparent; box-shadow: var(--sd-glow); }

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(18,38,63,.24);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn var(--dur-m) both;
}
.drawer {
  position: absolute; right: 0; top: 0; bottom: 0; width: 460px; max-width: 92vw;
  background: var(--glass-4);
  backdrop-filter: blur(var(--blur-l)) saturate(200%);
  -webkit-backdrop-filter: blur(var(--blur-l)) saturate(200%);
  border-left: 1px solid var(--glass-brd);
  box-shadow: -18px 0 50px rgba(31,74,140,.18);
  padding: 20px; overflow-y: auto;
  animation: drawerIn var(--dur-m) var(--ease-out) both;
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; font-size: 13px; }
.kv .k { color: var(--t-3); }

/* ---------- 图表 ---------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart .grid-line { stroke: rgba(31,74,140,.08); stroke-width: 1; }
.chart .axis-txt { font-size: 10px; fill: var(--t-4); }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--t-3); flex-wrap: wrap; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }

.rank-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.rank-no {
  width: 20px; height: 20px; border-radius: 7px; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #fff; background: rgba(130,150,171,.5); flex: none;
}
.rank-no.n1 { background: linear-gradient(135deg,#ffd76a,#ff9a5b); }
.rank-no.n2 { background: linear-gradient(135deg,#c7d4e6,#9fb2c9); }
.rank-no.n3 { background: linear-gradient(135deg,#ffbb8f,#e08b5b); }
.bar-track { height: 6px; border-radius: 99px; background: rgba(130,150,171,.18); overflow: hidden; flex: 1; }
.bar-track i { display: block; height: 100%; border-radius: 99px; background: var(--grad-primary); animation: barGrow .8s var(--ease-out) both; }
@keyframes barGrow { from { width: 0 !important; } }

/* ---------- 权限树 / 标签页 ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab-btn {
  height: 32px; padding: 0 14px; border-radius: 10px; font-size: 12.5px; font-weight: 600;
  background: var(--glass-3); border: 1px solid var(--glass-brd-soft); color: var(--t-2);
  transition: all var(--dur-f);
}
.tab-btn:hover { color: var(--c-blue); }
.tab-btn.on { background: var(--grad-primary); color: #fff; border-color: transparent; box-shadow: var(--sd-glow); }

.tree-node { padding: 7px 10px; border-radius: 10px; display: flex; align-items: center; gap: 9px; font-size: 13px; }
.tree-node:hover { background: rgba(255,255,255,.55); }
.tree-sub { padding-left: 26px; }
.cbox {
  width: 17px; height: 17px; border-radius: 5px; flex: none;
  border: 1.6px solid rgba(130,150,171,.5); display: grid; place-items: center;
  color: #fff; transition: all var(--dur-f) var(--ease-spring); cursor: pointer;
}
.cbox.on { background: var(--grad-primary); border-color: transparent; box-shadow: var(--sd-glow); }
.cbox svg { width: 12px; height: 12px; opacity: 0; }
.cbox.on svg { opacity: 1; }

/* ---------- 状态点 ---------- */
.sdot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.sdot.ok { background: var(--c-success); box-shadow: 0 0 0 3px rgba(31,191,122,.16); }
.sdot.off { background: var(--t-4); }
.sdot.warn { background: var(--c-warn); box-shadow: 0 0 0 3px rgba(240,160,32,.16); }
.sdot.err { background: var(--c-danger); box-shadow: 0 0 0 3px rgba(244,82,95,.16); }

.empty { padding: 46px 0; text-align: center; color: var(--t-4); font-size: 13px; }
.notice-line {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 13px;
  background: linear-gradient(135deg, rgba(255,215,106,.22), rgba(255,154,91,.16));
  border: 1px solid rgba(255,180,90,.3); font-size: 12.5px; color: #8a5a10; margin-bottom: 12px;
}

/* ---------- 系统告警（/system/alert） ---------- */
.alert-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 8px; }
.alert-card {
  display: flex; align-items: stretch; gap: 14px; padding: 14px 16px;
  border-radius: 16px; background: var(--glass-2);
  border: 1px solid var(--glass-brd); box-shadow: var(--sd-1);
  transition: transform var(--dur-f) var(--ease-out), box-shadow var(--dur-f) var(--ease-out), border-color var(--dur-f);
  cursor: pointer; position: relative;
}
.alert-card:hover { transform: translateY(-1px); box-shadow: var(--sd-2); border-color: rgba(47,124,246,.25); }
.alert-card.sev-err { border-left: 3px solid #ff5260; }
.alert-card.sev-warn { border-left: 3px solid #ff9a3c; }
.alert-card.sev-ok { border-left: 3px solid #2fbf7a; }
.alert-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none; align-self: flex-start; margin-top: 6px;
  box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}
.alert-card.sev-err .alert-dot { box-shadow: 0 0 0 3px rgba(244,82,95,.18); animation: alertPulse 1.6s ease-in-out infinite; }
@keyframes alertPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(244,82,95,.18); }
  50%      { box-shadow: 0 0 0 6px rgba(244,82,95,.10); }
}
.alert-body { flex: 1; min-width: 0; }
.alert-top { display: flex; align-items: center; gap: 8px; }
.alert-title { font-size: 14.5px; font-weight: 700; color: var(--t-1); display: flex; align-items: center; gap: 6px; }
.alert-time { margin-left: auto; font-size: 12px; color: var(--t-3); flex: none; }
.alert-desc { margin-top: 6px; font-size: 13px; color: var(--t-2); line-height: 1.55; }
.alert-foot { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.alert-foot .f11 { color: var(--t-4); }
.alert-foot .btn-xs { margin-left: auto; }

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g23 { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .sidebar { position: fixed; z-index: 80; height: calc(100vh - 24px); }
  .sidebar.mini { width: 74px; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .login-card { grid-template-columns: 1fr; max-width: 440px; }
  .login-brand { display: none; }
}

/* ---------- SVG 图标动画（替代 SMIL <animate>） ---------- */
.admin-chart-line {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: adminChartDraw 1.1s ease-out forwards;
}
@keyframes adminChartDraw { to { stroke-dashoffset: 0; } }
.admin-chart-bar {
  transform-box: fill-box;
  transform-origin: center bottom;
  transform: scaleY(0);
  animation: adminChartBarGrow .8s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes adminChartBarGrow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
  .admin-chart-line { stroke-dashoffset: 0; animation: none; }
  .admin-chart-bar  { transform: none; animation: none; }
}
