/* WeAdmin 全局样式 · v2 视觉优化 */
[v-cloak] { display: none; }

:root {
  --wa-sidebar-bg: #18202f;
  --wa-sidebar-active: #409eff;
  --wa-header-h: 56px;
  --wa-radius: 12px;
  --wa-shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --wa-shadow-md: 0 4px 12px rgba(16, 24, 40, .08), 0 2px 4px rgba(16, 24, 40, .04);
  --wa-shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --wa-primary: #409eff;
  --wa-text-main: #1f2d3d;
  --wa-text-sub: #909399;
}

html, body, #app { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: #f4f6fa;
  color: var(--wa-text-main);
  -webkit-font-smoothing: antialiased;
}

/* 细滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, .4); }
.side-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); }

/* ---------- 登录页 ---------- */
.login-page {
  height: 100%; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #141b2b 0%, #1f3a5f 55%, #2b6cb8 130%);
}
.login-page::before, .login-page::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none;
}
.login-page::before {
  width: 460px; height: 460px; right: -110px; top: -140px;
  background: rgba(64, 158, 255, .32);
}
.login-page::after {
  width: 380px; height: 380px; left: -120px; bottom: -150px;
  background: rgba(142, 107, 241, .28);
}
.login-card {
  width: 384px; padding: 42px 38px 30px; background: #fff; border-radius: 16px;
  box-shadow: 0 24px 64px rgba(6, 12, 24, .38); position: relative; z-index: 1;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand .logo {
  width: 58px; height: 58px; border-radius: 15px; margin: 0 auto 14px;
  background: linear-gradient(135deg, #53a8ff, #2f7de1);
  color: #fff; font-size: 27px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(64, 158, 255, .4);
}
.login-brand h1 { font-size: 20px; margin: 0 0 6px; color: #1f2d3d; letter-spacing: .5px; }
.login-brand p { margin: 0; color: #909399; font-size: 13px; }

/* ---------- 整体布局 ---------- */
.layout { height: 100%; display: flex; }
.sidebar {
  width: 220px; background: var(--wa-sidebar-bg); color: #aab3c5;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar .brand {
  height: var(--wa-header-h); display: flex; align-items: center; gap: 10px;
  padding: 0 20px; color: #fff; font-weight: 600; font-size: 16px; letter-spacing: .3px;
  border-bottom: 1px solid rgba(255, 255, 255, .06); flex-shrink: 0;
}
.sidebar .brand .logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #53a8ff, #2f7de1);
  color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(64, 158, 255, .35);
}
.side-menu { flex: 1; padding: 10px 0; overflow-y: auto; }
.side-item {
  height: 42px; margin: 2px 10px; padding: 0 14px; border-radius: 9px;
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 13.5px; color: #9aa5b8; position: relative;
  transition: background .18s, color .18s;
}
.side-item:hover { background: rgba(255, 255, 255, .06); color: #e8edf5; }
.side-item.active {
  background: linear-gradient(90deg, #409eff, #3583e0);
  color: #fff; font-weight: 500;
  box-shadow: 0 4px 14px rgba(64, 158, 255, .38);
}
.side-item .el-icon { font-size: 16px; }
/* 带二级栏目的分组 */
.side-item.group-title { justify-content: flex-start; }
.side-item.group-title .caret {
  margin-left: auto; font-size: 12px; transition: transform .2s; opacity: .7;
}
.side-item.group-title .caret.open { transform: rotate(-90deg); }
.side-sub { padding: 2px 0 6px; }
.side-item.sub-item {
  height: 36px; margin: 1px 10px 1px 24px; padding: 0 12px;
  font-size: 13px; border-left: 2px solid rgba(255, 255, 255, .08); border-radius: 0 8px 8px 0;
}
.side-item.sub-item.active {
  background: rgba(64, 158, 255, .16); color: #79bbff; font-weight: 500;
  border-left-color: #409eff; box-shadow: none;
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header {
  height: var(--wa-header-h); background: #fff;
  box-shadow: 0 1px 4px rgba(16, 24, 40, .06);
  display: flex; align-items: center; padding: 0 20px; gap: 14px; flex-shrink: 0;
  position: relative; z-index: 5;
}
.header .spacer { flex: 1; }
.content { flex: 1; overflow-y: auto; padding: 20px 22px; }

/* ---------- 通用 ---------- */
.page-title {
  font-size: 18px; font-weight: 600; color: var(--wa-text-main);
  margin: 0 0 4px; position: relative; padding-left: 12px; line-height: 1.4;
}
.page-title::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, #53a8ff, #2f7de1);
}
.page-sub { color: var(--wa-text-sub); font-size: 13px; margin: 0 0 16px; padding-left: 12px; }

.card {
  background: #fff; border-radius: var(--wa-radius); padding: 18px 20px;
  box-shadow: var(--wa-shadow-sm);
}
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

/* ---------- 统计卡片 ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 16px; margin-bottom: 18px;
}
.stat-card {
  background: linear-gradient(180deg, #ffffff, #fcfdff);
  border-radius: var(--wa-radius); padding: 20px;
  display: flex; gap: 16px; align-items: center;
  box-shadow: var(--wa-shadow-sm); position: relative; overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--wa-shadow-md); }
.stat-card::before {
  content: ''; position: absolute; right: -26px; bottom: -26px;
  width: 120px; height: 120px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(64, 158, 255, .07), transparent 68%);
}
.stat-card .icon-wrap {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; color: #fff;
  box-shadow: 0 6px 14px rgba(16, 24, 40, .14);
}
.stat-card .stat-info { min-width: 0; position: relative; }
.stat-card .label { color: var(--wa-text-sub); font-size: 13px; line-height: 1; }
.stat-card .num {
  font-size: 27px; font-weight: 700; color: var(--wa-text-main);
  line-height: 1.25; margin-top: 5px; font-variant-numeric: tabular-nums;
  letter-spacing: -.5px;
}
.stat-sub { font-size: 12px; color: #a8abb2; margin-top: 3px; line-height: 1; }
.stat-sub.up { color: #67c23a; }
.stat-sub.down { color: #f56c6c; }

/* ---------- 趋势图 / 列表面板 ---------- */
.panel-title {
  margin: 0 0 12px; font-size: 15px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.panel-title::before {
  content: ''; width: 4px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, #53a8ff, #2f7de1);
}
.trend { display: flex; align-items: flex-end; gap: 10px; height: 168px; padding-top: 12px; }
.trend .bar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 6px; height: 100%; justify-content: flex-end;
}
.trend .bar {
  width: 58%; max-width: 40px; border-radius: 6px 6px 2px 2px; min-height: 4px;
  background: linear-gradient(180deg, #79bbff, #409eff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: filter .2s;
}
.trend .bar-item:hover .bar { filter: brightness(1.08); }
.trend .bar-label { font-size: 12px; color: var(--wa-text-sub); }
.trend .bar-num { font-size: 12px; color: #606266; font-weight: 500; }

.msg-feed-item {
  display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px dashed #f0f2f5;
  font-size: 13px; align-items: center;
}
.msg-feed-item:last-child { border-bottom: none; }

/* ---------- 聊天 ---------- */
.chat-wrap {
  display: flex; height: calc(100vh - var(--wa-header-h) - 58px);
  background: #fff; border-radius: var(--wa-radius); overflow: hidden;
  box-shadow: var(--wa-shadow-sm);
}
.conv-list { width: 302px; border-right: 1px solid #eef1f5; display: flex; flex-direction: column; }
.conv-list .search { padding: 12px; border-bottom: 1px solid #f0f2f5; }
.conv-scroll { flex: 1; overflow-y: auto; }
.conv-item {
  display: flex; gap: 10px; padding: 12px 14px; cursor: pointer;
  align-items: center; transition: background .15s;
  border-left: 3px solid transparent;
}
.conv-item:hover { background: #f7f9fc; }
.conv-item.active { background: #ecf5ff; border-left-color: var(--wa-primary); }
.conv-item .meta { flex: 1; min-width: 0; }
.conv-item .name { font-size: 14px; color: var(--wa-text-main); display: flex; justify-content: space-between; }
.conv-item .name .time { font-size: 11px; color: #c0c4cc; font-weight: 400; }
.conv-item .preview {
  font-size: 12px; color: var(--wa-text-sub); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.chat-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 12px 18px; border-bottom: 1px solid #f0f2f5; display: flex; align-items: center; gap: 10px; }
.chat-body {
  flex: 1; overflow-y: auto; background: #f6f8fb;
  padding: 18px; display: flex; flex-direction: column; gap: 14px;
}
.bubble-row { display: flex; gap: 10px; max-width: 72%; }
.bubble-row.me { align-self: flex-end; flex-direction: row-reverse; }
.bubble {
  padding: 9px 13px; border-radius: 10px; font-size: 14px; line-height: 1.55;
  word-break: break-word; background: #fff; color: var(--wa-text-main);
  box-shadow: var(--wa-shadow-sm);
}
.bubble-row.me .bubble {
  background: linear-gradient(135deg, #4da1ff, #338af0);
  color: #fff; box-shadow: 0 3px 10px rgba(64, 158, 255, .3);
}
.bubble img { max-width: 220px; border-radius: 6px; display: block; }
.bubble .type-tag { font-size: 12px; opacity: .75; }
.chat-foot { padding: 12px 16px; border-top: 1px solid #f0f2f5; display: flex; gap: 10px; }

/* ---------- 手机预览(菜单编辑) ---------- */
.menu-editor { display: flex; gap: 26px; align-items: flex-start; flex-wrap: wrap; }
.phone {
  width: 320px; height: 560px; border: 10px solid #232b3b; border-radius: 36px;
  background: #f7f8fa; display: flex; flex-direction: column; overflow: hidden;
  flex-shrink: 0; box-shadow: 0 18px 40px rgba(28, 36, 49, .18);
}
.phone .phone-head {
  background: #232b3b; color: #fff; text-align: center;
  font-size: 13px; padding: 10px 0 8px; letter-spacing: 1px;
}
.phone .phone-account {
  text-align: center; color: var(--wa-text-sub); font-size: 12px;
  padding: 8px 0; background: #efefef;
}
.phone .wechat-bar { margin-top: auto; }
.phone .menu-bar { display: flex; border-top: 1px solid #dcdfe6; background: #fafafa; }
.phone .menu-main {
  flex: 1; text-align: center; padding: 11px 4px; font-size: 13px; color: #1f2d3d;
  cursor: pointer; position: relative; border-left: 1px solid #e4e7ed;
}
.phone .menu-main:first-child { border-left: none; }
.phone .menu-main.active, .phone .menu-sub.active { color: var(--wa-primary); }
.phone .menu-sub-wrap {
  position: absolute; bottom: 44px; left: 6px; right: 6px;
  background: #fafafa; border: 1px solid #dcdfe6; border-radius: 8px; overflow: hidden;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .1);
}
.phone .menu-sub {
  padding: 10px 4px; font-size: 13px; color: #1f2d3d; cursor: pointer;
  border-bottom: 1px solid #e4e7ed; text-align: center;
}
.phone .menu-sub:last-child { border-bottom: none; }
.phone .plus-btn { color: var(--wa-text-sub); }

/* ---------- 素材 / 公众号卡片 ---------- */
.material-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.material-card {
  background: #fff; border: 1px solid #edf0f4; border-radius: var(--wa-radius);
  overflow: hidden; box-shadow: var(--wa-shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.material-card:hover { transform: translateY(-3px); box-shadow: var(--wa-shadow-md); }
.material-card .thumb {
  height: 118px; background: #f3f5f9; display: flex;
  align-items: center; justify-content: center; overflow: hidden;
}
.material-card .thumb img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease;
}
.material-card:hover .thumb img { transform: scale(1.05); }
.material-card .thumb .file-icon { font-size: 40px; color: #c0c4cc; }
.material-card .info { padding: 10px 12px; }
.material-card .title {
  font-size: 13px; color: var(--wa-text-main);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.material-card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }

.mp-card { transition: transform .2s ease, box-shadow .2s ease; }
.mp-card:hover { transform: translateY(-2px); box-shadow: var(--wa-shadow-md); }
.mp-card .mp-avatar.el-avatar {
  background: linear-gradient(135deg, #53a8ff, #2f7de1);
  color: #fff; font-weight: 600; font-size: 18px;
  box-shadow: 0 4px 12px rgba(64, 158, 255, .3);
}

.muted { color: var(--wa-text-sub); font-size: 12px; }
.mono { font-family: SFMono-Regular, Consolas, Menlo, monospace; font-size: 12px; }
.copy-line {
  display: flex; align-items: center; gap: 8px; background: #f7f9fc;
  border: 1px solid #eef1f5; border-radius: 8px; padding: 8px 10px; margin: 4px 0;
}
.copy-line .txt { flex: 1; word-break: break-all; }

.avatar-fallback {
  background: #e3e9f2; color: #8a94a6; display: flex;
  align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0;
}

/* ---------- Element Plus 细节覆盖 ---------- */
.el-dialog { border-radius: 14px; }
.el-table { --el-table-header-bg-color: #f8fafc; --el-table-border-color: #f0f2f5; }
.el-table th.el-table__cell { color: #4e5969; font-weight: 600; }
.el-card { border-radius: var(--wa-radius); }
.el-drawer__header { margin-bottom: 12px; color: var(--wa-text-main); font-weight: 600; }
.el-pagination { justify-content: flex-end; }
