:root {
  --bg: #f3f3f3;
  --bg-2: #f9f9f9;
  --surface: #ffffff;
  --stroke: #e5e5e5;
  --stroke-2: #d1d1d1;
  --text: #1a1a1a;
  --text-2: #605e5c;
  --text-3: #8a8886;
  --accent: #0f6cbd;
  --accent-2: #115ea3;
  --accent-soft: #e6f2fb;
  --ok: #0f7b0f;
  --ok-soft: #e7f5e7;
  --warn: #c47b00;
  --warn-soft: #fff4d6;
  --danger: #c42b1c;
  --danger-soft: #fde7e9;
  --shadow: 0 2px 8px rgba(0, 0, 0, .06), 0 0 0 1px rgba(0, 0, 0, .03);
  --radius: 8px;
  --sidebar: 248px;
  --sidebar-rail: 56px;
  --top: 52px;
  --font: "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
html.sidebar-collapsed {
  --sidebar: var(--sidebar-rail);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body:not(.is-auth) { overflow: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code {
  font-family: Consolas, "Cascadia Mono", monospace;
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.ico { display: inline-block; vertical-align: -3px; flex-shrink: 0; }

/* auth */
body.is-auth {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, #d6e8f8 0%, transparent 50%),
    radial-gradient(900px 400px at 100% 0%, #e8eef5 0%, transparent 46%),
    var(--bg);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 400px;
  max-width: 100%;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 45px 32px 40px;
  min-height: 375px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.login-card h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}
.login-card .alert {
  margin: 16px 0 0;
}
.login-card form {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  margin-top: 8px;
  min-height: 0;
}
.login-card form label {
  margin-bottom: 0;
}
.login-card.is-sms {
  min-height: 525px;
  padding: 50px 32px 45px;
}
.login-hint {
  margin: 16px 0 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}
.login-sms-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 22px;
  margin-top: 22px !important;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.login-field > label {
  font-size: 12px;
  color: var(--text-2);
  margin: 0;
}
.login-field-msg {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  min-height: 0;
}
.login-field-msg.is-error { color: var(--danger); }
.login-field-msg.is-ok { color: var(--ok); }
.login-code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.login-code-row .btn {
  height: 32px;
  white-space: nowrap;
}
.login-code-row .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.login-submit {
  width: 100%;
  justify-content: center;
  height: 36px;
  margin-top: 4px;
}
.login-back {
  margin-top: 18px;
  flex: 0 !important;
}
.batch-translate-bar {
  border-top: 1px solid var(--stroke);
  padding-top: 12px;
  margin-top: 4px;
  align-items: center;
}
.batch-translate-bar > label,
.batch-translate-bar .batch-translate-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}
.batch-translate-bar > label input,
.batch-translate-bar .batch-translate-check input {
  margin: 0;
  flex-shrink: 0;
}
.batch-translate-bar > .muted {
  line-height: 1.3;
}
table.data .col-check {
  width: 36px;
  text-align: center;
}

/* shell */
.app {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  grid-template-rows: var(--top) 1fr;
  overflow: hidden;
}
.topbar {
  grid-column: 1 / -1;
  background: rgba(249, 249, 249, .86);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--stroke);
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  align-items: stretch;
  padding: 0;
  z-index: 20;
  white-space: nowrap;
}
.brand-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 4px 0 16px;
  border-right: 1px solid var(--stroke);
}
.brand {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.sidebar-toggle {
  color: var(--text-2);
  flex-shrink: 0;
  margin-left: auto;
}
.sidebar-toggle:hover { color: var(--text); }
html.sidebar-collapsed .sidebar-toggle .ico {
  transform: scaleX(-1);
}
html.sidebar-collapsed .brand-name { display: none; }
html.sidebar-collapsed .brand-wrap {
  padding: 0;
  justify-content: center;
}
html.sidebar-collapsed .brand { display: none; }
html.sidebar-collapsed .sidebar-toggle { margin-left: 0; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(145deg, #0f6cbd, #0a4e8a);
  color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
}
.header-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 0 16px;
}
.ctx-switch {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
}
.ctx-switch label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.ctx-switch select {
  width: auto;
  min-width: 132px;
  max-width: 220px;
  flex: 0 0 auto;
}
.top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  flex: 0 0 auto;
  white-space: nowrap;
}

.sidebar {
  background: #f6f6f6;
  border-right: 1px solid var(--stroke);
  padding: 10px 8px 24px;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
.nav-group { margin: 12px 8px 6px; font-size: 11px; color: var(--text-3); letter-spacing: .04em; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px;
  color: var(--text); text-decoration: none;
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover { background: #ececec; text-decoration: none; }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.nav-label { min-width: 0; }
.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 5px;
}

html.sidebar-collapsed .sidebar {
  padding: 10px 6px 24px;
  overflow-x: hidden;
}
html.sidebar-collapsed .nav-group {
  height: 1px;
  margin: 8px 6px;
  padding: 0;
  overflow: hidden;
  color: transparent;
  background: var(--stroke);
  font-size: 0;
  letter-spacing: 0;
}
html.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 9px 0;
  gap: 0;
}
html.sidebar-collapsed .nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
html.sidebar-collapsed .nav-item .badge {
  position: absolute;
  top: 3px;
  right: 3px;
  margin: 0;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  padding: 0 4px;
}

.nav-flyout {
  position: fixed;
  z-index: 50;
  transform: translateY(-50%);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--stroke);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .04);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  min-width: 88px;
}
.nav-flyout.show {
  opacity: 1;
  visibility: visible;
}

.main {
  padding: 20px 24px 40px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.page-head h1 { margin: 0; font-size: 22px; font-weight: 600; }
.page-head .crumb { color: var(--text-2); font-size: 12px; margin-bottom: 4px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card { margin-top: 16px; }

.wiki-stats-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.wiki-stat-card {
  flex: 1 1 160px;
  min-width: 150px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 14px;
  text-align: center;
}
.wiki-stat-label {
  font-size: 12px;
  color: var(--text-2);
}
.wiki-stat-value {
  margin: 8px 0 4px;
  font-size: 26px;
  font-weight: 700;
  color: var(--primary, #3b5bdb);
  line-height: 1.1;
}
.wiki-stat-sub {
  font-size: 12px;
  color: var(--text-3);
}
.wiki-stat-card.is-bot .wiki-stat-value {
  color: #e03131;
}

.toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 14px;
}
.toolbar .spacer { flex: 1; }
.toolbar .side-filters { margin-left: 12px; white-space: nowrap; }
.toolbar .side-filters a.on { color: var(--text); font-weight: 600; }
.search {
  position: relative;
}
.search .ico {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

/* buttons */
.btn {
  appearance: none; border: 1px solid var(--stroke-2);
  background: var(--surface); color: var(--text);
  border-radius: 6px; height: 32px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; font: inherit; text-decoration: none;
}
.btn:hover { background: #f5f5f5; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #a52316; border-color: #a52316; color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #ececec; }
.btn-sm { height: 28px; padding: 0 8px; font-size: 12px; }
.icon-btn {
  width: 32px; height: 32px; padding: 0; justify-content: center;
}

/* form */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.sort-input),
select, textarea {
  width: 100%;
  border: 1px solid var(--stroke-2);
  background: var(--surface);
  border-radius: 6px;
  height: 32px;
  padding: 0 10px;
  font: inherit;
  color: var(--text);
  outline: none;
}
.search input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.sort-input) {
  padding: 0 10px 0 34px;
  min-width: 220px;
  width: auto;
}
textarea { height: auto; min-height: 88px; padding: 8px 10px; resize: vertical; }
.html-box {
  min-height: 88px;
  padding: 8px 10px;
  border: 1px solid var(--stroke-2);
  background: var(--surface);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  line-height: 1.6;
  white-space: normal;
  word-break: break-word;
}
.html-box p { margin: 0 0 .6em; }
.html-box p:last-child { margin-bottom: 0; }
.html-box a { color: var(--accent); }
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
label, .field { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 12px; }
label > span.req, .field > span.req { color: var(--danger); }
.seo-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0; font-weight: 400;
}
.seo-bar .btn { font-weight: 400; }
.seo-bar .hint { margin: 0; color: var(--text-3); font-size: 12px; font-weight: 400; }
.label-row {
  display: grid;
  grid-template-columns: 1fr 1fr 32px;
  gap: 0 16px;
  align-items: end;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.span-2 { grid-column: span 2; }
.form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  margin-bottom: 0;
}
.form-pair > label { margin-bottom: 12px; }
.form-section-title {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  font-weight: 600; margin: 8px 0 12px; padding-top: 8px;
  border-top: 1px solid var(--stroke);
}
.form-section-title:first-child { border-top: 0; padding-top: 0; }
.form-section-title > span { min-width: 4em; }
.form-actions {
  display: flex; gap: 8px; align-items: center;
  padding-top: 8px;
}
.hint { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.hint.is-error, .js-field-msg:not([hidden]) { color: var(--danger); }
input.is-error, select.is-error { border-color: var(--danger); }
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
  vertical-align: -2px;
  border: 1.5px solid var(--stroke-2);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  position: relative;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
input[type="checkbox"]:hover {
  border-color: var(--accent);
}
input[type="checkbox"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}
input[type="checkbox"]:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.checkline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  color: var(--text); font-size: 14px; margin-bottom: 12px;
  cursor: pointer; user-select: none;
}
.checkline-end {
  margin-top: 12px;
  padding-top: 8px;
}
.checkline .hint {
  flex: 1 1 100%;
  margin: 0 0 0 26px;
}

/* table */
.table-wrap { overflow: auto; width: 100%; }
table.data {
  width: 100%; border-collapse: collapse;
}
table.data th, table.data td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
  vertical-align: middle;
}
table.data th {
  font-size: 12px; color: var(--text-2); font-weight: 600;
  background: #fafafa;
}
table.data tr:hover td { background: #fafcff; }
table.data tr.is-cat-big { background: #f4f8fc; }
table.data tr.is-cat-big td { background: transparent; }
table.data tr.is-cat-big:hover { background: #eaf2fa; }
table.data tr.is-cat-big:hover td { background: transparent; }
table.data tr.is-cat-big .cat-name { font-weight: 650; }
table.data tr.is-cat-small .cat-name { color: var(--text-2); }
.cat-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cat-name .tag { flex: none; min-width: 40px; justify-content: center; }
table.data .ops {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
table.data .ops-inner {
  display: flex;
  align-items: center;
  gap: 4px;
}
table.data .ops .btn {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1;
  box-sizing: border-box;
  vertical-align: middle;
}
table.data .ops .btn .ico {
  width: 14px;
  height: 14px;
  flex: none;
}
table.data .ops form { display: inline-flex; align-items: center; margin: 0; }
.use-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  line-height: 1.45;
}
.use-list li + li { margin-top: 2px; }
.use-list a { color: var(--text); }
.use-list a:hover { color: var(--accent); }
.file-preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px dashed var(--stroke-2);
  cursor: default;
}
.file-hover-pop {
  position: fixed;
  z-index: 70;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
  pointer-events: none;
}
.file-hover-pop[hidden] { display: none; }
.file-hover-pop img {
  display: block;
  max-width: 240px;
  max-height: 180px;
  object-fit: contain;
  background: var(--bg);
  border-radius: 4px;
}
table.product-list {
  width: 100%;
  table-layout: fixed;
}
table.product-list .col-sort { width: 4%; }
table.product-list .col-site { width: 10%; }
table.product-list .col-name { width: 26%; }
table.product-list .col-model { width: 14%; }
table.product-list .col-series { width: 18%; }
table.product-list .col-cat { width: 10%; }
table.product-list .col-status { width: 8%; }
table.product-list .col-ops { width: 20%; }
/* 主站多一列「站点」时压缩其它列，避免 fixed 布局挤叠 */
table.product-list.has-site .col-name { width: 20%; }
table.product-list.has-site .col-model { width: 12%; }
table.product-list.has-site .col-series { width: 16%; }
table.product-list.has-site .col-cat { width: 8%; }
table.product-list.has-site .col-ops { width: 18%; }
table.product-list td.ops { padding-right: 8px; }
table.data .sort-input {
  width: 40px;
  max-width: 100%;
  height: 22px;
  padding: 0 2px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
  box-shadow: none;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
table.data .sort-input::-webkit-outer-spin-button,
table.data .sort-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
table.data .sort-input:focus {
  border-color: var(--stroke-2);
  background: #fff;
  color: var(--text);
}
table.product-list .col-model,
table.product-list .col-cat {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.product-list .col-series .cell-main,
table.product-list .col-series .muted-xs {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thumb {
  width: 48px; height: 36px; object-fit: cover;
  border-radius: 4px; background: var(--bg); border: 1px solid var(--stroke);
}
.muted { color: var(--text-2); }
.muted-xs { font-size: 12px; line-height: 1.4; margin-top: 2px; }
.nowrap { white-space: nowrap; }

.tag {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 8px; border-radius: 4px;
  background: var(--bg); color: var(--text-2); font-size: 12px;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.info { background: var(--accent-soft); color: var(--accent-2); }

.switch {
  position: relative; width: 40px; height: 20px; display: inline-block;
}
.switch input { display: none; }
.switch i {
  position: absolute; inset: 0; background: #c8c8c8;
  border-radius: 10px; cursor: pointer; transition: .2s;
}
.switch i:before {
  content: ""; position: absolute; width: 16px; height: 16px;
  left: 2px; top: 2px; background: #fff; border-radius: 50%;
  transition: .2s;
}
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i:before { transform: translateX(20px); }

.pager { display: flex; align-items: center; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pager-btn {
  min-width: 32px; height: 28px; padding: 0 8px;
  border-radius: 6px; border: 1px solid var(--stroke);
  display: inline-grid; place-items: center;
  color: var(--text); background: #fff; text-decoration: none;
}
.pager-btn:hover { background: #f5f5f5; text-decoration: none; }
.pager-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager-btn.is-disabled { opacity: .4; pointer-events: none; }
.pager-info { color: var(--text-2); font-size: 12px; margin-left: 8px; }

.alert {
  padding: 10px 12px; border-radius: 6px; margin-bottom: 14px;
}
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--accent-soft); color: var(--accent-2); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.trans-status { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.stat .n { font-size: 26px; font-weight: 650; letter-spacing: -.03em; }
.stat .k { color: var(--text-2); font-size: 12px; margin-top: 4px; }

.gallery-box { margin-top: 4px; }
.gallery-drop {
  border: 1.5px dashed var(--stroke-2);
  border-radius: 10px;
  background: #fafcff;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.gallery-drop:hover, .gallery-drop.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.gallery-drop-ico { color: var(--accent); margin-bottom: 6px; }
.gallery-drop-title { font-weight: 600; }
.gallery-drop-hint { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.gallery-item {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  position: relative;
}
.gallery-item.is-drag { opacity: .45; }
.gallery-item img { width: 100%; height: 110px; object-fit: cover; display: block; background: #f3f3f3; }
.gallery-item .meta { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.gallery-item .meta input {
  height: 28px; font-size: 12px; padding: 0 8px;
}
.gallery-item-ops {
  display: flex; justify-content: space-between; align-items: center; gap: 4px;
}
.gallery-item-ops .muted { font-size: 11px; cursor: grab; }
.gallery-badge {
  position: absolute; left: 8px; top: 8px;
  background: rgba(15,108,189,.92); color: #fff;
  font-size: 11px; height: 20px; padding: 0 6px; border-radius: 4px;
  display: inline-flex; align-items: center;
}

.img-picker {
  display: flex; align-items: flex-start; gap: 12px;
  width: max-content;
}
.img-picker-view {
  width: 168px; height: 112px;
  border: 1.5px dashed var(--stroke-2);
  border-radius: 10px;
  background: #fafcff;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  display: grid; place-items: center;
  transition: border-color .15s, background .15s;
}
.img-picker-view:hover, .img-picker.is-over .img-picker-view {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.img-picker-view.has-img { border-style: solid; background: #fff; }
.img-picker-preview {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.img-picker-preview[hidden] { display: none !important; }
.img-picker-empty {
  text-align: center; color: var(--text-3); font-size: 12px; padding: 8px;
  line-height: 1.4;
}
.img-picker-empty .ico { display: block; margin: 0 auto 4px; color: var(--accent); }
.img-picker-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.img-picker-logo .img-picker-view { height: 80px; background: #f4f4f4; }
.img-picker-logo .img-picker-preview { object-fit: contain; padding: 8px; }
.img-picker-logo.is-dark .img-picker-view { background: #1f1f1f; }
.img-picker-square .img-picker-view {
  width: 120px;
  height: 120px;
  aspect-ratio: 1 / 1;
}
.img-picker-square .img-picker-preview {
  object-fit: contain;
  padding: 6px;
}
.img-picker-cert .img-picker-view {
  width: 200px;
  height: auto;
  aspect-ratio: 500 / 415;
}
.img-picker-cert.img-picker-case .img-picker-view {
  width: 240px;
  aspect-ratio: 375 / 135;
}
.img-picker-cert .img-picker-preview {
  object-fit: contain;
  padding: 6px;
  background: #fff;
}
.thumb-cert {
  width: 60px;
  height: 50px;
  object-fit: contain;
  background: #fff;
}
.profile-subhead {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0 10px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-1);
}
.profile-subhead span {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
}
.social-qr-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.social-qr-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: #fbfcfe;
}
.social-qr-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
}
.social-qr-card label {
  margin-bottom: 0;
}
.social-qr-card .field-bare {
  margin-bottom: 0;
}
.social-qr-card .img-picker {
  width: 100%;
}
@media (max-width: 960px) {
  .social-qr-grid { grid-template-columns: 1fr; }
}

.article-head-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.45fr);
  gap: 0 16px;
  align-items: start;
}
.article-head-fields label { margin-bottom: 12px; }
.article-head-fields label:last-child { margin-bottom: 0; }
.article-cover-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 10px;
}
.cover-defaults {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cover-pick {
  appearance: none;
  width: 88px;
  height: auto;
  padding: 0;
  border: 1.5px solid var(--stroke-2);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  flex: none;
  display: flex;
  flex-direction: column;
}
.cover-pick img { width: 100%; height: 50px; object-fit: cover; display: block; }
.cover-pick span {
  display: block;
  font-size: 11px;
  line-height: 1;
  padding: 6px 4px 7px;
  color: var(--text-2);
}
.cover-pick:hover { border-color: var(--accent); }
.cover-pick.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.cover-pick.is-on span { color: var(--accent); font-weight: 600; }

.tags-editor .tag-row { display: grid; grid-template-columns: 1fr 1.4fr 32px; gap: 8px; margin-bottom: 8px; }

.related-picker { margin: 0 0 16px; }
.related-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  margin: 0 0 8px;
}
.related-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  line-height: 1.3;
}
.related-chip-x {
  border: 0;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
.related-chip-x:hover { color: var(--danger); }
.related-picker .js-related-filter {
  width: 100%;
  margin-bottom: 8px;
}
.related-picker-list {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
}
.related-picker-list.is-suggest {
  margin-top: 0;
  padding: 4px;
}
.related-picker-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 6px 4px;
  font-weight: 400;
  cursor: pointer;
}
.related-picker-item.is-hide { display: none !important; }
.related-picker-item + .related-picker-item { border-top: 1px solid var(--stroke); }
.related-picker-item input { margin-top: 3px; flex: none; }
.related-picker-item span { line-height: 1.4; color: var(--text); }
.related-suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
}
.related-suggest-item:hover { background: var(--bg-2, #f5f6f8); }
.related-suggest-item[hidden] { display: none !important; }

.upload-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.preview-sm { width: 72px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--stroke); }

.empty {
  text-align: center; color: var(--text-2); padding: 36px 12px;
}

.toast-wrap {
  position: fixed; right: 16px; top: 64px; z-index: 50;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #2b2b2b; color: #fff; padding: 10px 14px;
  border-radius: 8px; min-width: 220px; box-shadow: var(--shadow);
}

.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.32);
  display: none; place-items: center; z-index: 40;
}
.modal-mask.show { display: grid; }
.modal {
  width: 420px; max-width: calc(100% - 32px);
  background: #fff; border-radius: 10px; padding: 20px;
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
}
.modal h3 { margin: 0 0 8px; }
.modal p { color: var(--text-2); margin: 0 0 16px; }
.modal .row { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

.video-preview-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: none; place-items: center; z-index: 45;
  padding: 24px 16px;
}
.video-preview-mask.show { display: grid; }
.video-preview {
  width: 840px; max-width: 100%;
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff; border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.22);
}
.video-preview-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 16px 18px 10px;
}
.video-preview-head h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.video-preview-head .sub { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.video-preview-player {
  background: #111; aspect-ratio: 16 / 9;
  margin: 0 18px; border-radius: 8px; overflow: hidden;
}
.video-preview-player video,
.video-preview-player iframe {
  width: 100%; height: 100%; display: block; border: 0; background: #000;
}
.video-preview-empty {
  height: 100%; display: grid; place-items: center;
  color: #aaa; font-size: 13px; padding: 16px; text-align: center;
}
.video-preview-body {
  padding: 14px 18px 8px;
  min-height: 48px; line-height: 1.65;
}
.video-preview-body p { margin: 0 0 .6em; }
.video-preview-body p:last-child { margin-bottom: 0; }
.video-preview-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 18px 16px;
  border-top: 1px solid var(--stroke);
}
.video-preview-foot code {
  font-size: 12px; color: var(--text-2); word-break: break-all;
}

.link-btn {
  appearance: none; border: 0; background: none;
  padding: 0; margin: 0; font: inherit;
  color: inherit; cursor: pointer; text-align: left;
  outline: none;
}
.link-btn:hover { color: inherit; text-decoration: none; }
.link-btn:focus,
.link-btn:focus-visible { outline: none; box-shadow: none; }

.copy-preview-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: none; place-items: center; z-index: 46;
  padding: 24px 16px;
}
.copy-preview-mask.show { display: grid; }
.copy-preview {
  width: 920px; max-width: 100%;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.22);
}
.copy-preview-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 16px 18px 10px;
  flex: 0 0 auto;
}
.copy-preview-head h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.copy-preview-head .sub { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.copy-preview-body {
  padding: 6px 18px 18px;
  display: flex; flex-direction: column; gap: 10px;
  flex: 1 1 auto; min-height: 0; overflow: auto;
}
.copy-preview-main {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.copy-preview-photo {
  border: 1px solid var(--stroke);
  border-radius: 8px;
  overflow: hidden;
  background: #f6f6f6;
  aspect-ratio: 1;
}
.copy-preview-photo img {
  width: 100%; height: 100%; object-fit: contain;
  display: block; background: #fff;
}
.copy-preview-photo .muted {
  height: 100%; display: grid; place-items: center;
  font-size: 13px; padding: 12px; text-align: center;
}
.copy-block {
  appearance: none; border: 1px solid var(--stroke);
  background: #fafafa; border-radius: 8px;
  padding: 10px 12px; text-align: left; font: inherit; color: inherit;
  cursor: pointer; width: 100%;
  overflow: hidden; outline: none; box-shadow: none;
}
.copy-block:hover { border-color: var(--accent); background: var(--accent-soft); }
.copy-block:focus,
.copy-block:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: var(--accent);
}
.copy-k {
  display: block; font-size: 12px; color: var(--text-3); margin-bottom: 4px;
}
.copy-v { display: block; font-weight: 600; word-break: break-word; }
.copy-html {
  font-size: 13px; line-height: 1.55; color: var(--text);
  overflow: auto;
}
.copy-html table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 6px; }
.copy-html th, .copy-html td {
  border: 1px solid var(--stroke); padding: 6px 8px; text-align: left;
}
.copy-html p { margin: 0 0 .5em; }
.copy-html p:last-child { margin-bottom: 0; }
@media (max-width: 720px) {
  .copy-preview-main { grid-template-columns: 1fr; }
  .copy-preview-photo { max-width: 280px; }
}

.progress-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.36);
  display: none; place-items: center; z-index: 60;
}
.progress-mask.show { display: grid; }
.progress-box {
  width: 420px; max-width: calc(100% - 32px);
  background: #fff; border-radius: 10px; padding: 22px 22px 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
}
.progress-box h3 { margin: 0 0 8px; font-size: 16px; }
.progress-box .progress-text { color: var(--text-2); margin: 0 0 14px; font-size: 13px; min-height: 20px; }
.progress-bar {
  height: 8px; background: #ececec; border-radius: 8px; overflow: hidden;
}
.progress-bar > i {
  display: block; height: 100%; width: 0;
  background: var(--accent); border-radius: 8px;
  transition: width .25s ease;
}

@media (max-width: 960px) {
  html.sidebar-collapsed { --sidebar: 248px; }
  body:not(.is-auth) { overflow: auto; }
  .app {
    height: auto;
    min-height: 100%;
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .main { overflow: visible; }
  .topbar {
    display: flex;
    padding: 0 12px;
    gap: 8px;
  }
  .brand-wrap {
    width: auto;
    flex: 0 0 auto;
    border-right: none;
    padding: 0;
  }
  html.sidebar-collapsed .brand { display: flex; }
  html.sidebar-collapsed .brand-name { display: inline; }
  html.sidebar-collapsed .brand-wrap { padding: 0; }
  .header-main {
    flex: 1 1 auto;
    padding: 0;
    min-width: 0;
  }
  .sidebar { display: none; }
  html.sidebar-open .sidebar {
    display: block;
    position: fixed;
    left: 0;
    top: var(--top);
    bottom: 0;
    width: 248px;
    z-index: 25;
    padding: 10px 8px 24px;
    box-shadow: 8px 0 24px rgba(0, 0, 0, .12);
  }
  html.sidebar-open .nav-group {
    height: auto;
    margin: 12px 8px 6px;
    overflow: visible;
    color: var(--text-3);
    background: transparent;
    font-size: 11px;
    letter-spacing: .04em;
  }
  html.sidebar-open .nav-item {
    justify-content: flex-start;
    padding: 8px 10px;
    gap: 10px;
  }
  html.sidebar-open .nav-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    clip: auto;
    overflow: visible;
    white-space: nowrap;
  }
  html.sidebar-open .nav-item .badge {
    position: static;
    top: auto;
    right: auto;
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    padding: 0 5px;
  }
  .stats { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .article-head-row { grid-template-columns: 1fr; }
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--stroke-2);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.seg a {
  padding: 0 12px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface);
  text-decoration: none;
  white-space: nowrap;
}
.seg a + a { border-left: 1px solid var(--stroke-2); }
.seg a:first-child { border-radius: 7px 0 0 7px; }
.seg a:last-child { border-radius: 0 7px 7px 0; }
.seg a:only-child { border-radius: 7px; }
.seg a.is-on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
button.linkish {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  max-width: 280px;
}
.stats-table .cell-clip,
.stats-table .cell-clip .linkish {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 12px;
}
.stats-kpis div {
  min-width: 120px;
  padding: 10px 14px;
  border: 1px solid var(--stroke-2);
  border-radius: 8px;
  background: var(--bg, #f7f8fa);
}
.stats-kpis b { display: block; font-size: 20px; line-height: 1.2; }
.stats-kpis span { font-size: 12px; color: var(--text-2); }
.stats-note { margin: 0 0 14px; font-size: 12px; }
.stats-h { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.stats-h-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.stats-h-row .stats-h { margin: 0; }
.stats-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--text-3, #9aa3ad);
  border-radius: 8px;
  text-decoration: none;
}
.stats-refresh:hover { color: var(--text-2); background: var(--bg, #f7f8fa); }
.stats-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.stats-sites-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-3, #9aa3ad);
  text-decoration: none;
  border-radius: 8px;
}
.stats-sites-link:hover { color: var(--text-2); background: var(--bg, #f7f8fa); }
.stats-head-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.stats-dash { padding-bottom: 8px; }
.stats-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.stats-range > a {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--stroke-2);
  background: var(--surface);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
}
.stats-range > a.is-on {
  background: var(--accent-soft);
  color: var(--accent-2);
  border-color: transparent;
  font-weight: 600;
}
.stats-range > a.stats-expand {
  margin-left: 4px;
  padding: 0 12px;
  color: var(--text-3, #9aa3ad);
  border-style: dashed;
}
.stats-range > a.stats-expand.is-on {
  color: var(--accent-2);
  border-style: solid;
}
.stats-custom {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  gap: 6px;
}
.stats-custom input[type="date"]:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.sort-input) {
  width: 140px;
  max-width: 140px;
  min-width: 0;
  flex: 0 0 140px;
  padding: 0 6px;
  box-sizing: border-box;
}
.stats-custom .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  width: auto;
}
.stats-filters { margin: 16px 0 8px; }
.stats-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  position: relative;
}
.stats-filter-row .seg {
  flex: 0 1 auto;
}
.stats-site-actions { width: 88px; text-align: right; }
.stats-site-actions form { display: inline-flex; }
.stats-label {
  width: 36px;
  flex: 0 0 36px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  color: var(--text-2);
  font-size: 12px;
}
.stats-more-check {
  display: none;
}
.stats-more-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px dashed var(--stroke-2);
  background: var(--surface);
  color: var(--text-3, #9aa3ad);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  box-sizing: border-box;
}
.stats-more-toggle .on-open { display: none; }
.stats-more-check:checked + .stats-more-toggle {
  color: var(--accent-2);
  border-style: solid;
  border-color: transparent;
  background: var(--accent-soft);
  font-weight: 600;
}
.stats-more-check:checked + .stats-more-toggle .on-closed { display: none; }
.stats-more-check:checked + .stats-more-toggle .on-open { display: inline; }
.stats-more-list {
  display: none;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.stats-more-check:checked + .stats-more-toggle + .stats-more-list {
  display: flex;
}
.stats-more-list a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: inherit;
  text-decoration: none;
  font-size: 12px;
}
.stats-more-list a.is-on {
  background: var(--accent-soft);
  color: var(--accent-2);
}
.stats-more-list em {
  font-style: normal;
  color: var(--text-3, #9aa3ad);
}
.stats-split-3 { grid-template-columns: 1fr 1fr 1fr; }
.stats-site-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
@media (max-width: 1100px) {
  .stats-split-3 { grid-template-columns: 1fr 1fr; }
}
