/* ============ 管理后台 ============ */
.admin-body {
  overflow-x: hidden;
}

.admin-root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.admin-boot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13.5px;
}

.boot-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  animation: boot-spin 0.8s linear infinite;
}

@keyframes boot-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.login-card {
  width: 100%;
  max-width: 404px;
  padding: 34px 30px 30px;
  border-radius: 22px;
  background: rgba(12, 20, 36, 0.92);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.login-brand .brand-mark {
  width: 44px;
  height: 44px;
  font-size: 20px;
}

.login-brand strong {
  display: block;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.login-brand small {
  color: var(--muted-2);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 23px;
  letter-spacing: -0.01em;
}

.login-card > p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13.5px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 123, 138, 0.1);
  border: 1px solid rgba(255, 123, 138, 0.3);
  color: var(--danger);
  font-size: 13px;
}

.login-error[hidden] {
  display: none;
}

.login-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted-2);
}

.login-foot a {
  color: var(--accent);
}

/* ---------- 布局 ---------- */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 244px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px 14px 18px;
  background: rgba(8, 13, 23, 0.9);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px;
}

.side-brand .brand-mark {
  width: 38px;
  height: 38px;
}

.side-brand strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.side-brand small {
  display: block;
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.side-nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.side-nav a.is-active {
  background: linear-gradient(135deg, rgba(124, 156, 255, 0.2), rgba(53, 224, 214, 0.12));
  border: 1px solid rgba(124, 156, 255, 0.3);
  color: var(--text);
}

.side-nav .ic {
  opacity: 0.9;
}

.side-nav-label {
  padding: 14px 12px 6px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.side-foot {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-foot a,
.side-foot button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.side-foot a:hover,
.side-foot button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.side-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 10px;
  font-size: 12.5px;
  color: var(--muted-2);
}

.side-user i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(61, 220, 151, 0.8);
}

.admin-main {
  flex: 1;
  min-width: 0;
  margin-left: 244px;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 28px;
  background: rgba(7, 11, 20, 0.82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.topbar-title {
  min-width: 0;
}

.topbar-title h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-title p {
  margin: 1px 0 0;
  font-size: 12px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

#side-toggle {
  display: none;
}

.view {
  width: 100%;
  max-width: 1280px;
  padding: 24px 28px 64px;
}

.side-backdrop {
  display: none;
}

/* ---------- 通用块 ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.page-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
}

.panel.panel-flush {
  padding: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.panel-head .muted {
  font-size: 12px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted-2);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
}

.check-row input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.check-row small {
  display: block;
  color: var(--muted-2);
  font-size: 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

/* ---------- 概览 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 156, 255, 0.2), transparent 70%);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
}

.stat-label .ic {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-sub {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted-2);
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.chart-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 176px;
  padding-top: 26px;
}

.chart-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chart-bar {
  width: 100%;
  max-width: 42px;
  min-height: 4px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #7c9cff, #35e0d6);
  position: relative;
  opacity: 0.9;
}

.chart-bar.is-zero {
  background: rgba(255, 255, 255, 0.1);
}

.chart-bar b {
  position: absolute;
  top: -21px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}

.chart-label {
  font-size: 10.5px;
  color: var(--muted-2);
  white-space: nowrap;
}

.recent-list {
  display: flex;
  flex-direction: column;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}

.recent-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.recent-info {
  min-width: 0;
  flex: 1;
}

.recent-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-info small {
  display: block;
  color: var(--muted-2);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-actions a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  font-size: 13px;
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.quick-actions a:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-strong);
}

.quick-actions .ic {
  color: var(--accent);
}

.quick-actions small {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 11.5px;
}

/* ---------- 表格 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}

.search-box .ic {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  width: 16px;
  height: 16px;
}

.search-box .input {
  padding-left: 38px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.14s ease;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tr.is-link {
  cursor: pointer;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  white-space: nowrap;
}

.short-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.short-copy:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.short-copy code {
  font-family: var(--mono);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.short-copy .ic {
  width: 14px;
  height: 14px;
  color: var(--muted-2);
  flex: none;
}

.short-target {
  display: block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.cell-strong {
  font-weight: 600;
  color: var(--text);
}

.cell-sub {
  display: block;
  color: var(--muted-2);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* 应用小图标 */
.mini-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: var(--accent-grad);
  color: #061020;
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
  object-fit: cover;
}

.mini-icon img,
img.mini-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.app-cell .mini-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

/* ---------- 详情 ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12.5px;
}

.back-link:hover {
  color: var(--text);
}

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.detail-icon {
  width: 74px;
  height: 74px;
  border-radius: 20px;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  color: #061020;
}

.detail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-title {
  flex: 1;
  min-width: 200px;
}

.detail-title h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.detail-meta code {
  font-family: var(--mono);
  font-size: 12px;
}

.detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}

/* 上传区 */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 24px 18px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone.is-drag {
  border-color: var(--accent);
  background: rgba(124, 156, 255, 0.07);
}

.dropzone input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone .dz-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(124, 156, 255, 0.14);
  color: var(--accent);
  margin-bottom: 4px;
}

.dropzone .dz-icon .ic {
  width: 20px;
  height: 20px;
}

.dropzone strong {
  font-size: 13.5px;
}

.dropzone small {
  font-size: 11.5px;
  color: var(--muted-2);
}

.upload-extra {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
  margin-top: 12px;
}

.progress {
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress[hidden] {
  display: none;
}

.progress > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent-grad);
  transition: width 0.18s ease;
}

.upload-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
}

.upload-status.is-error {
  color: var(--danger);
}

.upload-status.is-ok {
  color: var(--green);
}

/* 版本表 */
.version-name {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.version-changelog {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted-2);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 开关 */
.switch {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 22px;
  flex: none;
  vertical-align: middle;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.18s ease;
  pointer-events: none;
}

.switch i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.switch input:checked + i {
  background: linear-gradient(135deg, #7c9cff, #35e0d6);
}

.switch input:checked + i::after {
  transform: translateX(16px);
}

/* 分发链接 */
.link-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.link-copy-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.link-copy-row:last-of-type {
  padding-bottom: 0;
}

.lc-label {
  width: 56px;
  flex: none;
  font-size: 12px;
  color: var(--muted-2);
}

.link-copy-row code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
}

.qr-box {
  display: flex;
  justify-content: center;
  padding: 12px;
  margin-bottom: 14px;
  background: #fff;
  border-radius: 14px;
}

.qr-box img {
  width: 186px;
  height: 186px;
}

.info-list {
  display: grid;
  gap: 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}

.info-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.info-row span {
  color: var(--muted-2);
  flex: none;
}

.info-row strong {
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

.protect-state {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 12px;
}

.protect-state strong {
  display: block;
  font-size: 13px;
}

.protect-state small {
  display: block;
  color: var(--muted-2);
  font-size: 11.5px;
}

.password-form {
  display: none;
  gap: 10px;
}

.password-form.is-open {
  display: grid;
}

/* ---------- 令牌 ---------- */
.token-reveal {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px dashed rgba(61, 220, 151, 0.4);
  background: rgba(61, 220, 151, 0.07);
  margin: 4px 0 6px;
}

.token-reveal code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--green);
}

.hint-box {
  padding: 12px 14px;
  border-radius: 11px;
  background: rgba(124, 156, 255, 0.08);
  border: 1px solid rgba(124, 156, 255, 0.22);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.hint-box code {
  font-family: var(--mono);
  color: var(--text);
  font-size: 12px;
}

.secret-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.secret-row code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
}

/* ---------- 设置 ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(290px, 1fr);
  gap: 16px;
  align-items: start;
}

.danger-zone {
  border-color: rgba(255, 123, 138, 0.25);
}

.danger-zone .panel-head h3 {
  color: var(--danger);
}

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(6vh, 28px) 18px 32px;
  overflow-y: auto;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(6px);
  animation: fade-in 0.16s ease;
}

.modal {
  width: 100%;
  max-width: 540px;
  border-radius: 20px;
  background: #0d1526;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  animation: modal-in 0.18s ease;
}

.modal.modal-lg {
  max-width: 640px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 0;
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.modal-body {
  padding: 18px 22px 4px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px 22px;
}

.confirm-text {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.confirm-text strong {
  color: var(--text);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
}

/* ---------- 空状态 ---------- */
.admin-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.admin-empty .ic {
  width: 26px;
  height: 26px;
  color: var(--muted-2);
  margin-bottom: 6px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .overview-grid,
  .detail-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.6);
  }

  .sidebar.is-open {
    transform: none;
  }

  .admin-main {
    margin-left: 0;
  }

  #side-toggle {
    display: inline-flex;
  }

  .side-backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(3, 6, 12, 0.6);
  }

  .view {
    padding: 20px 16px 60px;
  }

  .topbar {
    padding: 13px 16px;
  }

  .topbar-title h1 {
    font-size: 16px;
  }

  .topbar-actions .btn span.label {
    display: none;
  }
}

@media (max-width: 640px) {
  .form-row-2,
  .upload-extra {
    grid-template-columns: 1fr;
  }

  .detail-actions {
    margin-left: 0;
    width: 100%;
  }

  .detail-actions .btn {
    flex: 1;
  }

  .toolbar .search-box {
    max-width: none;
    flex-basis: 100%;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card strong {
    font-size: 22px;
  }

  .modal-foot {
    flex-direction: column-reverse;
  }

  .modal-foot .btn {
    width: 100%;
  }
}

/* ---------- 补充 ---------- */
.btn-danger {
  background: rgba(255, 123, 138, 0.14);
  border-color: rgba(255, 123, 138, 0.4);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(255, 123, 138, 0.22);
  border-color: rgba(255, 123, 138, 0.55);
}

.panel-flush .panel-head {
  padding: 18px 20px;
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.mt-16 {
  margin-top: 16px;
}

.field .field-label {
  margin-bottom: 7px;
}

.field .input,
.field .textarea {
  width: 100%;
}

.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted-2);
}

[hidden] {
  display: none !important;
}

.pagination-note {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted-2);
}
