/* ================= 后台管理样式 ================= */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f2f5fa;
  color: #22304a;
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}
a { color: #1769d6; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; }

/* ---------- 登录页 ---------- */
.login-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #0f2c52 0%, #123e73 45%, #0a2547 100%);
  padding: 20px;
}
.login-wrap {
  width: 100%; max-width: 380px;
  background: #fff; border-radius: 16px; padding: 32px 28px 24px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .28);
}
.login-brand { text-align: center; margin-bottom: 22px; }
.brand-mark {
  width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 12px;
  background: linear-gradient(135deg, #1a78e0, #0b4ca3);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 600;
}
.login-brand h1 { font-size: 19px; letter-spacing: 1px; }
.login-brand p { margin: 6px 0 0; font-size: 12.5px; color: #8b98ab; letter-spacing: 1px; }

.login-form label { display: block; font-size: 12.5px; color: #7b8798; margin-bottom: 14px; }
.login-form input {
  width: 100%; margin-top: 6px; height: 44px; padding: 0 12px;
  border: 1px solid #dfe5ee; border-radius: 10px; font-size: 15px; outline: 0;
  background: #fbfcfe;
}
.login-form input:focus { border-color: #8ab6ee; background: #fff; }
.login-err { color: #d9363e; font-size: 13px; margin: -4px 0 12px; }
.login-foot { margin: 18px 0 0; font-size: 12px; color: #9aa6b8; text-align: center; line-height: 1.7; }

.btn-primary {
  width: 100%; height: 46px; border: 0; border-radius: 10px;
  background: linear-gradient(135deg, #1a78e0, #0d55b4);
  color: #fff; font-size: 15.5px; letter-spacing: 3px; cursor: pointer;
}
.btn-primary:hover { opacity: .94; }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 224px; flex: 0 0 224px;
  background:
    radial-gradient(120% 60% at 20% -10%, rgba(46,120,220,.35), transparent 55%),
    linear-gradient(180deg, #102743 0%, #0b1c33 60%, #091729 100%);
  color: #c7d6e8;
  padding: 20px 0;
  display: flex; flex-direction: column;
}
.side-brand {
  padding: 0 22px 18px; margin-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.side-brand b { display: block; color: #fff; font-size: 15.5px; letter-spacing: 1px; }
.side-brand span {
  display: block; margin-top: 3px;
  font-size: 10.5px; color: #6f88a6; letter-spacing: 2.5px;
}
.nav { display: flex; flex-direction: column; padding: 8px 12px; gap: 3px; flex: 1; overflow-y: auto; }
.nav-group {
  padding: 16px 12px 7px;
  font-size: 11px; color: #66809e; letter-spacing: 1.5px;
}
.nav-group:first-child { padding-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 11px;
  color: #b6c7dc; font-size: 13.5px;
  position: relative;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
.nav-item.on {
  background: linear-gradient(135deg, #2b85ec, #1463c8);
  color: #fff; font-weight: 600;
  box-shadow: 0 8px 20px rgba(27,105,210,.45);
}
.nav-item.on::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 20px; border-radius: 0 3px 3px 0; background: #5aa2ff;
}
.nav-ico { font-style: normal; font-size: 14px; width: 18px; text-align: center; opacity: .95; }
.side-foot { margin-top: auto; padding: 14px 22px 0; font-size: 11px; color: #5d748e; }

/* 快速上手流程卡 */
.guide-card { border-radius: 16px; }
.guide-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.guide-step {
  display: block; padding: 16px 14px;
  border: 1px solid #e6ecf5; border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff, #f5f8fd);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.guide-step:hover {
  transform: translateY(-3px);
  border-color: #bcd4f4;
  box-shadow: 0 12px 26px rgba(23,105,214,.14);
}
.guide-step b {
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2b85ec, #1463c8); color: #fff;
  font-size: 14px; margin-bottom: 10px;
}
.guide-step span { font-size: 14px; font-weight: 600; color: #1d2c44; }
.guide-step p { margin: 5px 0 0; font-size: 12px; color: #8593a8; line-height: 1.6; }

.main { flex: 1; min-width: 0; padding: 20px 24px 40px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.topbar h1 { font-size: 20px; letter-spacing: .5px; }
.topbar .who { font-size: 12.5px; color: #8b98ab; }
.topbar .who a { margin-left: 10px; }

/* ---------- 卡片 / 表格 ---------- */
.card {
  background: #fff; border-radius: 14px; padding: 20px;
  box-shadow: 0 6px 20px rgba(20, 45, 80, .06);
  margin-bottom: 16px;
}
.card-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.card-hd h2 { font-size: 15px; }
.card-hd .sub { font-size: 12px; color: #8b98ab; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 13px; margin-bottom: 16px; }
.stat-card {
  background: #fff; border-radius: 14px; padding: 18px 17px 16px;
  box-shadow: 0 6px 20px rgba(20, 45, 80, .06);
  position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(20,45,80,.12); }
.stat-card::after {
  content: ""; position: absolute; right: -22px; top: -22px;
  width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle, rgba(39,124,228,.16), transparent 70%);
}
.stat-card b {
  display: block; font-size: 26px; letter-spacing: .5px;
  background: linear-gradient(135deg, #2b85ec, #0f4fa8);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.stat-card span { font-size: 12px; color: #8b98ab; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 10px; text-align: left; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
.table th { background: #f7f9fc; color: #55637a; font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.table tr:hover td { background: #fafcff; }
.table td.num { font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; }
.badge.on { background: #e8f6ef; color: #12996c; }
.badge.off { background: #f0f2f5; color: #8b98ab; }
.badge.warn { background: #fff4e5; color: #c4791a; }
.badge.blue { background: #eaf2fe; color: #1769d6; }

/* ---------- 表单 ---------- */
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.fld { display: flex; flex-direction: column; gap: 5px; }
.fld > span { font-size: 12px; color: #7b8798; }
.fld input[type=text], .fld input[type=number], .fld input[type=date], .fld input[type=password], .fld select, .fld textarea {
  height: 38px; padding: 0 10px; min-width: 130px;
  border: 1px solid #dfe5ee; border-radius: 8px; font-size: 13.5px; outline: 0; background: #fff;
  font-family: inherit;
}
.fld textarea { height: auto; padding: 8px 10px; line-height: 1.7; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: #8ab6ee; }
.fld.grow { flex: 1; min-width: 220px; }
.fld.grow textarea, .fld.grow input { width: 100%; }

.btn {
  height: 38px; padding: 0 16px; border: 0; border-radius: 8px;
  background: #1769d6; color: #fff; font-size: 13.5px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
}
.btn:hover { opacity: .93; }
.btn.ghost { background: #fff; color: #1769d6; border: 1px solid #cfe0f7; }
.btn.gray { background: #f0f3f8; color: #55637a; }
.btn.danger { background: #e34d59; }
.btn.warn { background: #f59e0b; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }

.tip { font-size: 12px; color: #8b98ab; line-height: 1.8; }
.notice { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.notice.ok { background: #eaf8f1; color: #12855c; }
.notice.err { background: #fdecec; color: #c9302c; }
.notice.info { background: #eef4ff; color: #2b5fa8; }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; border: 1px solid #e2e8f2; color: #55637a; background: #fff;
}
.pager a.on { background: #1769d6; border-color: #1769d6; color: #fff; }

/* ---------- 上传区 ---------- */
.upload-box {
  border: 1px dashed #b9cde8; background: #f8fbff; border-radius: 10px;
  padding: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.upload-box .up-info { flex: 1; min-width: 200px; font-size: 12.5px; color: #607089; }
.up-bar { height: 6px; border-radius: 3px; background: #e8eef7; overflow: hidden; margin-top: 6px; }
.up-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2b8bf0, #1769d6); transition: width .2s; }

.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 980px) {
  .split-grid { grid-template-columns: 1fr; }
}

/* 手机汉堡按钮与遮罩（桌面不显示） */
.menu-toggle { display: none; }
.drawer-mask {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(8, 16, 30, .5);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
body.drawer-open .drawer-mask { opacity: 1; visibility: visible; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }

  /* 侧边栏变为左侧抽屉，默认滑出屏幕外 */
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
    width: 250px; flex: none; padding: 18px 0;
    transform: translateX(-100%);
    transition: transform .28s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.35);
  }
  body.drawer-open .side { transform: translateX(0); }

  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border: 1px solid #dfe5ee;
    border-radius: 10px; background: #fff; font-size: 17px;
    color: #33455f; cursor: pointer;
  }
  .topbar { gap: 10px; }
  .topbar h1 { font-size: 18px; }

  .nav { flex: 1; overflow-y: auto; padding: 8px 12px; gap: 3px; }
  .nav-item { white-space: normal; padding: 10px 12px; }
  .nav-item.on::before { display: block; }
  .nav-item:hover { transform: none; }
  .side-foot { display: block; }

  .main { padding: 14px 14px 36px; }
  .card { padding: 16px; }
  .guide-steps { grid-template-columns: repeat(2, 1fr); }

  /* 表单在手机上纵向排列，输入框全宽，避免横向挤压 */
  .form-row { flex-direction: column; align-items: stretch; }
  .fld { width: 100%; }
  .fld input[type=text], .fld input[type=number], .fld input[type=date],
  .fld input[type=password], .fld select, .fld textarea { min-width: 0; width: 100%; }
  .upload-box { flex-direction: column; align-items: stretch; }
}
@media (max-width: 520px) {
  .guide-steps { grid-template-columns: 1fr; }
}

/* ==================== 主题配色页 ==================== */
.theme-wrap { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.theme-wrap .card { flex: 1 1 420px; min-width: 300px; }
.card-hd p { margin: 6px 0 0; font-size: 12.5px; color: #8a97a8; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 22px; }
.swatch {
  position: relative; height: 58px; border: 0; border-radius: 12px; cursor: pointer;
  color: #fff; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 6px 14px rgba(20, 40, 80, .18);
}
.swatch span {
  position: absolute; left: 0; right: 0; bottom: 5px; font-size: 11px;
  text-shadow: 0 1px 3px rgba(0,0,0,.45);
}
.swatch:hover { transform: translateY(-2px); }
.swatch.sel { outline: 3px solid rgba(23,105,214,.35); outline-offset: 2px; }
.theme-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.theme-pick input[type=color] {
  width: 64px; height: 44px; border: 1px solid #dce3ee; border-radius: 10px;
  background: #fff; padding: 4px; cursor: pointer;
}
.hex-box {
  width: 110px; height: 40px; border: 1px solid #dce3ee; border-radius: 10px;
  padding: 0 12px; font-size: 14px; letter-spacing: 1px;
}
.theme-form .tip { margin-top: 12px; font-size: 12.5px; color: #8a97a8; }

/* 手机模型预览 */
.theme-preview-card { flex: 0 0 300px !important; }
.phone-mock {
  width: 230px; margin: 10px auto 0; border-radius: 26px; overflow: hidden;
  border: 6px solid #1c2636; background: #f3f5f9;
  box-shadow: 0 18px 40px rgba(15, 30, 60, .25);
}
.pm-hero { padding: 22px 16px 26px; color: #fff; position: relative; overflow: hidden; }
.pm-mark {
  width: 30px; height: 30px; border-radius: 8px; margin-bottom: 10px;
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.pm-hero b { display: block; font-size: 15px; }
.pm-hero span { font-size: 10px; opacity: .85; }
.pm-body { padding: 14px 16px 18px; }
.pm-line { height: 10px; border-radius: 5px; background: #e4e9f1; margin-bottom: 12px; width: 70%; }
.pm-btn {
  height: 32px; border-radius: 16px; color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center; letter-spacing: 2px;
  margin-bottom: 14px;
}
.pm-bar { height: 5px; border-radius: 3px; background: #e4e9f1; overflow: hidden; }
.pm-bar i { display: block; width: 62%; height: 100%; border-radius: 3px; }

/* ==================== 品牌设置页 ==================== */
.brand-wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.brand-wrap .card { flex: 1 1 420px; min-width: 300px; }
.stack-form { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.fld-col { display: flex; flex-direction: column; gap: 6px; }
.fld-col span { font-size: 12px; color: #7a869a; letter-spacing: .5px; }
.fld-col input {
  height: 42px; border: 1px solid #dce3ee; border-radius: 10px;
  padding: 0 12px; font-size: 14px; outline: none;
}
.fld-col input:focus { border-color: #1769d6; }
.stack-form button { align-self: flex-start; }
.logo-current { text-align: center; padding: 14px 0; }
.logo-current img {
  max-width: 130px; max-height: 130px; border-radius: 14px;
  background: #f4f6fa; padding: 10px; border: 1px solid #e4e9f1;
}
.logo-current .tip { margin-top: 8px; word-break: break-all; }
.stack-form input[type=file] { font-size: 13px; }

/* v6 课程表单 */
.switch-line { display: flex; align-items: center; gap: 7px; height: 42px; font-size: 12.5px; color: #7a869a; }
.switch-line input { width: 16px; height: 16px; accent-color: #1769d6; }
.input-btn { display: flex; gap: 8px; align-items: center; }
.input-btn input { flex: 1; height: 42px; border: 1px solid #dce3ee; border-radius: 10px; padding: 0 12px; font-size: 14px; outline: none; }
.input-btn input:focus { border-color: #1769d6; }
.upload-box.hidden { display: none !important; }

/* ==================== 课程中心：标签页 ==================== */
.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: #e7edf5; border-radius: 12px; margin-bottom: 16px;
}
.tab {
  flex: 1; height: 38px; border: 0; border-radius: 9px;
  background: transparent; color: #6a7790; font-size: 13.5px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: all .2s ease;
}
.tab em {
  font-style: normal; font-size: 11px; background: rgba(0,0,0,.08);
  border-radius: 9px; padding: 0 7px; line-height: 17px;
}
.tab.on {
  background: #fff; color: #1769d6; font-weight: 600;
  box-shadow: 0 3px 10px rgba(20,45,80,.1);
}
.tab.on em { background: #eaf2fe; color: #1769d6; }
.tab-pane { display: none; }
.tab-pane.on { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 工具条 */
.list-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
.list-filters { display: flex; gap: 9px; flex-wrap: wrap; }
.mini-sel {
  height: 36px; padding: 0 10px; border: 1px solid #dfe5ee;
  border-radius: 9px; background: #fff; font-size: 13px; color: #44526a; outline: 0;
}

/* 类型小标签（四种颜色） */
.t-badge { display: inline-block; padding: 1px 9px; border-radius: 9px; font-size: 11.5px; white-space: nowrap; }
.t-badge.t1 { background: #eaf2fe; color: #1769d6; }
.t-badge.t2 { background: #f1ecfe; color: #7a4fd0; }
.t-badge.t3 { background: #e6f6f4; color: #0e8a83; }
.t-badge.t4 { background: #fff4e5; color: #c4791a; }

/* 桌面课程单元格 */
.course-cell { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.cc-thumb {
  width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.cc-thumb.ph { font-size: 11.5px; font-weight: 600; }
.cc-thumb.ph.t1 { background: #eaf2fe; color: #1769d6; }
.cc-thumb.ph.t2 { background: #f1ecfe; color: #7a4fd0; }
.cc-thumb.ph.t3 { background: #e6f6f4; color: #0e8a83; }
.cc-thumb.ph.t4 { background: #fff4e5; color: #c4791a; }
.cc-main b { display: block; font-size: 13.5px; line-height: 1.4; }
.cc-main small { font-size: 11.5px; color: #9aa6b8; }
.muted-cell { color: #6a7790; font-size: 12.5px; line-height: 1.9; }
.row-actions { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
.row-actions form { display: inline; }
.empty-row .tip { padding: 26px 0; }

/* 表单内小节标题 */
.form-sec {
  margin: 20px 0 10px; padding-top: 14px;
  border-top: 1px solid #eef2f7;
  font-size: 12.5px; font-weight: 600; color: #33455f; letter-spacing: .5px;
}
.form-sec:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* 分类表单 */
.cat-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }

/* ==================== 手机课程卡片 ==================== */
.course-cards { display: flex; flex-direction: column; gap: 12px; }
.course-card {
  background: #fff; border-radius: 14px; padding: 14px;
  box-shadow: 0 6px 20px rgba(20,45,80,.06);
}
.mc-top { display: flex; gap: 12px; align-items: center; }
.mc-thumb {
  width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.mc-thumb.ph { font-size: 12px; font-weight: 600; }
.mc-thumb.ph.t1 { background: #eaf2fe; color: #1769d6; }
.mc-thumb.ph.t2 { background: #f1ecfe; color: #7a4fd0; }
.mc-thumb.ph.t3 { background: #e6f6f4; color: #0e8a83; }
.mc-thumb.ph.t4 { background: #fff4e5; color: #c4791a; }
.mc-main { flex: 1; min-width: 0; }
.mc-main b { display: block; font-size: 14.5px; line-height: 1.4; }
.mc-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.cat-tag {
  font-size: 11px; background: #f2f5fa; color: #6a7790;
  border-radius: 9px; padding: 1px 9px;
}
.mc-data {
  margin: 11px 0 0; padding-top: 10px; border-top: 1px solid #f2f5fa;
  font-size: 12px; color: #7b8798; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.mc-actions { display: flex; gap: 8px; margin-top: 12px; }
.mc-actions form { flex: 1; display: flex; }
.mc-actions .btn { flex: 1; }
.mc-actions > a { flex: 1; }
.empty-card { text-align: center; padding: 30px 0; }

/* ==================== 模态框 ==================== */
.modal-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(8,16,30,.52); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility .22s ease;
}
.modal-mask.show { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 680px; max-height: 88vh;
  background: #fff; border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column;
  transform: translateY(14px) scale(.98); transition: transform .22s ease;
}
.modal-mask.show .modal { transform: none; }
.modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #eef2f7; flex: none;
}
.modal-hd h3 { font-size: 16px; }
.modal-x {
  width: 32px; height: 32px; border: 0; border-radius: 9px;
  background: #f2f5fa; color: #6a7790; font-size: 17px; cursor: pointer;
}
.modal-bd { padding: 20px; overflow-y: auto; }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px;
}
.modal-actions .btn { padding: 0 22px; }

/* 桌面/手机内容切换 */
.only-mobile { display: none; }
@media (max-width: 860px) {
  .only-desktop { display: none; }
  .only-mobile { display: block; }
  .modal-mask { padding: 0; }
  .modal { max-width: none; max-height: 94vh; border-radius: 16px 16px 0 0; align-self: flex-end; }
  .modal-bd { padding: 16px; }
  .modal-actions .btn { flex: 1; }
  .cat-form { flex-direction: column; align-items: stretch; }
  .cat-form .fld { width: 100%; }
  .cat-form .fld input, .cat-form .fld select { width: 100%; min-width: 0; }
}

/* ==================== 首页设置完成度清单 ==================== */
.setup-list { display: flex; flex-direction: column; }
.setup-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 4px; border-bottom: 1px solid #f2f5fa;
  color: #33455f; text-decoration: none;
}
.setup-item:last-child { border-bottom: 0; }
.setup-item:active { background: #f8fafd; border-radius: 8px; }
.sdot {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff;
}
.sdot.ok { background: #18a56e; }
.sdot.no { background: #c4cdd9; }
.sname { font-size: 13.5px; }
.smeta {
  margin-left: auto; font-size: 12px; color: #9aa6b8;
  font-variant-numeric: tabular-nums;
}
.sgo { color: #c4cdd9; font-size: 17px; }
@media (max-width: 860px) {
  .setup-item { padding: 12px 2px; }
}

/* ==================== 机构树 ==================== */
.org-hd { flex-wrap: wrap; gap: 10px; }
.org-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.org-tree { margin-top: 8px; }
.tree-branch {
  border: 1px solid #e8edf5; border-radius: 12px;
  margin-bottom: 9px; overflow: hidden;
  background: #fff;
}
.tree-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.tree-row-l1 {
  background: linear-gradient(180deg, #f8fafd, #f2f6fb);
  font-weight: 600; color: #2c3d57;
}
.tree-toggle {
  width: 26px; height: 26px; flex: none;
  border: 0; border-radius: 8px;
  background: #e6edf7; color: #4a5d78;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.tree-toggle svg { transition: transform .2s ease; }
.tree-branch.expanded .tree-toggle svg { transform: rotate(90deg); }
.tree-toggle-ph { width: 26px; flex: none; }
.tree-ico {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.tree-row-l1 .tree-ico { background: rgba(23,105,214,.12); color: #1769d6; }
.tree-row-l2 .tree-ico { background: #eef2f7; color: #93a1b5; font-size: 10px; }
.tree-name { flex: 1; min-width: 0; word-break: break-all; }
.tree-count { font-size: 12px; color: #8b98ab; font-weight: 400; white-space: nowrap; }
.tree-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.tree-actions form { display: inline; }
.tree-children { display: none; }
.tree-branch.expanded .tree-children { display: block; }
.tree-row-l2 { border-top: 1px solid #f0f3f8; font-weight: 400; color: #3a4a63; }
.tree-empty-outlet { color: #9aa6b8; padding-top: 12px; padding-bottom: 12px; }

/* 三个弹窗统一通过各自的 .show 类独立开关，互不影响 */

@media (max-width: 640px) {
  .tree-row { flex-wrap: wrap; row-gap: 8px; padding: 10px; }
  .tree-actions { width: 100%; justify-content: flex-end; }
  .tree-row-l2 { padding-left: 8px; }
  .org-tools { width: 100%; }
  .org-tools .btn.sm { flex: 1; }
  .org-tools .sub { width: 100%; }
}

/* ==================== 系统设置页 ==================== */
#sysTabs { margin-bottom: 14px; }
.sys-pane { display: none; }
.sys-pane.on { display: block; animation: fadeIn .2s ease; }
.sys-save-bar { margin: 4px 0 16px; }
.sys-save-bar .btn { width: 100%; }
.db-test-bar { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.db-test-result { font-size: 13.5px; font-weight: 600; }
.db-test-result.ok { color: #18a56e; }
.db-test-result.no { color: #e34d59; }
@media (max-width: 640px) {
  .db-test-bar .btn { flex: 1; }
  .sys-save-bar .btn { height: 44px; }
}

/* 水印设置 */
.wm-setting { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e8edf5; }
.wm-setting h3 { margin: 0 0 14px; font-size: 15px; color: #24324a; }
.wm-row { display: flex; gap: 26px; flex-wrap: wrap; }
.wm-field { flex: 1; min-width: 220px; }
.wm-field > span { display: block; font-size: 13px; color: #5a6a83; margin-bottom: 8px; }
.wm-color-line { display: flex; align-items: center; gap: 10px; }
.wm-color-line input[type=color] { width: 46px; height: 38px; padding: 2px; border: 1px solid #d8e0ec; border-radius: 8px; background: #fff; }
.wm-color-line .hex-box { width: 110px; }
.wm-opacity-line { display: flex; align-items: center; gap: 12px; }
.wm-opacity-line input[type=range] { flex: 1; accent-color: #1769d6; }
.wm-opacity-line b { min-width: 34px; text-align: center; background: #eef3fb; color: #1769d6; border-radius: 8px; padding: 4px 0; font-size: 13px; }

/* 微信分享封面行 */
.cos-cover-line { display: flex; gap: 10px; align-items: center; }
.cos-cover-line input { flex: 1; background: #f7f9fc; }
.cos-cover-line .btn { flex: none; }
@media (max-width: 560px) {
  .sys-tabs .tab { font-size: 12px; padding: 0 8px; }
  .cos-cover-line { flex-wrap: wrap; }
}

/* 账号设置：当前密码行 */
.pwd-line { display: flex; gap: 10px; align-items: center; }
.pwd-line input { flex: 1; background: #f7f9fc; letter-spacing: 1px; }
.pwd-line .btn { flex: none; white-space: nowrap; }
.pwd-sep { margin: 18px 0 10px; padding-top: 14px; border-top: 1px dashed #e3e9f2; font-size: 13px; color: #8494ac; }
.btn.ghost { background: #fff; color: #1769d6; border: 1px solid #cfe0f6; }
.btn.ghost:hover { background: #f2f7ff; }
button[disabled] { opacity: .55; cursor: not-allowed; }

/* ==================================================================
   v19 上传反馈体系：统一状态卡片 / 当前文件 / 待替换提示
   ================================================================== */
.ucard {
  border: 1px solid #e2e8f2; border-radius: 12px; padding: 12px 14px;
  background: #f8fafd; margin-top: 10px; font-size: 13px;
}
.ucard.busy { border-color: #b9d4f5; background: #f3f8ff; }
.ucard.ok   { border-color: #9fdcc2; background: #f1fbf6; }
.ucard.err  { border-color: #f3b9b6; background: #fef4f3; }
.ucard-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ucard-dot {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; background: #98a3b5;
}
.ucard.busy .ucard-dot { background: #1769d6; }
.ucard.ok .ucard-dot   { background: #12a06f; }
.ucard.err .ucard-dot  { background: #d9534f; }
.ucard-name {
  flex: 1; min-width: 0; color: #2a364b; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ucard-size { flex: none; color: #8494ac; font-size: 12px; font-weight: 400; }
.ucard-bar { height: 6px; border-radius: 3px; background: #e4ebf4; margin: 10px 0 8px; overflow: hidden; }
.ucard-bar i { display: block; height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, #2b8bf0, #1769d6); transition: width .2s; }
.ucard.ok .ucard-bar i { background: #12a06f; }
.ucard-meta { color: #607089; font-size: 12.5px; line-height: 1.6; word-break: break-all; }
.ucard.ok .ucard-meta { color: #12855c; }
.ucard.err .ucard-meta { color: #c0392b; }
.ucard-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ucard-actions .btn { padding: 6px 16px; font-size: 12.5px; height: auto; border-radius: 7px; }
.ucard-preview { margin-top: 10px; }
.ucard-preview img {
  max-height: 120px; border-radius: 8px; border: 1px solid #e2e8f2; display: block;
}
.ucard .spin-ico {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  animation: ucardSpin .8s linear infinite;
}
@keyframes ucardSpin { to { transform: rotate(360deg); } }

/* 编辑模式：当前已绑定文件 */
.cur-file {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid #dfe6f0; border-radius: 12px; padding: 10px 12px;
  background: #fff; margin-bottom: 10px;
}
.cur-file img, .cur-file .cf-ph {
  flex: none; width: 72px; height: 45px; border-radius: 8px; object-fit: cover;
  border: 1px solid #e2e8f2; background: #0d1a2b;
}
.cur-file .cf-ph { display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.85); font-size: 18px; }
.cur-file .cf-body { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.55; }
.cur-file .cf-title { color: #2a364b; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cur-file .cf-sub { color: #8494ac; word-break: break-all; }
.cur-file .cf-tag {
  flex: none; font-size: 11px; color: #1769d6; background: #eaf2fd;
  border-radius: 5px; padding: 2px 8px;
}

/* 待替换横幅 */
.pending-banner {
  display: none; align-items: flex-start; gap: 8px;
  border-radius: 10px; padding: 9px 12px; margin-top: 10px;
  background: #fff8e8; border: 1px solid #f5dd9d;
  color: #9a6b12; font-size: 12.5px; line-height: 1.55;
}
.pending-banner.on { display: flex; }

/* 小按钮旁的内联反馈（封面/Logo/分享封面） */
.inline-fb { display: none; margin-top: 8px; font-size: 12.5px; line-height: 1.5; border-radius: 8px; padding: 8px 10px; }
.inline-fb.on { display: block; }
.inline-fb.ok { background: #f1fbf6; color: #12855c; border: 1px solid #9fdcc2; }
.inline-fb.err { background: #fef4f3; color: #c0392b; border: 1px solid #f3b9b6; }
.inline-fb.busy { background: #f3f8ff; color: #1769d6; border: 1px solid #b9d4f5; }
.inline-fb .if-actions { margin-top: 6px; }
.inline-fb .if-actions .btn { padding: 4px 12px; font-size: 12px; height: auto; border-radius: 6px; }
.inline-fb img { max-height: 90px; border-radius: 6px; margin-top: 6px; }

/* ==================================================================
   v19 云文件清理页
   ================================================================== */
.cloud-wrap { position: relative; }
.cloud-tabs { display: flex; gap: 10px; margin-bottom: 14px; }
.cloud-tabs .ct {
  flex: 1; padding: 10px 0; border-radius: 10px; border: 1px solid #dfe6f0;
  background: #fff; color: #607089; font-size: 14px; cursor: pointer;
}
.cloud-tabs .ct.on { background: #1769d6; border-color: #1769d6; color: #fff; font-weight: 600; }

.cloud-summary {
  background: #f3f8ff; border: 1px solid #d4e5fb; border-radius: 10px;
  padding: 10px 14px; font-size: 13px; color: #4a5a72; margin-bottom: 12px;
}
.cloud-summary b { color: #1769d6; }

.cloud-list { display: flex; flex-direction: column; gap: 8px; }
.cf-row {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #e6ecf4; border-radius: 10px;
  padding: 10px 12px; cursor: pointer;
}
.cf-row.used { background: #fafbfd; cursor: default; }
.cf-row input[type=checkbox] { flex: none; width: 17px; height: 17px; }
.cf-thumb {
  flex: none; width: 64px; height: 40px; border-radius: 7px; overflow: hidden;
  background: #0d1a2b; display: flex; align-items: center; justify-content: center;
}
.cf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cf-thumb .cf-ico { color: rgba(255,255,255,.85); font-size: 17px; }
.cf-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cf-name {
  font-size: 13.5px; font-weight: 600; color: #2a364b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cf-sub {
  font-size: 11.5px; color: #8b98ab;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cf-size { flex: none; font-size: 12px; color: #607089; width: 58px; text-align: right; }
.cf-state {
  flex: none; font-size: 11px; border-radius: 5px; padding: 2px 8px;
}
.cf-state.ok { color: #12855c; background: #e6f7ef; }
.cf-state.idle { color: #9a6b12; background: #fff4d6; }

.cloud-loading, .cloud-empty, .cloud-err {
  padding: 26px 14px; text-align: center; font-size: 13px;
  background: #fff; border: 1px dashed #d8e0ec; border-radius: 10px; color: #8494ac;
}
.cloud-err { color: #c0392b; border-color: #f3b9b6; background: #fef4f3; }

.cloud-pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 16px 0; }
.cloud-pager .btn.sm { padding: 7px 18px; font-size: 13px; }
.pg-info { font-size: 13px; color: #607089; }

.cloud-actionbar {
  position: sticky; bottom: 10px; z-index: 15;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #23304a; color: #fff; border-radius: 12px;
  padding: 11px 16px; margin-top: 14px;
  box-shadow: 0 10px 26px rgba(15, 25, 45, .28);
}
.cloud-actionbar.hidden { display: none; }
.cloud-actionbar span { font-size: 13px; }
.cloud-actionbar .btn { flex: none; background: #e85d57; border-color: #e85d57; color: #fff; }

/* 删除确认层 */
.cf-modal {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15, 22, 38, .55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.cf-modal.hidden { display: none; }
.cfm-box {
  background: #fff; border-radius: 14px; max-width: 480px; width: 100%;
  max-height: 82vh; overflow: auto; padding: 22px;
}
.cfm-box h3 { margin: 0 0 12px; font-size: 17px; color: #1b2434; }
.cfm-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.cfm-item {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12.5px; background: #f6f8fb; border-radius: 8px; padding: 7px 10px;
}
.cfm-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2a364b; }
.cfm-item em { flex: none; color: #8494ac; font-style: normal; }
.cfm-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.cfm-btns .btn { padding: 8px 20px; }

@media (max-width: 640px) {
  .cf-size { display: none; }
  .cf-thumb { width: 54px; height: 34px; }
}

/* 分享封面预览 */
.share-preview {
  width: 100%; border-radius: 10px; overflow: hidden;
  border: 1px solid #e2e8f2; background: #f8fafd; margin-bottom: 10px;
}
.share-preview img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.share-preview .sp-empty {
  padding: 26px 10px; text-align: center; color: #98a3b5; font-size: 13px;
}
