/* ===== COS 管理后台 · Element-UI 风格（参考 cms-copy 后台） ===== */
:root {
  --bg: #f5f6fa;
  --panel: #ffffff;
  --border: #e4e7ed;
  --border-soft: #ebeef5;
  --text: #303133;
  --label: #606266;
  --muted: #909399;
  --primary: #409eff;
  --primary-d: #66b1ff;
  --success: #67c23a;
  --warning: #e6a23c;
  --danger: #f56c6c;
  --header: #1f2d3d;
  --sidebar-w: 200px;
  --topbar-h: 56px;
  --radius: 6px;
  --shadow: 0 1px 4px rgba(0,21,41,.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }

/* ===== 顶部栏（深蓝，参考 cms 后台 header） ===== */
.topbar {
  height: var(--topbar-h);
  background: var(--header);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.topbar .brand {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar .brand::before {
  content: "";
  width: 8px; height: 18px;
  background: var(--primary);
  border-radius: 2px;
  display: inline-block;
}
.topbar .brand-link { color: #fff; text-decoration: none; }
.topbar .brand-link:hover { color: #fff; opacity: .85; }
.topbar .home-link {
  margin-left: 4px;
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #cdd4e0;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  text-decoration: none;
  transition: all .15s ease;
}
.topbar .home-link:hover { color: #fff; background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.35); }
.topbar-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #cdd4e0; }
.topbar-user .uname { color: #fff; }
.topbar-user .btn-link { color: #cdd4e0; }
.topbar-user .btn-link:hover { color: #fff; }

/* 顶栏居中随机语录 */
.topbar-quote {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: 50vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 14px; font-weight: 600; color: #ffd54f; pointer-events: none;
  letter-spacing: .5px;
}

/* ===== 布局 ===== */
.shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }

/* ===== 左侧导航（深色面板，参考 cms-copy/web 的 Layout 侧边栏） ===== */
.sidebar {
  width: var(--sidebar-w);
  background: #304156;
  color: #bfcbd9;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  /* 固定不随右侧内容滚动：粘在顶栏下方，独立内部滚动 */
  position: sticky;
  top: var(--topbar-h);
  align-self: flex-start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}
.sidebar .nav-group { margin-top: 14px; }
.sidebar .nav-title {
  font-size: 15px;
  font-weight: 700;
  color: #c2cede;
  letter-spacing: 1px;
  padding: 12px 20px 8px;
  text-transform: none;
}
.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px 10px 32px;
  color: #9fb0c3;
  text-decoration: none;
  border-left: 3px solid transparent;
  font-size: 13px;
  transition: background .15s, color .15s;
}
.sidebar .nav-item:hover { background: #263445; color: #fff; }
.sidebar .nav-item.active {
  background: #263445;
  color: #409eff;
  border-left-color: #409eff;
  font-weight: 600;
}

/* ===== 内容区 ===== */
.content { flex: 1; padding: 20px; min-width: 0; }
.page { max-width: 1200px; }
.page-wide { max-width: none; }
/* 新增/编辑页全屏：撑满内容区，去掉宽度限制 */
.page-full { max-width: none; width: 100%; }
.page-full .form { max-width: none; }
.page-title { margin: 0 0 16px; font-size: 18px; color: var(--text); font-weight: 600; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.muted { color: var(--muted); }
.page-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(100vh - 120px);
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 16px 24px;
  box-sizing: border-box;
}
.welcome-card {
  width: 100%;
  max-width: 720px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 48px;
  text-align: center;
  box-sizing: border-box;
}
.stat-cards {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 22px;
  box-sizing: border-box;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(107, 79, 224, .15);
}
.stat-icon {
  flex: 0 0 auto;
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.stat-icon svg {
  width: 26px; height: 26px;
  display: block;
}
.stat-icon--violet { background: linear-gradient(135deg, #7c6cf0, #a78bfa); }
.stat-icon--blue   { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.stat-icon--amber  { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.stat-icon--green  { background: linear-gradient(135deg, #10b981, #34d399); }
.stat-body { display: flex; flex-direction: column; line-height: 1.2; }
.stat-num { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-label { margin-top: 4px; font-size: 13px; color: var(--muted); }
@media (max-width: 720px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
.welcome-title {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 2px;
}
.welcome-sub {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.welcome-date {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--muted);
}

/* ===== 卡片（仪表盘入口） ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: .15s;
}
.card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(64,158,255,.18); }
.card-icon { font-size: 28px; margin-bottom: 8px; }
.card-label { font-weight: 500; }

/* ===== 面板容器 ===== */
.panel-box {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

/* ===== 表格 ===== */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table th, .table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.table-wrap { overflow-x: auto; max-width: 100%; }
.menu-tabs { display: flex; gap: 8px; justify-content: center; margin: 12px 0; }
.menu-tab { padding: 6px 16px; border-radius: 999px; border: 1px solid var(--border-soft); color: var(--text); text-decoration: none; font-size: 13px; transition: all .15s; }
.menu-tab:hover { border-color: var(--primary); color: var(--primary); }

.search-bar { display: flex; gap: 10px; align-items: center; margin: 14px 0 6px; flex-wrap: wrap; }
.search-input { flex: 0 1 240px; padding: 7px 12px; border: 1px solid var(--border-soft); border-radius: 8px; font-size: 13px; outline: none; }
.search-input:focus { border-color: var(--primary); }
.search-status { padding: 7px 10px; border: 1px solid var(--border-soft); border-radius: 8px; font-size: 13px; background: #fff; }
.btn-search { padding: 7px 18px; border: 1px solid var(--primary); border-radius: 8px; background: var(--primary); color: #fff; font-size: 13px; cursor: pointer; }
.btn-search:hover { opacity: .9; }
.btn-reset { margin-left: 4px; font-size: 12px; color: var(--text-soft); text-decoration: none; }
.btn-reset:hover { color: var(--primary); }
.menu-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
/* trend（年度趋势）四列：年份 / 年度热点 / 热门来源数 / 热门角色数
   固定布局 + 显式列宽，让分布更平衡（数字统计列收窄并居中） */
.table.table-trend { table-layout: fixed; width: 100%; }
.table.table-trend td, .table.table-trend th { white-space: normal; word-break: break-word; }
/* 第 1 列：年份（窄） */
.table.table-trend th:nth-child(1),
.table.table-trend td:nth-child(1) { width: 14%; text-align: left; }
/* 第 2 列：年度热点（宽，承载较长摘要） */
.table.table-trend th:nth-child(2),
.table.table-trend td:nth-child(2) { width: 44%; text-align: left; }
/* 第 3、4 列：热门来源数 / 热门角色数（窄数字列，居中） */
.table.table-trend th:nth-child(3),
.table.table-trend td:nth-child(3),
.table.table-trend th:nth-child(4),
.table.table-trend td:nth-child(4) { width: 21%; text-align: center; }
.table th { background: #f5f7fa; font-weight: 600; color: var(--muted); font-size: 13px; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafcff; }
.table .empty { text-align: center; color: var(--muted); padding: 24px; }
.table .col-op { width: 90px; white-space: nowrap; }
.table .col-op a { margin-right: 6px; }
.table .col-op .op-form { display: inline; margin: 0; padding: 0; }
.table .col-op .op-form .btn-danger { background: none; border: none; color: var(--danger); padding: 0; cursor: pointer; font-size: 14px; }
.table .col-op .op-form .btn-danger:hover { color: #f78989; text-decoration: underline; }
.table .col-cover { width: 80px; text-align: left; }
/* ===== 角色表（/character，12 列）：固定布局 + 显式列宽，避免横向滚动条 ===== */
.table.table-character { table-layout: fixed; width: 100%; }
.table.table-character td, .table.table-character th { white-space: normal; word-break: break-word; }
.table.table-character th:nth-child(1), .table.table-character td:nth-child(1) { width: 5%; }   /* ID */
.table.table-character th:nth-child(2), .table.table-character td:nth-child(2) { width: 10%; }  /* 来源 */
.table.table-character th:nth-child(3), .table.table-character td:nth-child(3) { width: 11%; }  /* 名称 */
.table.table-character th:nth-child(4), .table.table-character td:nth-child(4) { width: 6%; }   /* 性别 */
.table.table-character th:nth-child(5), .table.table-character td:nth-child(5) { width: 5%; }   /* 排序 */
.table.table-character th:nth-child(6), .table.table-character td:nth-child(6) { width: 6%; }   /* 状态 */
.table.table-character th:nth-child(7), .table.table-character td:nth-child(7) { width: 8%; }   /* 封面 */
.table.table-character th:nth-child(8), .table.table-character td:nth-child(8) { width: 11%; }  /* 服装 */
.table.table-character th:nth-child(9), .table.table-character td:nth-child(9) { width: 11%; }  /* 饰品 */
.table.table-character th:nth-child(10), .table.table-character td:nth-child(10) { width: 11%; } /* 妆造 */
.table.table-character th:nth-child(11), .table.table-character td:nth-child(11) { width: 7%; } /* 创建人 */
.table.table-character th:nth-child(12), .table.table-character td:nth-child(12) { width: 11%; } /* 创建时间 */
.table.table-character th:nth-child(13), .table.table-character td:nth-child(13) { width: 110px; white-space: nowrap; } /* 操作 */
.table.table-character td:nth-child(13) .op-form,
.table.table-character td:nth-child(13) .btn-link { display: inline-block; vertical-align: middle; }
.table.table-character td:nth-child(13) .op-form { margin-left: 8px; }

/* ===== 列表排序（表头点击切换升/降序） ===== */
.col-sortable { white-space: nowrap; }
.sort-btns { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; }
.sort-btn { color: #bbb; text-decoration: none; cursor: pointer; font-size: 11px; line-height: 1; padding: 1px 2px; }
.sort-btn:hover { color: var(--primary); }
.sort-btn.active { color: var(--primary); font-weight: bold; }
.table .thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); background: #f5f5f5; transition: transform .12s; cursor: zoom-in; }
.table .thumb:hover { transform: scale(1.06); }
.thumb-wrap { position: relative; display: inline-block; }
.thumb-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; line-height: 18px;
  background: var(--primary); color: #fff; font-size: 11px;
  border-radius: 9px; text-align: center; padding: 0 4px;
  font-weight: 600; pointer-events: none; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

/* ===== 图片上传组件（通用） ===== */
.field-hint { margin: 0 0 8px; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ===== 删除关联提示弹窗 ===== */
.modal-mask {
  display: none;
  position: fixed; left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.45);
  align-items: center; justify-content: center;
  z-index: 1000;
}
.modal {
  background: #fff; border-radius: 8px; width: 420px; max-width: 92vw;
  box-shadow: 0 8px 30px rgba(0,0,0,.2); overflow: hidden;
}
.modal-head {
  padding: 14px 18px; font-size: 16px; font-weight: 600;
  background: #fff4f4; color: var(--danger); border-bottom: 1px solid var(--border);
}
.modal-body { padding: 16px 18px; font-size: 14px; color: #333; }
.modal-body p { margin: 0 0 10px; }
.ref-list { margin: 0; padding-left: 18px; }
.ref-list li { margin: 6px 0; }
.ref-list b { color: var(--danger); }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--border); background: #fafafa;
}
.modal-foot .op-form { margin: 0; }
.field-size-hint { margin: 0 0 8px; font-size: 12px; color: #e6a23c; line-height: 1.5; padding-left: 2px; }

/* ===== 系统配置页（/setting） ===== */
.setting-wrap { max-width: none; width: 100%; }
.setting-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 20px;
}
.setting-card .section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.setting-card .section-title::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--primary);
}
.setting-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border-soft);
}
.setting-row:last-child { border-bottom: none; }
.setting-row .s-label { flex: 0 0 260px; text-align: left; }
.setting-row .s-label .s-name { font-size: 14px; font-weight: 600; color: var(--text); line-height: 20px; }
.setting-row .s-label .s-remark { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 6px; word-break: break-word; white-space: normal; }
.setting-row .s-body { flex: 1; min-width: 0; display: flex; align-items: center; }
.setting-row .s-control { display: flex; align-items: center; justify-content: flex-start; gap: 14px; flex-wrap: wrap; width: 100%; }
.setting-row .s-control > .radio-inline,
.setting-row .s-control > input,
.setting-row .s-control > textarea { margin: 0; padding: 0; text-align: left; }
.setting-row .s-control > .radio-inline { line-height: 20px; }
.setting-row .s-textarea {
  width: 100%;
  max-width: 520px;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.setting-row .s-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.setting-save {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
  z-index: 30;
}
.setting-save .btn { min-width: 120px; }
.setting-hint-inline { font-size: 12px; color: var(--muted); margin-left: 6px; }
.img-add { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.img-add input[type=file] { flex: 1; min-width: 0; padding: 7px 10px; border: 1px dashed var(--border); border-radius: 6px; background: #fafbfc; font-size: 13px; }
.img-add .img-hint { font-size: 12px; color: var(--muted); white-space: nowrap; }
.img-preview { list-style: none; margin: 0; padding: 4px 0 0; display: grid !important; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; gap: 10px !important; align-items: start !important; }
.img-item { position: relative; display: flex !important; flex-direction: column !important; align-items: center !important; gap: 4px !important; padding: 4px !important; border: 1px solid var(--border) !important; border-radius: 8px !important; background: #fff !important; transition: border-color .15s, box-shadow .15s !important; height: fit-content !important; }
.img-item.is-default { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(64,124,255,0.12); }
.img-item img { width: 100%; aspect-ratio: 3 / 2; height: auto; object-fit: cover; border-radius: 6px; background: #f5f5f5; display: block; cursor: zoom-in; transition: transform .12s; }
.img-item img:hover { transform: scale(1.03); }
.img-item .img-meta { position: absolute; top: 12px; left: 12px; }
.img-item .img-default-tag { display: none; background: var(--primary); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 10px; }
.img-item.is-default .img-default-tag { display: inline-block; }
.img-item .img-del { position: absolute; top: 10px; right: 10px; color: #fff; background: rgba(245,108,108,.92); border: none; border-radius: 4px; padding: 3px 8px; font-size: 12px; cursor: pointer; line-height: 1.2; }
.img-item .radio-inline { white-space: nowrap; font-size: 12px; color: var(--label); }
.img-size { margin-top: 2px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.4; }

/* ===== 分页（合并到一行） ===== */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--muted);
}
.pager-size-wrap { display: inline-flex; align-items: center; gap: 4px; }
.pager-size {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  margin: 0 4px;
}
.pager-divider { width: 1px; height: 18px; background: var(--border-soft); margin: 0 4px; }
.pager-nav { display: flex; align-items: center; gap: 8px; }
.pg {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--label);
  font-size: 13px;
  text-decoration: none;
  transition: all .15s;
}
.pg:hover { border-color: var(--primary); color: var(--primary); }
.pg-disabled, .pg-disabled:hover {
  color: #c0c4cc;
  border-color: var(--border);
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== 表单（水平栅格，参考 cms-copy/Element-UI） ===== */
.form {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  max-width: 720px;
}
.field {
  display: flex;
  align-items: flex-start;
  margin-bottom: 18px;
}
.field label {
  flex: 0 0 110px;
  text-align: right;
  padding-right: 14px;
  padding-top: 9px;
  font-size: 14px;
  color: var(--label);
  line-height: 1.4;
}
.field label.is-required { color: var(--text); font-weight: 600; }
.field label.is-required::after { content: "："; }
.field label .req { color: #f56c6c; margin-left: 2px; font-weight: 700; }
.field input.is-invalid, .field select.is-invalid, .field textarea.is-invalid {
  border-color: #f56c6c !important;
  box-shadow: 0 0 0 2px rgba(245,108,108,.18) !important;
}
.form-error { position: absolute; right: 24px; bottom: 100%; margin-bottom: 4px; color: #f56c6c; font-size: 13px; white-space: nowrap; pointer-events: none; }
.field label::after { content: "："; }

/* 只读字段（如 user.kind 编辑态不允许修改）展示为禁用态 */
.readonly-field {
  flex: 1; min-width: 0; height: 38px; line-height: 38px;
  padding: 0 12px; border: 1px solid var(--border, #dcdfe6);
  border-radius: 8px; background: #f5f7fa; color: var(--muted, #909399);
  font-size: 14px;
}

/* 角色梗标签展示（纵向换行，每个梗一行） */
.meme-tags { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 7px; }
.meme-tag {
  display: block; padding: 4px 12px;
  background: #f0ecff; color: #6b4fe0;
  border-radius: 8px; font-size: 13px; line-height: 1.5;
}
.meme-empty { color: var(--muted); font-size: 13px; padding-top: 2px; }
.meme-editor { flex: 1; min-width: 0; }
.meme-input-row { display: flex; gap: 8px; margin-bottom: 8px; }
.meme-input-row .meme-input { flex: 1; }
.meme-input-row .meme-add { flex: 0 0 auto; height: 38px; padding: 0 16px; }
.meme-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; background: #f0ecff; color: #6b4fe0; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.meme-del { border: none; background: transparent; color: #6b4fe0; font-size: 16px; line-height: 1; cursor: pointer; padding: 0 0 0 2px; opacity: .7; }
.meme-del:hover { opacity: 1; }
.field input, .field select, .field textarea {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 80px; resize: vertical; line-height: 1.5; }
.meme-display {
  flex: 1; min-width: 0;
  padding: 9px 12px;
  border: 1px solid #dcdfe6; border-radius: 4px;
  background: #f5f7fa; color: #606266;
  font-family: monospace; font-size: 13px; line-height: 1.5;
  white-space: pre-line;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #c0c4cc; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(64,158,255,.2);
}
.radio-inline { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; font-size: 13px; color: var(--text); cursor: pointer; vertical-align: middle; }
.radio-inline input[type=radio] { margin: 0; vertical-align: middle; accent-color: var(--primary); }
/* ===== 年度趋势「导入 JSON」弹窗表单 ===== */
.import-form .import-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.import-form label { width: 64px; font-size: 13px; color: #606266; flex-shrink: 0; }
.import-form input[type=number] { width: 120px; }
.import-form textarea { flex: 1; font-family: monospace; font-size: 12px; line-height: 1.5; }
.import-actions { display: flex; justify-content: flex-end; }
.trend-count { text-align: center; }
.badge-num { display: inline-block; min-width: 28px; padding: 2px 8px; border-radius: 10px; background: #ecf5ff; color: var(--primary); font-weight: 600; font-size: 12px; }
.form-actions {
  margin-top: 8px;
  padding: 18px 24px 18px 124px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  position: sticky;
  bottom: 0;
  top: auto;
  background: #fff;
  z-index: 30;
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  transition: .15s;
}
.btn:hover { color: var(--primary); border-color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
.btn-ghost { background: #f4f4f5; border-color: #d9d9d9; color: #606266; }
.btn-ghost:hover { background: #e9e9eb; color: #606266; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #f78989; border-color: #f78989; color: #fff; }
.btn-link { color: var(--primary); text-decoration: none; background: none; border: none; cursor: pointer; padding: 0; }
.btn-link:hover { color: var(--primary-d); }

/* ===== 语义标签（参考 cms 方法徽标配色） ===== */
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
}
.tag-success { background: #f0f9eb; color: var(--success); }
.tag-danger  { background: #fef0f0; color: var(--danger); }
.tag-warning { background: #fdf6ec; color: var(--warning); }
.tag-info    { background: #ecf5ff; color: var(--primary); }
.tag-muted   { background: #f4f4f5; color: var(--muted); }
.muted-text  { color: var(--muted); }

/* ===== 提示 ===== */
.alert {
  background: #ecf5ff;
  border: 1px solid #d9ecff;
  color: #2c6cb0;
  padding: 10px 14px;
  border-radius: 4px;
  margin: 0 0 16px;
}
/* 数据来源说明（trend 查看页，风格与 alert 呼应） */
.data-source-note {
  background: #ecf5ff;
  border: 1px solid #d9ecff;
  color: #2c6cb0;
  padding: 10px 14px;
  border-radius: 4px;
  margin: 0 0 16px;
}
.data-source-note code {
  font-family: monospace;
  background: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  color: #2d5fb3;
}
.alert.error { background: #fef0f0; border-color: #fde2e2; color: var(--danger); }
.alert.success { background: #f0f9eb; border-color: #e1f3d8; color: var(--success); }
code { background: #eef1f7; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ===== 菜单列表一级/二级分级 ===== */
tr.menu-l1 > td {
  background: #f5f8fc;
  border-top: 2px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
}
tr.menu-l1:first-child > td { border-top: none; }
.menu-l1-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-right: 8px;
}
.menu-l1-sub {
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
}
tr.menu-l2 > td { background: #fff; }
.menu-l2-name {
  padding-left: 30px !important;
  color: #4a5a6e;
}
tr.menu-l2:hover > td { background: #fafbfd; }

/* ===== 登录页 ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1f2d3d 0%, #2c3e50 100%);
}
.login-card {
  background: #fff;
  border-radius: 10px;
  padding: 32px;
  width: 340px;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.login-title { text-align: center; margin: 0 0 22px; font-size: 20px; color: var(--header); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--label); }
.login-form input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
}
.login-form input:focus { outline: none; border-color: var(--primary); }
.login-form .btn { width: 100%; margin-top: 4px; }
.env-label { text-align: center; color: var(--muted); font-size: 12px; margin-top: 4px; letter-spacing: 1px; }
.login-card .hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

/* ===== Element 风格组件 ===== */
/* 按钮 */
.el-button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 16px; height: 32px; line-height: 32px;
  font-size: 14px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  transition: .1s; box-sizing: border-box; white-space: nowrap;
}
.el-button:hover { color: var(--primary); border-color: var(--primary); background: #ecf5ff; }
.el-button--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.el-button--primary:hover { background: #66b1ff; border-color: #66b1ff; }
.el-button--small { height: 28px; padding: 0 10px; font-size: 13px; }

/* 输入框 */
.el-input { position: relative; display: inline-block; width: 100%; }
.el-input__inner {
  width: 100%; height: 32px; line-height: 32px;
  padding: 0 12px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 14px; color: var(--text); background: #fff; box-sizing: border-box;
  transition: border-color .15s;
}
.el-input__inner:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(64,158,255,.15); }
.el-input__prefix { position: absolute; left: 8px; top: 0; height: 32px; display: flex; align-items: center; color: var(--muted); }

/* 单选 */
.el-radio { display: inline-flex; align-items: center; cursor: pointer; font-size: 14px; margin-right: 24px; }
.el-radio__input { display: inline-flex; }
.el-radio__inner {
  width: 14px; height: 14px; border: 1px solid var(--border); border-radius: 50%;
  position: relative; box-sizing: border-box; transition: .15s;
}
.el-radio__original { opacity: 0; width: 0; height: 0; position: absolute; }
.el-radio.is-checked .el-radio__inner { border-color: var(--primary); background: var(--primary); }
.el-radio.is-checked .el-radio__inner::after { content: ""; position: absolute; width: 4px; height: 4px; background: #fff; border-radius: 50%; left: 4px; top: 4px; }
.el-radio.is-checked + label, .el-radio.is-checked { color: var(--primary); }

/* 下拉 */
.el-select { position: relative; display: inline-block; width: 120px; }
.el-select select {
  width: 100%; height: 32px; line-height: 32px;
  padding: 0 30px 0 12px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 14px; color: var(--text); background: #fff; box-sizing: border-box;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  outline: none; cursor: pointer;
}
.el-select select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(64,158,255,.15); }
.el-select::after {
  content: ""; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--muted); pointer-events: none;
}

/* 开关 */
.el-switch { display: inline-flex; align-items: center; cursor: pointer; }
.el-switch__core { position: relative; width: 40px; height: 20px; border-radius: 10px; background: #dcdfe6; transition: background .2s; display: inline-block; }
.el-switch__input { position: absolute; opacity: 0; width: 0; height: 0; }
.el-switch.is-checked .el-switch__core { background: var(--primary); }
.el-switch__label { font-size: 14px; color: var(--text); margin: 0 6px; }

/* 标签页 */
.el-tabs { width: 100%; }
.el-tabs__header { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.el-tabs__item { padding: 0 16px; height: 40px; line-height: 40px; font-size: 14px; color: var(--muted); cursor: pointer; box-sizing: border-box; border-bottom: 2px solid transparent; }
.el-tabs__item.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.el-tabs__content { padding-top: 8px; }

/* 对话框 */
.el-dialog__wrapper { position: fixed; inset: 0; z-index: 2000; }
.el-dialog__mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 2000; }
.el-dialog { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); background: #fff; border-radius: 4px; padding: 16px 20px; min-width: 320px; z-index: 2001; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.el-dialog__title { font-size: 16px; font-weight: 600; }
.el-dialog__body { padding: 16px 0; font-size: 14px; color: var(--text); }

/* 消息提示 */
.el-message { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 3000;
  min-width: 260px; padding: 10px 16px; border-radius: 4px; background: #fff;
  border: 1px solid var(--border); box-shadow: 0 4px 12px rgba(0,0,0,.1); font-size: 14px; }

/* 页头右侧操作区（如 trend 的「导入 JSON」按钮） */
.page-head-actions { display: flex; align-items: center; gap: 10px; }
.page-head-actions .btn { margin: 0; }

/* 年度趋势「导入 JSON」弹窗：加宽以适应 JSON 文本域 */
.modal-import {
  width: 640px;
  max-width: 94vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.modal-import .modal-head { background: #ecf5ff; color: var(--primary); flex-shrink: 0; }
.modal-import .modal-body { flex: 1 1 auto; overflow-y: auto; }
.modal-import .modal-tip { margin: 0 0 14px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.modal-import .import-form { margin-top: 4px; display: flex; flex-direction: column; min-height: 100%; }
.modal-import .import-row:last-of-type { flex: 1 1 auto; display: flex; align-items: stretch; }
.modal-import .import-row textarea { min-height: 280px; resize: vertical; }
.modal-import .import-actions { gap: 10px; flex-shrink: 0; margin-top: 4px; }
.el-message--success { border-color: #e1f3d8; background: #f0f9eb; color: #67c23a; }
.el-message--error { border-color: #fde2e2; background: #fef0f0; color: #f56c6c; }
.el-message--info { border-color: #ebeef5; background: #edf2fc; color: #909399; }
.el-message-fade-enter { opacity: 0; transform: translateX(-50%) translateY(-20px); }
.el-message-fade-leave-active { opacity: 0; transition: opacity .3s; }

/* 卡片 */
.el-card { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 16px; }

/* 内联提示条（如保存成功） */
.alert {
  margin: 16px 0;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.alert-ok {
  color: #67c23a;
  background: #f0f9eb;
  border-color: #e1f3d8;
}
.alert-err {
  color: #f56c6c;
  background: #fef0f0;
  border-color: #fde2e2;
}
.alert-ok a, .alert-err a { color: inherit; }
.alert-icon { margin-right: 8px; font-weight: 700; }
/* alert 转 toast：淡出后隐藏 */
.alert.is-fade {
  opacity: 0;
  max-height: 0;
  margin-top: -8px;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  transform: translateY(-6px);
  transition: opacity .4s ease, max-height .4s ease, padding .4s ease, margin .4s ease, transform .4s ease;
  pointer-events: none;
}

/* 返回顶部 */
.back-to-top {
  position: fixed; bottom: 40px; right: 40px; z-index: 2000;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff; color: var(--primary); font-size: 16px;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .3s, visibility .3s, transform .3s, background .2s, color .2s;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--primary); color: #fff; }

/* 图片查看大图层 */
.img-viewer {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
#img-viewer-mask {
  display: none; position: fixed; inset: 0; z-index: 4000;
  background: rgba(0,0,0,.85);
  align-items: center; justify-content: center;
}
#img-viewer-mask .img-viewer__img {
  max-width: 90vw; max-height: 84vh; border-radius: 4px; box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
#img-viewer-mask .img-viewer__bar {
  position: absolute; top: 0; left: 0; right: 0; height: 48px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; color: #fff; font-size: 14px;
}
#img-viewer-mask .img-viewer__close {
  background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; line-height: 1;
}
#img-viewer-mask .img-viewer__prev,
#img-viewer-mask .img-viewer__next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.15); color: #fff; font-size: 28px; line-height: 1;
}
#img-viewer-mask .img-viewer__prev { left: 24px; }
#img-viewer-mask .img-viewer__next { right: 24px; }
#img-viewer-mask .img-viewer__prev:hover,
#img-viewer-mask .img-viewer__next:hover { background: rgba(255,255,255,.3); }
