/* 新概念听写 · 后台管理（仿 management 模板：紫色 header + 白侧栏 + 大圆角菜单组） */

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-gradient-hover: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  --primary: #667eea;
  --primary-dark: #5a67d8;
  --accent-red: linear-gradient(135deg, #ff6b6b, #ff8787);
  --sidebar-bg: linear-gradient(180deg, #f8f9fc 0%, #eef2f7 100%);
  --text-primary: #2d3748;
  --text-secondary: #718096;
  --text-light: #a0aec0;
  --border-light: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.15);
  --transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.admin {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #f7fafc;
  color: var(--text-primary);
  min-height: 100vh;
}

/* ============ 顶部 header ============ */
.pg-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--primary-gradient);
  box-shadow: 0 4px 20px rgba(102, 126, 234, .25);
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pg-header .hamburger {
  display: none;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pg-header .hamburger:hover { background: rgba(255,255,255,.3); }
/* PC 侧栏折叠按钮(移动端隐藏,改用上面的抽屉汉堡) */
.pg-header .sb-collapse-btn {
  display: none;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pg-header .sb-collapse-btn:hover { background: rgba(255,255,255,.3); }
.pg-header .header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pg-header .brand {
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .5px;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-header .quote {
  flex: 1;
  min-width: 0;
  text-align: center;
  color: #fff;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: opacity .4s ease;
}
.pg-header .quote.fading { opacity: 0; }
.pg-header .quote .cq-zh {
  font-size: 13.5px; font-weight: 600; line-height: 1.35;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pg-header .quote .cq-en {
  font-size: 11.5px; font-style: italic; color: rgba(255,255,255,.82); line-height: 1.3;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pg-header .user-menu {
  position: relative;
}
.pg-header .user-avatar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 5px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 24px;
  cursor: pointer;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  transition: var(--transition);
}
.pg-header .user-avatar:hover { background: rgba(255,255,255,.3); }
.pg-header .user-avatar .ring {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  overflow: hidden;
}
.pg-header .user-dd {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.15);
  border: 1px solid var(--border-light);
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: var(--transition);
}
.pg-header .user-menu.open .user-dd { opacity: 1; pointer-events: auto; transform: translateY(0); }
.pg-header .user-dd a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}
.pg-header .user-dd a:hover { background: #f5f7fb; color: var(--primary); }
.pg-header .user-dd a.danger:hover { color: #c53030; background: #fff5f5; }

/* ============ 两栏布局 ============ */
.pg-body {
  display: flex;
  min-height: calc(100vh - 60px);
}
.pg-body > .left-menu {
  width: 230px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-light);
  box-shadow: 2px 0 12px rgba(0,0,0,.04);
  overflow-y: auto;
  padding: 18px 0;
}
.pg-body > .right-body {
  flex: 1;
  padding: 18px 24px 32px;
  overflow-x: auto;
  min-width: 0;
}

/* 移动端抽屉遮罩 */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 60px; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0;
  transition: opacity .25s;
}
.sidebar-overlay.show { display: block; opacity: 1; }

/* ============ 菜单 ============ */
.multi-menu { padding: 0; margin: 0; list-style: none; }
.multi-menu .item { margin-bottom: 8px; }

/* 一级菜单标题：大紫色圆角胶囊 */
.multi-menu .item > .title {
  display: flex;
  align-items: center;
  margin: 0 12px 8px;
  padding: 12px 16px;
  background: var(--primary-gradient);
  color: #fff;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .3px;
  box-shadow: 0 4px 14px rgba(102,126,234,.25);
  transition: var(--transition);
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
  user-select: none;
}
.multi-menu .item > .title:hover {
  background: var(--primary-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(102,126,234,.35);
}
.multi-menu .item > .title.has-active {
  background: var(--primary-gradient-hover);
  box-shadow: 0 6px 20px rgba(102,126,234,.35);
}
.multi-menu .item > .title .icon {
  width: 28px; height: 28px;
  background: rgba(255,255,255,.22);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  font-size: 15px;
  flex-shrink: 0;
}
.multi-menu .item > .title .text { flex: 1; }
.multi-menu .item > .title .chevron {
  font-size: 11px;
  opacity: .7;
  transition: transform .2s;
}
.multi-menu .item.collapsed > .title .chevron { transform: rotate(-90deg); }

/* 二级菜单：白卡片项 */
.multi-menu .item > .body {
  padding: 0 12px;
  max-height: 600px;
  overflow: hidden;
  transition: max-height .3s ease-out, opacity .25s;
  opacity: 1;
}
.multi-menu .item.collapsed > .body { max-height: 0; opacity: 0; }
.multi-menu .item > .body a {
  display: block;
  margin: 0 8px 4px;
  padding: 9px 16px;
  background: #fff;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 10px;
  border-left: 3px solid transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: var(--transition);
}
.multi-menu .item > .body a:hover {
  color: var(--primary-dark);
  border-left-color: var(--primary);
  transform: translateX(2px);
  background: #fafbff;
}
.multi-menu .item > .body a.active {
  background: var(--accent-red);
  color: #fff;
  font-weight: 600;
  border-left-color: #ff5757;
  box-shadow: 0 4px 12px rgba(255,107,107,.3);
}
.multi-menu .item > .body a.active:hover {
  transform: translateX(2px);
  color: #fff;
}

/* 没有子项的一级菜单（如「去练习」）：title 直接是链接 */
.multi-menu .item.solo > .title { display: flex; }
.multi-menu .item.solo > .title a { color: #fff; text-decoration: none; display: contents; }

/* ============ 面包屑 ============ */
.breadcrumb {
  list-style: none;
  background: #fff;
  margin: 0 0 18px;
  padding: 11px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.breadcrumb li:not(:last-child)::after {
  content: " / ";
  margin: 0 4px;
  color: var(--text-light);
}
.breadcrumb li a { color: var(--primary); text-decoration: none; }
.breadcrumb li:last-child { color: var(--text-primary); font-weight: 600; }

/* ============ 内容卡片 ============ */
.page-card {
  background: #fff;
  border-radius: 12px;
  padding: 22px 26px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  animation: fadeIn .25s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

h1.page-title { margin: 0 0 18px; font-size: 22px; font-weight: 700; color: var(--text-primary); }
h2.section { margin: 18px 0 12px; font-size: 16px; font-weight: 600; color: var(--text-primary); }

/* ============ flash ============ */
.flashes { list-style: none; padding: 0; margin: 0 0 16px; }
.flashes li {
  padding: 10px 14px; border-radius: 10px; margin-bottom: 8px;
  font-size: 13px; font-weight: 500;
  background: #d6f5d6; color: #1f7a1f;
  border: 1px solid #b6e0b6;
}
.flashes li.error { background: #ffe6e6; color: #c53030; border-color: #fed7d7; }

/* ============ 表单 ============ */
.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.form-row > label {
  width: 100px;
  text-align: right;
  font-size: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.form-row > input,
.form-row > select,
.form-row > textarea {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-row > input:focus,
.form-row > select:focus,
.form-row > textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102,126,234,.15);
}
.form-row > textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.form-row .form-help { font-size: 12px; color: var(--text-light); margin-left: 4px; }

/* ============ 按钮 ============ */
.btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--primary-gradient);
  color: #fff;
  padding: 9px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(102,126,234,.2);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(102,126,234,.3); }
.btn.ghost { background: #fff; color: var(--text-primary); border-color: var(--border-light); box-shadow: none; }
.btn.ghost:hover { background: #f7fafc; border-color: var(--primary); color: var(--primary); }
.btn.danger { background: linear-gradient(135deg, #f56565 0%, #c53030 100%); box-shadow: 0 4px 12px rgba(245,101,101,.25); }
.btn.danger:hover { box-shadow: 0 6px 16px rgba(245,101,101,.35); }
.btn.sm { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; box-shadow: none; }

/* ============ toolbar / scope tabs ============ */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.toolbar input[type="text"] {
  padding: 8px 12px; border: 1px solid var(--border-light); border-radius: 8px; font-size: 14px; min-width: 220px;
}
.toolbar .stat { margin-left: auto; color: var(--text-light); font-size: 13px; }
.toolbar .scope-tabs {
  display: inline-flex; background: #edf0f5; padding: 3px; border-radius: 10px; gap: 2px;
}
.toolbar .scope-tabs a {
  padding: 6px 14px; text-decoration: none; color: var(--text-secondary); border-radius: 8px; font-size: 13px; font-weight: 500;
}
.toolbar .scope-tabs a.active { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* 美化下拉框,做成跟 scope-tabs 同款胶囊风 */
.toolbar select.pill-select,
.toolbar select:not([class]) {
  appearance: none;
  -webkit-appearance: none;
  padding: 7px 30px 7px 14px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background-color: #fff;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  transition: border-color .15s, box-shadow .15s;
}
.toolbar select.pill-select:hover,
.toolbar select:not([class]):hover {
  border-color: var(--primary);
}
.toolbar select.pill-select:focus,
.toolbar select:not([class]):focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102,126,234,.15);
}

/* ============ 表格 ============ */
table.tb { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tb th, table.tb td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border-light); }
table.tb th { background: #f8f9fc; font-weight: 600; color: var(--text-secondary); font-size: 13px; }
table.tb th.actions, table.tb td.actions { text-align: center; white-space: nowrap; }
table.tb tr:hover td { background: #fafbfc; }
table.tb .tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: #edf0f5; color: var(--text-secondary);
}
table.tb .tag.SYSTEMADMIN { background: #fed7d7; color: #c53030; }
table.tb .tag.SUPERADMIN  { background: #feebc8; color: #c05621; }
table.tb .tag.ADMIN       { background: #c6f6d5; color: #22543d; }
table.tb .tag.CUSTOMER    { background: #ebf4ff; color: #4c51bf; }
table.tb .tag.public      { background: #c6f6d5; color: #22543d; }
table.tb .tag.tree        { background: #feebc8; color: #c05621; }
table.tb .tag.private     { background: #edf0f5; color: var(--text-secondary); }

/* 横排"标签:值"条 — 用于个人信息这种只读字段集,值短不浪费空间 */
.field-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-bottom: 20px;
}
.field-strip .field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.field-strip .field > label {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
}
.field-strip .field > .val {
  padding: 7px 12px;
  background: #f7faff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  min-width: 36px;
  white-space: nowrap;
}

/* 表格横滚容器:窄屏时让表格横向滚动而不是被压扁 */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;     /* 抵消 page-card 左右 padding,让滚动区填满 */
  padding: 0 4px;
}
.table-wrap > table.tb { min-width: 100%; }

table.tb .tag {
  white-space: nowrap;   /* "直接下级可见" 不应被强行换行 */
}
table.tb td.actions { white-space: nowrap; }
table.tb .code-cell { white-space: nowrap; }

.empty { padding: 40px; text-align: center; color: var(--text-light); }
.code-cell { font-family: ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: 1px; font-weight: 700; color: var(--primary-dark); }

/* ============ 统计卡片 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: linear-gradient(135deg, #667eea08, #764ba20a);
  border: 1px solid var(--border-light);
  padding: 18px 20px;
  border-radius: 12px;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .num { font-size: 30px; font-weight: 700; color: var(--primary-dark); }
.stat-card .lbl { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ============ 登录/注册 ============ */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: var(--primary-gradient);
  padding: 24px;
}
.auth-box {
  width: 100%; max-width: 440px;
  background: #fff;
  padding: 32px 32px 28px;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.auth-box h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.auth-box .sub { color: var(--text-secondary); font-size: 13px; margin-bottom: 22px; }
.auth-box .form-row { gap: 12px; margin-bottom: 14px; }
.auth-box .form-row > label { width: 64px; }
.auth-box .form-row > input,
.auth-box .row-img > input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  background: #f7faff;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: border-color .15s, background .15s;
}
.auth-box .form-row > input:focus,
.auth-box .row-img > input:focus {
  border-color: var(--primary);
  background: #fff;
}
.auth-box .row-img {
  flex: 1;
  min-width: 0;   /* 关键: 默认 min-width:auto 会让容器顶撑 — 阻止它溢出 */
  display: flex;
  gap: 12px;
  align-items: center;
}
.auth-box .row-img img {
  height: 44px;
  width: 130px;            /* 跟图片实际像素比例一致(170x50 → 高 44 时宽约 150) */
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
  object-fit: cover;
}
.auth-box .auth-actions { margin-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth-box .auth-actions a { color: var(--primary); font-size: 13px; text-decoration: none; }
.auth-box .errlist {
  list-style: none; padding: 10px 14px;
  background: #ffe6e6; color: #c53030;
  border-radius: 8px; margin: 0 0 14px; font-size: 13px;
  border: 1px solid #fed7d7;
}
.auth-box .errlist li + li { margin-top: 4px; }

/* ============ 复制提示 toast ============ */
.copy-toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #2d3748; color: #fff;
  padding: 10px 18px; border-radius: 8px;
  font-size: 13px; z-index: 9999;
  opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.copy-toast.show { opacity: 1; }

/* ============ 移动端适配(放在文件末尾,确保覆盖所有默认规则) ============ */
@media (max-width: 720px) {
  .pg-header { padding: 0 12px; gap: 8px; }
  .pg-header .hamburger { display: inline-flex; }
  .pg-header .brand { font-size: 15px; max-width: 160px; }
  .pg-header .quote { display: none; }
  .pg-header .user-avatar { padding: 4px 12px 4px 4px; font-size: 12px; }
  .pg-header .user-avatar .ring { width: 24px; height: 24px; font-size: 12px; }
  .pg-header .user-avatar span:not(.ring) { display: none; }

  /* 侧栏改为抽屉 */
  .pg-body > .left-menu {
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 999;
    box-shadow: 4px 0 20px rgba(0,0,0,.15);
  }
  .pg-body > .left-menu.open { transform: translateX(0); }

  /* 主区铺满 */
  .pg-body > .right-body { padding: 14px 14px 24px; }
  .page-card { padding: 16px 14px; border-radius: 10px; }
  h1.page-title { font-size: 18px; margin-bottom: 14px; }

  /* breadcrumb 紧凑 */
  .breadcrumb { padding: 8px 12px; font-size: 12px; flex-wrap: wrap; }

  /* 统计卡片 2 列 */
  .stat-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .stat-card { padding: 14px 16px; }
  .stat-card .num { font-size: 24px; }

  /* toolbar 折行 */
  .toolbar { gap: 8px; }
  .toolbar input[type="text"] { min-width: 0; flex: 1; }
  .toolbar .stat { width: 100%; margin-left: 0; order: 99; }
  .toolbar form { width: 100%; }

  /* 表格横滚 */
  table.tb { font-size: 13px; }
  .table-wrap > table.tb { min-width: 640px; }
  table.tb th, table.tb td { padding: 8px 10px; }

  /* toolbar:工具栏 form 内部允许折行,搜索按钮跟输入框同行 */
  .toolbar form { flex-wrap: wrap; }
  .toolbar form > * { flex-shrink: 0; }
  .toolbar form > input[type=text] { flex: 1 1 140px; }

  /* scope tabs 收紧 */
  .toolbar .scope-tabs { padding: 2px; gap: 0; }
  .toolbar .scope-tabs a { padding: 5px 10px; font-size: 12px; }

  /* 表单 label-在前 / 输入框-在后, 同一行(绝不堆叠) */
  .form-row {
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
  }
  .form-row > label {
    width: 72px;
    flex-shrink: 0;
    font-size: 13px;
    text-align: right;
  }
  .form-row > input,
  .form-row > select,
  .form-row > textarea {
    flex: 1 1 0;
    min-width: 0;
    font-size: 14px;
    padding: 8px 10px;
  }
  .form-row > textarea { min-height: 100px; }
}

/* ============ 轮播设置弹窗 ============ */
.cm-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(30,30,60,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.cm-overlay.hidden { display: none; }
.cm-box {
  position: relative; background: #fff;
  border-radius: 16px; padding: 22px 24px;
  width: 420px; max-width: 100%;
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
}
.cm-box h3 { margin: 0 0 16px; font-size: 18px; color: var(--text-primary); }
.cm-close {
  position: absolute; top: 12px; right: 14px;
  appearance: none; border: none; background: transparent;
  font-size: 18px; color: var(--text-light); cursor: pointer; line-height: 1;
}
.cm-close:hover { color: var(--text-primary); }
.cm-section { margin-bottom: 16px; }
.cm-section:last-child { margin-bottom: 0; }
.cm-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; margin-bottom: 8px; }
.cm-seg { display: flex; gap: 8px; }
.cm-seg button {
  flex: 1; appearance: none; cursor: pointer; font-family: inherit;
  border: 1.5px solid var(--border-light); background: #f7faff; color: var(--text-primary);
  padding: 9px 8px; border-radius: 10px; font-size: 13px; transition: var(--transition);
}
.cm-seg button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.cm-input {
  width: 100%; box-sizing: border-box; margin-bottom: 8px;
  border: 1px solid var(--border-light); border-radius: 8px;
  padding: 9px 11px; font-size: 13px; font-family: inherit; outline: none;
}
.cm-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(102,126,234,.15); }
.cm-btn {
  width: 100%; appearance: none; cursor: pointer; font-family: inherit;
  border: none; background: var(--primary); color: #fff;
  padding: 9px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
}
.cm-btn:hover { filter: brightness(1.05); }
.cm-list { margin-top: 12px; max-height: 220px; overflow-y: auto; }
.cm-empty { color: var(--text-light); font-size: 12.5px; padding: 6px 0; }
.cm-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 0; border-top: 1px solid var(--border-light); font-size: 12.5px;
}
.cm-item .cm-q { flex: 1; min-width: 0; }
.cm-item .cm-q .qz { font-weight: 600; color: var(--text-primary); }
.cm-item .cm-q .qe { color: var(--text-secondary); font-style: italic; margin-top: 2px; }
.cm-item .cm-del {
  flex-shrink: 0; appearance: none; border: none; background: transparent;
  color: #c53030; cursor: pointer; font-size: 14px; line-height: 1;
}

/* 轮播设置保存提示 toast */
.cm-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: #2d3748; color: #fff; padding: 10px 22px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 3001;
}
.cm-toast.show { opacity: 1; }

/* ============ 课程列表:进度/收藏/置顶 ============ */
.tb tr.r-done > td:first-child { box-shadow: inset 4px 0 0 #38a169; }
.tb tr.r-done { background: #f4fbf6; }
.tb tr.r-todo > td:first-child { box-shadow: inset 4px 0 0 #cbd5e0; }
.tb tr.r-fav { background: #fffbea; }
.tb tr.r-done.r-fav { background: #f2fbf3; }
.prog { display:inline-block; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:600; }
.prog.done { background:#d7f5e1; color:#1f7a45; }
.prog.partial { background:#fff0d4; color:#9a6700; }
.prog.none { background:#edf0f5; color:#a0aec0; }
.st-btn {
  appearance:none; border:1.5px solid var(--border-light); background:#fff;
  border-radius:8px; padding:4px 8px; font-size:13px; cursor:pointer; line-height:1;
  filter:grayscale(1) opacity(.55); transition:var(--transition);
}
.st-btn:hover { filter:grayscale(0) opacity(1); border-color:var(--primary); }
.st-btn.on { filter:none; border-color:var(--primary); background:#eef2ff; }
.st-btn.mas { filter:none; color:#1f7a45; }
.st-btn.mas:hover { background:#d7f5e1; border-color:#38a169; }
.st-btn.mas.on { background:#d7f5e1; border-color:#38a169; color:#1f7a45; }

/* 头像(header ring 内的图片 + 个人中心上传预览) */
.pg-header .user-avatar .ring img { width:100%; height:100%; border-radius:50%; object-fit:cover; display:block; }
.avatar-edit { display:flex; align-items:center; gap:18px; flex-wrap:wrap; margin-bottom:20px; }
.avatar-edit .avatar-preview {
  width:72px; height:72px; border-radius:50%; flex-shrink:0;
  background:var(--primary-gradient); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-size:30px; font-weight:700; overflow:hidden;
  box-shadow:0 4px 14px rgba(102,126,234,.3);
}
.avatar-edit .avatar-preview img { width:100%; height:100%; object-fit:cover; }

/* ============ 工单 ============ */
/* 侧栏菜单红点 */
.multi-menu .item > .title .menu-badge {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:18px; height:18px; padding:0 5px; margin-left:6px;
  background:#f56565; color:#fff; border-radius:9px;
  font-size:11px; font-weight:700; line-height:1; box-shadow:0 1px 3px rgba(0,0,0,.2);
}
/* 列表未读红点 */
.unread-dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:#f56565; margin-right:6px; vertical-align:middle; }
/* 工单状态标签 */
table.tb .tag.t-open,      .tag.t-open      { background:#fef3c7; color:#92400e; }
table.tb .tag.t-answered,  .tag.t-answered  { background:#dbeafe; color:#1e40af; }
table.tb .tag.t-resolved,  .tag.t-resolved  { background:#c6f6d5; color:#22543d; }
table.tb .tag.t-closed,    .tag.t-closed    { background:#e2e8f0; color:#64748b; }
/* 优先级标签 */
table.tb .tag.p-high,   .tag.p-high   { background:#fed7d7; color:#c53030; }
table.tb .tag.p-normal, .tag.p-normal { background:#edf0f5; color:#4a5568; }
table.tb .tag.p-low,    .tag.p-low    { background:#ebf4ff; color:#4c51bf; }
/* 上报次数标签 */
table.tb .tag.esc, .tag.esc { background:#fef3c7; color:#92400e; margin-left:6px; }

/* ============ PC 侧栏折叠 ============ */
/* 仅 PC(>=721px)生效;移动端走抽屉,折叠态不应影响它。
   放文件末尾,确保 .pg-header .sb-collapse-btn 的显示规则压过前面的 display:none。 */
@media (min-width: 721px) {
  .pg-header .sb-collapse-btn { display: inline-flex; }
  .pg-body > .left-menu { transition: width .2s ease, padding .2s ease; }
  html.sb-collapsed .pg-body > .left-menu {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
    border-right: none;
    box-shadow: none;
  }
}
