:root {
  --p-bg: #f4f7fb;
  --p-card: #ffffff;
  --p-line: #e4eaf2;
  --p-text: #0f172a;
  --p-muted: #64748b;
  --p-accent: #0e7490;
  --p-accent-dark: #155e75;
  --p-sidebar: #0b1220;
  --p-sidebar-text: #cbd5e1;
  --p-radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.portal-body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  background: var(--p-bg); color: var(--p-text);
  -webkit-font-smoothing: antialiased;
}
body.theme-platform { --p-accent: #2563eb; --p-accent-dark: #1d4ed8; --p-sidebar: #0b1b3a; }
body.theme-contractor { --p-accent: #ea580c; --p-accent-dark: #c2410c; --p-sidebar: #1c1917; }
body.theme-merchant { --p-accent: #0d9488; --p-accent-dark: #0f766e; --p-sidebar: #0f172a; }
body.theme-booth { --p-accent: #b45309; --p-accent-dark: #92400e; --p-sidebar: #111827; }
body.theme-park { --p-accent: #0e7490; --p-accent-dark: #155e75; --p-sidebar: #0b1220; }

.portal-shell { display: flex; min-height: 100vh; }
.portal-sidebar {
  width: 238px; flex: 0 0 238px; background: var(--p-sidebar); color: var(--p-sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30;
}
.portal-sidebar.collapsed { width: 76px; flex-basis: 76px; }
.portal-brand { display: flex; align-items: center; gap: 11px; padding: 22px 18px 18px; }
.portal-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--p-accent); color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -.05em;
}
.portal-brand strong { display: block; color: #fff; font-size: 16px; letter-spacing: -.02em; }
.portal-brand small { display: block; margin-top: 2px; font-size: 9px; letter-spacing: .16em; color: #94a3b8; }
.portal-nav { flex: 1; overflow-y: auto; padding: 6px 10px 18px; }
.portal-nav-group { padding: 15px 12px 7px; font-size: 9px; letter-spacing: .12em; color: #64748b; text-transform: uppercase; }
.portal-nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin: 2px 0;
  border-radius: 9px; color: var(--p-sidebar-text); text-decoration: none; font-size: 13px; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.portal-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.portal-nav a.active { background: var(--p-accent); color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.portal-nav a .nav-icon { width: 17px; height: 17px; flex: 0 0 17px; display: inline-grid; place-items: center; font-size: 15px; }
.portal-sidebar.collapsed .portal-nav a { justify-content: center; padding: 11px 0; }
.portal-sidebar.collapsed .nav-label, .portal-sidebar.collapsed .portal-nav-group, .portal-sidebar.collapsed .portal-brand-copy, .portal-sidebar.collapsed .portal-side-foot { display: none; }
.portal-side-foot { padding: 14px 18px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 10px; color: #94a3b8; line-height: 1.6; }
.portal-side-foot strong { display: block; color: #e2e8f0; font-size: 11px; }

.portal-body-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.portal-topbar {
  height: 64px; flex: 0 0 64px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--p-line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
}
.portal-menu-btn {
  width: 34px; height: 34px; border: 1px solid var(--p-line); background: #fff; border-radius: 9px;
  display: grid; place-items: center; cursor: pointer; color: var(--p-muted); font-size: 16px;
}
.portal-crumb { font-size: 12px; color: var(--p-muted); display: flex; align-items: center; gap: 8px; }
.portal-crumb strong { color: var(--p-text); font-size: 14px; }
.portal-top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.portal-user { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid var(--p-line); }
.portal-avatar { width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--p-accent) 12%, white); color: var(--p-accent-dark); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.portal-user strong { display: block; font-size: 12px; line-height: 1.2; }
.portal-user small { display: block; font-size: 9px; color: var(--p-muted); margin-top: 2px; }
.portal-main { padding: 24px; flex: 1; min-width: 0; }
.portal-page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.portal-page-head h1 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.portal-page-head p { margin: 6px 0 0; font-size: 12px; color: var(--p-muted); }
.portal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.portal-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.portal-stat { background: var(--p-card); border: 1px solid var(--p-line); border-radius: var(--p-radius); padding: 17px 18px; position: relative; overflow: hidden; }
.portal-stat::after { content: ""; position: absolute; right: -22px; top: -22px; width: 88px; height: 88px; border-radius: 50%; background: color-mix(in srgb, var(--p-accent) 7%, transparent); }
.portal-stat .label { font-size: 11px; color: var(--p-muted); }
.portal-stat .value { margin-top: 9px; font-size: 27px; font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.portal-stat .value small { font-size: 11px; font-weight: 500; color: var(--p-muted); margin-left: 3px; }
.portal-stat .foot { margin-top: 6px; font-size: 10px; color: var(--p-muted); }
.portal-stat .value.accent { color: var(--p-accent-dark); }
.portal-stat .value.danger { color: #dc2626; }
.portal-stat .value.success { color: #0f9f7f; }
.portal-panel { background: var(--p-card); border: 1px solid var(--p-line); border-radius: var(--p-radius); padding: 18px; min-width: 0; }
.portal-panel + .portal-panel { margin-top: 14px; }
.portal-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.portal-panel-head h3 { margin: 0; font-size: 14px; }
.portal-panel-head span { font-size: 11px; color: var(--p-muted); }
.portal-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.portal-table-wrap { background: var(--p-card); border: 1px solid var(--p-line); border-radius: var(--p-radius); padding: 6px 14px 14px; min-width: 0; overflow-x: auto; }
.portal-note { padding: 10px 12px; border-radius: 9px; background: #f8fafc; border: 1px dashed var(--p-line); font-size: 11px; line-height: 1.7; color: var(--p-muted); }
.portal-empty { padding: 28px; text-align: center; color: var(--p-muted); font-size: 12px; }
.portal-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; align-items: start; }
.portal-grid-2 > * { min-width: 0; }
.portal-panel .el-table { width: 100%; }
.portal-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 14px; }
.portal-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 18px; }
.portal-detail-grid > div { padding: 9px 0; border-bottom: 1px dashed #eef1f5; }
.portal-detail-grid small { display: block; font-size: 10px; color: var(--p-muted); }
.portal-detail-grid strong { display: block; margin-top: 3px; font-size: 12px; }
.portal-section-title { margin: 20px 0 10px; font-size: 13px; font-weight: 700; }
.portal-mobile-mask { display: none; }

.el-table { --el-table-header-bg-color: #f8fafc; --el-table-row-hover-bg-color: #f8fdfb; font-size: 12px; }
.el-table th.el-table__cell { color: #475569; font-weight: 650; font-size: 11px; }
.el-table .cell { line-height: 1.5; }
.el-tag { border-radius: 999px; font-size: 10px; }
.el-button { font-weight: 600; }
.el-pagination { justify-content: flex-end; margin-top: 14px; }
.el-form-item__label { font-size: 11px; color: #475569; }
.el-dialog__title { font-size: 16px; font-weight: 700; }
.el-drawer__title { font-size: 16px; font-weight: 700; }

/* Login */
.portal-login-body {
  min-height: 100vh; display: flex; flex-direction: column; background:
    radial-gradient(1100px 600px at 12% 8%, color-mix(in srgb, var(--p-accent) 22%, transparent), transparent 58%),
    linear-gradient(135deg, #07111f 0%, #0f1d33 55%, #10263a 100%);
}
.portal-login-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 32px; color: #e2e8f0; }
.portal-login-header a { color: #cbd5e1; text-decoration: none; font-size: 12px; }
.portal-login-header .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.portal-login-main { flex: 1; display: grid; place-items: center; padding: 24px; }
.portal-login-card { width: min(430px, 100%); background: rgba(255,255,255,.98); border-radius: 20px; padding: 32px; box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.portal-login-card .eyebrow { font-size: 10px; letter-spacing: .16em; color: var(--p-accent-dark); font-weight: 700; text-transform: uppercase; }
.portal-login-card h1 { margin: 10px 0 6px; font-size: 27px; letter-spacing: -.04em; }
.portal-login-card p.sub { margin: 0 0 22px; font-size: 12px; line-height: 1.7; color: var(--p-muted); }
.portal-field { display: block; margin-bottom: 14px; }
.portal-field span { display: block; margin-bottom: 6px; font-size: 11px; color: #475569; }
.portal-field input { width: 100%; height: 42px; border: 1px solid #d7dfe9; border-radius: 9px; padding: 0 12px; font-size: 13px; outline: none; background: #fff; }
.portal-field input:focus { border-color: var(--p-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-accent) 13%, transparent); }
.portal-login-btn { width: 100%; height: 44px; border: 0; border-radius: 9px; background: var(--p-accent); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 4px; }
.portal-login-btn:hover { background: var(--p-accent-dark); }
.portal-login-btn:disabled { opacity: .6; cursor: wait; }
.portal-login-error { display: none; margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 11px; line-height: 1.6; }
.portal-login-error.show { display: block; }
.portal-login-foot { padding: 18px 32px 24px; text-align: center; color: #94a3b8; font-size: 10px; }
.portal-login-foot a { color: #cbd5e1; text-decoration: none; }
.portal-demo { margin-top: 16px; padding: 10px 12px; border-radius: 9px; background: #f8fafc; border: 1px dashed #dbe3ec; font-size: 10px; color: #64748b; line-height: 1.7; }
.portal-demo code { color: var(--p-accent-dark); font-weight: 700; }

/* Portal chooser */
.portal-choose-body { min-height: 100vh; background: var(--p-bg); }
.portal-choose-wrap { max-width: 1180px; margin: 0 auto; padding: 54px 24px 70px; }
.portal-choose-head { text-align: center; margin-bottom: 34px; }
.portal-choose-head h1 { margin: 0 0 10px; font-size: 34px; letter-spacing: -.05em; }
.portal-choose-head p { margin: 0; color: var(--p-muted); font-size: 13px; }
.portal-cards { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 14px; }
.portal-card { display: flex; flex-direction: column; min-height: 220px; padding: 22px; border-radius: 16px; background: #fff; border: 1px solid var(--p-line); text-decoration: none; color: inherit; transition: transform .18s ease, box-shadow .18s ease; }
.portal-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(15,23,42,.1); }
.portal-card .badge { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; margin-bottom: 18px; }
.portal-card h2 { margin: 0 0 8px; font-size: 17px; }
.portal-card p { margin: 0; font-size: 11px; line-height: 1.7; color: var(--p-muted); flex: 1; }
.portal-card span.link { margin-top: 14px; font-size: 11px; color: var(--p-accent-dark); font-weight: 700; }
.portal-card.platform .badge { background: #2563eb; }
.portal-card.contractor .badge { background: #ea580c; }
.portal-card.park .badge { background: #0e7490; }
.portal-card.merchant .badge { background: #0d9488; }
.portal-card.booth .badge { background: #b45309; }

@media (max-width: 1100px) {
  .portal-cards { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .portal-stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .portal-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .portal-sidebar.mobile-open { transform: translateX(0); }
  .portal-mobile-mask { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 25; }
  .portal-main { padding: 18px; }
  .portal-grid-2, .portal-form-grid, .portal-detail-grid { grid-template-columns: minmax(0,1fr); }
  .portal-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .portal-cards { grid-template-columns: 1fr; }
  .portal-stat-grid { grid-template-columns: 1fr; }
  .portal-topbar { padding: 0 14px; }
  .portal-user > div:last-child { display: none; }
  .portal-page-head { flex-direction: column; }
  .portal-actions { width: 100%; }
  .portal-actions .el-button { flex: 1; }
}

/* 岗亭值守台 */
.lane-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 14px; }
.lane-grid.solo .lane-video { aspect-ratio: auto; height: calc(100vh - 300px); min-height: 360px; }
.lane-video { cursor: zoom-in; }
.lane { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.lane-head strong { font-size: 16px; }
.lane-park { margin-left: auto; font-size: 12px; color: #94a3b8; }
.lane-video { position: relative; aspect-ratio: 16 / 9; background: #0b1220; }
.lane-video img, .lane-video video, .lane-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border: 0; }
.lane-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #94a3b8; font-size: 12px; padding: 20px; text-align: center; }
.lane-badge { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.lane-foot { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.lane-last { flex: 1; font-size: 12px; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-body { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.ev-photo { position: relative; aspect-ratio: 16 / 10; background: #0b1220; border-radius: 10px; overflow: hidden; }
.ev-photo img { width: 100%; height: 100%; object-fit: contain; }
.ev-plate { font-size: 28px; font-weight: 800; letter-spacing: .06em; background: #1d4ed8; color: #fff; border-radius: 8px; padding: 6px 12px; text-align: center; margin-bottom: 10px; }
.ev-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed #e5e7eb; }
.ev-row span { color: #64748b; }
.ev-due { font-size: 32px; font-weight: 800; color: #b45309; margin: 10px 0; }
.ev-due small { font-size: 13px; color: #64748b; font-weight: 400; margin-right: 8px; }
.ev-tip { font-size: 12px; color: #64748b; margin-top: 10px; line-height: 1.6; }
@media (max-width: 900px) { .ev-body { grid-template-columns: 1fr; } .lane-grid { grid-template-columns: 1fr; } }
