:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --border: #e3e8f0;
  --text: #1f2733;
  --muted: #7a8699;
  --primary: #3b6ef6;
  --primary-dark: #2d55c4;
  --danger: #e5484d;
  --ok: #2f9e6e;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* 保证 hidden 属性始终生效，不被 display:flex/grid 等规则覆盖 */
[hidden] { display: none !important; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
}

/* ---------- 登录 ---------- */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 36px 32px; width: 380px; box-shadow: 0 8px 30px rgba(30,50,90,.08);
}
.brand { font-size: 22px; margin-bottom: 4px; }
.sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; background: var(--bg); border-radius: 8px; padding: 4px; }
.tabs.small { display: inline-flex; margin: 10px 0 14px; }
.tab {
  flex: 1; border: 0; background: transparent; padding: 8px 14px; border-radius: 6px;
  cursor: pointer; color: var(--muted); font-size: 14px;
}
.tabs.small .tab { flex: none; }
.tab.active { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
input, textarea, select {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  font-size: 14px; margin: 6px 0 12px; background: #fff; color: var(--text); font-family: inherit;
}
input:focus, textarea:focus { outline: 2px solid rgba(59,110,246,.25); border-color: var(--primary); }
label { font-size: 13px; color: var(--muted); display: block; }
.btn {
  border: 0; border-radius: 8px; padding: 10px 16px; font-size: 14px; cursor: pointer;
  background: #eceff5; color: var(--text); transition: .15s;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--border); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn.block { width: 100%; margin-top: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 14px; }
.msg { text-align: center; font-size: 13px; min-height: 18px; margin-top: 10px; color: var(--danger); }

/* ---------- 顶栏与布局 ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand-sm { font-weight: 700; font-size: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.whoami { font-size: 13px; color: var(--muted); }
.whoami b { color: var(--text); }
.role-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #eef2ff; color: var(--primary); margin-left: 6px; }

/* ---------- 主布局：侧边栏 + 内容 ---------- */
.layout {
  max-width: 1280px; margin: 0 auto; padding: 20px;
  display: flex; gap: 20px; align-items: flex-start;
}
.container { flex: 1; min-width: 0; max-width: none; margin: 0; padding: 0; }
.sidebar {
  width: 190px; flex: none; position: sticky; top: 76px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px; box-shadow: 0 2px 10px rgba(30,50,90,.04);
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: transparent; color: var(--muted);
  padding: 10px 12px; border-radius: 8px; font-size: 14px; font-family: inherit;
  text-align: left; cursor: pointer; transition: .15s; white-space: nowrap;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: #eef3ff; color: var(--primary); font-weight: 600; }
.nav-ico { font-size: 14px; }

.panel, .view {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 20px;
}
.panel h2, .view h2 { font-size: 16px; margin-bottom: 12px; }
.upload-form { max-width: 640px; }
.form-grid { display: grid; grid-template-columns: 1fr 160px; gap: 14px; }
.form-grid.four { grid-template-columns: 1fr 1fr 140px auto; align-items: end; }
.create-user-form { margin-bottom: 16px; }
.file-label { display: block; }
.file-preview { max-width: 220px; max-height: 160px; border-radius: 8px; border: 1px solid var(--border); margin-top: 6px; }
.upload-opts { display: flex; gap: 16px; margin-bottom: 10px; flex-wrap: wrap; }
.upload-opts label { min-width: 160px; }
.upload-opts input, .upload-opts select { margin-bottom: 0; }

/* ---------- 类别管理 ---------- */
.category-form { display: flex; gap: 10px; max-width: 460px; margin-bottom: 14px; }
.category-form input { flex: 1; margin: 0; }
.category-form .btn { white-space: nowrap; }
.category-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 20px;
  padding: 5px 12px; font-size: 13px;
}
.cat-chip .count { color: var(--muted); font-size: 11px; }
.cat-chip button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 2px;
}
.cat-chip button:hover { color: var(--danger); }

/* ---------- 筛选条 ---------- */
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.type-filter { display: flex; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  border-radius: 18px; padding: 5px 14px; font-size: 13px; cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-select { width: 150px; margin: 0; padding: 6px 10px; font-size: 13px; }
.filter-search { width: 200px; margin: 0; padding: 6px 10px; font-size: 13px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#claims-table th, #claims-table td { white-space: nowrap; }
#claims-table td.cell-resource { white-space: normal; min-width: 140px; }
/* 领取列表「资源」列：缩略图 + 名称 */
.row-thumb {
  width: 46px; height: 34px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--border); background: #f0f3f9;
  vertical-align: middle; margin-right: 8px; display: inline-block;
}
.row-thumb[src=""] { visibility: hidden; }
.cell-resource { overflow-wrap: anywhere; vertical-align: middle; }
#claims-table tbody tr:hover { background: #fafbfe; }
.dropzone {
  max-width: 640px; border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 36px 20px; text-align: center; cursor: pointer; transition: .15s; background: #fafbfe;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary); background: #eef3ff;
}
.dz-main { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.dz-sub { font-size: 12px; color: var(--muted); }

/* ---------- 瀑布流资源列表（JS 均衡分列，追加不重排） ---------- */
.list-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13px; }
.sort-select { width: auto; margin: 0 0 0 auto; padding: 5px 8px; font-size: 12px; }
.masonry { display: flex; align-items: flex-start; gap: 16px; }
.masonry-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: .15s;
}
.card:hover { box-shadow: 0 6px 18px rgba(30,50,90,.10); }
.card-thumb {
  position: relative;
  background: #f0f3f9;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 30px;
  min-height: 60px;
}
.card-thumb.clickable { cursor: zoom-in; }
.card-img { width: 100%; height: auto; display: block; }
video.card-img { background: #000; max-height: 420px; object-fit: contain; }
.video-badge {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(20,26,38,.72); color: #fff; font-size: 11px;
  padding: 3px 9px; border-radius: 12px; pointer-events: none;
}

/* ---------- 图片预览弹层 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 20, 30, .82);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.lightbox img {
  max-width: 88vw; max-height: 82vh; border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0,0,0,.5);
}
.lightbox video {
  max-width: 88vw; max-height: 82vh; border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0,0,0,.5); background: #000;
}
.lb-title { color: #e8ecf4; font-size: 14px; }
.lb-close {
  position: absolute; top: 18px; right: 26px;
  background: transparent; border: 0; color: #fff; font-size: 42px; line-height: 1;
  cursor: pointer; opacity: .8;
}
.lb-close:hover { opacity: 1; }

/* ---------- 通用弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 20, 30, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  background: #fff; border-radius: 14px; padding: 24px 24px 18px;
  width: 360px; max-width: 100%; box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.modal-card h3 { font-size: 16px; margin-bottom: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
/* 扫码下载弹窗 */
.qr-card { text-align: center; }
.qr-card h3 { margin-bottom: 6px; }
.qr-title { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; word-break: break-word; }
.qr-img { width: 240px; height: 240px; margin: 10px auto 6px; display: block; border-radius: 8px; }
.qr-hint { font-size: 12.5px; line-height: 1.6; color: var(--muted); margin: 4px 0; }
.qr-hint .muted { color: #a0a8b8; }
.qr-url { font-size: 11px; color: #a0a8b8; overflow-wrap: anywhere; word-break: break-all; margin: 6px 0 4px; }
.qr-card .modal-actions { justify-content: center; }
/* 拉黑弹窗 */
.block-target { font-size: 13px; color: var(--text); margin-bottom: 8px; overflow-wrap: anywhere; }
.block-target .tag { margin-left: 6px; }
.block-hint { font-size: 12px; color: #a0a8b8; margin: -4px 0 4px; }
.req { color: var(--danger); }
#block-reason { resize: vertical; min-height: 76px; }
@media (max-width: 640px) {
  .modal-card { padding: 20px 16px 14px; }
}
.card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
/* 文件名/hash 类无空格长串要允许断行，否则会撑破卡片宽度 */
.card-title { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; word-break: break-word; }
.card-desc { color: var(--muted); font-size: 13px; line-height: 1.5; max-height: 40px; overflow: hidden; overflow-wrap: anywhere; }
.card-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--bg); white-space: nowrap; }
.tag.ok { background: #e7f6ef; color: var(--ok); }
.tag.warn { background: #fdf0e7; color: #c96a1f; }
.tag.grey { background: #eceff5; color: var(--muted); }
.card-actions { display: flex; gap: 8px; padding: 0 16px 16px; flex-wrap: wrap; }
.card-actions .btn { flex: 1; white-space: nowrap; }
@media (max-width: 640px) { .card-actions .btn .dl-type { display: none; } }
/* ---------- 文本资源卡片（无顶部缩略图占位） ---------- */
.card.text-card { border-left: 3px solid #d3dff5; }
.text-preview {
  font-size: 13px; line-height: 1.75; color: #3d4a5f;
  padding-left: 10px; border-left: 2px solid #e5ebf6;
  white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}
.text-preview.locked { color: var(--muted); font-size: 12.5px; border-left-style: dashed; }

/* ---------- 每日领取额度条 ---------- */
.quota-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-bottom: 12px;
}
.quota-label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.quota-chip {
  font-size: 12px; padding: 4px 12px; border-radius: 14px;
  background: #eef2ff; color: var(--primary); white-space: nowrap;
}
.quota-chip.full { background: #fdf0e7; color: #c96a1f; }

/* ---------- 领取次数配置 ---------- */
.config-form { margin-top: 14px; }
.config-form .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 640px; align-items: start; }

/* ---------- 懒加载提示 ---------- */
.list-sentinel {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 20px 0 6px; color: var(--muted); font-size: 13px;
}
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-tip { text-align: center; padding: 40px 0; }
.hint-left { font-size: 12px; margin-top: 10px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 500; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #2a3140; color: #fff; padding: 10px 22px; border-radius: 10px; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 99;
}
.toast.err { background: var(--danger); }

/* ---------- 手机端适配 ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; gap: 12px; }
  .sidebar {
    position: sticky; top: 52px; z-index: 8; width: 100%;
    padding: 6px; border-radius: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .nav { flex-direction: row; gap: 4px; }
  .nav-item { width: auto; padding: 8px 12px; font-size: 13px; }
  .sort-select { margin-left: 0; }
}
@media (max-width: 640px) {
  .auth-card { width: 100%; padding: 26px 20px; }
  .topbar-inner { padding: 10px 12px; gap: 8px; }
  .brand-sm { font-size: 14px; }
  .topbar-right { gap: 6px; }
  .topbar-right .btn.sm { padding: 5px 8px; font-size: 12px; }
  .whoami { font-size: 12px; }
  .whoami .role-badge { display: none; }
  .layout { padding: 12px; }
  .sidebar { top: 48px; }
  .nav-item { padding: 7px 10px; font-size: 12px; }
  .nav-ico { font-size: 12px; }
  .panel, .view { padding: 14px 14px 16px; border-radius: 10px; }
  .masonry { gap: 10px; }
  .masonry-col { gap: 10px; }
  .card { border-radius: 10px; }
  .card-body { padding: 10px 12px; gap: 4px; }
  .card-title { font-size: 13px; }
  .card-desc { font-size: 12px; }
  .card-meta { font-size: 11px; gap: 6px; }
  .tag { font-size: 10px; padding: 1px 6px; }
  .card-actions { padding: 0 12px 12px; gap: 6px; }
  .card-actions .btn { padding: 7px 6px; font-size: 12px; }
  .text-preview { font-size: 12px; -webkit-line-clamp: 5; }
  .dropzone { padding: 24px 12px; }
  .dz-main { font-size: 13px; }
  .form-grid, .form-grid.four, .config-form .form-grid { grid-template-columns: 1fr; gap: 0; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 6px 6px; }
  .filter-select, .filter-search { width: 100%; }
  .lightbox img { max-width: 94vw; max-height: 76vh; }
}

/* ---------- 设备管理 ---------- */
.row-thumb.lg { width: 64px; height: 48px; }
.assign-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.assign-cell .filter-select { width: auto; min-width: 120px; }
.device-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px;
}
.device-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: .15s;
}
.device-card:hover { box-shadow: 0 6px 18px rgba(30,50,90,.10); }
.device-img {
  background: #f0f3f9; height: 170px; display: flex; align-items: center; justify-content: center;
  font-size: 44px; overflow: hidden;
}
.device-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.device-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.device-name { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.device-desc { color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.device-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

@media (max-width: 640px) {
  .device-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .device-img { height: 120px; font-size: 32px; }
  .assign-cell { flex-direction: column; align-items: stretch; gap: 6px; }
  .assign-cell .filter-select { width: 100%; }
}

/* ---------- 图片/视频防下载保护 ---------- */
img, video {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
#lightbox { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* ---------- 采集查询 ---------- */
.collect-form {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  max-width: 760px; margin-bottom: 18px;
}
.collect-form label { display: flex; flex-direction: column; gap: 4px; }
.collect-form label.grow { flex: 1; min-width: 220px; }
.collect-form select, .collect-form input { margin: 0; }
.collect-form .btn { white-space: nowrap; height: 40px; }
.collect-result { max-width: 760px; }
.collect-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; background: var(--bg);
}
.collect-card.found { border-color: #bfe6d2; background: #f3fbf7; }
.collect-card.miss { border-color: #ffe0b8; background: #fffaf2; }
.collect-badge { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.collect-badge.ok { color: var(--ok); }
.collect-badge.warn { color: #c47c17; }
.collect-lines { display: grid; gap: 8px; }
.collect-line { display: flex; gap: 12px; font-size: 14px; }
.collect-line .k { color: var(--muted); width: 64px; flex: none; }
.collect-line .v { font-weight: 500; overflow-wrap: anywhere; }
.collect-card .btn { margin-top: 14px; }
/* 采集拉黑 */
.collect-badge.danger { color: var(--danger); }
.collect-card.is-blocked { border-color: rgba(220, 60, 60, .45); background: #fff7f7; }
.collect-blocked {
  margin-top: 12px; padding: 10px 12px; border-radius: 8px;
  background: #fdecec; display: grid; gap: 8px;
}
.collect-blocked .k { width: 64px; }
.collect-blocked .block-strong { color: var(--danger); font-weight: 600; }
.block-reason-text { font-size: 12.5px; color: var(--text); margin-top: 4px; overflow-wrap: anywhere; }
.block-meta { font-size: 11.5px; color: #a0a8b8; margin-top: 2px; }
td .block-reason-text, td .block-meta { max-width: 260px; }

/* ---------- 平台管理 ---------- */
.platform-list { display: flex; flex-direction: column; gap: 8px; max-width: 660px; }
.platform-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
.plat-name { flex: 1; min-width: 140px; margin: 0; }
.plat-count { font-size: 12px; white-space: nowrap; }
.plat-actions { display: flex; gap: 6px; }

@media (max-width: 640px) {
  .collect-form { flex-direction: column; align-items: stretch; }
  .collect-form .btn { width: 100%; }
  .platform-row { flex-direction: column; align-items: stretch; }
  .plat-count { text-align: right; }
  .plat-actions { justify-content: flex-end; }
}

/* ---------- 采集查询使用说明弹窗 ---------- */
.help-card {
  width: 720px; max-height: 88vh; padding: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.help-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px; border-bottom: 1px solid var(--border); flex: none;
}
.help-head h3 { font-size: 16px; margin: 0; }
.help-close {
  border: 0; background: transparent; font-size: 26px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 0 4px;
}
.help-close:hover { color: var(--text); }
.help-body { padding: 18px 22px 22px; overflow-y: auto; }
.help-steps { margin: 0 0 18px 18px; display: grid; gap: 8px; font-size: 14px; line-height: 1.7; color: var(--text); }
.help-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.help-figure { display: flex; flex-direction: column; gap: 6px; }
.help-figure h4 { font-size: 14px; margin: 0; }
.help-figure p { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }
.help-img {
  width: 100%; height: 340px; object-fit: contain; margin-top: 4px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
.help-note {
  margin-top: 16px; padding: 10px 14px; font-size: 13px; line-height: 1.6;
  color: #8a5a12; background: #fff8ea; border: 1px solid #ffe0b8; border-radius: 8px;
}
@media (max-width: 640px) {
  .help-card { max-height: 92vh; }
  .help-head { padding: 14px 16px; }
  .help-body { padding: 14px 16px 18px; }
  .help-figures { grid-template-columns: 1fr; gap: 14px; }
  .help-img { height: 300px; }
}
/* 使用说明按钮与标题垂直居中（list-head 默认 baseline 对齐） */
.list-head #collect-help-btn { align-self: center; }

/* ---------- 话术查询 ---------- */
.script-search { display: flex; gap: 10px; max-width: 640px; margin-bottom: 16px; }
.script-search input { margin: 0; }
.script-search .btn { white-space: nowrap; }
.script-results { display: flex; flex-direction: column; gap: 12px; max-width: 900px; }
.script-card {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; background: var(--bg);
}
.script-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.script-book { font-size: 12px; color: var(--primary); background: #eef3ff; border-radius: 6px; padding: 2px 8px; }
.script-method { font-size: 12px; color: var(--muted); }
.script-q { font-weight: 600; font-size: 14px; margin-bottom: 6px; overflow-wrap: anywhere; }
.script-a { font-size: 14px; line-height: 1.7; color: #3a4656; white-space: pre-wrap; overflow-wrap: anywhere; }
.script-card mark { background: #fff1a8; color: inherit; padding: 0 1px; border-radius: 2px; }

/* ---------- 话术管理 ---------- */
.section-title { font-size: 14px; margin: 20px 0 10px; }
.script-form { max-width: 820px; }
.script-form .form-grid.two { grid-template-columns: 1fr 1fr; }
.script-form textarea { margin-bottom: 12px; resize: vertical; }
.script-form-actions { display: flex; gap: 10px; margin-bottom: 6px; }
.script-list-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 22px 0 10px; }
.script-list-head .section-title { margin: 0; }
.script-list-head .filter-select { width: auto; min-width: 160px; margin: 0; }
#script-table td { vertical-align: top; font-size: 13px; }
.script-cell-q { min-width: 180px; overflow-wrap: anywhere; }
.script-cell-a {
  max-width: 320px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.row-actions { white-space: nowrap; }
.row-actions .btn + .btn { margin-left: 6px; }
@media (max-width: 640px) {
  .script-search { flex-direction: column; }
  .script-search .btn { width: 100%; }
  .script-form .form-grid.two { grid-template-columns: 1fr; }
  .script-cell-a { max-width: 200px; }
}

/* ---------- 开发工具（SQLite 导入） ---------- */
.dev-warn {
  background: #fff4f4; border: 1px solid #f3c1c3; color: #a33;
  border-radius: 8px; padding: 10px 14px; font-size: 13px;
  margin-bottom: 16px; line-height: 1.7; max-width: 820px;
}
.dev-upload { display: flex; gap: 10px; align-items: center; max-width: 560px; margin-bottom: 16px; flex-wrap: wrap; }
.dev-upload input[type="file"] { margin: 0; }
.dev-upload .btn { white-space: nowrap; }
.dev-preview { max-width: 640px; }
.dev-file { font-size: 13px; color: var(--muted); margin-bottom: 10px; overflow-wrap: anywhere; }
.dev-table { margin-bottom: 14px; }
.dev-result {
  background: #0f1622; color: #d6e2f5; border-radius: 10px;
  padding: 14px 16px; font-size: 12px; line-height: 1.7;
  overflow: auto; max-width: 820px; white-space: pre-wrap; margin-top: 14px;
}

/* ---------- 我的采集 ---------- */
#my-collections-table .collect-account {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; overflow-wrap: anywhere;
}
#my-collections-table td:last-child { white-space: nowrap; }

/* ---------- 我的上传 / 成员上传 ---------- */
.tag.owner { background: #eef3ff; color: #3558b5; }
.upload-note {
  max-width: 820px; margin: 0 0 16px; padding: 10px 14px;
  font-size: 13px; line-height: 1.7; color: #3558b5;
  background: #f2f6ff; border: 1px solid #d7e2fb; border-radius: 8px;
}
.list-head #my-uploads-goto { align-self: center; }
