/* ============ 合肥机场巴士 CMS 后台样式 ============ */
:root {
  --bg: #f2f5fa;
  --panel: #ffffff;
  --ink: #16202f;
  --ink-2: #475467;
  --muted: #8b95a5;
  --line: #e6eaf0;
  --line-2: #eef1f6;
  --brand: #1565c0;
  --brand-dark: #0f4c92;
  --brand-soft: #e8f1fd;
  --green: #12805c;
  --green-soft: #e5f6ef;
  --amber: #9a6700;
  --amber-soft: #fdf4e0;
  --red: #c02b2b;
  --red-soft: #fdecec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

/* ---------- 侧边栏 ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  background: #101b2c;
  color: #c2ccda;
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, #2f80ed, #1565c0);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .5px;
  flex: none;
}
.brand-text b { display: block; color: #fff; font-size: 14px; font-weight: 600; letter-spacing: .3px; }
.brand-text span { display: block; font-size: 11px; color: #7d8da1; letter-spacing: 1.2px; }

.nav { flex: 1; overflow-y: auto; padding: 14px 10px 20px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 3px; }

.nav-group {
  padding: 14px 12px 6px;
  font-size: 11px;
  letter-spacing: 1.4px;
  color: #64748b;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #c2ccda;
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, #1d4ed8, #1565c0); color: #fff; box-shadow: 0 6px 16px rgba(21, 101, 192, .35); }
.nav-item.active svg { opacity: 1; }
.nav-count {
  margin-left: auto;
  background: rgba(255, 255, 255, .14);
  border-radius: 20px;
  font-size: 11px;
  padding: 0 7px;
  line-height: 18px;
}
.nav-item.active .nav-count { background: rgba(255, 255, 255, .25); }

.sidebar-foot {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 11px;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-foot a { color: #94a3b8; }
.sidebar-foot a:hover { color: #fff; }

/* ---------- 主区 ---------- */
.shell { margin-left: 236px; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 62px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-left h1 { font-size: 17px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { color: var(--muted); font-size: 12.5px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  display: none;
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); cursor: pointer; font-size: 16px;
}
.user-chip { display: flex; align-items: center; gap: 8px; padding-left: 12px; border-left: 1px solid var(--line); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.user-chip .u-name { font-size: 13px; color: var(--ink); line-height: 1.2; }
.user-chip .u-role { font-size: 11px; color: var(--muted); }

.page { padding: 24px; flex: 1; width: 100%; max-width: 1400px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2);
}
.card-head h2 { font-size: 15px; margin: 0; font-weight: 600; }
.card-head .sub { color: var(--muted); font-size: 12.5px; margin-left: 8px; font-weight: 400; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 15px; border-radius: 8px;
  border: 1px solid transparent; background: var(--brand); color: #fff;
  font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, box-shadow .15s, border-color .15s;
  font-family: inherit;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: #f7f9fc; color: var(--ink); border-color: #d3dae4; }
.btn-danger { background: #fff; border-color: #f0c8c8; color: var(--red); }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--brand); font-size: 13px; font-family: inherit;
}
.link-btn:hover { color: var(--brand-dark); text-decoration: underline; }
.link-btn.danger { color: var(--red); }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-weight: 500; color: var(--muted);
  background: #fafbfd; padding: 11px 16px; border-bottom: 1px solid var(--line);
  white-space: nowrap; font-size: 12.5px; letter-spacing: .3px;
}
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #fafcff; }
table.data .t-title { color: var(--ink); font-weight: 500; }
table.data .t-title:hover { color: var(--brand); }
table.data .muted { color: var(--muted); }
table.data .num { font-variant-numeric: tabular-nums; }
table.data .nowrap { white-space: nowrap; }
table.data .actions { text-align: right; white-space: nowrap; }
table.data .actions > * { margin-left: 10px; }

.thumb {
  width: 92px; height: 46px; border-radius: 6px; object-fit: cover;
  border: 1px solid var(--line); background: #f4f6fa; display: block;
}
.thumb-empty {
  width: 92px; height: 46px; border-radius: 6px; border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px;
}

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 20px;
  font-size: 12px; line-height: 1; white-space: nowrap;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-gray { background: #f1f3f7; color: var(--muted); }
.badge-blue { background: var(--brand-soft); color: var(--brand-dark); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }

.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: #f1f3f7; color: var(--ink-2); font-size: 11.5px; }

/* ---------- 工具条 ---------- */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line-2);
  background: #fcfdff;
}
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters .sep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.tabs { display: flex; gap: 4px; background: #f1f4f9; padding: 3px; border-radius: 9px; }
.tabs a {
  padding: 5px 13px; border-radius: 7px; font-size: 13px; color: var(--ink-2);
}
.tabs a:hover { color: var(--ink); }
.tabs a.active { background: #fff; color: var(--brand-dark); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); font-weight: 500; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.form-main > .card:last-child, .form-side > .card:last-child { margin-bottom: 0; }
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.field .req { color: var(--red); margin-left: 2px; }

input[type="text"], input[type="password"], input[type="number"], input[type="url"],
input[type="email"], input[type="datetime-local"], input[type="date"], select, textarea {
  width: 100%; border: 1px solid #d8dfe9; border-radius: 8px;
  padding: 8px 11px; font-size: 13.5px; color: var(--ink); background: #fff;
  font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: #7aa9e8; box-shadow: 0 0 0 3px rgba(21, 101, 192, .12);
}
input[readonly] { background: #f7f9fc; color: var(--ink-2); }
textarea { min-height: 84px; resize: vertical; line-height: 1.7; }
select { height: 36px; padding: 0 10px; }
.input-sm { height: 32px; font-size: 13px; padding: 0 10px; width: auto; }
.form-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.check-row { display: flex; gap: 20px; flex-wrap: wrap; }

.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 4px; }

/* 发布/保存按钮放在侧栏卡片顶部（原“发布设置”标题的位置），滚动正文时始终先看到操作 */
.side-actions {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--line-2);
  background: #fbfcfe;
}
.side-actions .btn:first-child { flex: 1; }
.side-actions .btn-ghost { flex: none; }

/* ---------- 编辑器 ---------- */
.editor { border: 1px solid #d8dfe9; border-radius: 9px; overflow: hidden; background: #fff; }
.editor:focus-within { border-color: #7aa9e8; box-shadow: 0 0 0 3px rgba(21, 101, 192, .12); }
.editor-toolbar {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  padding: 7px 9px; border-bottom: 1px solid var(--line);
  background: #fafbfd;
}
.editor-toolbar button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 28px; padding: 0; border: 1px solid transparent;
  background: transparent; border-radius: 6px; cursor: pointer;
  color: var(--ink-2); font-family: inherit;
}
.editor-toolbar button:hover { background: #eef2f8; color: var(--ink); }
.editor-toolbar button.on { background: #e3edfb; color: #1565c0; }
.editor-toolbar button.busy { opacity: .45; pointer-events: none; }
.editor-toolbar button svg {
  width: 16px; height: 16px; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.editor-toolbar button svg .dot { fill: currentColor; stroke: none; }
.editor-toolbar button svg .tnum {
  fill: currentColor; stroke: none; font-size: 4.6px; font-weight: 600;
  font-family: inherit;
}
.editor-toolbar .tb-sep { width: 1px; height: 18px; background: var(--line); margin: 0 5px; }
.editor-toolbar select { width: auto; height: 28px; border-color: transparent; background: transparent; font-size: 12.5px; padding: 0 4px; cursor: pointer; }
.editor-toolbar select:hover { background: #eef2f8; }
.editor-toolbar .tb-select { min-width: 66px; }
/* 图标 + 下拉的组合控件（字号 / 行距） */
.editor-toolbar .tb-combo {
  display: inline-flex; align-items: center; gap: 1px;
  height: 28px; padding: 0 4px 0 5px; border-radius: 6px; cursor: pointer;
  color: var(--ink-2);
}
.editor-toolbar .tb-combo:hover { background: #eef2f8; color: var(--ink); }
.editor-toolbar .tb-combo svg {
  width: 15px; height: 15px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.editor-toolbar .tb-combo select {
  height: 26px; padding: 0 2px; font-size: 12.5px; min-width: 46px;
  color: inherit;
}
.editor-body {
  min-height: 360px; max-height: 620px; overflow-y: auto;
  padding: 16px 18px; font-size: 14px; line-height: 1.8; outline: none;
}
.editor-body:empty::before { content: '在此输入正文内容…'; color: #a8b1bf; }
.editor-body img { max-width: 100%; height: auto; }
.editor-body a.att-file { font-size: 13px; }
.editor-body a.att-file:hover { background: #dfeafc !important; }
.editor-body table { border-collapse: collapse; max-width: 100%; }
.editor-body table td, .editor-body table th { border: 1px solid #d8dfe9; padding: 6px 10px; }
.editor-source {
  width: 100%; min-height: 360px; border: none; border-radius: 0;
  padding: 14px 16px; font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px; line-height: 1.7; resize: vertical; display: none;
}

/* ---------- 图片选择 ---------- */
.image-picker { display: flex; gap: 12px; align-items: flex-start; }
.image-preview {
  width: 132px; height: 88px; border-radius: 9px; border: 1px solid var(--line);
  background: #f4f6fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23c3cbd8' stroke-width='1.5'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M3 16l5-5 4 4 3-3 6 6'/%3E%3C/svg%3E") center/32px no-repeat;
  object-fit: cover; flex: none;
}
.image-preview.has { background: #f4f6fa; }
.image-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.file-input { display: none; }

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat .label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.stat .label i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand); display: inline-block;
}
.stat .value { font-size: 28px; font-weight: 650; letter-spacing: -.5px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat .foot { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat a.stretched { position: absolute; inset: 0; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick a {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  font-size: 13.5px; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.quick a:hover { border-color: #b9d2f2; box-shadow: 0 6px 18px rgba(21, 101, 192, .1); transform: translateY(-1px); color: var(--ink); }
.quick .qi {
  width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.quick .qi svg { width: 17px; height: 17px; }
.quick b { display: block; font-weight: 550; font-size: 13.5px; }
.quick span { display: block; color: var(--muted); font-size: 11.5px; }

/* ---------- 栏目树表格 ---------- */
.tree-name { display: flex; align-items: center; gap: 8px; }
.tree-name .indent { display: inline-block; height: 1px; }
.tree-icon { width: 15px; height: 15px; color: #b3bdcc; flex: none; }
.tree-icon.leaf { color: var(--brand); }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.pager-info { color: var(--muted); font-size: 12.5px; }
.pager-links { display: flex; gap: 5px; align-items: center; }
.pg {
  min-width: 31px; height: 31px; padding: 0 9px; border-radius: 7px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.pg:hover { border-color: #b9d2f2; color: var(--brand); background: #f7fbff; }
.pg.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.pg-gap { color: var(--muted); padding: 0 2px; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .ico { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px; background: #f2f5fa; display: flex; align-items: center; justify-content: center; color: #b3bdcc; }
.empty p { margin: 0 0 14px; font-size: 13.5px; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: #101b2c; color: #fff; padding: 10px 18px; border-radius: 9px;
  font-size: 13.5px; box-shadow: 0 10px 30px rgba(16, 24, 40, .25); z-index: 100;
  display: flex; align-items: center; gap: 8px; animation: toastIn .25s ease;
}
.toast.ok { background: #0f6b4c; }
.toast.err { background: #b42318; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } }

.alert { padding: 11px 14px; border-radius: 9px; font-size: 13px; margin-bottom: 16px; }
.alert-err { background: var(--red-soft); color: var(--red); border: 1px solid #f6d3d3; }
.alert-info { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #d3e4fa; }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff;
}
.login-visual {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(circle at 20% 20%, #2f80ed 0%, #1565c0 38%, #0b2e5c 100%);
  display: flex; flex-direction: column; justify-content: space-between; padding: 48px;
}
.login-visual::after {
  content: ''; position: absolute; right: -120px; bottom: -160px;
  width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.13), transparent 65%);
}
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 15px; letter-spacing: .5px; }
.login-brand .brand-mark { width: 40px; height: 40px; font-size: 16px; background: rgba(255,255,255,.16); backdrop-filter: blur(4px); }
.login-copy h2 { font-size: 34px; line-height: 1.35; margin: 0 0 14px; font-weight: 600; letter-spacing: -.5px; }
.login-copy p { margin: 0; color: rgba(255,255,255,.72); font-size: 14px; max-width: 380px; line-height: 1.9; }
.login-meta { font-size: 12px; color: rgba(255,255,255,.55); position: relative; z-index: 1; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-box { width: 100%; max-width: 340px; }
.login-box h1 { font-size: 22px; margin: 0 0 6px; font-weight: 600; }
.login-box .lead { color: var(--muted); font-size: 13px; margin: 0 0 28px; }
.login-box .field > label { font-size: 12.5px; }
.login-box input[type="text"], .login-box input[type="password"] { height: 42px; }
.captcha-row { display: flex; gap: 10px; }
.captcha-row input { flex: 1; }
.captcha-img {
  width: 120px; height: 42px; border-radius: 8px; border: 1px solid #d8dfe9;
  cursor: pointer; object-fit: contain; object-position: center; background: #eef2f7; flex: none;
  display: block; padding: 0;
}
.login-box .btn { height: 42px; margin-top: 6px; }
.login-foot { margin-top: 22px; font-size: 12px; color: var(--muted); text-align: center; }
.login-error { margin-bottom: 16px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  body.nav-open::after {
    content: ''; position: fixed; inset: 0; background: rgba(9, 16, 28, .45); z-index: 25;
  }
  .shell { margin-left: 0; }
  .icon-btn { display: inline-flex; align-items: center; justify-content: center; }
  .page { padding: 16px; }
  .topbar { padding: 0 16px; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .quick { grid-template-columns: 1fr; }
  .user-chip .u-meta { display: none; }
}

/* ---------- 内容管理：左侧列表 + 右侧栏目目录 ---------- */
.contents-layout { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 20px; align-items: start; transition: grid-template-columns .24s ease; }
.contents-layout.is-rail { grid-template-columns: minmax(0, 1fr) 46px; gap: 12px; }
.contents-main { min-width: 0; }
.contents-side { position: sticky; top: 88px; }

/* 所属栏目被隐藏 / 已不存在的内容：整行灰度 */
table.data tbody tr.row-dim { opacity: .5; }
table.data tbody tr.row-dim:hover { opacity: .85; }
table.data tbody tr.row-dim .t-title { color: var(--muted); }

/* 栏目目录卡片 */
.cat-card .card-head { padding: 12px 14px; gap: 8px; }
.cat-card .card-head h2 { font-size: 13.5px; }
.cat-card .card-head .sub { font-size: 11.5px; margin-left: 6px; }
.cat-fold {
  width: 24px; height: 24px; padding: 0; flex: none; cursor: pointer; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line); border-radius: 7px;
}
.cat-fold:hover { color: var(--brand); border-color: #cfe0f7; }
/* 展开状态箭头朝右（点它把目录收到右侧），收起后朝左（点它再展开） */
.cat-fold svg { width: 12px; height: 12px; transition: transform .18s ease; transform: rotate(-90deg); }

/* 左右收起：整栏窄化成竖条，把宽度让给列表 */
.contents-layout.is-rail .cat-card .card-head {
  flex-direction: column-reverse; justify-content: center; gap: 10px; padding: 10px 4px;
}
.contents-layout.is-rail .cat-card .card-head h2 { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.contents-layout.is-rail .cat-card .card-head h2 .t { writing-mode: vertical-rl; letter-spacing: 3px; font-size: 12.5px; }
.contents-layout.is-rail .cat-card .card-head .sub { display: none; }
.contents-layout.is-rail .cat-card-body { display: none; }
.contents-layout.is-rail .cat-fold svg { transform: rotate(90deg); }
.contents-layout.is-rail .contents-side { position: sticky; top: 88px; }
.cat-card-body { padding: 8px 8px 10px; max-height: calc(100vh - 215px); overflow: auto; }

.cat-all {
  display: flex; align-items: center; gap: 6px; padding: 7px 8px; margin: 0 0 6px;
  border-radius: 8px; font-size: 13px; color: var(--ink-2); text-decoration: none;
}
.cat-all:hover { background: #f5f8fd; }
.cat-all svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
.cat-all .nm, .cat-all span:nth-of-type(1) { flex: 1; }
.cat-all.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.cat-all .cnt { font-size: 11px; color: var(--muted); }

.cat-tree, .cat-children { list-style: none; margin: 0; padding: 0; }
.cat-children { margin-left: 11px; padding-left: 5px; border-left: 1px dashed var(--line); }
.cat-node.is-closed > .cat-children { display: none; }
.cat-node.is-closed > .cat-row .cat-toggle svg { transform: rotate(-90deg); }

.cat-row { display: flex; align-items: center; gap: 2px; border-radius: 7px; }
.cat-row:hover { background: #f5f8fd; }
.cat-row.on { background: var(--brand-soft); }
.cat-row.on .cat-link .nm { color: var(--brand-dark); font-weight: 600; }
.cat-toggle {
  width: 18px; height: 18px; flex: none; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
}
.cat-toggle svg { width: 12px; height: 12px; transition: transform .16s ease; }
.cat-toggle.is-leaf { cursor: default; }
.cat-link {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 5px 7px 5px 2px; font-size: 13px; color: var(--ink-2); text-decoration: none; border-radius: 7px;
}
.cat-link .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-link .cnt { flex: none; font-size: 11px; color: var(--muted); background: #f2f4f8; border-radius: 9px; padding: 1px 6px; }
.cat-row.on .cat-link .cnt { background: #fff; color: var(--brand-dark); }
.cat-empty { color: var(--muted); font-size: 12.5px; padding: 12px 6px; margin: 0; }

/* 目录树底部：表单页 / 招聘列表这类不在此发布的栏目，直接给出各自的管理入口 */
.cat-note { margin: 8px 2px 2px; padding-top: 8px; border-top: 1px dashed var(--line); }
.cat-note a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px; border-radius: 7px; font-size: 12.5px; color: var(--ink-2);
  text-decoration: none;
}
.cat-note a:hover { background: #f5f8fd; color: var(--brand-dark); }
.cat-note .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-note .tag {
  flex: none; font-size: 11px; color: var(--muted);
  background: #f2f4f8; border-radius: 9px; padding: 1px 7px;
}
.cat-note a:hover .tag { background: #fff; color: var(--brand-dark); }

@media (max-width: 1100px) {
  .contents-layout { grid-template-columns: 1fr; }
  .contents-side { position: static; order: -1; }
  .cat-card-body { max-height: 260px; }
}

/* ---------- 内容列表：紧凑行（栏目 / 时间并入标题下方） ---------- */
.contents-main table.data th { padding: 10px 14px; }
.contents-main table.data td { padding: 9px 14px; }
.t-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.t-line .t-title {
  font-size: 14px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.t-cover { flex: none; height: 19px; padding: 0 6px; font-size: 11px; }
.t-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.5;
}
.t-meta .code { font-variant-numeric: tabular-nums; }
.t-meta .cat { color: var(--ink-2); }
.t-meta .sep { color: #ccd4e0; }
.t-flag { font-size: 11px; line-height: 1; padding: 2px 6px; border-radius: 5px; background: #f1f3f7; color: var(--muted); }
.t-flag.danger { background: var(--red-soft); color: var(--red); }
.badge-off { background: #fff; color: #b6bfcd; box-shadow: inset 0 0 0 1px #e6eaf0; }
.badge-off:hover { color: var(--brand); box-shadow: inset 0 0 0 1px #cfe0f7; }

/* ---------- 分段胶囊 & 标签式勾选 ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: #f1f4f9; border-radius: 10px; }
.seg label { position: relative; display: inline-flex; }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 76px; height: 30px; padding: 0 14px; border-radius: 8px;
  font-size: 13px; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s;
}
.seg input:checked + span {
  background: #fff; color: var(--brand-dark); font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .1);
}
.seg input[value="0"]:checked + span { color: var(--amber); }
.seg input:focus-visible + span { outline: 2px solid #cfe0f7; outline-offset: 1px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--line); background: #fff;
  font-size: 13px; color: var(--ink-2); cursor: pointer; transition: .15s;
}
.chip span::before {
  content: ''; width: 13px; height: 13px; border-radius: 4px;
  border: 1.5px solid #c6cfdd; flex: none; transition: .15s;
}
.chip input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 500; }
.chip input:checked + span::before { background: var(--brand); border-color: var(--brand); box-shadow: inset 0 0 0 2.5px #fff; }
.chip input:focus-visible + span { outline: 2px solid #cfe0f7; outline-offset: 1px; }

/* ---------- 媒体库 ---------- */
.media-summary {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 18px;
}
.media-stats { display: flex; gap: 30px; flex-wrap: wrap; }
.ms { display: flex; flex-direction: column; gap: 2px; min-width: 88px; }
.ms-num { font-size: 22px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ms-label { font-size: 12.5px; color: var(--ink-2); }
.ms-sub { font-size: 11.5px; color: var(--muted); }
.ms.ok .ms-num { color: var(--green); }
.ms.warn .ms-num { color: var(--amber); }
.ms.danger .ms-num { color: var(--red); }
.media-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.tab-count { margin-left: 6px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tabs a.active .tab-count { color: var(--brand); }

.m-thumb {
  display: flex; width: 52px; height: 52px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); background: #f4f6fa;
  align-items: center; justify-content: center;
}
.m-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-ext { font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .5px; }

.m-name {
  max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-path {
  margin-top: 3px; font-size: 11.5px; color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-refs { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.ref-chip {
  display: inline-block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 1px 7px; border-radius: 5px; background: #f1f4f9; color: var(--ink-2); font-size: 11.5px;
}
.ref-chip:hover { background: var(--brand-soft); color: var(--brand-dark); }
.media-table td { vertical-align: top; padding-top: 11px; padding-bottom: 11px; }
.media-row.is-orphan td { background: #fffdf8; }
.media-row.is-orphan:hover td { background: #fff9ee; }

.bulk-bar {
  position: sticky; bottom: 16px; z-index: 20; margin: 16px 0 0;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 18px; background: #101b2c; color: #dfe7f2;
  border-radius: 12px; box-shadow: 0 10px 28px rgba(16, 24, 40, .28);
}
.bulk-bar[hidden] { display: none; }
.bulk-info b { color: #fff; }
.bulk-ops { display: flex; align-items: center; gap: 14px; }
.bulk-bar .link-btn { color: #9fb4d0; }
.bulk-bar .link-btn:hover { color: #fff; }
.bulk-bar .btn-danger { background: #fff; border-color: #fff; color: var(--red); }
.bulk-bar .btn-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* 回收站 */
.card-head-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.trash-sum { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13.5px; }
.trash-sum code { background: #f1f4f9; padding: 1px 6px; border-radius: 5px; font-size: 11.5px; }
.trash-batch { margin-bottom: 16px; }
.trash-batch .card-head { flex-wrap: wrap; gap: 10px; }
.trash-body[hidden] { display: none; }

@media (max-width: 1100px) {
  .contents-layout.is-rail { grid-template-columns: 1fr; gap: 20px; }
  .contents-layout.is-rail .cat-card .card-head { flex-direction: row; justify-content: space-between; padding: 12px 14px; }
  .contents-layout.is-rail .cat-card .card-head h2 { flex-direction: row; }
  .contents-layout.is-rail .cat-card .card-head h2 .t { writing-mode: horizontal-tb; letter-spacing: normal; }
  .contents-layout.is-rail .cat-card-body { display: block; }
}
