/* ================= L 管理后台（极简单色） ================= */
body.admin-body { background: var(--bg); color: var(--ink); overflow: auto; }

/* 登录页 */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-card {
  width: 400px; max-width: calc(100vw - 40px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 32px; box-shadow: var(--shadow-lg);
}
.login-card h2 { text-align: center; font-size: 22px; }
.login-sub { text-align: center; color: var(--muted); font-size: 12.5px; margin: 8px 0 22px; line-height: 1.7; }
/* 基础 Logo 尺寸：登录页直接使用 .logo，必须自带宽高与居中（此前只有背景色导致被压成一条横条） */
.logo {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--green-900); color: #fff;
  font-family: Georgia, serif; font-size: 26px; font-weight: 700;
  user-select: none; flex-shrink: 0;
}

/* 布局 */
#adminApp { display: flex; min-height: 100vh; }
.admin-side {
  width: 212px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; font-size: 16px; }
.admin-logo .logo { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; display: grid; place-items: center; font-family: Georgia, serif; }
.adm-nav {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; padding: 11px 14px;
  border-radius: 11px; color: var(--ink-2); font-size: 14px; margin-bottom: 3px;
  background: none; border: none;
}
.adm-nav svg,
.admin-side-foot svg { width: 16px; height: 16px; flex: none; }
.adm-nav:hover { background: var(--green-50); }
.adm-nav.active { background: var(--green-900); color: #fff; font-weight: 600; box-shadow: none; }
.admin-side-foot { margin-top: auto; }

.admin-main { flex: 1; min-width: 0; }
.admin-head {
  height: 62px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); z-index: 5;
}
.tab-title { font-size: 17px; font-weight: 700; }
.admin-head-actions { display: flex; align-items: center; gap: 10px; }
.admin-updated { font-size: 11.5px; white-space: nowrap; }
.admin-content { padding: 22px 26px; max-width: 1240px; }
.dt-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dt-wrap > .dt { min-width: 720px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; font-size: 13.5px; font-weight: 600; padding: 9px 16px; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--green-900); color: #fff; }
.btn-primary:hover { background: var(--green-800); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--green-400); background: var(--green-50); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 数据分析 */
.analytics-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.analytics-toolbar label { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); }
.analytics-toolbar .input { width:auto; padding:7px 9px; }
.analytics-toolbar .seg { margin:0; }

/* 概览卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 15px; padding: 18px; box-shadow: var(--shadow); }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-value { font-size: 28px; font-weight: 800; color: var(--green-900); margin: 6px 0 2px; }
.stat-sub { font-size: 12px; color: var(--muted); }

/* 通用卡片 */
.cardx { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.cardx-head { margin-bottom: 14px; font-size: 15px; }

/* 表格 */
.dt { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 13px; }
.cardx:has(.dt) { overflow-x: auto; }
.dt th, .dt td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.dt th { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.dt .dim { color: var(--muted); font-size: 11.5px; }
.dim { color: var(--muted); font-size: 12px; }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* 标签 */
.tag { display: inline-block; padding: 2px 9px; border-radius: 7px; font-size: 11.5px; }
.tag-green { background: var(--green-50); color: var(--green-800); }
.tag-gray { background: var(--green-100); color: var(--muted); }
.tag-red { background: var(--danger-soft); color: var(--danger); }
.tag-blue { background: #e6f0ff; color: #1d5fd0; }

/* 分段切换 */
.seg { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.seg-btn { border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); padding: 8px 18px; border-radius: 11px; font-size: 13.5px; }
.seg-btn.on { background: var(--green-900); color: #fff; border-color: var(--green-900); }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fg { display: flex; flex-direction: column; }
.fg label { font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; font-weight: 500; }
.fg .input { width: 100%; }
textarea.input { min-height: 70px; resize: vertical; }
textarea.mono, input.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

.alert-ok { background: var(--green-50); border: 1px solid var(--green-100); color: var(--green-800); border-radius: 11px; padding: 11px 14px; font-size: 13px; margin-bottom: 10px; }

/* 弹窗 */
#admModal .modal { width: 680px; max-width: calc(100vw - 40px); }
#admModal h3 { margin: 0 0 14px; }

@media (max-width: 900px) {
  .admin-side { width: 100%; height: auto; min-height: 0; position: sticky; top: 0; z-index: 10; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px; }
  #adminApp { display: block; }
  .admin-logo { padding: 2px 4px 9px; }
  #adminNav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  .adm-nav { width: auto; flex: 0 0 auto; white-space: nowrap; margin: 0; padding: 9px 11px; }
  .admin-side-foot { display: flex; gap: 8px; margin-top: 8px; }
  .admin-side-foot .btn { width: auto; flex: 1; margin-top: 0 !important; }
  .admin-head { padding: 0 14px; }
  .admin-content { padding: 14px; }
  .admin-updated { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .cardx { padding: 14px; overflow: hidden; }
}

/* 站点标识：手写 L */
.logo {
  background: transparent url('/assets/img/logo-l.png') center / contain no-repeat !important;
  color: transparent !important;
  box-shadow: none !important;
  text-shadow: none !important;
  border-radius: 50%;
}