:root {
  /* 与前台首页一致的浅色 + 青绿主色 */
  --bg: #f0f9f4;
  --bg-elevated: #ffffff;
  --bg-sidebar: rgba(255, 255, 255, 0.82);
  --border: rgba(15, 118, 110, 0.12);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0d9488;
  --accent-deep: #0f766e;
  --accent-dim: rgba(13, 148, 136, 0.14);
  --danger: #dc2626;
  --success: #059669;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 6px rgba(15, 23, 42, 0.04), 0 24px 48px rgba(15, 23, 42, 0.07);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.06);
  --font: "Alimama FangYuanTi VF", "PingFang SC", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Alimama FangYuanTi VF", "PingFang SC", ui-sans-serif, system-ui, sans-serif;
  --admin-sidebar-w: 248px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body.admin-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 18% 12%, rgba(180, 230, 190, 0.55), transparent 55%),
    radial-gradient(700px 420px at 88% 25%, rgba(167, 243, 208, 0.4), transparent 50%),
    radial-gradient(600px 380px at 40% 95%, rgba(209, 250, 229, 0.65), transparent 45%),
    linear-gradient(180deg, #f7fcf8 0%, #eef8f1 50%, #e8f5ec 100%);
}

body.admin-body:not(.admin-body--login)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2310b981' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

body.admin-body--login {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 2rem 1.25rem;
  font-family: var(--font);
  color: #0f172a;
  background: #f3faf5;
  overflow-x: hidden;
}

.admin-body--login .login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 18% 12%, rgba(180, 230, 190, 0.55), transparent 55%),
    radial-gradient(700px 420px at 88% 25%, rgba(167, 243, 208, 0.4), transparent 50%),
    radial-gradient(600px 380px at 40% 95%, rgba(209, 250, 229, 0.7), transparent 45%),
    linear-gradient(180deg, #f7fcf8 0%, #eef8f1 50%, #e8f5ec 100%);
}

.admin-body--login .login-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2310b981' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.admin-body--login .login-page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
}

.admin-body--login .login-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.15rem;
  padding: 0.4rem 0.85rem 0.4rem 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #047857;
  text-decoration: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 118, 110, 0.12);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.admin-body--login .login-back::before {
  content: "←";
  font-size: 1rem;
  opacity: 0.85;
}

.admin-body--login .login-back:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}

.admin-shell {
  position: relative;
  z-index: 1;
  display: block;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
}

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: var(--admin-sidebar-w);
  height: 100vh;
  height: 100dvh;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 32px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  padding: max(1.35rem, env(safe-area-inset-top, 0px)) 0 max(1.35rem, env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.admin-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1.25rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: #134e4a;
}

.admin-logo-mark {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  border-radius: 4px;
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.admin-logo-img {
  max-height: 32px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  flex-shrink: 0;
}

.admin-logo-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.75rem;
  flex: 1;
}

.admin-nav-item {
  display: block;
  padding: 0.65rem 0.85rem;
  border-radius: 999px;
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.admin-nav-item:hover {
  color: #134e4a;
  background: rgba(255, 255, 255, 0.95);
}

.admin-nav-item.is-active {
  color: #0f766e;
  background: rgba(240, 253, 244, 0.98);
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.35);
}

.admin-nav-item--ghost {
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  width: 100%;
}

.admin-sidebar-foot {
  padding: 1rem 1.25rem 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.admin-user {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.admin-main {
  /* 侧栏 position:fixed 不占文档流：须显式占满「视口 − 侧栏」，不能再用 width:100% + margin-left */
  margin-left: var(--admin-sidebar-w);
  width: calc(100% - var(--admin-sidebar-w));
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  padding: 2rem clamp(1.5rem, 2.5vw, 3rem) 3rem;
}

.admin-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: -0.35rem 0 1.1rem;
}

.admin-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #047857;
  text-decoration: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
  transition: background 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.admin-home-link:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
  color: #065f46;
}

.admin-page-head {
  margin-bottom: 1.75rem;
}

.admin-page-head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #134e4a;
}

.admin-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* —— 设置类页面：文本分享 / 站点设置 / 管理员 —— */
.admin-page-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 720px;
  width: 100%;
}

.admin-page-stack--wide {
  max-width: 100%;
  width: 100%;
}

/* 仅文本分享：新建表单卡片与文件管理同宽，下列表仍占满 */
.admin-page-stack--texts > .admin-card:first-child {
  max-width: min(720px, 100%);
  align-self: flex-start;
  width: 100%;
}

.admin-page-stack > .admin-page-head {
  margin-bottom: 0;
}

.admin-page-stack > .alert {
  margin-bottom: 0;
}

.admin-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.admin-card__head {
  padding: 1.15rem 1.35rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.5) 0%, rgba(255, 255, 255, 0.4) 100%);
}

.admin-card__head--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-card__head-text {
  min-width: 0;
  flex: 1;
}

.admin-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: #134e4a;
  letter-spacing: -0.02em;
}

.admin-card__lead {
  margin: 0.45rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
}

.admin-card__body {
  padding: 1.35rem 1.35rem 1.5rem;
}

.admin-card__body--flush {
  padding: 0;
}

.admin-card__body > .form-stack:last-child {
  margin-bottom: 0;
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f766e;
  background: rgba(240, 253, 244, 0.98);
  border: 1px solid rgba(20, 184, 166, 0.3);
  flex-shrink: 0;
}

.admin-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.admin-card__head .admin-meta-chips {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  width: 100%;
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  color: #475569;
  background: rgba(241, 245, 249, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.admin-form-section {
  margin-bottom: 1.25rem;
}

.admin-form-section:last-child {
  margin-bottom: 0;
}

.admin-form-section__title {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.admin-form-divider {
  height: 0;
  margin: 1.35rem 0;
  border: none;
  border-top: 1px dashed rgba(148, 163, 184, 0.45);
}

.admin-verify-box {
  margin-top: 0.25rem;
  padding: 1.15rem 1.2rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, rgba(255, 251, 235, 0.92) 0%, rgba(254, 252, 232, 0.5) 100%);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.admin-verify-box .field:last-child {
  margin-bottom: 0;
}

/* 后台文本分享：类型切换 */
.admin-text-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.admin-subtab {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.admin-subtab:hover {
  color: #134e4a;
  border-color: rgba(20, 184, 166, 0.35);
}

.admin-subtab.is-active {
  color: #0f766e;
  background: rgba(240, 253, 244, 0.98);
  border-color: rgba(20, 184, 166, 0.45);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}

.admin-textarea--code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.55;
}

.badge--mode {
  background: rgba(209, 250, 229, 0.95);
  color: #047857;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.admin-upload-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
}

@media (min-width: 768px) {
  .admin-upload-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.admin-docs-list {
  margin: 0 0 1rem;
  padding: 0 0 0 1.15rem;
  color: #475569;
  font-size: 0.9025rem;
  line-height: 1.65;
}

.admin-docs-list li {
  margin-bottom: 0.65rem;
}

.admin-docs-list li:last-child {
  margin-bottom: 0;
}

.admin-code-label {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #134e4a;
}

.admin-card .table-wrap {
  margin: 0;
}

.admin-card .data-table thead th {
  background: rgba(248, 250, 252, 0.98);
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  font-size: 0.6875rem;
}

.admin-card .data-table tbody tr:hover td {
  background: rgba(240, 253, 244, 0.5);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #134e4a;
  font-variant-numeric: tabular-nums;
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.panel--form {
  max-width: 560px;
}

.panel-upload-box {
  max-width: min(720px, 100%);
  margin-bottom: 1.5rem;
}

.field-hint--files-upload {
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-card__lead--wrap {
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.form-stack--files-upload {
  gap: 1rem;
}

.files-upload-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
}

.files-upload-actions__expiry {
  flex: 1 1 12rem;
  min-width: 0;
  max-width: 22rem;
}

.files-upload-actions__submit {
  flex: 0 0 auto;
}

.files-upload-actions__preview {
  flex: 1 1 100%;
  min-width: 0;
}

.files-upload-actions__preview .field-label {
  margin-bottom: 0.35rem;
}

.admin-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.admin-switch__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.admin-switch__track {
  position: relative;
  width: 2.5rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.admin-switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.35rem - 4px);
  height: calc(1.35rem - 4px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.admin-switch__input:focus-visible + .admin-switch__track {
  outline: 2px solid rgba(45, 212, 191, 0.65);
  outline-offset: 2px;
}

.admin-switch__input:checked + .admin-switch__track {
  background: #0d9488;
}

.admin-switch__input:checked + .admin-switch__track::after {
  transform: translateX(1.15rem);
}

.admin-switch__label {
  font-size: 0.8125rem;
  color: #475569;
  font-weight: 600;
}

.admin-switch--table {
  margin: 0;
}

.cell-preview-toggle {
  vertical-align: middle;
  text-align: center;
}

.file-preview-toggle-form {
  display: inline-block;
  margin: 0;
}

.admin-switch--table .admin-switch__track {
  margin: 0 auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.panel--wide {
  max-width: 720px;
}

.panel-subtitle {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #134e4a;
}

.code-block-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.code-block {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #1e293b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.btn--sm {
  align-self: flex-start;
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
}

.brand-preview {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(240, 253, 244, 0.65);
  border: 1px solid var(--border);
}

.brand-preview img {
  max-height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.brand-preview--icon img {
  max-height: 32px;
}

.input--file {
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.rewrite-tips {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.rewrite-tips li {
  margin-bottom: 0.5rem;
}

.rewrite-tips code {
  font-size: 0.8125rem;
  background: rgba(15, 118, 110, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: #134e4a;
}

.login-brand-logo {
  display: block;
  max-height: 48px;
  width: auto;
  max-width: 200px;
  margin: 0 auto 1rem;
  object-fit: contain;
}

.admin-body--login .login-brand-logo {
  filter: none;
  margin: 0;
  max-height: 44px;
  max-width: 160px;
  align-self: center;
}

.readonly-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.panel-divider {
  height: 0;
  margin: 0.5rem 0 1rem;
  border: none;
  border-top: 1px solid var(--border);
}

.field-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #134e4a;
}

.field-hint--block {
  display: block;
  margin: -0.25rem 0 0.75rem;
}

.input--textarea {
  min-height: 5rem;
  resize: vertical;
  line-height: 1.5;
}

.input--text-share {
  min-height: 14rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
}

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

.panel-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  color: #134e4a;
}

.link-quiet {
  color: var(--accent-deep);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
}

.link-quiet:hover {
  text-decoration: underline;
  color: #134e4a;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.data-table tbody tr:hover td {
  background: rgba(240, 253, 244, 0.65);
}

.cell-muted {
  color: var(--muted);
  white-space: nowrap;
}

.cell-ellipsis {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-actions {
  white-space: nowrap;
  text-align: right;
}

.short-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.data-table--files {
  table-layout: fixed;
}

.data-table--files th,
.data-table--files td {
  vertical-align: top;
}

.data-table--files .data-table-files__url {
  width: 34%;
  min-width: 0;
}

.data-table--files .data-table-files__name {
  width: 20%;
  min-width: 0;
  max-width: none;
}

.data-table--files th:nth-child(3),
.data-table--files td:nth-child(3) {
  width: 14%;
}

.data-table--files th:nth-child(4),
.data-table--files td:nth-child(4) {
  width: 9%;
}

.data-table--files th:nth-child(5),
.data-table--files td:nth-child(5) {
  width: 9%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table--files th:nth-child(6),
.data-table--files td:nth-child(6) {
  width: 11%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table--files th:nth-child(7),
.data-table--files td:nth-child(7) {
  width: 4.5rem;
  min-width: 4.5rem;
}

.data-table--files th:nth-child(8),
.data-table--files td:nth-child(8) {
  width: 5.5rem;
  min-width: 5.5rem;
  box-sizing: border-box;
}

.data-table--files .short-cell--file-url {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
}

.data-table--files .short-cell--file-url .code-tag--ellipsis {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.data-table--files .short-cell--file-url .copy-btn {
  flex-shrink: 0;
}

@media (min-width: 960px) {
  .data-table--files .short-cell--file-url {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
  }

  .data-table--files .short-cell--file-url .code-tag--ellipsis {
    flex: 1 1 auto;
    width: auto;
  }
}

.data-table--files .cell-mime {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* 短链列表：整表在 .table-wrap 内横向滚动；链接单行延伸，不在 code 框内单独出滚动条 */
.data-table--links {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}

.data-table--links th,
.data-table--links td {
  vertical-align: top;
}

.data-table--links .data-table-links__url {
  width: 30%;
  min-width: 0;
}

.data-table--links .data-table-links__title {
  width: 16%;
  min-width: 0;
  max-width: none;
}

.data-table--links th:nth-child(3),
.data-table--links td:nth-child(3) {
  width: 26%;
}

.data-table--links th:nth-child(4),
.data-table--links td:nth-child(4) {
  width: 6%;
}

.data-table--links th:nth-child(5),
.data-table--links td:nth-child(5) {
  width: 8%;
}

.data-table--links th:nth-child(6),
.data-table--links td:nth-child(6) {
  width: 9%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table--links th:nth-child(7),
.data-table--links td:nth-child(7) {
  width: 12%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table--links th:nth-child(8),
.data-table--links td:nth-child(8) {
  width: 8rem;
  min-width: 8rem;
  box-sizing: border-box;
}

/* 短链页：横向滚动只出现在表格外层，不出现在 code 灰框内 */
.table-wrap--links {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table--links .short-cell--link-url {
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  width: max-content;
  max-width: none;
}

.data-table--links .short-cell--link-url .code-tag--ellipsis {
  display: inline-block;
  white-space: nowrap;
  overflow: visible;
  word-break: normal;
  text-overflow: clip;
  max-width: none;
}

.data-table--links .short-cell--link-url .copy-btn {
  flex-shrink: 0;
}

.data-table--links .cell-link-target {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.data-table--links .code-tag--ellipsis {
  word-break: normal;
}

/* 窄屏：短链列表改为卡片行；与后台 max-width:960px 窄屏区对齐，避免 901–959px 仍用表格+省略号 */
@media (max-width: 959px) {
  .table-wrap .data-table--links {
    min-width: 100%;
    width: max-content;
  }

  .data-table--links thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .data-table--links tbody tr.data-table-row--links {
    display: block;
    margin-bottom: 0.85rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  }

  .data-table--links tbody tr.data-table-row--links:hover td {
    background: transparent;
  }

  .data-table--links tbody tr.data-table-row--links td {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  }

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

  .data-table--links tbody tr.data-table-row--links td:first-child {
    padding-top: 0;
  }

  .data-table--links tbody tr.data-table-row--links td::before {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .data-table--links tbody tr.data-table-row--links td.data-table-links__url::before {
    content: "短链";
  }

  .data-table--links tbody tr.data-table-row--links td.data-table-links__title::before {
    content: "标题";
  }

  .data-table--links tbody tr.data-table-row--links td.cell-link-target::before {
    content: "目标 URL";
  }

  .data-table--links tbody tr.data-table-row--links td:nth-child(4)::before {
    content: "点击";
  }

  .data-table--links tbody tr.data-table-row--links td:nth-child(5)::before {
    content: "状态";
  }

  .data-table--links tbody tr.data-table-row--links td:nth-child(6)::before {
    content: "过期";
  }

  .data-table--links tbody tr.data-table-row--links td:nth-child(7)::before {
    content: "创建时间";
  }

  .data-table--links tbody tr.data-table-row--links td.cell-actions::before {
    content: "操作";
  }

  .data-table--links tbody tr.data-table-row--links td.cell-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
  }

  /* 与桌面一致：单行延伸，由外层 table-wrap 横向滚动，code 不出滚动条 */
  .data-table--links tbody tr.data-table-row--links .short-cell--link-url {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    width: max-content;
    max-width: none;
    gap: 0.5rem;
  }

  .data-table--links tbody tr.data-table-row--links .short-cell--link-url .code-tag--ellipsis {
    display: inline-block;
    white-space: nowrap;
    overflow: visible;
    word-break: normal;
    max-width: none;
  }

  .data-table--links tbody tr.data-table-row--links .short-cell--link-url .copy-btn {
    flex-shrink: 0;
  }

  .data-table--links tbody tr.data-table-row--links .cell-link-target {
    white-space: normal;
    word-break: break-all;
  }

  .data-table--links tbody tr.data-table-row--links .cell-ellipsis {
    max-width: none;
    white-space: normal;
    word-break: break-word;
  }
}

/* 文本分享列表 */
.data-table--texts {
  table-layout: fixed;
}

.data-table--texts th,
.data-table--texts td {
  vertical-align: top;
}

.data-table--texts .data-table-texts__url {
  width: 34%;
  min-width: 0;
}

.data-table--texts .data-table-texts__title {
  width: 20%;
  min-width: 0;
  max-width: none;
}

.data-table--texts th:nth-child(3),
.data-table--texts td:nth-child(3) {
  width: 10%;
}

.data-table--texts th:nth-child(4),
.data-table--texts td:nth-child(4) {
  width: 9%;
}

.data-table--texts th:nth-child(5),
.data-table--texts td:nth-child(5) {
  width: 10%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table--texts th:nth-child(6),
.data-table--texts td:nth-child(6) {
  width: 12%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table--texts th:nth-child(7),
.data-table--texts td:nth-child(7) {
  width: 5.75rem;
  min-width: 5.75rem;
  box-sizing: border-box;
}

.data-table--files .cell-actions,
.data-table--links .cell-actions,
.data-table--texts .cell-actions {
  white-space: normal;
  vertical-align: middle;
}

.data-table--texts .short-cell--text-url {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
}

.data-table--texts .short-cell--text-url .code-tag--ellipsis {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.data-table--texts .short-cell--text-url .copy-btn {
  flex-shrink: 0;
}

@media (min-width: 960px) {
  .data-table--texts .short-cell--text-url {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
  }

  .data-table--texts .short-cell--text-url .code-tag--ellipsis {
    flex: 1 1 auto;
    width: auto;
  }
}

.data-table--texts .code-tag--ellipsis {
  word-break: normal;
}

.code-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
  background: rgba(15, 118, 110, 0.08);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  word-break: break-all;
  color: #134e4a;
}

.data-table--files .code-tag--ellipsis {
  word-break: normal;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.badge--ok {
  background: rgba(209, 250, 229, 0.95);
  color: #047857;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.badge--off {
  background: rgba(254, 226, 226, 0.85);
  color: #b91c1c;
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.empty-hint {
  color: var(--muted);
  padding: 1.5rem 0;
  text-align: center;
}

.empty-hint a {
  color: var(--accent-deep);
  font-weight: 600;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.pager-link {
  color: var(--accent-deep);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
}

.pager-info {
  color: var(--muted);
  font-size: 0.875rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}

.btn--primary {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff;
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.32);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(13, 148, 136, 0.4);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.75);
  color: #475569;
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  color: #134e4a;
  border-color: rgba(20, 184, 166, 0.45);
  background: #fff;
}

.btn--block {
  width: 100%;
}

.btn-icon {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}

.btn-icon:hover {
  color: #134e4a;
  border-color: rgba(20, 184, 166, 0.35);
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent-deep);
  cursor: pointer;
  font: inherit;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.btn-text--danger {
  color: var(--danger);
}

.inline-form {
  display: inline;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.form-stack--wide {
  max-width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
}

.req {
  color: var(--danger);
}

.input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.65);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

.input::placeholder {
  color: #94a3b8;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.field--checkbox input {
  width: auto;
  accent-color: #0d9488;
}

/* 存储设置：存储方式卡片单选 */
.admin-storage-mode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

@media (min-width: 640px) {
  .admin-storage-mode-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
  }
}

@media (min-width: 560px) and (max-width: 639px) {
  .admin-storage-mode-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
  }
}

.admin-storage-mode-card {
  display: block;
  margin: 0;
  cursor: pointer;
  border-radius: 14px;
}

.admin-storage-mode-card__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-storage-mode-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  height: 100%;
  min-height: 9.5rem;
  padding: 1rem 1.1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.admin-storage-mode-card:hover .admin-storage-mode-card__body {
  border-color: rgba(45, 212, 191, 0.45);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.admin-storage-mode-card:focus-within .admin-storage-mode-card__body {
  outline: 2px solid rgba(45, 212, 191, 0.65);
  outline-offset: 2px;
}

.admin-storage-mode-card:has(.admin-storage-mode-card__input:checked) .admin-storage-mode-card__body {
  border-color: rgba(13, 148, 136, 0.55);
  background: rgba(240, 253, 244, 0.95);
  box-shadow: 0 2px 12px rgba(13, 148, 136, 0.12);
}

.admin-storage-mode-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e;
  margin-bottom: 0.15rem;
}

.admin-storage-mode-card__icon--cos {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.admin-storage-mode-card__icon--oss {
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
}

.admin-storage-cloud-section--hidden {
  display: none !important;
}

.admin-storage-cloud-section .admin-storage-cloud-title {
  margin-top: 1rem;
  margin-bottom: 0.35rem;
}

.admin-storage-cloud-section:first-of-type .admin-storage-cloud-title {
  margin-top: 0.5rem;
}

.admin-storage-mode-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: #134e4a;
}

.admin-storage-mode-card__path {
  font-size: 0.8125rem;
}

.admin-storage-mode-card__path code {
  font-size: 0.8125rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(15, 118, 110, 0.08);
  color: #134e4a;
}

.admin-storage-mode-card__path--muted {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 500;
}

.admin-storage-mode-card__desc {
  margin-top: auto;
  padding-top: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted);
}

.admin-alert-storage-sdk__text {
  margin: 0;
}

.admin-storage-root-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
}

.admin-storage-root-row .code-tag--path {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-all;
  text-align: left;
}

.form-actions {
  padding-top: 0.5rem;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

.alert--error {
  background: rgba(254, 226, 226, 0.92);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #991b1b;
}

.alert--success {
  background: rgba(240, 253, 244, 0.95);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #065f46;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 2rem 2.25rem;
  box-shadow: var(--shadow-sm);
}

.admin-body--login .login-card {
  max-width: none;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 22px;
  padding: clamp(1.75rem, 4vw, 2.25rem);
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 24px 48px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.login-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-brand .admin-logo-mark {
  margin: 0 auto 1rem;
  display: block;
}

.admin-body--login .login-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.875rem;
  text-align: left;
  margin-bottom: 1.5rem;
}

.admin-body--login .login-brand-text {
  flex: 1;
  min-width: 0;
}

.admin-body--login .login-logo-mark {
  display: block;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin: 0;
  border-radius: 4px;
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.login-brand h1 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.admin-body--login .login-brand h1 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.2vw, 1.45rem);
  letter-spacing: -0.03em;
  color: #134e4a;
  margin: 0 0 0.35rem;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-body--login .login-brand p {
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.45;
}

.admin-body--login .login-alert.alert--error {
  background: rgba(254, 226, 226, 0.92);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #991b1b;
}

.admin-body--login .login-oauth {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-body--login .login-form .field-label {
  color: #475569;
}

.admin-body--login .login-input.input {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.45);
  color: #0f172a;
}

.admin-body--login .login-input.input:focus {
  border-color: rgba(45, 212, 191, 0.65);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

.admin-body--login .btn--login-submit.btn--primary {
  margin-top: 0.25rem;
  padding: 0.78rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0c1f1a;
  background: linear-gradient(90deg, #bef264 0%, #6ee7b7 42%, #2dd4bf 100%);
  box-shadow: 0 4px 18px rgba(45, 212, 191, 0.35);
}

.admin-body--login .btn--login-submit.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.42);
}

.admin-body--login .btn--login-submit.btn--primary:active {
  transform: translateY(0);
}

/* —— 数据概览仪表盘 —— */
.dash {
  width: 100%;
}

.dash-section {
  margin-bottom: 1.75rem;
}

.dash-section-heading {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.dash-kpi {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.2rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.dash-kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--kpi-accent, var(--accent));
  opacity: 0.9;
}

.dash-kpi--accent {
  --kpi-accent: #0d9488;
}
.dash-kpi--violet {
  --kpi-accent: #7c3aed;
}
.dash-kpi--cyan {
  --kpi-accent: #0891b2;
}
.dash-kpi--amber {
  --kpi-accent: #d97706;
}
.dash-kpi--green {
  --kpi-accent: #059669;
}
.dash-kpi--slate {
  --kpi-accent: #64748b;
}

.dash-kpi-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(240, 253, 244, 0.95);
  color: var(--kpi-accent, var(--accent));
  border: 1px solid rgba(20, 184, 166, 0.15);
}

.dash-kpi-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dash-kpi-label {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 500;
}

.dash-kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: #134e4a;
  font-variant-numeric: tabular-nums;
}

.dash-kpi-meta {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

.dash-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  align-items: stretch;
}

.dash-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-sm);
}

.dash-panel--full {
  margin-bottom: 1.75rem;
}

.dash-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.dash-panel-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #134e4a;
}

.dash-panel-hint {
  font-size: 0.8125rem;
  color: var(--muted);
}

.dash-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 200px;
  padding: 0.5rem 0 0;
}

.dash-chart-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.dash-chart-bar-wrap {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.dash-chart-bar {
  width: 100%;
  max-width: 48px;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, rgba(13, 148, 136, 0.95), rgba(45, 212, 191, 0.35));
  position: relative;
  transition: filter 0.15s;
}

.dash-chart-bar:hover {
  filter: brightness(1.1);
}

.dash-chart-tip {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, -6px);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.dash-chart-bar:hover .dash-chart-tip {
  opacity: 1;
}

.dash-chart-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.dash-chart-sub {
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: -0.15rem;
}

.dash-rank {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dash-rank-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.dash-rank-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dash-rank-num {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  background: rgba(13, 148, 136, 0.12);
  color: var(--accent-deep);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-rank-item:nth-child(1) .dash-rank-num {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1c1917;
}
.dash-rank-item:nth-child(2) .dash-rank-num {
  background: rgba(148, 163, 184, 0.25);
  color: #334155;
}
.dash-rank-item:nth-child(3) .dash-rank-num {
  background: rgba(251, 146, 60, 0.25);
  color: #9a3412;
}

.dash-rank-main {
  flex: 1;
  min-width: 0;
}

.dash-rank-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.dash-rank-code {
  font-size: 0.75rem;
  color: var(--muted);
  word-break: break-all;
}

.dash-rank-clicks {
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0d9488;
}

.dash-empty {
  margin: 0.5rem 0;
}

.dash-triple {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.dash-mini-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
}

.dash-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.dash-mini-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dash-mini-list li {
  padding: 0.55rem 0;
  border-top: 1px solid var(--border);
}

.dash-mini-list li:first-child {
  border-top: none;
  padding-top: 0;
}

.dash-mini-code {
  display: block;
  font-size: 0.75rem;
  word-break: break-all;
  margin-bottom: 0.2rem;
}

.dash-mini-name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-mini-link {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-deep);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-mini-link:hover {
  text-decoration: underline;
}

.dash-mini-sub {
  display: block;
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.data-table--compact th,
.data-table--compact td {
  padding: 0.55rem 0.65rem;
  font-size: 0.8125rem;
}

@media (max-width: 1024px) {
  .dash-split {
    grid-template-columns: 1fr;
  }
}

/* —— 手机 / 平板：顶栏 + 抽屉侧栏 —— */
.admin-mobile-bar {
  display: none;
}

.admin-sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .admin-mobile-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 95;
    padding: max(0.5rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right)) 0.55rem max(1rem, env(safe-area-inset-left));
    margin: 0 0 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 0 20px rgba(15, 23, 42, 0.07);
  }

  .admin-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #134e4a;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, box-shadow 0.15s ease;
  }

  .admin-menu-btn:hover {
    background: rgba(240, 253, 244, 0.95);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  }

  .admin-menu-btn:focus-visible {
    outline: 2px solid rgba(45, 212, 191, 0.65);
    outline-offset: 2px;
  }

  .admin-menu-btn__icon {
    display: block;
}

  .admin-mobile-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9375rem;
    color: #134e4a;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.02em;
  }

  .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 99;
    margin: 0;
    padding: 0;
    border: none;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .admin-sidebar-backdrop:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-sidebar-backdrop[hidden] {
    display: none !important;
  }

  .admin-shell {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: min(17.5rem, 88vw);
    height: 100vh;
    height: 100dvh;
    padding: max(1.35rem, env(safe-area-inset-top, 0px)) 0 max(1.35rem, env(safe-area-inset-bottom, 0px));
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: none;
  }

  .admin-shell.is-nav-open .admin-sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(15, 23, 42, 0.12);
  }

  .admin-nav {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .admin-nav-item {
    padding: 0.7rem 0.9rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .admin-sidebar-foot {
    border-top: 1px solid var(--border);
    margin-top: auto;
    padding: 1rem 1.25rem 0;
    width: 100%;
    display: block;
  }

  .admin-sidebar-foot .admin-nav-item--ghost {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .admin-main {
    margin-left: 0;
    max-width: 100%;
    padding: 1rem max(1rem, env(safe-area-inset-right)) 2.5rem max(1rem, env(safe-area-inset-left));
    width: 100%;
  }

  .admin-title {
    font-size: 1.35rem;
  }

  .admin-page-head--row {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-card__head--row {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-card__body {
    padding: 1.1rem 0.85rem 1.15rem;
  }

  .panel {
    padding: 1.1rem 1rem 1.25rem;
  }

  .table-wrap {
    margin: 0 -0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap .data-table,
  .admin-card .table-wrap .data-table {
    min-width: 520px;
  }

  /* 短链管理：与其它列表一致由外层 table-wrap 横向滚动，不在 code 内滚动 */
  .table-wrap .data-table--links,
  .admin-card .table-wrap .data-table--links {
    min-width: 520px;
  }

  .dash-kpi-grid {
    grid-template-columns: 1fr;
  }

  .dash-triple {
    grid-template-columns: 1fr;
  }

  .dash-chart {
    gap: 0.2rem;
  }

  .dash-chart-bar-wrap {
    height: 120px;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .admin-main {
    padding: 0.85rem max(0.85rem, env(safe-area-inset-right)) 2rem max(0.85rem, env(safe-area-inset-left));
  }

  .admin-title {
    font-size: 1.25rem;
  }

  .input,
  .input--textarea,
  select.input,
  textarea.input {
    font-size: 1rem;
  }

  .admin-body--login .input,
  .admin-body--login .login-input {
    font-size: 1rem;
  }
}
