/* ============ 注册机系统工作台 样式 ============ */
:root {
  --lime: #B9F26E;
  --lime-soft: #E8FBC9;
  --lime-deep: #8FD14F;
  --ink: #14161A;
  --ink-2: #2A2D33;
  --ink-3: #6B7280;
  --ink-4: #9CA3AF;
  --bg: #F3F4F6;
  --card: #FFFFFF;
  --line: #EDEEF2;
  --line-2: #E5E7EB;
  --green: #22C55E;
  --green-bg: #DCFCE7;
  --orange: #F59E0B;
  --orange-bg: #FEF3C7;
  --blue: #3B82F6;
  --blue-bg: #DBEAFE;
  --purple: #8B5CF6;
  --purple-bg: #EDE9FE;
  --red: #EF4444;
  --red-bg: #FEE2E2;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 8px 24px rgba(16,24,40,.08);
  --font: 'Manrope', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
/* 预留滚动条槽位：页面长短变化时 body 宽度不变，内容与顶栏不会左右跳动 */
html { scrollbar-gutter: stable; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
svg { flex-shrink: 0; }

/* ============ 布局：左侧导航栏 ============ */
.app-shell { min-height: 100vh; }

/* 左侧固定侧边栏 */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: 232px; z-index: 60;
  background: #FFFFFF;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 20px 14px;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.logo-text { font-weight: 800; font-size: 17px; letter-spacing: -.3px; white-space: nowrap; }

/* 主内容右移 */
.main { padding: 28px 0 48px; margin-left: 232px; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* 顶部栏：仅搜索 + 用户 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: 64px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: flex-end;
  margin-left: 232px;
  padding: 0 max(24px, calc((100% - 232px - 1280px) / 2 + 24px));
  min-width: 0;
}

/* 侧边导航：垂直排列 */
.main-nav {
  display: flex; flex-direction: column; gap: 4px;
  flex: 1 1 auto; position: relative;
  overflow-y: auto;
}
.nav-item {
  border: none; background: transparent;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--ink-3);
  white-space: nowrap; transition: color .2s ease;
  position: relative; z-index: 1;
  width: 100%; text-align: left;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: #f2f3f5; color: var(--ink); }
.nav-item.active { background: transparent !important; color: var(--ink); box-shadow: none; }
.nav-item.active:hover { background: transparent !important; color: var(--ink); }

/* 滑动圆角高亮块（左侧导航：垂直滑动，高度跟随目标项变化） */
.nav-indicator {
  position: absolute; left: 0; top: 0;
  border-radius: 10px;
  background: var(--lime);
  box-shadow: 0 3px 10px rgba(185,242,110,.45);
  transform: translate3d(0,0,0);
  pointer-events: none;
  z-index: 0;
  transition:
    transform .42s cubic-bezier(.34, 1.56, .64, 1),
    width  .42s cubic-bezier(.34, 1.56, .64, 1),
    height .42s cubic-bezier(.34, 1.56, .64, 1),
    opacity  .18s ease;
  opacity: 0;
}

.topbar-right {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0; margin-left: auto;
  flex-wrap: nowrap;
}
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: #F4F5F7; border-radius: 10px;
  padding: 8px 12px; width: 100px; flex-shrink: 1; min-width: 80px;
  color: var(--ink-4);
  transition: box-shadow .2s;
  position: relative;
}
.search-box:focus-within { box-shadow: 0 0 0 2px var(--lime); }
.search-box input { border: none; background: none; outline: none; width: 100%; font-size: 13px; color: var(--ink); }
.search-box input::placeholder { color: var(--ink-4); }

/* 全局搜索结果面板 */
.search-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 460px; max-width: 92vw; max-height: 420px;
  overflow-y: auto;
  background: #fff; border: 1px solid var(--line-2);
  border-radius: 14px; box-shadow: 0 12px 36px rgba(16,24,40,.16);
  padding: 6px; z-index: 300;
  animation: fadeIn .14s ease;
}
.search-panel.hidden { display: none; }
.search-group + .search-group { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.search-group-title {
  font-size: 11px; font-weight: 700; color: var(--ink-4);
  padding: 6px 10px 4px; letter-spacing: .4px;
}
.search-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; border: none; background: transparent; text-align: left;
  padding: 8px 10px; border-radius: 9px;
  transition: background .12s;
}
.search-item:hover, .search-item.active { background: var(--lime-soft); }
.search-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.search-item-title {
  font-size: 13px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-item-sub {
  font-size: 11px; color: var(--ink-4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-item-meta { font-size: 11px; font-weight: 700; color: var(--ink-3); white-space: nowrap; flex-shrink: 0; }
.search-empty { padding: 18px 12px; font-size: 13px; color: var(--ink-4); text-align: center; }

/* 搜索跳转后的定位高亮 */
.row-hl > td { background: var(--lime-soft); }
.row-hl > td:first-child { box-shadow: inset 3px 0 0 var(--lime-deep); }
.card-hl { border-color: var(--lime-deep); box-shadow: 0 0 0 2px var(--lime-soft), var(--shadow); }

/* 激活码管理页标题行的「一键清空激活码」按钮 */
.clear-licenses-btn { flex-shrink: 0; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 10px;
  border: none; background: #F4F5F7; color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; flex-shrink: 0;
}
.icon-btn:hover { background: #e9eaee; color: var(--ink); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; background: transparent; }
.badge {
  position: absolute; top: 5px; right: 5px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--green); color: #fff;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
/* 用户区域：点击展开功能菜单 */
.user-nav {
  display: flex; align-items: center;
  flex-shrink: 0; position: relative;
}
.user-trigger {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  padding: 5px 10px 5px 6px; margin-left: 2px;
  border-radius: 12px; cursor: pointer;
  background: transparent; transition: background .18s ease;
  position: relative; z-index: 1;
}
.user-trigger:hover { background: #F4F5F7; }
.user-trigger:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.user-trigger.open { background: #F4F5F7; }
.user-chevron {
  color: var(--ink-4); flex-shrink: 0;
  transition: transform .22s cubic-bezier(.34,1.4,.64,1), color .18s ease;
}
.user-trigger.open .user-chevron { transform: rotate(180deg); color: var(--ink-3); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--lime), var(--lime-deep));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--ink); font-size: 15px;
  flex-shrink: 0;
}
.user-meta {
  display: flex; flex-direction: column; line-height: 1.2;
  white-space: nowrap; flex-shrink: 0;
}
.user-name { font-weight: 700; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.user-role { font-size: 11px; color: var(--ink-4); white-space: nowrap; flex-shrink: 0; }

/* 用户下拉菜单（相对 .user-nav 定位，右边缘与用户区域精确对齐） */
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 216px; z-index: 320;
  background: #fff; border: 1px solid var(--line-2);
  border-radius: 14px; box-shadow: 0 12px 34px rgba(16,24,40,.16);
  padding: 6px;
  animation: userMenuIn .16s cubic-bezier(.22,1,.36,1);
}
.user-menu.hidden { display: none; }
@keyframes userMenuIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.user-menu-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 12px;
}
.user-menu-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.user-menu-info .user-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.user-menu-info .user-role { font-size: 11px; }
.user-menu-divider { height: 1px; background: var(--line); margin: 2px 6px; }
.user-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: none; background: transparent; text-align: left;
  padding: 9px 10px; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
  transition: background .14s ease, color .14s ease;
}
.user-menu-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.user-menu-item:hover { background: var(--lime-soft); color: var(--ink); }
.user-menu-item.danger { color: var(--red); }
.user-menu-item.danger:hover { background: var(--red-bg, #FEF2F2); color: var(--red); }

/* 导航项图标缩放 */
.nav-item svg { transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.nav-item.animating svg { animation: navIconPop .38s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes navIconPop {
  0%   { transform: scale(1); }
  30%  { transform: scale(.72); }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* 文字颜色渐变（激活态亮色覆盖） */
.nav-item svg { color: inherit; }

/* 页面内容淡入 + 沿点击方向轻推（顶部导航为水平方向） */
.page {
  animation: pageSlideLeft .38s cubic-bezier(.22,1,.36,1) both;
}
.page.slide-left  { animation-name: pageSlideLeft; }
.page.slide-right { animation-name: pageSlideRight; }
@keyframes pageSlideLeft {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pageSlideRight {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============ 主体 ============ */
.page.hidden { display: none; }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.page-sub { color: var(--ink-3); margin-top: 4px; font-size: 14px; }
.date-chip {
  background: #fff; border: 1px solid var(--line-2);
  padding: 8px 14px; border-radius: 10px; font-size: 13px; color: var(--ink-3);
  display: flex; align-items: center; gap: 8px;
}

/* ============ 统计卡片 ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px; margin-bottom: 20px;
}
.stat-card {
  background: var(--card); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  border: 1px solid var(--line);
  min-height: 148px; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card.lg { grid-row: span 1; }
.stat-card.highlight {
  background: linear-gradient(145deg, #DDF7C0, var(--lime));
  border: none;
}
.stat-card.highlight .stat-value { color: var(--ink); }
.stat-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
  margin-bottom: 12px;
}
.stat-icon {
  width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-icon.orange { background: var(--orange-bg); color: var(--orange); }
.stat-icon.blue { background: var(--blue-bg); color: var(--blue); }
.stat-icon.purple { background: var(--purple-bg); color: var(--purple); }
.stat-value { font-size: 32px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.stat-sub { font-size: 12px; color: var(--ink-4); margin-top: 8px; }
.stat-trend { font-size: 12px; color: var(--ink-4); margin-top: 8px; }
.trend.up { color: var(--green); font-weight: 700; }
.trend.down { color: var(--red); font-weight: 700; }

.progress-track { margin-top: auto; height: 6px; border-radius: 3px; background: #f0f1f4; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--lime-deep); transition: width .8s cubic-bezier(.22,1,.36,1); }

.mini-bars {
  position: absolute; bottom: 14px; left: 20px; right: 20px;
  height: 26px; display: flex; align-items: flex-end; gap: 3px;
}
.mini-bars span { flex: 1; background: var(--lime-soft); border-radius: 2px 2px 0 0; }
.mini-bars span.hi { background: var(--lime); }

/* ============ 卡片 & 图表 ============ */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 20px;
}
/* 同一页面内相邻卡片之间留出间距，避免贴在一起 */
.page > .card + .card { margin-top: 16px; }
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.card-title { font-size: 16px; font-weight: 700; }
.card-sub { font-size: 12px; color: var(--ink-4); margin-top: 2px; }
.pill {
  font-size: 12px; font-weight: 600; padding: 4px 10px;
  background: #F4F5F7; color: var(--ink-3); border-radius: 999px;
}
.pill.green { background: var(--lime-soft); color: #5a9b1e; }
.chart-wrap { height: 240px; position: relative; }
.chart-wrap.sm { height: 220px; }

.bottom-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* 最近记录 */
.recent-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.recent-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px;
  border-radius: 10px; transition: background .2s;
}
.recent-item:hover { background: #f7f8fa; }
.recent-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.recent-dot.orange { background: var(--orange); }
.recent-main { flex: 1; min-width: 0; }
.recent-code { font-family: 'Manrope'; font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-meta { font-size: 11px; color: var(--ink-4); }
.recent-status { font-size: 11px; font-weight: 700; }
.recent-status.active { color: var(--green); }
.recent-status.unused { color: var(--orange); }
.recent-status.expired { color: var(--red); }
.recent-status.revoked { color: var(--ink-4); }

/* ============ 生成页 ============ */
.gen-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: span 2; }
/* 发布增量更新：共用 6 列栅格，第一行 3 个、第二行 2 个、说明整行 */
.update-form-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.update-form-grid > .field.col-2 { grid-column: span 2; }
.update-form-grid > .field.col-3 { grid-column: span 3; }
.update-form-grid > .field.col-6 { grid-column: span 6; }
/* 第二行两个标签底部对齐；仅当窄到标签换行时才补等高，输入框仍对齐 */
.update-form-grid > .field.col-3 > label { display: flex; align-items: flex-end; }
@media (max-width: 1100px) {
  .update-form-grid > .field.col-3 > label { min-height: 40px; }
}
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--red); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s; background: #fff; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--lime-deep); box-shadow: 0 0 0 3px var(--lime-soft);
}
.hint { font-size: 11px; color: var(--ink-4); }
.gen-actions { margin-top: 20px; }

.gen-result-card { display: flex; flex-direction: column; }
.gen-result-list { flex: 1; overflow-y: auto; max-height: 400px; }
.gen-code-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 8px; background: var(--lime-soft);
}
.gen-code-text { font-family: 'Manrope'; font-weight: 700; font-size: 14px; color: var(--ink); letter-spacing: .3px; }
.gen-code-copy { border: none; background: transparent; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.gen-code-copy:hover { color: var(--green); }
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 50px 20px; color: var(--ink-4); gap: 10px; text-align: center;
}
.empty-state p { font-size: 13px; }
.copy-bar { margin-top: 12px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 700; border: none;
  transition: all .2s ease;
}
.btn.primary { background: var(--ink); color: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15); }
.btn.primary:hover { background: #000; transform: translateY(-1px); }
.btn.primary:active { transform: scale(.98); }
.btn.ghost { background: #F4F5F7; color: var(--ink-2); }
.btn.ghost:hover { background: #e9eaee; }
.btn.lime { background: var(--lime); color: var(--ink); }
.btn.lime:hover { background: var(--lime-deep); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: var(--red-bg); color: var(--red); }
.btn.danger:hover { background: #fecaca; }

/* ============ 表格 ============ */
.filter-bar { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; }
.filter-bar select {
  border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 12px;
  font-size: 13px; background: #fff; outline: none;
}
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-4);
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap; text-transform: uppercase; letter-spacing: .3px;
}
.data-table td {
  padding: 12px; font-size: 13px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: #fafbfc; }
.code-cell { font-family: 'Manrope'; font-weight: 600; font-size: 12px; color: var(--ink-2); }
.mono { font-family: 'Manrope'; font-size: 12px; color: var(--ink-3); }

.status-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.status-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-tag.active { background: var(--green-bg); color: var(--green); }
.status-tag.unused { background: var(--orange-bg); color: var(--orange); }
.status-tag.expired { background: var(--red-bg); color: var(--red); }
.status-tag.revoked { background: #F3F4F6; color: var(--ink-4); }

.type-tag {
  display: inline-block; padding: 3px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
}
.type-tag.perpetual { background: var(--green-bg); color: var(--green); }
.type-tag.annual { background: var(--blue-bg); color: var(--blue); }
.type-tag.monthly { background: var(--purple-bg); color: var(--purple); }

.row-actions { display: flex; gap: 6px; }
.row-actions .icon-btn { width: 30px; height: 30px; border-radius: 8px; background: transparent; }
.row-actions .icon-btn:hover { background: #f0f1f4; }
.icon-btn.copied { color: var(--green) !important; }

/* ============ 推送平台页面 ============ */
.type-tag.t-system { background: var(--blue-bg); color: var(--blue); }
.type-tag.t-update { background: var(--orange-bg); color: var(--orange); }
.type-tag.t-target { background: var(--purple-bg); color: var(--purple); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.empty-cell { text-align: center; color: var(--ink-4); padding: 32px 0; font-size: 13px; }
.muted { color: var(--ink-4); font-size: 12px; }
.data-table td .btn.sm + .btn.sm { margin-left: 6px; }
/* 表格内操作按钮横排，不换行（如"下架/发消息/删除"） */
.row-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.row-actions .btn.sm { white-space: nowrap; }
.mono-link { color: var(--blue); text-decoration: underline; font-size: 12px; word-break: break-all; }
/* 完整更新包地址：等宽、可换行、不溢出 */
.mono-link.full {
  display: block; font-size: 11px; word-break: break-all; white-space: normal;
  line-height: 1.5; margin-bottom: 2px; text-decoration: none;
}
.mono-link.full:hover { text-decoration: underline; }

/* 已发布消息：固定等宽列，列间距一致；表头与数据同起点左对齐；操作按钮横排 */
.push-msg-table {
  table-layout: fixed;
  min-width: 900px;
}
.push-msg-table th,
.push-msg-table td {
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}
.push-msg-table .empty-cell { text-align: center; }
.push-msg-table .row-actions { flex-wrap: nowrap; }
.push-msg-table .row-actions .btn.sm { flex: 0 0 auto; }
.push-msg-table .row-actions .btn.sm + .btn.sm { margin-left: 0; }

/* 更新清单：固定列宽、统一列间距，标题与数据居中 */
.upd-table {
  table-layout: fixed;
  min-width: 1080px;
}
.upd-table th,
.upd-table td {
  padding: 12px;
  text-align: center;
  vertical-align: middle;
}
.upd-table .type-tag,
.upd-table .status-tag { white-space: nowrap; }
/* 说明：按序号分段，段内文字两端对齐 */
.upd-table td.upd-notes { text-align: center; }
.upd-note {
  margin: 0 0 8px; text-align: justify; text-align-last: left;
  line-height: 1.7; font-size: 12px; color: var(--ink-3);
  word-break: break-word;
}
.upd-note:last-child { margin-bottom: 0; }
.upd-note-no { font-weight: 700; color: var(--ink-2); margin-right: 4px; }
.upd-note-lead { font-weight: 600; color: var(--ink-2); }
/* 发布时间：日期一行、时间一行 */
.upd-date span { display: block; white-space: nowrap; }
/* 操作：按钮组居中，中间「发消息」与表头同中线 */
.upd-table .row-actions { justify-content: center; flex-wrap: nowrap; }
.upd-table .row-actions .btn.sm { flex: 0 0 auto; }
.upd-table .row-actions .btn.sm + .btn.sm { margin-left: 0; }

/* ============ 软件卡片 ============ */
.software-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.soft-card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--line);
  padding: 20px; box-shadow: var(--shadow); position: relative;
  transition: transform .2s, box-shadow .2s;
}
.soft-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.soft-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.soft-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--lime-soft); display: flex; align-items: center; justify-content: center;
  color: var(--lime-deep);
}
.soft-name { font-weight: 700; font-size: 15px; }
.soft-ver { font-size: 12px; color: var(--ink-4); }
.soft-desc { font-size: 12px; color: var(--ink-3); min-height: 34px; }
.soft-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.soft-price { font-weight: 800; font-size: 18px; }
.soft-price small { font-size: 11px; font-weight: 500; color: var(--ink-4); }
.soft-count { font-size: 12px; color: var(--ink-4); }
.soft-actions { display: flex; gap: 6px; margin-top: 14px; }

/* ============ 销售统计 ============ */
.sales-summary {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px;
}
.sale-stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
}
.sale-stat span { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.sale-stat strong { font-size: 28px; font-weight: 800; letter-spacing: -1px; }

/* ============ 模态框 ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20,22,26,.4); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}
.modal-mask.hidden { display: none; }
.modal {
  background: #fff; border-radius: 20px; width: 460px; max-width: 92vw;
  padding: 26px; box-shadow: 0 20px 50px rgba(0,0,0,.2);
  animation: popIn .25s cubic-bezier(.22,1,.36,1);
}
@keyframes popIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 20px; }
.modal .form-grid { grid-template-columns: 1fr; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ============ Toast ============ */
.toast-wrap { position: fixed; top: 80px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  display: flex; align-items: center; gap: 8px;
  animation: slideIn .3s cubic-bezier(.22,1,.36,1);
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ============ 认证页面 ============ */
.auth-page {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.auth-page.hidden { display: none; }
.auth-bg {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.auth-grid {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(185,242,110,.15) 0, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(143,209,79,.12) 0, transparent 45%),
    linear-gradient(rgba(20,22,26,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,22,26,.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
}
.auth-container {
  position: relative; z-index: 1;
  width: 400px; max-width: 92vw;
  display: flex; flex-direction: column; align-items: center;
  animation: popIn .4s cubic-bezier(.22,1,.36,1);
}
.auth-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.auth-brand .logo-mark { width: 44px; height: 44px; border-radius: 13px; }
.auth-brand .logo-text { font-size: 24px; }
.auth-card {
  width: 100%; background: var(--card);
  border-radius: 24px; padding: 36px 32px;
  box-shadow: 0 12px 40px rgba(16,24,40,.1);
  border: 1px solid var(--line);
}
.auth-form.hidden { display: none; }
.auth-title { font-size: 24px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 6px; }
.auth-sub { font-size: 14px; color: var(--ink-3); margin-bottom: 26px; }
.auth-fields { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.auth-btn { width: 100%; justify-content: center; padding: 13px; font-size: 15px; border-radius: 12px; }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; }
.auth-switch { text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 18px; }
.auth-switch a { color: var(--lime-deep); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-footer { margin-top: 24px; font-size: 12px; color: var(--ink-4); }

/* 应用壳 */
.app-shell.hidden { display: none; }

/* ============ 用户管理 ============ */
.user-cell { display: flex; align-items: center; gap: 10px; }
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.self-tag {
  font-size: 10px; font-weight: 700; color: var(--green);
  background: var(--green-bg); padding: 2px 6px; border-radius: 6px;
}
.perm-badges { display: flex; flex-wrap: wrap; gap: 4px; max-width: 280px; }
.perm-chip {
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
}
.perm-chip.on { background: var(--lime-soft); color: #5a9b1e; }
.perm-chip.off { background: #F4F5F7; color: var(--ink-4); }
.perm-hint { font-size: 13px; color: var(--ink-3); margin: -8px 0 16px; }
.perm-checks { display: flex; flex-direction: column; gap: 10px; }
.perm-check {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 10px;
  cursor: pointer; transition: all .2s; font-size: 14px; font-weight: 600;
}
.perm-check.on { border-color: var(--lime-deep); background: var(--lime-soft); }
.perm-check input { width: 16px; height: 16px; accent-color: var(--lime-deep); }
.perm-modal { text-align: center; }
.perm-icon {
  width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%;
  background: var(--orange-bg); color: var(--orange);
  display: flex; align-items: center; justify-content: center;
}
.perm-text { font-size: 14px; color: var(--ink-3); line-height: 1.7; margin-bottom: 22px; }
.modal-actions.center { justify-content: center; }

/* ============ 远程监测 ============ */
.remote-actions { display: flex; gap: 10px; }
.remote-summary {
  display: grid; grid-template-columns: repeat(3, 1fr) 2fr; gap: 16px; margin-bottom: 20px;
}
.remote-soft-card { padding: 16px; }
.soft-dist-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.soft-dist-item { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.soft-dist-name { width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--ink-2); }
.soft-dist-bar { flex: 1; height: 8px; background: #F0F1F4; border-radius: 4px; overflow: hidden; }
.soft-dist-bar span { display: block; height: 100%; background: var(--lime-deep); border-radius: 4px; }
.soft-dist-count { font-weight: 700; color: var(--ink-3); min-width: 20px; text-align: right; }
.crm-code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--lime-soft); border-radius: 12px; padding: 16px;
}
.crm-code { font-family: 'Manrope'; font-weight: 800; font-size: 20px; letter-spacing: 1px; color: var(--ink); word-break: break-all; }

/* ============ 软件资产页 ============ */
.asset-tabs {
  display: flex; gap: 6px; margin-bottom: 18px;
  background: #fff; border: 1px solid var(--line);
  padding: 5px; border-radius: 12px; width: fit-content;
}
.asset-tab {
  border: none; background: transparent;
  padding: 8px 16px; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
  transition: all .18s ease;
}
.asset-tab:hover { background: #f2f3f5; color: var(--ink); }
.asset-tab.active {
  background: var(--lime); color: var(--ink);
  box-shadow: 0 2px 8px rgba(185,242,110,.4);
}
.asset-view.hidden { display: none; }
.asset-soft-badges { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.asset-top-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 6px; border-radius: 10px;
  transition: background .14s;
}
.asset-top-row:hover { background: #f8f9fb; }
.asset-top-rank {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.asset-top-info { flex: 1; min-width: 0; }
.asset-top-name { font-weight: 700; font-size: 14px; }
.asset-top-vendor { font-size: 12px; color: var(--ink-4); }
.asset-top-stats { display: flex; gap: 12px; font-size: 12px; color: var(--ink-3); flex-shrink: 0; }
.asset-top-usage { color: var(--blue); font-weight: 600; }

/* ============ 响应式 ============ */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .bottom-grid { grid-template-columns: 1fr; }
  .gen-layout { grid-template-columns: 1fr; }
  .remote-summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  /* 窄屏：侧边栏收起为紧凑模式 */
  .sidebar { width: 68px; padding: 16px 8px; }
  .sidebar-logo { justify-content: center; padding: 4px 0 16px; }
  .sidebar-logo .logo-text { display: none; }
  .nav-item { justify-content: center; padding: 11px 8px; }
  .nav-item { font-size: 0; }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-item::after { content: attr(data-tip); position: absolute; left: 100%; top: 50%; transform: translateY(-50%); background: var(--ink); color: #fff; padding: 4px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; margin-left: 8px; }
  .nav-item:hover::after { opacity: 1; }
  .main { margin-left: 68px; }
  .topbar { margin-left: 68px; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 14px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: span 1; }
  .update-form-grid { grid-template-columns: minmax(0, 1fr); }
  .update-form-grid > .field.col-2,
  .update-form-grid > .field.col-3,
  .update-form-grid > .field.col-6 { grid-column: span 1; }
  .update-form-grid > .field.col-3 > label { min-height: 0; }
  .search-box { width: 80px; }
  .container { padding: 0 14px; }
  .asset-tabs { flex-wrap: wrap; width: 100%; }
}
