* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-hover: #1a1a26;
  --border: rgba(255,255,255,.06);
  --text: #e8e8ef;
  --text-muted: #7a7a8c;
  --accent: #00e5ff;
  --accent-dim: rgba(0,229,255,.12);
  --danger: #ff4757;
  --success: #2ed573;
  --warn: #ffa502;
}

body {
  font-family: "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: .85; }

/* ===== 登录 ===== */
.login-body { min-height: 100vh; background: var(--bg); }
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative;
}
.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0,229,255,.08) 0%, transparent 60%),
    var(--bg);
}
.login-card {
  position: relative; z-index: 1;
  width: 400px; max-width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 36px;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.login-logo {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #7c5cff);
  color: #0a0a0f; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.login-card h1 { font-size: 20px; font-weight: 600; color: var(--text); }
.login-card .sub { color: var(--text-muted); font-size: 13px; }
.login-form label { display: block; margin: 0 0 8px; color: var(--text-muted); font-size: 13px; }
.login-form input {
  width: 100%; height: 42px; padding: 0 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 14px; margin-bottom: 16px;
}
.login-form input:focus { outline: none; border-color: rgba(0,229,255,.4); box-shadow: 0 0 0 3px var(--accent-dim); }
.btn-login {
  width: 100%; height: 42px; margin-top: 8px;
  background: var(--accent); color: #0a0a0f; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer; letter-spacing: 2px;
}
.btn-login:hover { filter: brightness(1.08); }

/* ===== 右下角下载手机 App ===== */
.app-dl-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #00e5ff, #9d4edd);
  color: #07070c !important;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 229, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none !important;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .15s ease, filter .15s;
}
.app-dl-fab:hover,
.app-dl-fab:active { opacity: 1; filter: brightness(1.06); }
.app-dl-fab:active { transform: scale(0.97); }
.app-dl-icon { font-size: 16px; line-height: 1; flex-shrink: 0; }
.app-dl-text { white-space: nowrap; }
body.login-body .app-dl-fab {
  bottom: max(24px, calc(16px + env(safe-area-inset-bottom)));
}
@media (max-width: 768px) {
  .app-dl-fab {
    right: max(12px, env(safe-area-inset-right));
    /* 避开底部 Tab：约 56px 导航 + 安全区 */
    bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 10px);
    padding: 10px 14px;
    font-size: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 6px 16px rgba(0, 229, 255, 0.25);
  }
  body.login-body .app-dl-fab {
    bottom: max(20px, calc(12px + env(safe-area-inset-bottom, 0px)));
  }
}
@media (max-width: 380px) {
  .app-dl-fab { padding: 10px 12px; }
  .app-dl-text { font-size: 11px; }
}

/* ===== 框架 ===== */
.ruoyi-app { display: flex; min-height: 100vh; }
.ruoyi-sidebar {
  width: 220px; background: linear-gradient(180deg, #0e0e16 0%, #0a0a0f 100%);
  border-right: 1px solid var(--border);
  flex-shrink: 0; display: flex; flex-direction: column;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px; border-bottom: 1px solid var(--border);
}
.brand-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #7c5cff);
  color: #0a0a0f; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-text strong { font-size: 15px; font-weight: 700; color: var(--text); }
.brand-text small { font-size: 11px; color: var(--text-muted); }
.sidebar-nav { padding: 16px 12px; flex: 1; }
.nav-group-label {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 8px 12px 6px; margin-top: 4px;
}
.nav-group-label:first-child { margin-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; margin-bottom: 2px;
  color: var(--text-muted); border-radius: 10px;
  transition: all .15s; border: 1px solid transparent;
}
.nav-item:hover { color: var(--text); background: var(--bg-hover); }
.nav-item.active {
  color: var(--accent); background: var(--accent-dim);
  border-color: rgba(0,229,255,.15);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255,255,255,.04);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.nav-item.active .nav-icon { background: rgba(0,229,255,.15); }
.nav-label { font-size: 14px; font-weight: 500; }
.sidebar-foot {
  padding: 14px 18px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px;
}
.foot-user { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.foot-users { color: var(--text-muted); flex-shrink: 0; font-size: 12px; }
.foot-users:hover { color: var(--accent); }
.foot-logout { color: var(--text-muted); flex-shrink: 0; }
.foot-logout:hover { color: var(--danger); }
.ruoyi-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ruoyi-header {
  height: 56px; background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px;
}
.ruoyi-header .breadcrumb { font-size: 16px; font-weight: 600; color: var(--text); }
.header-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header-hint { font-size: 12px; color: var(--text-muted); }
.header-user { font-size: 11px; color: var(--text-muted); }
.header-logout { font-size: 13px; color: var(--text-muted); padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,.04); }
.mobile-only { display: none; }
.mobile-bottom-nav { display: none; }
.ruoyi-content { padding: 16px 20px; flex: 1; }

/* ===== 页面头 ===== */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.page-title { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.page-desc { font-size: 13px; color: var(--text-muted); }

/* ===== 面板 ===== */
.panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px 0; overflow: hidden;
}
.panel-title { font-size: 15px; font-weight: 600; padding: 16px 20px; color: var(--text); }

.platform-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.platform-tabs a {
  padding: 7px 16px; border-radius: 20px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px; transition: all .15s;
}
.platform-tabs a:hover { color: var(--text); border-color: rgba(255,255,255,.12); }
.platform-tabs a.active {
  color: var(--accent); border-color: rgba(0,229,255,.35); background: var(--accent-dim);
}

/* ===== 表格 ===== */
.ruoyi-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ruoyi-table th, .ruoyi-table td { padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--border); }
.ruoyi-table th { color: var(--text-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.ruoyi-table tbody tr:last-child td { border-bottom: none; }
.ruoyi-table tbody tr:hover { background: var(--bg-hover); }
.ruoyi-table .empty { text-align: center; color: var(--text-muted); padding: 48px; }
.cell-main { font-weight: 500; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.actions { display: flex; gap: 8px; align-items: center; }
.inline-form { display: inline; }

.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.tag.ok { background: rgba(46,213,115,.12); color: var(--success); }
.tag.off { background: rgba(255,71,87,.12); color: var(--danger); }
.tag.dy { background: rgba(0,229,255,.1); color: var(--accent); }
.tag.xhs { background: rgba(255,71,87,.1); color: #ff6b81; }

/* ===== 表单 / 按钮 ===== */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.search-form { display: flex; gap: 8px; }
.search-form input { width: 220px; }

input, select, textarea {
  padding: 9px 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 14px; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: rgba(0,229,255,.35);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
label { display: block; margin: 12px 0 6px; font-size: 13px; color: var(--text-muted); }

.btn, .btn-primary {
  padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-hover);
  color: var(--text); cursor: pointer; font-size: 13px; transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(255,255,255,.15); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #0a0a0f; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); color: #0a0a0f; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { background: rgba(255,71,87,.12); border-color: rgba(255,71,87,.25); color: var(--danger); }
.btn-danger:hover { background: rgba(255,71,87,.2); color: var(--danger); }
.link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0 6px; font-size: 13px; }
.link.danger { color: var(--danger); }

/* ===== 提示 ===== */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert.success { background: rgba(46,213,115,.1); color: var(--success); border: 1px solid rgba(46,213,115,.2); }
.alert.error { background: rgba(255,71,87,.1); color: var(--danger); border: 1px solid rgba(255,71,87,.2); }
.alert.warn { background: rgba(255,165,2,.1); color: var(--warn); border: 1px solid rgba(255,165,2,.2); }

/* ===== 弹窗 ===== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal.hidden { display: none; }
.modal-box {
  background: var(--bg-card); border: 1px solid var(--border);
  width: 420px; max-width: 92vw; border-radius: 12px;
  padding: 24px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
.modal-box h3 { margin: 0 0 20px; font-size: 16px; font-weight: 600; color: var(--text); }
.check-row { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--text); cursor: pointer; }
.check-row input { width: auto; accent-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ===== 安装页 ===== */
.install-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.install-box {
  width: 480px; max-width: 100%; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 12px; padding: 40px;
}
.install-box h2 { font-size: 20px; margin-bottom: 12px; color: var(--text); }
.install-box p { color: var(--text-muted); margin-bottom: 10px; line-height: 1.8; }
.install-box .ok { color: var(--success); }
.install-box .fail { color: var(--danger); }
.install-box code { background: var(--bg); padding: 2px 8px; border-radius: 4px; color: var(--accent); }

.form-footer { margin-top: 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hint-inline { font-size: 12px; color: var(--text-muted); }
.account-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
  padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
}
.account-form { display: flex; align-items: center; gap: 10px; }
.account-form label { margin: 0; white-space: nowrap; }
.account-form select { min-width: 220px; }
.account-link { margin-left: auto; }
.platform-tabs.compact { margin-bottom: 0; }
.sync-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 8px; }
.sync-grid.two-col { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.sync-form textarea { width: 100%; min-height: 100px; resize: vertical; font-family: inherit; }
.sync-form .panel select { width: 100%; margin-bottom: 12px; }
.sync-form .panel input { margin-bottom: 12px; }
.panel-desc { font-size: 12px; color: var(--text-muted); margin: -8px 0 12px; }
.code-area { font-family: ui-monospace, monospace; font-size: 12px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.dh-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.dh-tab {
  padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted);
  text-decoration: none;
}
.dh-tab.active {
  background: rgba(0,229,255,.12); border-color: rgba(0,229,255,.35); color: var(--accent);
}

.dh-layout {
  display: grid; grid-template-columns: minmax(300px, 1fr) minmax(280px, 1fr);
  gap: 16px; align-items: stretch; margin-bottom: 16px;
}
.dh-left { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.dh-right { padding: 12px; min-height: 420px; }
.dh-section {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.dh-section:last-child { border-bottom: none; }
.dh-section-head { margin-bottom: 10px; }
.dh-section label { display: block; margin: 8px 0 4px; font-size: 12px; color: var(--text-muted); }
.dh-section input, .dh-section textarea {
  width: 100%; box-sizing: border-box; margin-bottom: 4px;
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-input, rgba(0,0,0,.2)); color: var(--text);
}
.dh-preview {
  margin-top: 12px; border-radius: 12px; overflow: hidden;
  background: rgba(0,0,0,.35); border: 1px solid var(--border); min-height: 220px;
  display: flex; align-items: center; justify-content: center;
}
.dh-preview-video { width: 100%; max-height: 320px; display: block; background: #000; }
.dh-preview-img { max-width: 100%; max-height: 280px; object-fit: contain; }
.dh-preview-empty { text-align: center; padding: 32px 16px; color: var(--text-muted); }
.dh-preview-icon { font-size: 40px; display: block; margin-bottom: 8px; }
.dh-preview-hint { font-size: 12px; color: var(--text-muted); padding: 8px; text-align: center; }
.dh-script-preview {
  margin-top: 12px; padding: 10px; border-radius: 8px;
  background: rgba(0,229,255,.06); border: 1px solid rgba(0,229,255,.15);
  font-size: 12px; line-height: 1.6; max-height: 120px; overflow: auto;
}
.dh-script-preview label { font-size: 11px; color: var(--accent); margin-bottom: 4px; display: block; }

/* 数字人 · 一屏左右布局 */
.dh-page-compact {
  display: flex; flex-direction: column;
  height: calc(100vh - 118px); min-height: 520px; max-height: 900px;
  overflow: hidden;
}
.dh-board {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.dh-left-panel {
  display: grid; grid-template-rows: auto 1fr auto;
  min-height: 0; padding: 0; overflow: hidden;
}
.dh-right-panel {
  display: flex; flex-direction: column; min-height: 0;
  padding: 12px 14px; overflow: hidden;
}
.dh-pane {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  min-height: 0;
}
.dh-pane:last-child { border-bottom: none; }
.dh-pane-upload { flex-shrink: 0; }
.dh-pane-avatar { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dh-pane-script { flex-shrink: 0; }
.dh-pane-head {
  font-size: 12px; font-weight: 700; color: var(--accent);
  margin-bottom: 8px; letter-spacing: .5px;
}
.dh-upload-zone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 12px; border-radius: 10px; cursor: pointer;
  border: 1px dashed rgba(0,229,255,.35); background: rgba(0,229,255,.04);
  text-align: center; overflow: hidden;
}
.dh-upload-zone .dh-file-input {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.dh-upload-icon { font-size: 20px; color: var(--accent); font-weight: 700; }
.dh-upload-text { font-size: 12px; color: var(--text); }
.dh-upload-hint { font-size: 11px; color: var(--text-muted); }
.dh-avatar-box {
  flex: 1; min-height: 0; border-radius: 10px; overflow: hidden;
  background: rgba(0,0,0,.35); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.dh-avatar-media { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.dh-avatar-placeholder {
  text-align: center; color: var(--text-muted); padding: 16px;
}
.dh-avatar-placeholder span { font-size: 36px; display: block; margin-bottom: 6px; }
.dh-avatar-placeholder small { font-size: 11px; line-height: 1.5; }
.dh-script-input {
  width: 100%; box-sizing: border-box; min-height: 72px; max-height: 100px;
  resize: none; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: rgba(0,0,0,.25); color: var(--text);
  font-size: 12px; line-height: 1.5;
}
.dh-output-box {
  flex: 1; min-height: 0; border-radius: 10px; overflow: hidden;
  background: rgba(0,0,0,.4); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.dh-output-video { width: 100%; height: 100%; max-height: 100%; object-fit: contain; background: #000; }
.dh-output-empty { text-align: center; color: var(--text-muted); padding: 20px; }
.dh-output-icon { font-size: 32px; display: block; margin-bottom: 6px; color: var(--accent); }
.dh-output-upload { display: inline-block; margin-bottom: 8px; position: relative; cursor: pointer; }
.dh-output-upload .dh-file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dh-output-caption {
  flex-shrink: 0; padding: 8px 10px; border-radius: 8px; font-size: 11px; line-height: 1.5;
  background: rgba(157,78,221,.08); border: 1px solid rgba(157,78,221,.2);
  max-height: 72px; overflow: auto;
}
.dh-output-caption .cap-label { color: #c77dff; font-weight: 600; display: block; margin-bottom: 4px; }
.dh-save-bar {
  flex-shrink: 0; display: flex; align-items: center; gap: 12px;
  padding-top: 10px; margin-top: 4px;
}

/* ===== 手机互联 · 视频/图片左右双栏 ===== */
.datahub-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.datahub-top-bar .kb-intro { margin: 0; flex: 1; }
.datahub-refresh-btn { flex-shrink: 0; }
.datahub-sync-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}
.datahub-sync-col { min-height: 420px; display: flex; flex-direction: column; }
.datahub-sync-col .mini-card-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.datahub-upload-form {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.datahub-upload-form label {
  display: block;
  margin: 8px 0 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.datahub-upload-form .input-text,
.datahub-upload-form .datahub-file {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  font-size: 12px;
}
.datahub-upload-btn { width: 100%; margin-top: 4px; }
.datahub-list-head {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.datahub-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 16px 8px;
  text-align: center;
}
.datahub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 340px);
  overflow-y: auto;
}
.datahub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  margin-bottom: 8px;
}
.datahub-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.datahub-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.datahub-vicon {
  font-size: 18px;
  color: var(--accent);
}
.datahub-meta {
  flex: 1;
  min-width: 0;
}
.datahub-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.datahub-meta small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.datahub-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.datahub-actions .btn-sm { padding: 4px 8px; font-size: 11px; }
.datahub-actions-row {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.datahub-list-compact .datahub-item {
  padding: 6px 8px;
  margin-bottom: 4px;
  gap: 8px;
}
.datahub-list-compact .datahub-title { font-size: 12px; }
.datahub-list-compact .datahub-meta small { font-size: 10px; }
.datahub-list-compact .datahub-actions .btn-sm {
  padding: 2px 6px;
  font-size: 10px;
}
.datahub-clear-form { margin-top: 4px; }

@media (max-width: 960px) {
  .datahub-sync-grid { grid-template-columns: 1fr; }
  .datahub-list { max-height: none; }
}

/* ===== 即创风格 · 数字人口播 ===== */
.jichuang-studio {
  margin: -4px -4px 0;
  height: calc(100vh - 108px);
  min-height: 560px;
  max-height: 920px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.jc-form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.jc-workspace {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 56px minmax(260px, 340px) 1fr minmax(220px, 280px);
  gap: 0;
  background: linear-gradient(135deg, #1a1030 0%, #120820 40%, #0d0618 100%);
  border-radius: 14px;
  border: 1px solid rgba(139, 92, 246, 0.25);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.jc-rail {
  background: rgba(0, 0, 0, 0.35);
  border-right: 1px solid rgba(139, 92, 246, 0.15);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.jc-rail-label {
  display: block;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  margin-bottom: 4px;
  line-height: 1.2;
}
.jc-rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 8px 4px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: default;
  font-size: 10px;
}
.jc-rail-btn span { font-size: 18px; line-height: 1; }
.jc-rail-btn.active {
  background: rgba(139, 92, 246, 0.25);
  color: #e9d5ff;
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.35);
}
.jc-panel-left {
  padding: 12px 14px;
  border-right: 1px solid rgba(139, 92, 246, 0.12);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(20, 12, 36, 0.6);
}
.jc-script-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.jc-tab {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.35);
  color: #f3e8ff;
}
.jc-tab.ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  border: 1px dashed rgba(255, 255, 255, 0.15);
}
.jc-asset-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.jc-asset {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  overflow: hidden;
  min-height: 72px;
}
.jc-asset.active { border-color: rgba(167, 139, 250, 0.5); background: rgba(139, 92, 246, 0.12); }
.jc-asset-icon { font-size: 22px; }
.jc-asset-text { font-size: 11px; color: rgba(255, 255, 255, 0.75); }
.jc-file {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.jc-asset-voice { cursor: default; }
.jc-voice-input {
  width: 100%;
  margin-top: 4px;
  padding: 4px 6px;
  font-size: 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  text-align: center;
}
.jc-script-area {
  flex: 1;
  min-height: 120px;
  width: 100%;
  box-sizing: border-box;
  resize: none;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: #f3e8ff;
  font-size: 13px;
  line-height: 1.6;
}
.jc-script-area::placeholder { color: rgba(255, 255, 255, 0.35); }
.jc-quick-tools {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-shrink: 0;
}
.jc-tool {
  flex: 1;
  text-align: center;
  padding: 10px 4px;
  border-radius: 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.jc-panel-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 0;
  background: rgba(10, 6, 20, 0.5);
}
.jc-phone {
  position: relative;
  width: min(100%, 280px);
  aspect-ratio: 9 / 16;
  max-height: 100%;
  border-radius: 16px;
  overflow: hidden;
  background:
    repeating-conic-gradient(rgba(255, 255, 255, 0.06) 0% 25%, transparent 0% 50%) 50% / 16px 16px,
    #1a1028;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.jc-phone-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.jc-phone-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.jc-phone-avatar {
  max-width: 85%;
  max-height: 70%;
  object-fit: contain;
  border-radius: 8px;
}
.jc-phone-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  line-height: 1.6;
  padding: 20px;
}
.jc-phone-sub {
  position: absolute;
  bottom: 24px;
  left: 12px;
  right: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  text-align: center;
  line-height: 1.4;
}
.jc-panel-right {
  padding: 14px 16px;
  border-left: 1px solid rgba(139, 92, 246, 0.12);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(20, 12, 36, 0.75);
}
.jc-side-title {
  font-size: 14px;
  font-weight: 700;
  color: #e9d5ff;
  margin: 0 0 10px;
}
.jc-subtitle-box {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
}
.jc-sub-empty { font-size: 12px; color: rgba(255, 255, 255, 0.4); text-align: center; padding: 24px 8px; }
.jc-sub-line {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
}
.jc-sub-line span {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.3);
  color: #e9d5ff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jc-sub-line p { margin: 0; line-height: 1.4; }
.jc-result-mini { margin-bottom: 8px; border-radius: 8px; overflow: hidden; }
.jc-result-video { width: 100%; max-height: 100px; display: block; background: #000; }
.jc-upload-result {
  display: block;
  text-align: center;
  padding: 8px;
  margin-bottom: 10px;
  border-radius: 8px;
  font-size: 11px;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.12);
  border: 1px dashed rgba(167, 139, 250, 0.35);
  position: relative;
  cursor: pointer;
}
.jc-upload-result .jc-file { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.jc-generate-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #6366f1 100%);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45);
}
.jc-generate-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===== 数字人 · 图2 模板库 + 合成设置 ===== */
.dh-studio-v2 {
  margin: -4px -4px 0;
  height: calc(100vh - 108px);
  min-height: 560px;
  max-height: 920px;
  overflow: hidden;
}
.dh-v2-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 0;
  height: 100%;
  background: #0f1117;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.dh-v2-left {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #141820;
  padding: 14px 16px;
}
.dh-v2-left-head h2,
.dh-v2-right-head h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: #f0f3fa;
}
.dh-v2-sub { margin: 0; font-size: 12px; color: rgba(255, 255, 255, 0.45); }
.dh-v2-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.dh-v2-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.dh-v2-tab {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  cursor: pointer;
}
.dh-v2-tab.active {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(96, 165, 250, 0.45);
  color: #dbeafe;
}
.dh-v2-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  flex-shrink: 0;
  align-items: center;
}
.dh-v2-file-inline { max-width: 120px; font-size: 11px; color: rgba(255,255,255,0.7); }
.dh-v2-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  align-content: start;
  padding-right: 4px;
}
.dh-v2-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  padding: 32px 8px;
}
.dh-v2-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s;
}
.dh-v2-card.active { border-color: #3b82f6; box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35); }
.dh-v2-card-pick {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
}
.dh-v2-card-pick img,
.dh-v2-card-pick video {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: #1a1f2e;
}
.dh-v2-card-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}
.dh-v2-card-label {
  display: block;
  padding: 6px 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.45);
}
.dh-v2-card-del { position: absolute; right: 4px; bottom: 28px; margin: 0; }
.dh-v2-del {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.dh-v2-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 18px;
  background: #12151c;
}
.dh-v2-synth-form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dh-v2-notice {
  flex-shrink: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.dh-v2-notice p {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  flex: 1;
  min-width: 200px;
}
.dh-v2-row {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 88px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.dh-v2-row-label { font-size: 13px; color: rgba(255, 255, 255, 0.85); }
.dh-v2-row-label small { color: rgba(255, 255, 255, 0.45); font-weight: normal; }
.dh-v2-row-value { font-size: 12px; color: #e2e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-v2-row-value.muted { color: rgba(255, 255, 255, 0.4); }
.dh-v2-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.dh-v2-field { flex-shrink: 0; }
.dh-v2-field .dh-v2-row-label { display: block; margin-bottom: 6px; }
.dh-v2-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 88px;
  max-height: 120px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  color: #f1f5f9;
  font-size: 13px;
  line-height: 1.5;
}
.dh-v2-textarea::placeholder { color: rgba(255, 255, 255, 0.35); }
.dh-v2-field-actions { display: flex; gap: 8px; margin-top: 6px; }
.dh-v2-params {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.dh-v2-param {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}
.dh-v2-select,
.dh-v2-input {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #f1f5f9;
  font-size: 12px;
}
.dh-v2-select.sm,
.dh-v2-input.sm { padding: 6px 8px; font-size: 11px; }
.dh-v2-btn {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.dh-v2-btn.sm { padding: 6px 10px; font-size: 11px; }
.dh-v2-btn.primary { background: #3b82f6; color: #fff; }
.dh-v2-btn.synth {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  padding: 10px 24px;
  font-size: 14px;
}
.dh-v2-btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.dh-v2-btn.outline {
  background: transparent;
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.45);
}
.dh-v2-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.dh-v2-file-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
.dh-v2-row-actions label.dh-v2-btn,
.dh-v2-field-actions label.dh-v2-btn {
  position: relative;
  cursor: pointer;
}
.dh-v2-actions {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.dh-v2-log {
  flex: 1;
  min-height: 80px;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 8px;
  background: #050608;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
}
.dh-v2-log-line { color: #94a3b8; margin-bottom: 2px; }
.dh-v2-log-line.muted { color: rgba(255, 255, 255, 0.25); }

/* ===== 数字人 · 绿幕抠像合成 ===== */
.dh-page-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.dh-flash {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  max-width: min(520px, 92%);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.4s;
}
.dh-flash.ok {
  background: rgba(16, 185, 129, 0.92);
  color: #ecfdf5;
}
.dh-flash.err {
  background: rgba(239, 68, 68, 0.92);
  color: #fff;
}
.dh-flash.fade { opacity: 0; }
.dh-toast {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 130;
  max-width: min(480px, 92%);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.dh-toast.ok { background: rgba(16, 185, 129, 0.95); color: #fff; }
.dh-toast.err { background: rgba(239, 68, 68, 0.95); color: #fff; }
.ruoyi-main:has(.dh-page-wrap) {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
.ruoyi-content:has(.dh-page-wrap) {
  padding: 8px 16px 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.dh-compose {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr minmax(260px, 320px);
  gap: 0;
  overflow: hidden;
  background: #0f1117;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.dh-compose-left,
.dh-compose-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 16px;
  background: #141820;
}
.dh-compose-left { border-right: 1px solid rgba(255, 255, 255, 0.08); }
.dh-compose-right { border-left: 1px solid rgba(255, 255, 255, 0.08); }
.dh-compose-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 16px;
  background: #0a0c10;
}
.dh-compose-head h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #f0f3fa;
}
.dh-compose-head p {
  margin: 0 0 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}
.dh-compose-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.dh-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.dh-upload-row .dh-in.sm { flex: 1; min-width: 100px; }
.dh-file-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dh-file-label input[type="file"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}
.dh-compose-upload input[type="file"] {
  display: none;
}
.dh-in {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #f1f5f9;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
}
.dh-in.sm { padding: 6px 8px; font-size: 11px; width: auto; min-width: 80px; }
.dh-btn {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.dh-btn.sm { padding: 6px 10px; font-size: 11px; }
.dh-btn.primary { background: #3b82f6; color: #fff; }
.dh-btn.synth {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  width: 100%;
}
.dh-btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.dh-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.dh-file {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}
.dh-compose-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  align-content: start;
}
.dh-compose-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  padding: 32px 8px;
  margin: 0;
}
.dh-compose-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: rgba(0, 0, 0, 0.35);
}
.dh-compose-card.active { border-color: #10b981; box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35); }
.dh-compose-pick {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
}
.dh-compose-pick img,
.dh-compose-pick video {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: #1a1f2e;
}
.dh-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}
.dh-compose-label {
  display: block;
  padding: 6px 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.5);
}
.dh-compose-del {
  position: absolute;
  top: 4px;
  right: 4px;
  margin: 0;
  z-index: 2;
}
.dh-compose-del button {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: rgba(15, 17, 23, 0.75);
  color: #fca5a5;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.dh-compose-del button:hover { background: rgba(239, 68, 68, 0.85); color: #fff; }
.dh-compose-bg-preview {
  width: 100%;
  max-height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: #0a0c10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}
.dh-compose-bg-preview img,
.dh-compose-bg-preview video {
  width: 100%;
  max-height: 72px;
  object-fit: cover;
  display: block;
}
.dh-compose-bg-empty {
  padding: 16px;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}
.dh-compose-preview-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.dh-compose-canvas {
  width: 100%;
  max-height: calc(100vh - 220px);
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  background: #050608;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.dh-compose-status {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}
.dh-compose-form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dh-compose-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}
.dh-compose-row.actions { flex-wrap: wrap; }
.dh-compose-row.stack {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.dh-compose-row.stack > span { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.55); }
.dh-compose-bg-wrap { width: 100%; }
.dh-compose-row strong { color: #e2e8f0; font-size: 12px; }
.dh-compose-params {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dh-compose-params label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}
.dh-compose-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}
.dh-compose-actions .dh-btn.synth { grid-column: 1 / -1; }
.dh-compose-actions .dh-btn.primary { grid-column: 1 / -1; }
.dh-compose-tip {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.4);
}

.account-bar-compact { margin-bottom: 10px; padding: 10px 14px; }
.account-bar-compact .hint-inline { font-size: 11px; margin-left: 8px; }
.sync-account-bar .account-label { font-size: 12px; color: var(--text-muted); margin-right: 8px; }
.sync-account-bar .account-name { font-size: 13px; color: var(--text); margin-right: 8px; }
.sync-account-bar .sync-hint { flex-shrink: 0; }
.hint-inline.warn { color: #fbbf24; }

.empty-panel { padding: 48px 24px; text-align: center; }
.empty-panel .empty { padding: 0; }
.modal-hint { font-size: 12px; color: var(--text-muted); margin: -12px 0 16px; line-height: 1.6; }

/* ===== 截流工具页（紧凑三列） ===== */
.device-bind-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
}
.device-bind-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.device-bind-title { font-weight: 600; font-size: 14px; color: var(--text); }
.device-bind-tip { font-size: 12px; color: var(--text-muted); flex: 1; }
.device-select-all { font-size: 12px; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.device-empty { font-size: 12px; color: var(--text-muted); margin: 0; padding: 8px 0; }
.device-chip-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-height: 80px; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,229,255,.35) rgba(255,255,255,.04);
}
.device-chip-list::-webkit-scrollbar { width: 6px; height: 6px; }
.device-chip-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04); border-radius: 6px;
}
.device-chip-list::-webkit-scrollbar-thumb {
  background: rgba(0,229,255,.28); border-radius: 6px;
}
.device-chip.readonly { cursor: default; }
.device-chip.chip-compact { padding: 6px 10px; }
.device-chip.chip-compact .chip-main strong { font-size: 12px; }
.chip-remark.muted { color: var(--text-muted); font-weight: 500; }
.group-devices-bar.compact-chips .device-chip-list { max-height: 120px; }
.group-devices-bar { margin-bottom: 14px; }
.device-chip-list::-webkit-scrollbar-thumb:hover { background: rgba(0,229,255,.5); }
.device-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg);
  transition: all .15s; user-select: none;
}
.device-chip:hover { border-color: rgba(255,255,255,.12); }
.device-chip:has(input:checked) { border-color: rgba(0,229,255,.4); background: var(--accent-dim); }
.device-chip input { accent-color: var(--accent); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.device-chip.online .chip-dot { background: var(--success); box-shadow: 0 0 6px var(--success); }
.device-chip.offline .chip-dot { background: var(--text-muted); }
.chip-main { display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.chip-main strong { font-size: 13px; font-weight: 500; }
.chip-main small { font-size: 11px; color: var(--text-muted); }

.tools-grid-3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: stretch;
}
.mini-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; display: flex; flex-direction: column;
  transition: opacity .2s, border-color .2s;
}
.mini-card.off { opacity: .55; }
.mini-card.on { border-color: rgba(0,229,255,.25); }
.mini-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.mini-switch { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; }
.mini-switch input { accent-color: var(--accent); width: 16px; height: 16px; }
.mini-badge {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 6px;
}
.mini-badge.green { background: rgba(46,213,115,.15); color: var(--success); }
.mini-badge.cyan { background: rgba(0,229,255,.15); color: var(--accent); }
.mini-badge.purple { background: rgba(124,92,255,.15); color: #a78bfa; }
.mini-plat { font-size: 11px; color: var(--text-muted); }
.mini-card-body { padding: 10px 12px 12px; flex: 1; }
.mini-card-body label {
  margin: 8px 0 4px; font-size: 11px; color: var(--text-muted);
}
.mini-card-body label:first-child { margin-top: 0; }
.mini-card-body input, .mini-card-body select, .mini-card-body textarea {
  width: 100%; padding: 7px 10px; font-size: 13px; margin-bottom: 0;
}
.mini-card-body textarea { min-height: 72px; resize: vertical; font-family: inherit; }
.mini-hint {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.12);
}
.mini-hint.subtle {
  margin-top: 8px;
  margin-bottom: 0;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-muted);
}
.mini-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.task-checks { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.task-check {
  display: flex; align-items: center; gap: 8px; margin: 0;
  padding: 5px 8px; border-radius: 6px; background: var(--bg);
  font-size: 12px; color: var(--text); cursor: pointer;
}
.task-check input { width: auto; accent-color: var(--accent); margin: 0; }
.task-check.solo { background: transparent; padding: 5px 0; }
.tools-save-bar {
  display: flex; align-items: center; gap: 14px; margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* 截流页：三列并列，一屏展示 */
.tools-compact .device-bind-panel {
  padding: 8px 12px; margin-bottom: 10px;
}
.tools-compact .device-bind-head { margin-bottom: 6px; }
.tools-compact .device-empty { padding: 2px 0; font-size: 11px; }
.dm-dot { color: #f87171; font-weight: 700; }
.dm-alert-panel {
  background: rgba(247, 37, 133, 0.08);
  border: 1px solid rgba(247, 37, 133, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.dm-alert-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.dm-alert-title { font-weight: 700; font-size: 14px; color: #fda4af; }
.dm-alert-list { display: flex; flex-direction: column; gap: 8px; }
.dm-alert-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.dm-alert-main { display: flex; gap: 10px; align-items: flex-start; flex: 1; min-width: 0; }
.dm-badge {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dm-preview { margin: 4px 0 0; font-size: 12px; color: var(--text); line-height: 1.45; }
.dm-from { margin: 2px 0 0; font-size: 11px; color: var(--text-muted); }
.dm-alert-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; font-size: 11px; color: var(--text-muted); }
.inline-form { display: inline; margin: 0; }
.tools-compact .account-bar { margin-bottom: 10px; padding: 10px 12px; }
.tools-compact .tools-grid-3 {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px;
  align-items: start;
}
.tools-compact .mini-card {
  min-width: 0;
  height: auto;
  overflow: visible;
}
.tools-compact .mini-card-head { padding: 8px 10px; }
.tools-compact .mini-card-body {
  padding: 8px 10px 10px;
  flex: none !important;
  overflow: visible !important;
  max-height: none !important;
}
.tools-compact .mini-card-body label { margin: 6px 0 3px; font-size: 11px; }
.tools-compact .mini-card-body input,
.tools-compact .mini-card-body select { padding: 6px 8px; font-size: 12px; }
.tools-compact .mini-card-body textarea {
  min-height: 68px; resize: none; font-size: 12px; padding: 6px 8px;
}
.tools-compact .task-checks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
  overflow: visible !important;
  max-height: none !important;
}
.tools-compact .task-check {
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.35;
}
.tools-compact .tools-save-bar { margin-top: 10px; padding-top: 8px; }

.hidden-cmd-form { display: none; }

.remote-control-panel {
  background: var(--bg-card); border: 1px solid rgba(0,229,255,.18);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 12px;
}
.remote-control-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.remote-control-title { font-weight: 700; font-size: 14px; color: var(--accent); }
.remote-control-tip { font-size: 12px; color: var(--text-muted); flex: 1; }
.remote-task-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.remote-task-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px; border-radius: 10px; background: var(--bg);
  border: 1px solid var(--border);
}
.rt-badge {
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 6px; flex-shrink: 0;
}
.rt-badge.green { background: rgba(46,213,115,.15); color: var(--success); }
.rt-badge.cyan { background: rgba(0,229,255,.15); color: var(--accent); }
.rt-badge.purple { background: rgba(124,92,255,.15); color: #a78bfa; }
.rt-btn {
  flex: 1; min-height: 34px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer;
}
.rt-btn.start:hover { border-color: rgba(46,213,115,.4); color: var(--success); }
.rt-btn.stop:hover { border-color: rgba(255,71,87,.4); color: var(--danger); }

.ruoyi-main:has(.tools-compact) .ruoyi-header { height: 48px; padding: 0 16px; }
.ruoyi-content:has(.tools-compact) { padding: 10px 16px; }

.account-readonly { display: flex; align-items: center; gap: 10px; }
.account-name { font-size: 14px; color: var(--text); font-weight: 500; }

.user-mgmt-tabs {
  display: flex; gap: 8px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.user-mgmt-tab {
  padding: 10px 20px; font-size: 14px; font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all .15s;
}
.user-mgmt-tab:hover { color: var(--text); }
.user-mgmt-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== 用户管理 ===== */
.user-toolbar .btn-add-user { display: inline-flex; align-items: center; gap: 8px; }
.btn-add-icon {
  width: 22px; height: 22px; border-radius: 6px;
  background: rgba(10,10,15,.25); display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; line-height: 1;
}
.device-quota-pill {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 4px 12px; border-radius: 20px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  font-weight: 600;
}
.device-quota-pill.active { border-color: rgba(0,229,255,.35); background: var(--accent-dim); color: var(--accent); }
.device-quota-pill.full { border-color: rgba(255,165,2,.35); background: rgba(255,165,2,.1); color: var(--warn); }
.device-quota-pill .dq-num { font-size: 15px; }
.device-quota-pill .dq-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.tag-sm { font-size: 11px; padding: 2px 8px; margin-left: 6px; vertical-align: middle; }

.user-form-modal { width: 520px; max-width: 96vw; padding: 0; overflow: hidden; }
.user-form-header {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 22px 22px 16px;
  background: linear-gradient(135deg, rgba(0,229,255,.08), rgba(124,92,255,.06));
  border-bottom: 1px solid var(--border);
  position: relative;
}
.user-form-icon {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #7c5cff);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: 0 8px 24px rgba(0,229,255,.2);
}
.user-form-header h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text); }
.user-form-sub { margin: 4px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border: none; border-radius: 8px;
  background: rgba(255,255,255,.06); color: var(--text-muted);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: rgba(255,255,255,.1); color: var(--text); }

.user-form { padding: 0 22px 22px; }
.form-section { margin-top: 18px; }
.form-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 12px;
}
.fs-dot { width: 8px; height: 8px; border-radius: 50%; }
.fs-dot.cyan { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.fs-dot.green { background: var(--success); }
.fs-dot.purple { background: #a78bfa; }
.form-section-desc { font-size: 12px; color: var(--text-muted); margin: -6px 0 12px; line-height: 1.6; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-field-full { grid-column: 1 / -1; }
.form-field label { margin: 0 0 6px; font-size: 12px; font-weight: 500; }
.form-field .req { color: var(--danger); }
.form-field input, .form-field select { width: 100%; margin: 0; }
.field-hint { display: block; margin-top: 4px; font-size: 11px; color: var(--text-muted); }

.device-quota-picker {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--border);
}
.dq-picker-label { font-size: 13px; color: var(--text-muted); margin: 0; width: 100%; }
.dq-stepper { display: flex; gap: 8px; flex-wrap: wrap; }
.dq-step {
  min-width: 40px; height: 40px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text);
  font-size: 15px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.dq-step:hover { border-color: rgba(0,229,255,.3); }
.dq-step.active {
  background: var(--accent-dim); border-color: rgba(0,229,255,.45);
  color: var(--accent); box-shadow: 0 0 0 3px rgba(0,229,255,.1);
}
.dq-custom { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.dq-input-row {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 10px;
}
.dq-input-row input {
  flex: 1; text-align: center; font-size: 18px; font-weight: 700;
  min-height: 44px; max-width: 120px;
}
.dq-adjust {
  width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); font-size: 20px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.dq-adjust:hover { border-color: rgba(0,229,255,.35); color: var(--accent); }
.dq-unit { font-size: 14px; color: var(--text-muted); }

.status-toggle {
  display: flex; gap: 10px;
}
.status-opt {
  flex: 1; min-height: 44px; padding: 10px 16px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-muted);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.status-opt:hover { border-color: rgba(255,255,255,.12); color: var(--text); }
.status-opt.active {
  border-color: rgba(46,213,115,.45); background: rgba(46,213,115,.12); color: var(--success);
}
.status-opt[data-status="0"].active {
  border-color: rgba(255,71,87,.45); background: rgba(255,71,87,.1); color: var(--danger);
}

.dq-custom input { width: 64px; text-align: center; padding: 8px; }

.bound-devices-panel {
  margin-top: 12px; padding: 12px; border-radius: 12px;
  background: rgba(255,255,255,.02); border: 1px solid var(--border);
}
.bound-devices-panel.hidden { display: none; }
.bound-devices-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 10px;
}
.bound-devices-count { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.bound-devices-batch {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.bound-devices-batch.hidden { display: none; }
.bdi-check-all { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); cursor: pointer; margin-right: 4px; }
.bdi-check { display: inline-flex; align-items: center; flex-shrink: 0; cursor: pointer; }
.bdi-check input { width: 15px; height: 15px; margin: 0; }
.bound-devices-list { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }
.bound-device-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
}
.bdi-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bdi-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text-muted); }
.bound-device-item.online .bdi-dot { background: var(--success); box-shadow: 0 0 6px var(--success); }
.bdi-main strong { display: block; font-size: 13px; font-weight: 600; }
.bdi-main small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.bdi-actions { display: flex; gap: 6px; flex-shrink: 0; }

.user-form-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.user-form-modal .modal-box h3 { margin: 0; }

/* ===== 知识库 ===== */
.kb-intro {
  font-size: 13px; color: var(--text-muted); margin-bottom: 14px;
  padding: 10px 14px; background: var(--bg-card); border-radius: 10px; border: 1px solid var(--border);
}
.kb-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px;
}
.kb-dept-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 14px 8px; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  transition: all .15s; color: var(--text);
}
.kb-dept-card:hover { border-color: rgba(124,92,255,.35); background: rgba(124,92,255,.08); color: var(--text); }
.kb-dept-icon { font-size: 28px; line-height: 1; margin-bottom: 6px; }
.kb-dept-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.kb-dept-count { font-size: 11px; color: var(--text-muted); }
.kb-detail-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.kb-dept-title { font-size: 18px; font-weight: 600; }
.kb-dept-sub { font-size: 12px; color: var(--text-muted); }
.kb-form .kb-edit-card { margin-bottom: 0; }
.device-bind-panel.compact { margin-bottom: 12px; padding: 10px 12px; }
.label-hint { font-size: 11px; color: var(--text-muted); font-weight: 400; }

/* ===== 移动端（手机浏览器 / 微信内置） ===== */
@media (max-width: 768px) {
  body {
    font-size: 15px;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-only { display: block; }
  a, button, .btn, .nav-item, .mb-nav-item, .device-chip, .task-check, .kb-dept-card {
    touch-action: manipulation;
  }

  /* 隐藏桌面侧栏，改用底部导航 */
  .ruoyi-sidebar { display: none; }
  .ruoyi-app { flex-direction: column; min-height: 100vh; min-height: 100dvh; }
  .ruoyi-main { flex: 1; min-height: 0; padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }

  .ruoyi-header {
    height: auto; min-height: 52px;
    padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    flex-wrap: wrap; gap: 8px;
  }
  .ruoyi-header .breadcrumb { font-size: 17px; }
  .header-hint { display: none; }
  .header-logout.mobile-only { display: inline-block; }

  .ruoyi-content {
    padding: 12px 14px 20px;
  }
  .ruoyi-content:has(.tools-compact) { padding: 10px 12px 16px; }
  .ruoyi-main:has(.tools-compact) .ruoyi-header { min-height: 46px; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }

  /* 底部 Tab 导航 */
  .mobile-bottom-nav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
    background: rgba(14, 14, 22, .96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .35);
  }
  .mb-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 4px 10px;
    color: var(--text-muted); text-decoration: none;
    transition: color .15s;
  }
  .mb-nav-item.active { color: var(--accent); }
  .mb-nav-icon { font-size: 20px; line-height: 1; }
  .mb-nav-label { font-size: 11px; font-weight: 600; letter-spacing: .02em; }

  /* 表单触控区域 */
  input, select, textarea {
    font-size: 16px;
    min-height: 44px;
    padding: 10px 14px;
  }
  .btn, .btn-primary {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 15px;
  }
  .btn-sm { min-height: 38px; padding: 8px 14px; font-size: 14px; }
  .btn-login { min-height: 48px; font-size: 16px; }

  .login-wrap { padding: 16px; align-items: flex-start; padding-top: max(48px, env(safe-area-inset-top)); }
  .login-card { padding: 28px 22px; border-radius: 16px; }
  .login-brand { margin-bottom: 24px; }
  .login-form input { min-height: 48px; font-size: 16px; margin-bottom: 14px; }

  /* 配置范围 / 账号栏 */
  .account-bar {
    flex-direction: column; align-items: stretch;
    padding: 12px 14px; margin-bottom: 12px; gap: 10px;
  }
  .account-form {
    flex-direction: column; align-items: stretch; width: 100%;
  }
  .account-form label { margin: 0 0 4px; }
  .account-form select { width: 100%; min-width: 0; }
  .account-readonly { flex-wrap: wrap; }

  /* 截流三卡片：手机单列堆叠 */
  .tools-compact .tools-grid-3 {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .tools-compact .mini-card { border-radius: 14px; }
  .tools-compact .mini-card-head { padding: 12px 14px; }
  .tools-compact .mini-card-body { padding: 12px 14px 14px; }
  .tools-compact .mini-card-body input,
  .tools-compact .mini-card-body select,
  .tools-compact .mini-card-body textarea { font-size: 16px; padding: 10px 12px; }
  .tools-compact .task-check { padding: 10px 12px; font-size: 14px; border-radius: 10px; }
  .tools-compact .mini-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .remote-task-grid { grid-template-columns: 1fr; }
  .remote-task-row { flex-wrap: wrap; }

  /* 设备芯片：更易点选 */
  .device-bind-panel { padding: 12px 14px; border-radius: 14px; }
  .device-bind-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .device-bind-tip { flex: none; line-height: 1.5; }
  .device-chip-list { max-height: 120px; gap: 10px; }
  .device-chip {
    flex: 1 1 calc(50% - 5px);
    min-width: calc(50% - 5px);
    padding: 12px;
    border-radius: 12px;
  }

  /* 保存栏吸底（在底部导航上方） */
  .tools-save-bar {
    position: sticky;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    z-index: 50;
    flex-direction: column; align-items: stretch;
    gap: 10px; margin-top: 14px; padding: 12px 0 8px;
    background: linear-gradient(to top, var(--bg) 70%, transparent);
  }
  .tools-save-bar .btn-primary { width: 100%; }
  .tools-save-bar .hint-inline { text-align: center; line-height: 1.5; }

  /* 用户管理表格 → 卡片 */
  .panel { border-radius: 14px; padding: 0; background: transparent; border: none; }
  .ruoyi-table thead { display: none; }
  .ruoyi-table tbody { display: block; }
  .ruoyi-table tr {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
  }
  .ruoyi-table tr:hover { background: var(--bg-card); }
  .ruoyi-table td {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px; padding: 8px 0; border: none;
    text-align: right;
  }
  .ruoyi-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
    text-align: left;
  }
  .ruoyi-table td.empty { display: block; text-align: center; padding: 32px 16px; }
  .ruoyi-table td.empty::before { display: none; }
  .ruoyi-table .actions {
    flex-direction: column; align-items: stretch; gap: 8px;
    padding-top: 12px; margin-top: 4px;
    border-top: 1px solid var(--border);
  }
  .ruoyi-table .actions::before { align-self: flex-start; }
  .ruoyi-table .actions .btn,
  .ruoyi-table .actions .inline-form .btn { width: 100%; }

  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .search-form { width: 100%; display: flex; gap: 8px; }
  .search-form input { flex: 1; width: auto; min-width: 0; }
  .search-form .btn { flex-shrink: 0; }
  .toolbar .btn-primary { width: 100%; }

  .user-mgmt-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; gap: 0; }
  .user-mgmt-tab { flex-shrink: 0; padding: 12px 18px; font-size: 15px; }

  /* 知识库 */
  .kb-intro { font-size: 14px; padding: 12px 14px; line-height: 1.6; }
  .kb-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .kb-dept-card { padding: 16px 8px; border-radius: 14px; min-height: 88px; }
  .kb-dept-icon { font-size: 32px; }
  .kb-dept-name { font-size: 12px; }
  .kb-detail-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .kb-form textarea.code-area { min-height: 240px; font-size: 15px; }

  /* 弹窗全屏感 */
  .modal { padding: 12px; align-items: flex-end; }
  .modal-box {
    width: 100%; max-width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    max-height: 88vh;
  }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn, .modal-actions .btn-primary { width: 100%; min-height: 44px; }

  .user-form-modal { width: 100%; border-radius: 16px 16px 0 0; }
  .user-form-header { padding: 18px 16px 14px; }
  .user-form { padding: 0 16px 16px; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .device-quota-picker { flex-direction: column; align-items: stretch; }
  .dq-custom { margin-left: 0; justify-content: flex-start; }
  .bound-device-item { flex-direction: column; align-items: stretch; }
  .bdi-actions { justify-content: stretch; }
  .bdi-actions .btn { flex: 1; }

  .alert { font-size: 14px; padding: 14px 16px; border-radius: 12px; }
  .sync-grid, .sync-grid.two-col, .dh-layout, .dh-board { grid-template-columns: 1fr; }
  .dh-page-compact { height: auto; max-height: none; }
  .dh-left-panel { grid-template-rows: auto auto auto; }
  .jichuang-studio { height: auto; max-height: none; }
  .dh-studio-v2 { height: auto; max-height: none; }
  .dh-compose {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
  .dh-compose-left { max-height: 320px; }
  .dh-compose-center { min-height: 360px; }
  .dh-v2-layout { grid-template-columns: 1fr; height: auto; }
  .dh-v2-left { max-height: 360px; }
  .dh-v2-right { min-height: 480px; }
  .jc-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
  }
  .jc-rail { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .jc-rail-group { display: flex; align-items: center; gap: 6px; }
  .jc-rail-label { display: none; }
  .row-2 { grid-template-columns: 1fr; }
  .toolkit-body { grid-template-columns: 1fr; }
}

/* 工具库：一屏展示，无页面滚动 */
.ruoyi-main:has(.toolkit-screen) {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
.ruoyi-main:has(.wd-screen) {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
.ruoyi-main:has(.toolkit-screen) .ruoyi-header {
  height: 48px;
  min-height: 48px;
  padding: 0 16px;
  flex-shrink: 0;
}
.ruoyi-content:has(.toolkit-screen) {
  padding: 8px 16px 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.ruoyi-content:has(.toolkit-screen) .account-bar {
  margin-bottom: 8px;
  padding: 8px 12px;
  flex-shrink: 0;
}
.ruoyi-content:has(.toolkit-screen) .toolkit-alert {
  margin-bottom: 6px;
  padding: 8px 12px;
  flex-shrink: 0;
}
.toolkit-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.toolkit-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  overflow: hidden;
}
.toolkit-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.toolkit-dy { border-color: rgba(0,229,255,.18); }
.toolkit-xhs { border-color: rgba(247,37,133,.2); }
.tk-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tk-head strong { font-size: 14px; }
.tk-icon { font-size: 20px; line-height: 1; }
.tk-tag {
  margin-left: auto;
  font-size: 11px;
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,229,255,.1);
}
.tk-tag.xhs { color: #f72585; background: rgba(247,37,133,.1); }
.tk-block {
  padding: 10px 14px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.tk-block.tk-fill {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-bottom: none;
  overflow: hidden;
}
.tk-block-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}
.tk-block-head .tk-count { margin-left: auto; flex-shrink: 0; }
.tk-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(0,229,255,.1);
}
.tk-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tk-input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.tk-inline-result {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tk-inline-result.xhs { color: #f72585; }
.tk-add { margin-top: 6px; }
.tk-bind-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 8px;
}
.tk-bind-tag {
  font-size: 10px;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tk-save-tag {
  font-size: 10px;
  color: var(--success);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(46,213,115,.12);
  border: 1px solid rgba(46,213,115,.25);
}
/* ── 抖音监控表格 ── */
.tk-monitor-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.tk-monitor-wrap .tk-monitor-grid {
  display: none;
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.tk-monitor-wrap.has-rows .tk-monitor-grid {
  display: table;
}
.tk-monitor-wrap.has-rows .tk-monitor-empty {
  display: none;
}
.tk-monitor-grid thead th {
  height: 28px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  vertical-align: middle;
  position: sticky;
  top: 0;
  z-index: 1;
}
.tk-monitor-grid thead th.col-stat,
.tk-monitor-grid tbody td.col-stat {
  text-align: center;
  width: 13%;
}
.tk-monitor-grid thead th.col-act,
.tk-monitor-grid tbody td.col-act {
  text-align: right;
  width: 76px;
}
.tk-monitor-grid tbody tr {
  height: 32px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer;
  transition: background .12s;
}
.tk-monitor-grid tbody tr:last-child {
  border-bottom: none;
}
.tk-monitor-grid tbody tr:hover {
  background: rgba(0,229,255,.05);
}
.tk-monitor-grid tbody td {
  padding: 0 6px;
  font-size: 11px;
  vertical-align: middle;
  overflow: hidden;
}
.tk-monitor-grid .col-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.tk-monitor-grid .col-stat {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}
.tk-act-btns {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}
.tk-monitor-empty {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 8px;
}
.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}
.link-btn.danger { color: #ff6b81; }

/* ── 小红书笔记预览 ── */
.tk-xhs-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.tk-note-preview {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.tk-note-preview.tk-clickable.has-note {
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.tk-note-preview.tk-clickable.has-note:hover {
  border-color: rgba(247,37,133,.25);
  background: rgba(247,37,133,.04);
}
.tk-note-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 16px 12px;
  margin: 0;
}
.tk-note-preview.has-note .tk-note-empty {
  display: none;
}
.tk-note-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px 6px;
  min-height: 0;
}
.tk-note-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
}
.tk-note-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tk-note-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}
.tk-note-main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.tk-note-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tk-note-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tk-note-desc {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tk-note-foot {
  flex-shrink: 0;
  padding: 4px 12px 8px;
  font-size: 10px;
  color: #f72585;
  opacity: .85;
  border-top: 1px solid rgba(255,255,255,.04);
}
.tk-rewrite-bar {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: #f72585;
  background: rgba(247,37,133,.06);
  border: 1px solid rgba(247,37,133,.12);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tk-rw-label { font-weight: 600; }

.tk-placeholder {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 8px;
}
.toolkit-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.toolkit-sync {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.toolkit-sync-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}
.toolkit-sync-empty { font-size: 11px; color: var(--text-muted); }
.toolkit-sync-all {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.toolkit-devices {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.toolkit-dev {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}
.toolkit-dev.on { border-color: rgba(46,213,115,.35); }
.toolkit-dev-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}
.toolkit-dev.on .toolkit-dev-dot { background: var(--success); }
.toolkit-dev small { color: var(--text-muted); }
.toolkit-save {
  flex-shrink: 0;
  padding: 8px 20px;
  font-size: 13px;
}
.btn.xhs-btn, .btn-primary.xhs-btn {
  background: linear-gradient(135deg, #f72585, #b5179e);
  border-color: transparent;
}

/* 作品下载 · 简化版（抖音/小红书） */
.wd-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.wd-top {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.wd-tabs {
  display: flex;
  gap: 8px;
}
.wd-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.wd-tab.active {
  color: var(--text);
  border-color: rgba(0, 229, 255, .35);
  background: rgba(0, 229, 255, .08);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, .12);
}
.wd-tab-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}
.wd-tab-icon.dy { background: linear-gradient(135deg, #111, #333); }
.wd-tab-icon.xhs { background: linear-gradient(135deg, #f72585, #b5179e); }
.wd-parse-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.wd-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}
.wd-input::placeholder { color: var(--text-muted); }
.wd-btn-parse {
  flex-shrink: 0;
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
}
.wd-btn-parse:disabled { opacity: .55; cursor: not-allowed; }
.wd-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 2px;
}
.wd-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.wd-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 229, 255, .15);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.wd-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wd-check-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  margin-right: 4px;
}
.wd-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
.wd-btn-dl {
  background: rgba(37, 99, 235, .2);
  border-color: rgba(59, 130, 246, .45);
  color: #93c5fd;
}
.wd-btn-del {
  background: rgba(234, 88, 12, .15);
  border-color: rgba(249, 115, 22, .4);
  color: #fdba74;
}
.wd-btn-clear {
  background: rgba(239, 68, 68, .12);
  border-color: rgba(248, 113, 113, .4);
  color: #fca5a5;
}
.wd-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  align-content: start;
  padding: 2px 2px 8px;
}
.wd-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 2px 8px;
}
.wd-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.wd-row-check {
  flex-shrink: 0;
  padding-top: 4px;
  cursor: pointer;
}
.wd-row-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.wd-row-head .wd-row-title {
  flex: 1;
  min-width: 120px;
  margin: 0;
}
.wd-type-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}
.wd-row-link {
  display: block;
  font-size: 12px;
  color: #93c5fd;
  text-decoration: none;
  word-break: break-all;
  line-height: 1.45;
  margin-bottom: 4px;
}
.wd-row-link:hover { text-decoration: underline; color: #bfdbfe; }
.wd-row-link.empty { color: var(--text-muted); font-style: italic; }
.wd-plat-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.wd-plat-badge.dy { background: rgba(254, 44, 85, 0.15); color: #fb7185; }
.wd-plat-badge.xhs { background: rgba(255, 36, 66, 0.12); color: #f87171; }
.wd-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wd-row-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wd-row-meta {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}
.wd-row-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
}
.wd-row-stats span { white-space: nowrap; }
.wd-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.wd-row-actions .wd-act {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}
.wd-row-actions .wd-act.preview {
  color: #a5b4fc;
  border-color: rgba(129, 140, 248, 0.35);
  background: rgba(99, 102, 241, 0.12);
}
.wd-row-actions .wd-act.dl {
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(37, 99, 235, 0.12);
}
.wd-row-actions .wd-act.rm {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(239, 68, 68, 0.1);
}
.wd-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.wd-modal.hidden { display: none !important; }
.wd-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.wd-modal-box {
  position: relative;
  width: min(640px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.wd-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.wd-modal-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.wd-modal-body {
  padding: 12px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.wd-preview-video {
  width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  background: #000;
}
.wd-preview-img {
  width: 100%;
  border-radius: 8px;
}
.wd-preview-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.wd-preview-gallery img {
  width: 100%;
  border-radius: 6px;
  aspect-ratio: 3/4;
  object-fit: cover;
}
.wd-preview-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
}
.wd-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 48px 16px;
  margin: 0;
}
.wd-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
}
.wd-card-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
  border-radius: 4px;
  cursor: pointer;
}
.wd-card-check input { width: 14px; height: 14px; cursor: pointer; }
.wd-card-cover {
  position: relative;
  aspect-ratio: 9 / 12;
  background: #0a0a0f;
  overflow: hidden;
}
.wd-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wd-cover-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 12px;
}
.wd-plat-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, .65);
}
.wd-plat-badge.dy { background: rgba(0, 0, 0, .75); }
.wd-plat-badge.xhs { background: rgba(247, 37, 133, .85); }
.wd-card-body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.wd-card-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.wd-card-time {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}
.wd-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.wd-act {
  flex: 1;
  padding: 6px 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}
.wd-act.dl {
  background: rgba(37, 99, 235, .18);
  border-color: rgba(59, 130, 246, .35);
  color: #93c5fd;
}
.wd-act.rm {
  flex: 0 0 32px;
  padding: 6px;
  color: #f87171;
  border-color: rgba(248, 113, 113, .35);
  background: rgba(239, 68, 68, .1);
}

.hidden { display: none !important; }

/* 工具库弹窗 */
.tk-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tk-modal.hidden { display: none !important; }
.tk-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px);
}
.tk-modal-box {
  position: relative;
  width: 520px;
  max-width: 96vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,.55);
  overflow: hidden;
}
.tk-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tk-modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.tk-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.tk-modal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.tk-md-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.tk-md-gallery a { display: block; }
.tk-md-gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg);
}
.tk-note-cover {
  width: 100%;
  max-height: 100px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.tk-md-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 8px;
}
.tk-md-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.tk-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.tk-stats-text {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
}
.tk-stats-text span { white-space: nowrap; }
.tk-md-video {
  width: 100%;
  max-height: 220px;
  border-radius: 10px;
  background: #000;
  margin-bottom: 6px;
}
.tk-md-video-tip,
.tk-md-empty-vid {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}
.tk-md-section {
  margin-bottom: 14px;
}
.tk-md-section label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tk-md-section.xhs label { color: #f72585; }
.tk-md-pre {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  font-family: inherit;
  max-height: 200px;
  overflow-y: auto;
}
.tk-md-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.tk-md-tags span {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(247,37,133,.1);
  color: #f72585;
}
.tk-md-url label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.tk-md-url p {
  margin: 0;
  font-size: 12px;
  word-break: break-all;
  color: var(--text-muted);
}
.tk-md-loading {
  font-size: 12px;
  color: var(--accent);
  margin: 8px 0 0;
}

@media (min-width: 769px) {
  .mobile-bottom-nav { display: none !important; }
}
