:root {
  --bg: #0a101c;
  --sidebar: #0d1524;
  --card: #131c2e;
  --card-2: #0f1726;
  --line: #243049;
  --line-soft: rgba(148, 163, 184, 0.12);
  --text: #e8eef8;
  --muted: #8b9bb4;
  --primary: #3b82f6;
  --primary-press: #2563eb;
  --ok: #22c55e;
  --bad: #ef4444;
  --radius: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.85rem; }

/* Buttons */
.btn {
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}
.btn:hover { border-color: #334155; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-press); border-color: var(--primary-press); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.82rem; }
.mix-panel-btn.on,
.mix-kind-btn.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-xs { padding: 0.28rem 0.55rem; font-size: 0.78rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.btn-danger { color: #fecaca; border-color: #7f1d1d; background: rgba(127, 29, 29, 0.15); }
.btn-form { align-self: end; height: 42px; padding-inline: 1.2rem; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.field > span { font-size: 0.75rem; color: var(--muted); }
.field input,
.field select,
.filters input,
.filters select,
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.62rem 0.75rem;
  outline: none;
}
.field input:focus,
.field select:focus,
.filters input:focus,
.filters select:focus,
textarea:focus {
  border-color: var(--primary);
}
.file-input {
  padding: 0.45rem !important;
  background: var(--card-2) !important;
  color: var(--muted);
}
.file-input::file-selector-button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  margin-right: 0.65rem;
  cursor: pointer;
}
.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.check input { width: auto; }

/* Login */
.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(700px 360px at 15% 0%, rgba(59,130,246,.16), transparent),
    var(--bg);
}
.login-card {
  width: min(100%, 380px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.login-brand { font-size: 1.5rem; font-weight: 800; }
.login-sub { margin: -0.35rem 0 0.2rem; color: var(--muted); }
.error { color: #fecaca; margin: 0; font-size: 0.9rem; }

/* Shell layout */
.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.8rem;
  position: sticky;
  top: 0;
  height: 100dvh;
  z-index: 40;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0.55rem 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.85rem;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: #fff;
  flex-shrink: 0;
}
.brand strong { display: block; font-size: 0.98rem; }
.brand small { color: var(--muted); font-size: 0.75rem; }
.nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}
.nav-item {
  text-align: left;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  padding: 0.72rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-item.on {
  color: #fff;
  background: rgba(59, 130, 246, 0.92);
}
.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 0.45rem 0.2rem;
  border-top: 1px solid var(--line);
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.sidebar-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 35;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem 1.5rem;
}
.topbar {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.1rem 0 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
}
.topbar-text { flex: 1; min-width: 0; }
.topbar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.topbar-desc {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.domain {
  color: var(--muted);
  font-size: 0.78rem;
  padding-top: 0.35rem;
  white-space: nowrap;
}
.only-mobile { display: none; }

.content { flex: 1; }
.view { display: none; }
.view.on { display: block; }

/* Cards / panels */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  margin-bottom: 0.9rem;
}
.card.narrow { max-width: 520px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.card-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.4rem;
  text-align: center;
}
.stat b { display: block; font-size: 1.2rem; font-weight: 800; }
.stat span { color: var(--muted); font-size: 0.72rem; }

.dash-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}
.dash-kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 88px;
}
.dash-kpi span { color: var(--muted); font-size: 0.75rem; }
.dash-kpi b { font-size: 1.35rem; font-weight: 800; letter-spacing: 0.01em; }
.dash-kpi small { color: var(--muted); font-size: 0.7rem; line-height: 1.35; }
.dash-two {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.dash-today {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.dash-today-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
}
.dash-today-item span { color: var(--muted); font-size: 0.78rem; }
.dash-today-item b { font-size: 1rem; }
.dash-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
  align-items: end;
  min-height: 150px;
  padding-top: 0.4rem;
}
.dash-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  height: 150px;
  justify-content: flex-end;
}
.dash-bar {
  width: 70%;
  max-width: 28px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #38bdf8, #2563eb);
  min-height: 4px;
}
.dash-bar-col b { font-size: 0.68rem; font-weight: 700; }
.dash-bar-col span { font-size: 0.62rem; color: var(--accent, #7dd3fc); }
.dash-bar-col small { font-size: 0.58rem; color: var(--muted); text-align: center; line-height: 1.2; }
.tag.warn {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
}
.tag.ok {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
}
.order-card code {
  font-size: 0.72rem;
  word-break: break-all;
}

@media (max-width: 960px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-two { grid-template-columns: 1fr; }
}

.form-row {
  display: grid;
  grid-template-columns: 140px 90px 1fr auto;
  gap: 0.7rem;
  align-items: end;
}
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 520px;
}
.plans-editor {
  max-width: none;
}
.plan-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}
.plan-row .field.grow {
  flex: 1 1 180px;
  min-width: 160px;
}
.plan-row .plan-del {
  margin-bottom: 2px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.form-grid .span-2 { grid-column: 1 / -1; }

.filters {
  display: grid;
  grid-template-columns: 1fr 150px auto;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.gen-result {
  margin-top: 0.9rem;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}
.gen-result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.gen-result textarea {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.5;
  resize: vertical;
}

.list { display: flex; flex-direction: column; gap: 0.55rem; }
.mix-batch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
}
.mix-batch-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.88rem;
}
.mix-batch-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}
.mix-batch-style {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.mix-batch-style select {
  min-width: 7.5rem;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: inherit;
}
.lic-card {
  border: 1px solid var(--line);
  background: var(--card-2);
  border-radius: 10px;
  padding: 0.8rem 0.85rem;
}
.lic-card.mix-audio-card {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
}
.lic-card.mix-audio-card .mix-pick {
  margin-top: 0.2rem;
  flex: 0 0 auto;
}
.lic-card.mix-audio-card > div:last-child {
  min-width: 0;
  flex: 1;
}
.lic-card.mix-selected {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.25);
}
.lic-key {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9rem;
  word-break: break-all;
  font-weight: 700;
}
.sort-idx {
  display: inline-block;
  min-width: 1.6em;
  margin-right: 6px;
  color: #60a5fa;
  font-variant-numeric: tabular-nums;
}
.lic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.45rem 0;
}
.badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge-unused { color: #93c5fd; border-color: #1d4ed8; }
.badge-active { color: #86efac; border-color: #15803d; }
.badge-disabled { color: #fca5a5; border-color: #991b1b; }
.badge-expired { color: #fcd34d; border-color: #a16207; }
.expire-date {
  color: #f87171;
  font-weight: 600;
}
.lic-note, .lic-device {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.12rem 0;
  word-break: break-all;
}
.lic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 1.4rem 0;
  font-size: 0.9rem;
}
.hint {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}
.ug-input {
  font-family: "ALKATIP Basma Tom", "UKIJ Tor Tom", "Segoe UI", sans-serif;
  direction: rtl;
  text-align: right;
}
.ug-title {
  font-family: "ALKATIP Basma Tom", "UKIJ Tor Tom", "Segoe UI", sans-serif;
  direction: rtl;
  text-align: right;
  margin-top: 0.25rem !important;
}

.help-tip-lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  align-items: start;
}
.help-tip-lang-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.28);
}
.help-tip-lang-title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 750;
  color: var(--text, #e2e8f0);
}
@media (max-width: 900px) {
  .help-tip-lang-grid { grid-template-columns: 1fr; }
}

/* —— 参数提示页布局优化 —— */
.help-tips-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.help-tips-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
}
.help-tips-list-card .card-head,
.help-tips-editor-card .card-head {
  align-items: flex-start;
}
.help-tips-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.help-tip-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(10, 16, 28, 0.55);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.help-tip-row:hover {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(30, 58, 138, 0.18);
}
.help-tip-row.is-active {
  border-color: rgba(59, 130, 246, 0.7);
  background: rgba(37, 99, 235, 0.16);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}
.help-tip-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.help-tip-row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.help-tip-row-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.help-tip-row-id {
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
  border-radius: 6px;
  padding: 2px 6px;
}
.help-tip-row-previews {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.help-tip-row-preview {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.help-tip-row-preview em {
  font-style: normal;
  color: rgba(148, 163, 184, 0.85);
  margin-right: 4px;
  font-weight: 650;
}
.help-tip-row-preview.is-ug {
  font-family: "ALKATIP Basma Tom", "UKIJ Tor Tom", "Segoe UI", sans-serif;
  direction: rtl;
  text-align: right;
}
.help-tip-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.help-tip-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  min-height: 280px;
  padding: 28px 20px;
  color: var(--muted);
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: rgba(10, 16, 28, 0.35);
}
.help-tip-idle p {
  margin: 0;
  max-width: 360px;
  line-height: 1.55;
  font-size: 13.5px;
}
.help-tip-idle-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  font-style: italic;
  color: #93c5fd;
  border: 1.5px solid rgba(96, 165, 250, 0.45);
  background: rgba(37, 99, 235, 0.15);
  margin-bottom: 6px;
}
.help-tip-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.help-tip-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}
.help-tip-id-field {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
}
.help-tip-id-field input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  opacity: 0.85;
}
.help-tip-enabled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(10, 16, 28, 0.45);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  user-select: none;
}
.help-tip-enabled input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}
.help-tip-lang-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.help-tip-lang-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: var(--muted);
  background: rgba(148, 163, 184, 0.1);
}
.help-tip-lang-col.is-ug {
  border-color: rgba(167, 139, 250, 0.35);
  background: linear-gradient(180deg, rgba(91, 33, 182, 0.14), rgba(15, 23, 42, 0.35));
}
.help-tip-lang-col.is-zh {
  border-color: rgba(56, 189, 248, 0.28);
  background: linear-gradient(180deg, rgba(3, 105, 161, 0.14), rgba(15, 23, 42, 0.35));
}
.help-tip-lang-col .field {
  margin: 0;
}
.help-tip-lang-col textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.55;
}
.help-tip-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding-top: 2px;
}
.help-tip-form-actions .hint {
  margin: 0;
}
@media (max-width: 1100px) {
  .help-tips-layout {
    grid-template-columns: 1fr;
  }
}

.perm-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  margin-top: 0.45rem;
}
.perm-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.perm-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}
.badge-warn {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.12);
}

.product-card-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.product-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #0a101c;
  border: 1px solid var(--line);
}
.product-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-thumb-ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.75rem;
}
.product-card-body { flex: 1; min-width: 0; }
.product-edit-preview {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.product-edit-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

/* 教程 / 使用指南：图片形式上传区 */
.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.img-dropzone {
  display: block;
  position: relative;
  border: 1.5px dashed color-mix(in srgb, var(--accent, #0f766e) 45%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent, #0f766e) 6%, transparent);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.img-dropzone:hover,
.img-dropzone.is-dragover {
  border-color: var(--accent, #0f766e);
  background: color-mix(in srgb, var(--accent, #0f766e) 12%, transparent);
}
.img-dropzone-inner {
  padding: 1.35rem 1rem;
  text-align: center;
  pointer-events: none;
}
.img-dropzone-icon {
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.4rem;
}
.img-dropzone-title {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}
.img-dropzone-sub {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.img-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.65rem;
  margin-top: 0.7rem;
}
.img-preview-grid.hidden {
  display: none;
}
.img-preview-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b1220;
  aspect-ratio: 4 / 3;
}
.img-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.img-preview-item .img-preview-tag {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
}
.lic-card-thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  flex-shrink: 0;
  background: #0b1220;
}
.lic-card.has-thumb {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem 0.85rem;
  align-items: start;
}
.lic-card.has-thumb .lic-actions {
  grid-column: 1 / -1;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.85rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.1rem + var(--safe-bottom));
  transform: translateX(-50%);
  background: #1e293b;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  z-index: 80;
  max-width: 90vw;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(78vw, 260px);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 10px 0 28px rgba(0,0,0,.35);
  }
  .shell.nav-open .sidebar { transform: translateX(0); }
  .shell.nav-open .sidebar-mask { display: block; }
  .only-mobile { display: inline-flex; }
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
  .form-row .grow,
  .form-row .btn-form {
    grid-column: 1 / -1;
  }
  .filters {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .main { padding: 0 0.85rem 1.2rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .domain { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-bars { gap: 0.25rem; }
}

.user-tags-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.user-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 8, 20, 0.72);
  backdrop-filter: blur(4px);
}
.modal-mask.hidden { display: none; }
.modal-card {
  width: min(440px, 100%);
  background: #121a2b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  padding: 1rem 1.1rem 1.1rem;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.modal-head h3 { margin: 0; font-size: 1.05rem; }
.modal-close {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.modal-body { display: flex; flex-direction: column; gap: 0.7rem; }
.modal-actions { margin-top: 1rem; justify-content: flex-end; }
.modal-mask.modal-wide .modal-card { width: min(640px, 94vw); max-height: 86vh; }
.modal-mask.modal-wide .modal-body { max-height: 62vh; overflow: auto; }
.user-log-list { display: flex; flex-direction: column; gap: 0.65rem; }
.user-log-item {
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.35);
}
.user-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}
.user-log-action {
  font-size: 0.78rem;
  font-weight: 700;
  color: #67e8f9;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
}
.user-log-head time { font-size: 0.75rem; color: #94a3b8; }
.user-log-summary { font-size: 0.9rem; color: #e2e8f0; font-weight: 650; }
.user-log-detail-line { font-size: 0.78rem; color: #94a3b8; margin-top: 0.15rem; }
.user-log-actor { font-size: 0.72rem; color: #64748b; margin-top: 0.35rem; }
.pack-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.pack-badge.editor { color: #86efac; background: rgba(34, 197, 94, 0.16); }
.pack-badge.full { color: #fcd34d; background: rgba(234, 179, 8, 0.16); }
.pack-badge.none { color: #94a3b8; background: rgba(148, 163, 184, 0.14); }
