* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #7c6cf0;
  --primary-dark: #6a5ce6;
  --primary-light: #f0edff;
  --bg: #f4f6fb;
  --card: #fff;
  --border: #e8eaf3;
  --text: #1f2330;
  --muted: #8b90a5;
  --success: #22c55e;
  --warn: #f59e0b;
  --error: #ef4444;
  --sidebar-w: 220px;
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.brand-card {
  display: flex; align-items: center; gap: 12px; padding: 18px 14px;
  margin: 12px 10px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #9b8df8); color: #fff;
}
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px; background: transparent;
  border: 1px solid rgba(255,255,255,.28);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px;
  flex-shrink: 0;
}
.brand-logo-img {
  width: 42px; height: 42px; border-radius: 12px; object-fit: contain; flex-shrink: 0;
  background: transparent;
}
.brand-card h1 { font-size: 16px; font-weight: 700; }
.brand-card p { font-size: 10px; opacity: .9; margin-top: 2px; }
.nav-ico { width: 20px; text-align: center; }
.vip-tag {
  font-size: 9px; padding: 2px 6px; border-radius: 999px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; margin-left: 4px;
}
.badge.hot { margin-left: auto; font-size: 9px; padding: 2px 6px; border-radius: 999px; background: rgba(255,255,255,.25); color: inherit; }
.badge.lock { background: #fff4e6; color: #d97706; font-weight: 600; }
.nav-item.active .badge.lock { background: rgba(255,255,255,.35); color: #fff; }
.nav-item--locked { color: #666; }
.nav-item--locked:hover { background: #f5f6fa; }
.nav-item.active .badge.hot { background: rgba(255,255,255,.3); }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--border); }
.update-log { padding: 10px 14px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.update-log .ver { color: var(--primary); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.nav { padding: 12px 8px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin-bottom: 4px;
  border-radius: 10px; cursor: pointer; font-size: 14px; color: #555; transition: .15s;
}
.nav-item:hover { background: #f5f6fa; }
.nav-item.active { background: linear-gradient(135deg, var(--primary), #9b8df8); color: #fff; font-weight: 600; }
.nav-item .badge { margin-left: auto; font-size: 10px; padding: 2px 6px; border-radius: 999px; background: #ffe4e6; color: #e11; }
.nav-section { font-size: 11px; color: var(--muted); padding: 12px 14px 6px; }

.sidebar-config { padding: 12px; border-top: 1px solid var(--border); }
.sidebar-config label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 4px; }
.sidebar-config input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; margin-bottom: 8px;
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--border); padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar h2 { font-size: 20px; font-weight: 700; color: var(--primary); }
.topbar-meta { font-size: 12px; color: var(--muted); }
.server-queue-top {
  max-width: min(520px, 42vw);
  color: var(--warn);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.server-queue-banner {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #fde68a;
  background: linear-gradient(90deg, #fffbeb, #fef3c7);
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
}
body.dark .server-queue-banner {
  border-color: #854d0e;
  background: linear-gradient(90deg, #422006, #713f12);
  color: #fde68a;
}
body.dark .server-queue-top { color: #fbbf24; }

.page { display: none; flex: 1; padding: 20px 24px; overflow: auto; }
.page.active { display: block; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border-radius: 16px; border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(124,108,240,.06); padding: 20px;
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-title-row { justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.profile-field { margin-top: 16px; }
.profile-field > label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.profile-input {
  width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 14px; font-family: inherit; margin-bottom: 8px;
}
.profile-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,108,240,.12); }
.profile-redeem-row { display: flex; gap: 8px; align-items: stretch; }
.profile-redeem-row .profile-input { flex: 1; margin-bottom: 0; }
.profile-buy-link { margin-top: 8px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #444; }
.field label .req { color: var(--error); }
.field-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
textarea, select, input[type=text], input[type=password], input[type=number] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fafbff;
}
textarea { min-height: 100px; resize: vertical; }
textarea:focus, select:focus, input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,108,240,.12); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; border: none; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .15s;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), #9b8df8); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-outline { background: #fff; border: 1px solid var(--primary); color: var(--primary); }
.btn-ghost { background: #f5f6fa; color: #555; }
.btn-block { width: 100%; padding: 13px; font-size: 15px; border-radius: 12px; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

.ref-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ref-grid.ref-grid-omni { grid-template-columns: repeat(5, 1fr); }
.ref-grid.ref-grid-frames { grid-template-columns: repeat(2, 1fr); }
.ref-grid.ref-grid-7 { grid-template-columns: repeat(4, 1fr); }
@media (min-width: 720px) { .ref-grid.ref-grid-7 { grid-template-columns: repeat(7, 1fr); } }
.ref-grid-8 { grid-template-columns: repeat(4, 1fr); }
.ref-grid.drag-over { opacity: 0.85; outline: 2px dashed var(--primary); border-radius: 12px; }
@media (min-width: 600px) { .ref-grid-8 { grid-template-columns: repeat(4, 1fr); } }

.seg-control { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-control.seg-dur .seg { flex: 1; min-width: 56px; text-align: center; padding: 10px 8px; }
.omni-flash-badge {
  padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border);
  background: #fafbff; font-weight: 600; font-size: 14px;
}
.seg-control .seg {
  flex: 1; min-width: 120px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: #fafbff; font-size: 12px; cursor: pointer; transition: .15s;
}
.seg-control .seg.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 600; }

.table-scroll { overflow: auto; margin: 12px 0; border: 1px solid var(--border); border-radius: 12px; }

.filter-card { background: #f8f9fd; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.filter-title { font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.filter-grid { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 900px) { .filter-grid { grid-template-columns: 1fr 1fr; } }
.date-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.date-range input { flex: 1; min-width: 140px; font-size: 12px; padding: 8px; }
.btn-row { display: flex; gap: 8px; }
.batch-bar { margin-top: 0; }

.pagination-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px;
}
.pag-left, .pag-center, .pag-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-jump-input { width: 56px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }

.progress-cell { min-width: 80px; }
.progress-bar {
  height: 6px; background: #e8eaf3; border-radius: 999px; overflow: hidden; margin-top: 4px;
}
.progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #9b8df8); border-radius: 999px; transition: width .3s; }
.progress-bar--queued i {
  transition: none;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  animation: queue-bar-pulse 1.6s ease-in-out infinite;
}
.queue-ahead-badge {
  margin: 4px 0 2px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}
.queue-ahead-badge strong {
  font-size: 14px;
  color: #ea580c;
}
.queue-ahead-soon {
  background: #fef9c3;
  color: #a16207;
}
.status-pill.status-cancelled {
  background: #f3f4f6;
  color: #6b7280;
}
body.dark .queue-ahead-badge {
  background: #422006;
  color: #fdba74;
}
body.dark .queue-ahead-badge strong { color: #fb923c; }
body.dark .queue-ahead-soon { background: #422006; color: #fde047; }
body.dark .status-pill.status-cancelled { background: #2a2b3a; color: #9ca3af; }
@keyframes queue-bar-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.task-id { font-family: monospace; font-size: 11px; color: var(--muted); }

.route-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.route-pill {
  padding: 2px 8px; border-radius: 999px; font-size: 10px; border: 1px solid var(--primary-light);
  background: var(--primary-light); color: var(--primary); text-decoration: none; cursor: pointer;
}
.route-pill:hover { background: var(--primary); color: #fff; }
button.route-pill { font: inherit; appearance: none; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-item {
  background: #f8f9fd; border-radius: 12px; padding: 16px; text-align: center;
}
.stat-num { display: block; font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal.hidden { display: none !important; }
.modal-box {
  background: var(--card); border-radius: 16px; max-width: 560px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.2); overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; color: var(--primary); }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 20px; font-size: 14px; line-height: 1.8; }
.modal-body ol { padding-left: 20px; }
.modal-body li { margin-bottom: 8px; }
.ref-slot {
  aspect-ratio: 1; border: 2px dashed var(--border); border-radius: 12px; background: #fafbff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; position: relative; overflow: hidden; font-size: 11px; color: var(--muted);
  transition: border-color .15s, background .15s;
}
.ref-slot:hover { border-color: var(--primary); background: var(--primary-light); }
.ref-slot .slot-label {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  font-size: 10px; font-weight: 700; color: var(--primary);
  background: rgba(255,255,255,.9); padding: 2px 6px; border-radius: 6px;
}
.ref-slot .slot-plus { font-size: 22px; color: var(--primary); line-height: 1; }
.ref-slot .slot-hint { font-size: 10px; margin-top: 4px; }
.ref-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ref-slot .rm {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff; border: none; cursor: pointer; z-index: 2;
}
.ref-counter {
  float: right; font-size: 12px; color: var(--primary); font-weight: 600;
}
.route-order-hint { margin-left: auto; font-size: 11px; }

.preview-empty {
  min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); text-align: center; gap: 12px;
}
.preview-empty .ico { font-size: 48px; opacity: .3; }
.preview-result video, .preview-result img { max-width: 100%; border-radius: 12px; margin-top: 8px; }

.info-box {
  background: var(--primary-light); border-left: 4px solid var(--primary);
  padding: 12px 14px; border-radius: 0 10px 10px 0; font-size: 12px; line-height: 1.7; color: #555;
  margin-bottom: 16px;
}
.warn-box { background: #fff7ed; border-left: 4px solid var(--warn); padding: 12px 14px; border-radius: 0 10px 10px 0; font-size: 12px; color: #924; margin-top: 12px; }
.error-box { background: #fef2f2; border-left: 4px solid var(--error); padding: 12px 14px; border-radius: 0 10px 10px 0; font-size: 12px; color: #991; margin-top: 12px; }

.model-tabs { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.model-tab {
  flex: 1; min-width: 140px; padding: 14px; border-radius: 14px; cursor: pointer; text-align: center;
  background: linear-gradient(135deg, #e8e4ff, #f3f0ff); border: 2px solid transparent; transition: .15s;
}
.model-tab.active { border-color: var(--primary); box-shadow: 0 4px 16px rgba(124,108,240,.2); }
.model-tab h4 { font-size: 14px; margin-bottom: 4px; }
.model-tab p { font-size: 11px; color: var(--muted); }

.batch-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

.upload-two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
@media (max-width: 768px) { .upload-two-col { grid-template-columns: 1fr; } }
.upload-block {
  background: #f8f9fd; border: 1px solid var(--border); border-radius: 14px; padding: 16px;
}
.upload-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.upload-label .muted { font-weight: 400; color: var(--muted); font-size: 12px; }
.upload-btns { display: flex; flex-wrap: wrap; gap: 8px; }

.section-title { font-size: 14px; font-weight: 700; margin: 16px 0 10px; color: var(--primary); }
.info-box.warn-style { background: #fffbeb; border-left-color: var(--warn); }
.info-box.warn-style ul { margin: 8px 0 0 18px; }
.info-box.warn-style li { margin-bottom: 4px; }
.doc-table code { font-size: 12px; background: #f0edff; padding: 2px 6px; border-radius: 4px; }

.col-hidden { display: none !important; }
.col-settings label { display: block; margin-bottom: 10px; font-size: 14px; cursor: pointer; }
.col-settings input { margin-right: 8px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th, table.data-table td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
table.data-table th { background: #f8f9fd; font-weight: 600; }

.task-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px;
  padding: 12px; background: #f8f9fd; border-radius: 12px;
}
.task-table-wrap { overflow: auto; max-height: calc(100vh - 280px); border: 1px solid var(--border); border-radius: 12px; }
.task-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.task-table thead tr {
  background: linear-gradient(135deg, var(--primary), #9b8df8); color: #fff;
}
.task-table th, .task-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.task-table th { background: transparent; position: sticky; top: 0; z-index: 1; font-weight: 600; color: #fff; }
.task-table td.prompt { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.status-pending { background: #f3f4f6; color: #666; }
.status-running { background: #fef9c3; color: #854; }
.status-success { background: #dcfce7; color: #166; }
.status-failed { background: #fee2e2; color: #991; }

.log-box {
  background: #1a1b26; color: #aaa; padding: 12px; border-radius: 10px; font-size: 12px;
  max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin-top: 12px;
}

.task-error-hint {
  margin-top: 6px; font-size: 11px; line-height: 1.45; color: #c0392b;
  max-width: 280px; text-align: left;
}
.task-error-cat { margin-bottom: 4px; max-width: 300px; text-align: left; }
.task-error-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--err-cat, #6b7280);
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.4;
}
.task-error-summary {
  margin-top: 4px;
  font-size: 12px;
  color: #374151;
  line-height: 1.4;
  font-weight: 600;
}
.task-error-msg { font-size: 11px; color: #888; margin-top: 4px; word-break: break-all; max-width: 300px; }
.progress-stage { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.task-dl-btn { margin-right: 4px; }
.task-conc-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.task-retention-hint {
  display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px;
  background: #f0edff; color: #6a5ce6; border: 1px solid #ddd6fe; font-size: 11px; font-weight: 700;
}
body.dark .task-retention-hint { background: #2a2540; color: #c4b5fd; border-color: #3d3560; }
.task-conc-label select { padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); font-size: 12px; }
.hidden { display: none !important; }

body.theme-modern {
  --primary: #2563eb;
  --primary-light: #dbeafe;
}
body.theme-modern .brand-card {
  background: linear-gradient(135deg, #eff6ff, #f5f3ff);
}

body.dark {
  --bg: #12131a;
  --card: #1a1b26;
  --border: #2a2b3a;
  --text: #e1e1e6;
  --muted: #888;
  --primary-light: #2a2540;
}
html.theme-dark-boot { color-scheme: dark; }
body.dark .sidebar { background: var(--card); border-color: var(--border); }
body.dark .main { background: var(--bg); }
body.dark .topbar { background: var(--card); border-color: var(--border); }
body.dark .topbar h2 { color: #c4b5fd; }
body.dark .nav-item { color: #aaa; }
body.dark .nav-item:hover { background: #252636; }
body.dark .nav-item.active { background: linear-gradient(135deg, #5b4fc7, #7c6cf0); color: #fff; }
body.dark .brand-card { background: linear-gradient(135deg, #4c3d99, #6a5ce6); }
body.dark .card { box-shadow: none; border-color: var(--border); }
body.dark .card-title { color: var(--text); }
body.dark .field label { color: #ccc; }
body.dark .profile-field > label { color: #ccc; }
body.dark textarea, body.dark select, body.dark input[type=text], body.dark input[type=password], body.dark input[type=number] {
  background: #0f1117; color: #e1e1e6; border-color: var(--border);
}
body.dark .seg, body.dark .seg-control .seg { background: #0f1117; border-color: var(--border); color: #ccc; }
body.dark .seg.active, body.dark .seg-control .seg.active { background: var(--primary); color: #fff; border-color: var(--primary); }
body.dark .info-box { color: #ccc; background: #0f1117; border-color: var(--border); }
body.dark .task-table th { background: transparent; color: #fff; }
body.dark .task-toolbar { background: #1e1f2e; }
body.dark .btn-outline { background: transparent; border-color: var(--primary); color: #c4b5fd; }
body.dark .btn-ghost { background: #252636; color: #ccc; border: 1px solid var(--border); }
body.dark .btn-ghost:hover { background: #2a2b3a; }
body.dark .omni-flash-badge { background: #0f1117; border-color: var(--border); color: var(--text); }
body.dark .modal { background: rgba(0,0,0,.65); }
body.dark .modal-head { border-color: var(--border); }
body.dark .modal-foot { border-color: var(--border); }
body.dark .modal-head h3, body.dark .modal-head-title h3 { color: #c4b5fd; }
body.dark .sidebar-footer { border-color: var(--border); }
body.dark .update-log { color: var(--muted); }
body.dark a.https-folder-link { color: #a5b4fc; }

/* 多行批量 */
.multiline-input {
  min-height: 120px; font-family: inherit; font-size: 13px; line-height: 1.6;
  resize: vertical;
}
.multiline-rows { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; max-height: 420px; overflow-y: auto; }
.ml-row-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px;
}
.ml-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ml-row-num { font-weight: 700; color: var(--primary); font-size: 13px; }
.ml-prompt {
  width: 100%; min-height: 56px; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font: inherit; resize: vertical; background: var(--card); color: var(--text);
}
.ml-row-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.ml-row-controls select {
  flex: 1; min-width: 90px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 12px; background: var(--card); color: var(--text);
}
.ml-ref-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.ml-ref-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); }
.ml-model-hint { margin-top: 6px; font-size: 11px; }
.multiline-empty { text-align: center; padding: 16px; color: var(--muted); }

.preview-modal-box { max-width: 900px; }
.preview-modal-body { text-align: center; background: var(--bg); }
.modal-foot {
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--border);
}
.announce-modal-box { max-width: 520px; }
.announce-modal-body {
  max-height: 50vh; overflow-y: auto; font-size: 14px; line-height: 1.75; color: var(--text);
}
.announce-modal-foot { justify-content: space-between; }
.announce-dismiss-label {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer;
}
.announce-dismiss-label input { width: 16px; height: 16px; cursor: pointer; }

/* 增强弹窗 */
.modal-box-enhanced { max-width: 520px; }
.modal-head-enhanced {
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--primary-light), transparent);
}
.modal-head-title { display: flex; align-items: center; gap: 10px; }
.modal-head-title h3 { margin: 0; font-size: 16px; color: var(--primary); }
.modal-head-icon { font-size: 22px; line-height: 1; }
.modal-close-round {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-lead { font-size: 15px; font-weight: 600; margin: 0 0 8px; color: var(--text); }

/* 联系方式 */
.contact-panel {
  margin-top: 16px; padding: 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg);
}
.contact-panel-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.contact-slot { padding: 0 20px 16px; }
.contact-slot--embed { padding: 0; }
.contact-slot--compact { padding: 12px 0 0; }
.contact-slot--modal-foot {
  padding: 0 20px 12px; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 12px;
}
#announceModalContact.contact-slot--modal-foot { margin-top: 0; }
.contact-block {
  border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  background: var(--bg); text-align: center;
}
.contact-block-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.contact-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.contact-tab {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  padding: 6px 12px; border-radius: 999px; font-size: 12px; cursor: pointer; transition: .15s;
}
.contact-tab:hover { border-color: var(--primary); }
.contact-tab.active {
  border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600;
}
.contact-qr-box {
  display: inline-flex; padding: 10px; background: #fff; border-radius: 12px;
  border: 1px solid var(--border); box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.contact-qr-img { width: 160px; height: 160px; object-fit: contain; display: block; }
.contact-block-hint { margin-top: 10px; margin-bottom: 0; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--border); padding-bottom: 10px; }
.sidebar-contact { margin: 0 10px 10px; }
.sidebar-contact .contact-block--sidebar {
  background: #fff; border-radius: 12px; padding: 14px 12px 12px;
  border: 1px solid #e8eaf3; box-shadow: 0 4px 14px rgba(0,0,0,.06); text-align: center;
}
.sidebar-contact .contact-qr-wrap { display: flex; flex-direction: column; align-items: center; }
.sidebar-contact .contact-qr-box {
  padding: 0; border: none; box-shadow: none; background: transparent; width: 100%;
  display: flex; justify-content: center;
}
.sidebar-contact .contact-qr-img { width: 100%; max-width: 176px; height: auto; aspect-ratio: 1; object-fit: contain; }
.sidebar-contact .contact-sidebar-label {
  margin-top: 10px; font-size: 13px; font-weight: 600; color: #333; letter-spacing: 0.02em;
}
.sidebar-contact .contact-tabs { margin-bottom: 10px; gap: 6px; }
.sidebar-contact .contact-tab { padding: 4px 10px; font-size: 11px; }
.contact-block--large .contact-qr-img { width: 200px; height: 200px; }
.contact-block--large .contact-qr-box { padding: 12px; }
.contact-block--large .contact-block-title { font-size: 15px; margin-bottom: 14px; }

.route-pill.danger-text { color: #c0392b; border-color: #fecaca; background: #fff5f5; }
.route-pill.danger-text:hover { background: #c0392b; color: #fff; }
.https-folder-link { color: var(--primary); text-decoration: underline; }
.https-folder-link:hover { opacity: 0.85; }

body.dark .stat-item { background: #1e1f2e; }
body.dark table.data-table th { background: #1e1f2e; color: var(--text); }
body.dark .info-box.warn-style { background: #2a2410; color: #fbbf24; border-left-color: #f59e0b; }
body.dark .doc-table code { background: #2a2540; color: #c4b5fd; }
body.dark .filter-card { background: var(--card); }
body.dark .ref-slot { background: #0f1117; }
body.dark .ref-slot .slot-label { background: rgba(26,27,38,.92); color: #c4b5fd; }
body.dark .status-pending { background: #2a2b3a; color: #aaa; }
body.dark .status-running { background: #3a3418; color: #fbbf24; }
body.dark .status-success { background: #143024; color: #86efac; }
body.dark .status-failed { background: #3a1818; color: #fca5a5; }
body.dark .progress-bar { background: #2a2b3a; }
body.dark .ml-row-card { background: #0f1117; }
body.dark .modal-box { background: var(--card); }
body.dark .modal-head-enhanced { background: linear-gradient(135deg, #2a2540, transparent); }
body.dark .modal-close-round { background: #0f1117; }
body.dark .modal-lead { color: var(--text); }
body.dark .contact-block { background: #0f1117; }
body.dark .contact-panel { background: #0f1117; border-color: var(--border); }
body.dark .contact-panel-title { color: var(--text); }
body.dark .contact-tab { background: #1a1b26; color: #ccc; }
body.dark .contact-tab.active { background: #2a2540; color: #c4b5fd; }
body.dark .contact-qr-box { background: #fff; }
body.dark .contact-slot--modal-foot { border-color: var(--border); }
body.dark .btn-primary { background: linear-gradient(135deg, #5b4fc7, #7c6cf0); color: #fff; }
body.dark .btn-primary:hover { filter: brightness(1.08); }
body.dark .col-settings { color: var(--text); }
body.dark .modal-close-round:hover { background: #252636; }
body.dark input[type=datetime-local] { background: #0f1117; color: #e1e1e6; border-color: var(--border); }
body.dark .warn-box { background: #2a2410; border-color: #f59e0b; color: #fde68a; }
body.dark .preview-empty { color: var(--muted); }
body.dark .stat-num { color: #c4b5fd; }
body.dark .stat-label { color: var(--muted); }
body.dark .topbar-meta { color: var(--muted); }
body.dark .task-table td { color: var(--text); }
body.dark .task-table-wrap { border-color: var(--border); }
body.dark .task-error-msg { color: #888; }
body.dark .task-error-hint { color: #fca5a5; }
body.dark .task-error-summary { color: #fecaca; }
body.dark .model-tab { background: #1e1f2e; border-color: transparent; color: var(--text); }
body.dark .model-tab.active { border-color: var(--primary); box-shadow: 0 4px 16px rgba(124,108,240,.25); }
body.dark .model-tab p { color: var(--muted); }
body.dark .upload-block { background: #0f1117; border-color: var(--border); }
body.dark .error-box { background: #3a1818; color: #fca5a5; border-left-color: #ef4444; }
body.dark .pagination-bar { border-color: var(--border); color: var(--text); }
body.dark .page-jump-input { background: #0f1117; color: var(--text); border-color: var(--border); }
body.dark .route-pill { background: #2a2540; border-color: #3d3560; color: #c4b5fd; }
body.dark .route-pill:hover { background: var(--primary); color: #fff; }
body.dark .route-pill.danger-text { background: #3a1818; border-color: #7f1d1d; color: #fca5a5; }
body.dark .col-settings label { color: var(--text); }
body.dark .profile-input { background: #0f1117; color: #e1e1e6; border-color: var(--border); }
body.dark .field-hint a, body.dark #buyRedeemLink { color: #a5b4fc; }
body.dark .table-scroll { border-color: var(--border); }
body.dark table.data-table td { color: var(--text); border-color: var(--border); }
body.dark .nav-item .badge { background: #3a1818; color: #fca5a5; }
body.dark .nav-item--locked { color: #999; }
body.dark .nav-item--locked:hover { background: #252636; }
body.dark .badge.lock { background: #3a2a10; color: #fbbf24; }
body.dark .nav-item.active .badge.lock { background: rgba(255,255,255,.25); color: #fff; }
body.dark .sidebar-contact .contact-block--sidebar { background: #fff; border-color: #e8eaf3; }
body.dark .sidebar-contact .contact-sidebar-label { color: #333; }
body.dark .nav-item.active .badge { background: rgba(255,255,255,.25); color: #fff; }
body.dark .seg-control .seg.active { color: #fff; }
body.dark .announce-modal-body { color: var(--text); }
body.dark .announce-dismiss-label { color: var(--muted); }
body.dark .modal-close { color: var(--muted); }
body.dark .modal-close-round { color: var(--muted); }
body.dark .log-box { background: #0a0b10; color: #aaa; }

/* VIP repeat locks and profile badges */
select.vip-repeat-locked,
select.vip-repeat-locked option {
  color: #9a3412 !important;
  background: #fffaf0 !important;
  border-color: #fcd34d !important;
}
select.vip-repeat-locked { cursor: not-allowed; font-weight: 800; opacity: .96; }
select.vip-repeat-unlocked,
select.vip-repeat-unlocked option {
  color: #92400e !important;
  background: #fff7ed !important;
  border-color: #fbbf24 !important;
}
select.vip-repeat-unlocked { font-weight: 800; }
body.dark { color-scheme: dark; }
body.dark select.vip-repeat-locked,
body.dark select.vip-repeat-locked option {
  color: #fbbf24 !important;
  background: #151722 !important;
  border-color: #a16207 !important;
}
body.dark select.vip-repeat-unlocked,
body.dark select.vip-repeat-unlocked option {
  color: #fcd34d !important;
  background: #1b1c29 !important;
  border-color: #a16207 !important;
}
body.dark select option { background: #151722; color: #e1e1e6; }
.repeat-limit-badge {
  display: inline-flex; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 900; vertical-align: middle;
  background: linear-gradient(135deg,#fef3c7,#ffedd5); color:#b45309; border:1px solid #fbbf24;
}
.repeat-limit-badge.locked { background:#fff7ed; color:#b45309; border-color:#fcd34d; }
.field-hint.vip-hint-locked,
.field-hint.vip-hint-unlocked { color: #b45309; font-weight: 700; }
body.dark .repeat-limit-badge,
body.dark .repeat-limit-badge.locked { background:#2a2110; color:#fbbf24; border-color:#a16207; }
body.dark .field-hint.vip-hint-locked,
body.dark .field-hint.vip-hint-unlocked { color:#fbbf24; }
.profile-account-line { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.profile-account-line strong { font-size:15px; }
.profile-role-badge, .profile-vip-badge {
  display:inline-flex; align-items:center; border-radius:999px; padding:3px 9px;
  font-size:11px; font-weight:800; line-height:1.3;
}
.profile-role-badge { background:#eef2ff; color:#4f46e5; }
.profile-role-badge.vip { background:linear-gradient(135deg,#f59e0b,#d97706); color:#fff; box-shadow:0 3px 10px rgba(217,119,6,.22); }
.profile-role-badge.admin { background:linear-gradient(135deg,#7c3aed,#4f46e5); color:#fff; }
.profile-vip-features { display:flex; flex-wrap:wrap; gap:6px; margin-top:9px; }
.profile-vip-badge { background:linear-gradient(135deg,#fef3c7,#ffedd5); color:#b45309; border:1px solid #fed7aa; }
.profile-vip-badge.admin { background:linear-gradient(135deg,#ede9fe,#e0e7ff); color:#5b21b6; border-color:#ddd6fe; }
.profile-vip-badge.locked { background:#fff7ed; color:#b45309; border-color:#fcd34d; }
body.dark .profile-vip-badge.locked { background:#2a2110; color:#fbbf24; border-color:#a16207; }

.prompt-modal-box { max-width: 680px; }
.prompt-modal-text {
  margin: 0; max-height: 52vh; overflow: auto; white-space: pre-wrap; word-break: break-word;
  background: #f8f9fd; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--text);
}
body.dark .prompt-modal-text { background: #151722; border-color: #303247; }

.client-vip-badge {
  display:inline-flex; align-items:center; gap:4px; padding:5px 11px; border-radius:999px;
  font-size:11px; font-weight:900; letter-spacing:.2px;
  color:#fff; background:linear-gradient(135deg,#f59e0b,#d97706);
  box-shadow:0 5px 16px rgba(217,119,6,.28); white-space:nowrap;
}
.client-vip-badge.locked {
  color:#92400e; background:linear-gradient(135deg,#fff7ed,#ffedd5); box-shadow:0 5px 16px rgba(245,158,11,.16);
  border:1px solid #fdba74; font-weight:900;
}
.client-vip-badge.admin {
  background:linear-gradient(135deg,#7c3aed,#5b21b6); box-shadow:0 5px 16px rgba(124,58,237,.24);
}
body.dark .client-vip-badge.locked {
  color:#fcd34d; background:linear-gradient(135deg,#2a2110,#3a2a0f); border-color:#a16207; box-shadow:none;
}

.task-error-action {
  margin-top: 6px; padding: 7px 9px; border-radius: 8px; max-width: 320px;
  font-size: 11px; line-height: 1.5; color: #92400e; background: #fffbeb;
  border-left: 3px solid #f59e0b; text-align: left;
}
.task-error-details, .task-error-hints { margin-top: 5px; font-size: 10px; color: #888; }
.task-error-details summary, .task-error-hints summary { cursor: pointer; }
body.dark .task-error-action { color: #fde68a; background: #2a2410; border-left-color: #f59e0b; }


/* 手机端用户面板：只在小屏生效，PC 保持原布局 */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  .app { display: block; min-height: 100vh; }
  .sidebar {
    width: 100%; position: sticky; top: 0; z-index: 40;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .brand-card { padding: 10px 12px; }
  .brand-card h1 { font-size: 15px; }
  .brand-card p { font-size: 10px; }
  .brand-logo, .brand-logo-img { width: 38px; height: 38px; border-radius: 11px; font-size: 15px; }
  .nav {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px; padding: 8px 10px 10px;
  }
  .nav-section { grid-column: 1 / -1; padding: 5px 2px 0; font-size: 10px; }
  .nav-item {
    min-width: 0; padding: 9px 6px; justify-content: center;
    border-radius: 10px; font-size: 12px; background: var(--primary-light);
  }
  .nav-item .nav-ico { font-size: 16px; }
  .nav-item .badge { margin-left: 0; padding: 1px 5px; font-size: 9px; }
  .sidebar-footer { display: flex; gap: 8px; padding: 0 10px 10px; border-top: 0; }
  .sidebar-footer .update-log,
  .sidebar-footer .sidebar-contact,
  .sidebar-footer #siteFooter { display: none !important; }
  .sidebar-footer #btnReloadModels { width: auto; flex: 1; margin: 0; }
  .main { width: 100%; }
  .topbar { padding: 10px 12px; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
  .topbar h2 { font-size: 17px; line-height: 1.25; }
  .topbar-actions { width: 100%; flex-wrap: wrap; gap: 6px; }
  .topbar-actions .btn { padding: 7px 10px; font-size: 12px; }
  .client-vip-badge { font-size: 10px; padding: 4px 8px; white-space: normal; line-height: 1.35; }
  .topbar-meta { font-size: 11px; }
  .server-queue-top { max-width: 100%; white-space: normal; }
  .page { padding: 12px; overflow: visible; }
  .two-col, .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .card { padding: 14px; border-radius: 12px; }
  .card-title { font-size: 14px; margin-bottom: 12px; }
  .field { margin-bottom: 12px; }
  textarea, select, input[type=text], input[type=password], input[type=number], input[type=datetime-local] {
    font-size: 16px; padding: 10px; max-width: 100%;
  }
  textarea { min-height: 110px; }
  .seg-control { gap: 6px; }
  .seg-control .seg { flex: 1 1 calc(50% - 3px); min-width: 0; padding: 9px 6px; font-size: 12px; }
  .seg-control.seg-dur .seg { min-width: 0; }
  .model-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .model-tab { min-width: 0; padding: 10px 8px; }
  .ref-grid,
  .ref-grid.ref-grid-omni,
  .ref-grid.ref-grid-7,
  .ref-grid-8 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ref-grid.ref-grid-frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ref-slot { font-size: 10px; }
  .upload-two-col { gap: 12px; }
  .upload-block { padding: 12px; }
  .upload-btns { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .upload-btns .btn { width: 100%; }
  .batch-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .batch-actions .btn { width: 100%; }
  .filter-card { padding: 12px; }
  .filter-title { font-size: 14px; }
  .filter-grid { grid-template-columns: 1fr; gap: 10px; }
  .date-range { display: block; }
  .date-range input { width: 100%; min-width: 0; }
  .date-range span { display: none; }
  .task-toolbar { align-items: stretch; flex-direction: column; padding: 10px; }
  .task-toolbar .btn,
  .task-toolbar select,
  .task-toolbar input,
  .task-conc-label { width: 100%; }
  .task-table-wrap { max-height: none; overflow-x: auto; border-radius: 10px; }
  .task-table { min-width: 1040px; }
  .table-scroll { overflow-x: auto; }
  .data-table { min-width: 560px; }
  .pagination-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .pag-left, .pag-center, .pag-right { justify-content: center; }
  .profile-redeem-row { flex-direction: column; }
  .profile-redeem-row .btn { width: 100%; }
  .profile-account-line { align-items: flex-start; }
  .profile-vip-features { gap: 6px; }
  .profile-input { font-size: 16px; }
  .modal { padding: 10px; align-items: flex-end; }
  .modal-box { max-width: 100%; max-height: calc(100vh - 20px); overflow: auto; border-radius: 14px; }
  .modal-head { padding: 13px 14px; }
  .modal-body { padding: 14px; }
  .modal-foot { flex-wrap: wrap; padding: 10px 14px; }
  .modal-foot .btn-sm, .modal-foot .btn { flex: 1 1 auto; }
  .preview-empty { min-height: 220px; }
  .warn-box, .info-box, .error-box { font-size: 11px; }
  .route-pills { gap: 6px; }
  .route-pill { padding: 5px 8px; font-size: 11px; }
  .task-error-action, .task-error-cat { max-width: 100%; }
  .log-box { max-height: 260px; }
  .btn-block { width: 100%; }
}

@media (max-width: 420px) {
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ref-grid,
  .ref-grid.ref-grid-omni,
  .ref-grid.ref-grid-7,
  .ref-grid-8 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar h2 { font-size: 16px; }
  .client-vip-badge { width: 100%; justify-content: center; }
  .topbar-actions .btn { flex: 1; }
}


/* 量子科技桌面宠物 */
.desk-pet-root {
  position: fixed; z-index: 70; width: 140px; height: 150px; pointer-events: none;
}
.desk-pet-root.hidden { display: none; }
.desk-pet-root .pet-stage {
  position: relative; width: 140px; height: 150px; pointer-events: auto;
  cursor: grab; touch-action: none; user-select: none;
}
.desk-pet-root .pet-stage:active { cursor: grabbing; }
.pet-svg { width: 140px; height: 140px; overflow: visible; animation: petFloat 3s ease-in-out infinite; }
.pet-svg.pet-happy { animation: petHappy .75s ease; }
.pet-shell {
  fill: var(--pet-a, #12305c); stroke: var(--pet-accent, #67e8f9); stroke-width: 1.4;
  filter: drop-shadow(0 0 10px var(--pet-glow, rgba(103,232,249,.45)));
}
.pet-visor {
  fill: rgba(1, 10, 25, .94); stroke: var(--pet-accent, #67e8f9); stroke-width: 1.2;
  filter: drop-shadow(0 0 9px var(--pet-glow, rgba(103,232,249,.5)));
  animation: visorPulse 2.6s ease-in-out infinite;
}
.pet-eye { fill: var(--pet-accent, #67e8f9); filter: drop-shadow(0 0 6px var(--pet-accent, #67e8f9)); animation: petBlink 4.5s infinite; }
.pet-mouth { fill: none; stroke: var(--pet-accent, #67e8f9); stroke-width: 1.5; stroke-linecap: round; }
.pet-antenna-stem { stroke: var(--pet-accent, #67e8f9); stroke-width: 2; }
.pet-antenna-tip { fill: var(--pet-accent, #67e8f9); filter: drop-shadow(0 0 9px var(--pet-accent, #67e8f9)); }
.pet-holo-ring { fill: none; stroke: var(--pet-accent, #67e8f9); stroke-width: 1.2; opacity: .32; transform-origin: 70px 88px; animation: ringSpin 5s linear infinite; }
.pet-holo-ring.ring-b { stroke-dasharray: 8 7; opacity: .5; animation-direction: reverse; animation-duration: 3.5s; }
.pet-shadow { fill: rgba(0,0,0,.28); }
.pet-wing path, .pet-tail path, .pet-type-ears path { fill: var(--pet-b, #2563eb); opacity: .78; stroke: var(--pet-accent, #67e8f9); stroke-width: .8; }
.pet-wing { transform-origin: 70px 78px; animation: wingGlow 2.4s ease-in-out infinite; }
.pet-type-ears { display: none; }
.pet-type-ears path { fill: var(--pet-a, #12305c); }
.pet-type-fox .pet-type-ears, .pet-type-cat .pet-type-ears { display: block; }
.pet-type-fox .pet-type-ears path { fill: #c2410c; }
.pet-type-cat .pet-type-ears path { fill: var(--pet-a, #12305c); }
.pet-type-fox .pet-tail, .pet-type-cat .pet-tail { display: block; }
.pet-type-quantum .pet-wing, .pet-type-drone .pet-wing { display: block; }
.pet-type-fox .pet-wing, .pet-type-cat .pet-wing { display: none; }
.pet-type-fox .pet-tail { fill: #fb923c; }
.pet-type-cat .pet-tail { fill: var(--pet-b, #2563eb); }
.pet-color-cyan { --pet-a: #12305c; --pet-b: #2563eb; --pet-accent: #67e8f9; --pet-glow: rgba(103,232,249,.48); }
.pet-color-violet { --pet-a: #3b247a; --pet-b: #7c3aed; --pet-accent: #c4b5fd; --pet-glow: rgba(196,181,253,.45); }
.pet-color-plasma { --pet-a: #6b174d; --pet-b: #ec4899; --pet-accent: #f9a8d4; --pet-glow: rgba(249,168,212,.45); }
.pet-color-solar { --pet-a: #6b4308; --pet-b: #f59e0b; --pet-accent: #fde68a; --pet-glow: rgba(253,230,138,.45); }
.pet-color-stealth { --pet-a: #111827; --pet-b: #334155; --pet-accent: #94a3b8; --pet-glow: rgba(148,163,184,.34); }
.pet-accessory-hat, .pet-accessory-clothes { display: none; }
.pet-accessory-hat path, .pet-accessory-hat ellipse, .pet-accessory-hat rect,
.pet-accessory-clothes path, .pet-accessory-clothes rect {
  fill: none; stroke: var(--pet-accent, #67e8f9); stroke-width: 2; stroke-linejoin: round;
  filter: drop-shadow(0 0 7px var(--pet-glow, rgba(103,232,249,.45)));
}
.pet-accessory-clothes path { fill: var(--pet-a, #12305c); opacity: .86; }
.pet-accessory-clothes .line, .pet-accessory-hat .line { stroke: var(--pet-b, #2563eb); stroke-width: 1.2; }
.pet-hat-halo .hat-halo, .pet-hat-helmet .hat-helmet, .pet-hat-headset .hat-headset,
.pet-clothes-armor .clothes-armor, .pet-clothes-cape .clothes-cape,
.pet-clothes-wings .clothes-wings, .pet-clothes-scarf .clothes-scarf { display: block; }
.pet-clothes-wings path { fill: var(--pet-accent, #67e8f9); opacity: .18; }
.pet-bubble {
  position: absolute; left: -38px; bottom: 142px; width: 182px; padding: 8px 10px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 11px; line-height: 1.5; box-shadow: 0 10px 30px rgba(0,0,0,.2);
  opacity: 0; transform: translateY(6px); pointer-events: none; transition: .2s;
}
.pet-bubble.show { opacity: 1; transform: translateY(0); }
.pet-bubble::after { content: ""; position: absolute; left: 76px; bottom: -6px; width: 10px; height: 10px; background: var(--card); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transform: rotate(45deg); }
.pet-dock {
  position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; gap: 8px;
  padding: 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--card);
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
}
.pet-dock.hidden { display: none; }
.pet-dock-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg); color: var(--primary); font-size: 17px; font-weight: 800; cursor: pointer;
}
.pet-dock-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pet-panel {
  position: fixed; right: 16px; bottom: 72px; z-index: 81; width: 238px; padding: 11px;
  border-radius: 15px; border: 1px solid var(--border); background: var(--card); color: var(--text);
  box-shadow: 0 18px 48px rgba(0,0,0,.28); display: none;
}
.pet-panel.open { display: block; }
.pet-panel-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; margin-bottom: 9px; }
.pet-panel-head button { border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.pet-panel-row { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; }
.pet-panel-row > span { width: 30px; flex-shrink: 0; padding-top: 4px; font-size: 10px; color: var(--muted); }
.pet-options { display: flex; flex-wrap: wrap; gap: 4px; }
.pet-options button { border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 4px 6px; border-radius: 7px; font-size: 10px; cursor: pointer; }
.pet-options button.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); font-weight: 700; }
.pet-hide-full { width: 100%; margin-top: 9px; padding: 7px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 11px; cursor: pointer; }
body.dark .pet-bubble, body.dark .pet-panel, body.dark .pet-dock { box-shadow: 0 12px 34px rgba(0,0,0,.5); }
@keyframes petFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes petHappy { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-14px) rotate(-4deg) scale(1.06); } 70% { transform: translateY(-3px) rotate(3deg); } 100% { transform: translateY(0) scale(1); } }
@keyframes petBlink { 0%,44%,50%,100% { opacity: 1; } 47% { opacity: .18; } }
@keyframes ringSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes visorPulse { 0%,100% { opacity: .85; } 50% { opacity: 1; } }
@keyframes wingGlow { 0%,100% { opacity: .65; transform: scaleY(1); } 50% { opacity: 1; transform: scaleY(1.08); } }
.pet-svg.pet-action-scan .pet-holo-ring { animation-duration: 1s; opacity: .78; }
.pet-svg.pet-action-scan .pet-visor { animation: visorPulse .55s ease-in-out 2; }
.pet-svg.pet-action-wave .pet-wing-left { animation: wingWave .6s ease-in-out 2; }
.pet-svg.pet-action-wave .pet-wing-right { animation: wingWave .6s ease-in-out 2 reverse; }
.pet-svg.pet-action-spin { animation: petSpin 1.1s ease; }
.pet-svg.pet-action-nod { animation: petNod 1.1s ease; }
@keyframes wingWave { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(-14deg) scaleY(1.12); } }
@keyframes petSpin { 0% { transform: rotate(0deg); } 55% { transform: rotate(360deg) scale(1.05); } 100% { transform: rotate(360deg); } }
@keyframes petNod { 0%,100% { transform: translateY(0) rotate(0deg); } 35% { transform: translateY(4px) rotate(3deg); } 70% { transform: translateY(-2px) rotate(-2deg); } }
@media (max-width: 768px) {
  .desk-pet-root { transform: scale(.88); transform-origin: bottom right; }
  .pet-panel { right: 10px; bottom: 70px; width: 220px; }
  .pet-dock { right: 10px; bottom: 10px; }
}
