/* 运营端：单账号、邀请码、数据看板、货源审核上架 */
body.admin { background: #050605; }
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line);
  background: #000; display: flex; flex-direction: column; padding: 18px 14px; gap: 6px;
}
.side .brand { padding: 6px 10px 18px; }
.side .brand small { display: block; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; color: var(--text-2); font-weight: 600; font-size: 14px; border-radius: 2px;
  border-left: 2px solid transparent;
}
.side-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.side-nav a.on { color: var(--text); background: var(--nv-glow); border-left-color: var(--nv); }
.side-nav .badge { font-family: var(--mono); font-size: 11px; background: var(--nv); color: #000; padding: 0 6px; font-weight: 800; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--text-3); padding: 12px 10px; display: flex; flex-direction: column; gap: 8px; }

.main { min-width: 0; }
.topbar {
  height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 26px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
  background: rgba(5, 6, 5, 0.86); backdrop-filter: blur(12px);
}
.topbar h1 { font-size: 16px; font-weight: 700; letter-spacing: 0; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.content { padding: 26px; display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: row; overflow-x: auto; } .side-foot { display: none; } .side-nav { flex-direction: row; } }

.panel { border: 1px solid var(--line); background: var(--bg-1); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); font-weight: 700; }
.panel-body { padding: 18px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--bg-1); padding: 18px; }
.kpi b { display: block; font-family: var(--mono); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.kpi span { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.kpi small { display: block; color: var(--nv-hot); font-size: 12px; margin-top: 4px; }

.chart { display: flex; align-items: stretch; gap: 4px; height: 170px; padding: 10px 0 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-width: 6px; position: relative; height: 100%; }
.chart .col:hover { background: rgba(255, 255, 255, 0.05); }
.chart .col i { display: block; background: var(--nv); }
.chart .col i.secondary { background: rgba(255, 255, 255, 0.28); }
.chart-legend { display: flex; gap: 18px; font-size: 12px; color: var(--text-3); }
.chart-legend b { display: inline-block; width: 10px; height: 10px; margin-right: 6px; }
.chart-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-top: 6px; }

.toolbar2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar2 .input, .toolbar2 .select { height: 36px; width: auto; min-width: 140px; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.status.published::before { background: var(--nv); box-shadow: 0 0 8px var(--nv); }
.status.draft::before { background: var(--warn); }
.status.archived::before { background: var(--text-3); }

.code-pill { font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; background: var(--bg-3); border: 1px solid var(--line-strong); padding: 3px 8px; }
.copy { cursor: pointer; }
.copy:hover { border-color: var(--nv); color: var(--nv-hot); }

/* 表单抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); z-index: 100; opacity: 0; transition: opacity 0.18s; }
.drawer-mask.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(880px, 96vw); z-index: 101;
  background: #070807; border-left: 1px solid var(--line-strong); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.22s cubic-bezier(.2,.8,.2,1);
  box-shadow: var(--shadow);
}
.drawer.open { transform: none; }
.drawer-head { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.drawer-head h2 { font-size: 17px; }
.drawer-body { padding: 22px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 18px; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { height: 34px; padding: 0 12px; background: var(--bg-3); border: 1px solid var(--line-strong); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--nv); border-color: var(--nv); color: #000; }

.steps-edit { display: flex; flex-direction: column; gap: 8px; }
.step-edit { display: grid; grid-template-columns: 26px 120px 1fr 88px 30px; gap: 8px; align-items: center; }
.step-edit .idx { font-family: var(--mono); color: var(--text-3); font-size: 12px; text-align: right; }
.step-edit .input, .step-edit .select { height: 34px; font-size: 13px; }
.step-edit .rm { background: none; border: 0; color: var(--text-3); cursor: pointer; font-size: 16px; }
.step-edit .rm:hover { color: var(--danger); }
@media (max-width: 720px) { .step-edit { grid-template-columns: 1fr; } }

/* 审核卡片 */
.review-list { display: flex; flex-direction: column; }
.review-item { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 18px; align-items: flex-start; }
.review-item:last-child { border-bottom: 0; }
.review-item .main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.review-item .acts { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
.warn-line { color: var(--warn); font-size: 12px; }
.missing-line { color: var(--danger); font-size: 12px; }

.callout { border-left: 2px solid var(--nv); background: rgba(118, 185, 0, 0.06); padding: 12px 14px; font-size: 13px; color: var(--text-2); }
.callout.warn { border-left-color: var(--warn); background: rgba(242, 169, 0, 0.07); }
pre.json { background: #000; border: 1px solid var(--line); padding: 12px; font-size: 12px; overflow: auto; max-height: 320px; font-family: var(--mono); color: var(--text-2); }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-left { padding: 56px clamp(24px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); }
.login-right { display: grid; place-items: center; padding: 40px 24px; }
@media (max-width: 900px) { .login-screen { grid-template-columns: 1fr; } .login-left { display: none; } }

.events { display: flex; flex-direction: column; }
.event { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.event time { font-family: var(--mono); color: var(--text-3); font-size: 12px; }
.event .kind { font-weight: 700; font-size: 12px; }
.event .kind.view { color: var(--text-3); }
.event .kind.publish { color: var(--info); }

/* 列较多的货源表：避免窄列折行 */
.tbl td .status, .tbl th { white-space: nowrap; }
.tbl td { white-space: nowrap; }
.tbl td:first-child, .tbl td:nth-child(2), .tbl td:nth-child(3) { white-space: normal; }

/* 操作列：按钮紧凑排布 */
.tbl td:last-child { white-space: nowrap; }
.tbl td:last-child > div { flex-wrap: nowrap !important; }
.tbl td:last-child .btn.small { height: 28px; padding: 0 9px; font-size: 12px; }


/* ==================================================================
   访客名录（v0.6）：筛选条 / KPI / 名录表 / 轨迹抽屉
   仅新增选择器，不改动以上已有样式
   ================================================================== */

/* 加载骨架：先出占位条，数据回来再替换，避免闪空白 */
.vloading { display: flex; flex-direction: column; gap: 14px; }
.skeleton-lines { display: flex; flex-direction: column; gap: 10px; }
.skeleton-lines i { display: block; height: 64px; background: var(--bg-2); border: 1px solid var(--line); opacity: 0.6; animation: vf-pulse 1.2s ease-in-out infinite; }
.skeleton-lines i:nth-child(2) { animation-delay: 0.15s; }
.skeleton-lines i:nth-child(3) { animation-delay: 0.3s; }
@keyframes vf-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.75; } }

/* KPI 区：沿用 .kpis / .kpi，仅收紧上间距；爬虫提示单独一行，不占卡位 */
.vkpis { margin: 0; }
.vkpis .kpi b { font-size: 28px; }
.visit-botline { margin-top: -14px; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.visit-botline .linkbtn { background: none; border: 0; padding: 0; font-size: 12px; color: var(--nv-hot); cursor: pointer; border-bottom: 1px dashed rgba(143, 214, 0, 0.5); }
.visit-botline .linkbtn:hover { color: var(--text); }

/* 筛选条 */
.visit-filters { display: flex; flex-direction: column; gap: 12px; padding: 14px 18px; }
.vf-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vf-row .seg button { height: 32px; padding: 0 11px; font-size: 12px; }
.vf-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.visit-filters .select { height: 34px; width: auto; min-width: 170px; background-position: calc(100% - 18px) 15px, calc(100% - 13px) 15px; }
.visit-filters .input { height: 34px; flex: 1 1 240px; max-width: 420px; }
#v-bots-toggle.on { background: var(--warn); border-color: var(--warn); color: #000; font-weight: 800; }
.vf-meta { margin-left: auto; font-size: 12px; color: var(--text-3); font-family: var(--mono); }

/* 名录表：窄屏横向滚动，不撑破布局 */
.tbl-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.visit-tbl { min-width: 880px; }
.visit-tbl th, .visit-tbl td { white-space: nowrap; }
.visit-tbl td:first-child { white-space: normal; min-width: 150px; }
.visit-tbl td:nth-child(2) { white-space: normal; min-width: 120px; }
.visit-tbl td:last-child { white-space: nowrap; }
.visit-row { cursor: pointer; }
.visit-row:hover td { background: var(--nv-glow) !important; }
.visit-row:focus-visible { outline: 2px solid var(--nv); outline-offset: -2px; }
.visit-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag.warn { color: var(--warn); border-color: rgba(242, 169, 0, 0.55); background: rgba(242, 169, 0, 0.08); }

/* 分页 */
.visit-pager { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line); }
.visit-pager .btn[disabled] { opacity: 0.35; }

/* 轨迹抽屉 */
.vinfo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 720px) { .vinfo { grid-template-columns: 1fr; } }
.vinfo-row { background: var(--bg-1); padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vinfo-row.full { grid-column: 1 / -1; }
.vinfo-row > span { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.vinfo-row > b { color: var(--text); font-weight: 600; }
.vinfo-row b.brk { white-space: pre-wrap; word-break: break-all; }
.vtrail-meta { font-size: 12px; margin-bottom: 10px; }
.vtrail { display: flex; flex-direction: column; gap: 14px; }
.vtrail-day { display: grid; grid-template-columns: 92px 1fr; gap: 12px; }
@media (max-width: 720px) { .vtrail-day { grid-template-columns: 1fr; gap: 6px; } }
.vtrail-date { font-size: 12px; color: var(--nv-hot); font-weight: 700; padding-top: 2px; }
.vtrail-items { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line-strong); padding-left: 12px; }
.vtrail-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(0, 180px); gap: 10px; align-items: baseline; padding: 5px 0; font-size: 13px; }
.vtrail-item time { font-size: 12px; }
.vtrail-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.vtrail-ref { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .vtrail-item { grid-template-columns: 48px 1fr; } .vtrail-ref { grid-column: 2; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 非人类访问：可疑访客用「实心黄」，同 IP 多设备用「描边黄」，视觉区分 */
.tag.warn-solid { color: #000; background: var(--warn); border-color: var(--warn); font-weight: 800; }
#v-bots-toggle.nonhuman { background: var(--warn); border-color: var(--warn); color: #000; font-weight: 800; }
#v-bots-toggle.nonhuman::before { content: "⚠ "; }
.nonhuman-line { color: var(--warn); font-size: 12px; }
