/* 组件样式 V2 —— 复刻广州消费帮扶数据及活动平台版式语言 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text-main);
  background: var(--bg-page);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font-family: inherit; font-size: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.topbar-inner {
  max-width: var(--shell); margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img { width: 38px; height: 38px; object-fit: contain; }
.brand-txt b { display: block; font-size: 15px; font-weight: 700; color: var(--c-blue); letter-spacing: .3px; line-height: 1.3; }
.brand-txt span { display: block; font-size: 10px; color: var(--text-mute); letter-spacing: .5px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 7px 14px; border-radius: var(--r-sm);
  font-size: 13px; color: var(--text-sub); cursor: pointer;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--bg-page); color: var(--c-blue); }
.nav a.active { background: #EAF1F8; color: var(--c-blue); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.role-switch {
  display: flex; border: 1px solid var(--border); border-radius: var(--r-sm);
  overflow: hidden; background: #fff;
}
.role-switch button {
  border: 0; background: transparent; padding: 6px 11px;
  font-size: 12px; color: var(--text-sub); cursor: pointer;
}
.role-switch button.on { background: var(--c-blue); color: #fff; font-weight: 600; }

/* ---------- 按钮 ---------- */
.btn {
  height: 36px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: #fff; color: var(--text-main);
  font-size: 13px; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
  transition: opacity .15s, background .15s, border-color .15s;
}
.btn:hover { border-color: var(--c-teal); color: var(--c-blue); }
.btn-primary { background: var(--grad-btn); border: 0; color: #fff; font-weight: 500; }
.btn-primary:hover { opacity: .9; color: #fff; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }

/* ---------- 横幅（原平台 PavilionList / ActivityCenter） ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--grad-hero);
  min-height: 224px; padding: 40px 24px 76px;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: var(--grad-sheen); pointer-events: none;
}
.glow { position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none; }
.glow-gold  { width: 320px; height: 320px; top: -80px; right: -80px; background: rgba(249, 168, 37, .10); }
.glow-green { width: 320px; height: 320px; bottom: -80px; left: -80px; background: rgba(30, 122, 90, .30); }
.hero-inner { position: relative; z-index: 2; max-width: var(--shell); margin: 0 auto; text-align: center; }
.hero h1 {
  margin: 0 0 8px; color: #fff; font-size: 30px; font-weight: 700;
  letter-spacing: 1.5px; line-height: 1.35;
}
.hero p { margin: 0 auto; max-width: 720px; color: rgba(255, 255, 255, .82); font-size: 14px; }
.hero-rule { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.hero-rule i { display: inline-block; width: 32px; height: 2px; }
.hero-rule i.l { background: var(--grad-rule-l); }
.hero-rule i.r { background: var(--grad-rule-r); }
.hero-rule span { color: var(--c-gold); font-size: 13px; font-weight: 500; letter-spacing: 1px; }
.hero-badges {
  position: absolute; z-index: 2; right: 24px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.hero-badge {
  padding: 6px 12px; border-radius: var(--r-md);
  background: rgba(249, 168, 37, .20); border: 1px solid rgba(249, 168, 37, .40);
  backdrop-filter: blur(6px); color: #fff; font-size: 12px; font-weight: 500;
}

/* ---------- 内容区：负 margin 悬浮压在横幅上 ---------- */
.shell {
  position: relative; z-index: 3;
  max-width: var(--shell); margin: -48px auto 0;
  padding: 0 24px 48px;
}
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px);
  border: 1px solid var(--border-soft); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md); padding: 18px 20px;
}
.stat-card .label { font-size: 13px; color: var(--text-sub); }
.stat-card .num {
  margin-top: 6px; font-family: var(--font-num);
  font-size: 30px; font-weight: 700; line-height: 1.2;
}
.stat-card .note { margin-top: 8px; padding-top: 8px; border-top: 1px solid #F3F4F6; font-size: 11px; color: var(--text-mute); }
.num-blue { color: var(--c-blue); }
.num-green { color: var(--c-green); }
.num-gold { color: var(--c-gold-deep); }
.num-red { color: var(--c-red); }

.panel {
  background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px);
  border: 1px solid var(--border-soft); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.panel + .panel { margin-top: 20px; }
.filter-panel { padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; box-shadow: var(--shadow-md); }
.filter-panel .field { position: relative; }
.filter-panel input, .filter-panel select {
  height: 36px; border: 1px solid #E5E7EB; border-radius: var(--r-sm);
  padding: 0 12px; font-size: 13px; color: var(--text-main);
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.filter-panel input:focus, .filter-panel select:focus {
  border-color: var(--c-teal); box-shadow: 0 0 0 3px rgba(21, 104, 128, .12);
}
.filter-panel input { width: 260px; }
.filter-panel select { min-width: 132px; }
.filter-count { margin-left: auto; font-size: 13px; color: var(--text-sub); }
.filter-count b { color: var(--c-blue); font-weight: 600; font-family: var(--font-num); }

/* ---------- 表格列表 ---------- */
.table-head, .table-row {
  display: grid;
  grid-template-columns: 52px minmax(210px, 2.2fr) 108px 100px 132px 118px 104px 148px;
  align-items: center; gap: 8px; padding: 0 16px;
}
.table-head {
  height: 44px; background: var(--bg-head); border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: #4B5563;
}
.table-row {
  min-height: 62px; border-bottom: 1px solid #F3F4F6;
  transition: background .15s; font-size: 13px;
}
.table-row:last-child { border-bottom: 0; }
.table-row:hover { background: rgba(240, 245, 249, .55); }
.cell-idx { color: var(--text-mute); font-family: var(--font-num); font-size: 12px; text-align: center; }
.prod { display: flex; align-items: center; gap: 10px; min-width: 0; }
.prod-thumb {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: var(--r-md);
  background: #EEF3F7; color: var(--c-teal); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.prod-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-code { font-family: var(--font-num); font-size: 11px; color: var(--text-mute); }
.cell-sub { color: var(--text-sub); font-size: 12px; }
.cell-num { font-family: var(--font-num); font-weight: 600; color: var(--c-red); font-size: 14px; }
.cell-actions { display: flex; gap: 6px; justify-content: flex-end; }

.badge {
  display: inline-flex; align-items: center; padding: 2px 9px;
  border-radius: 4px; border: 1px solid transparent; font-size: 11px; font-weight: 500;
  white-space: nowrap;
}
.badge-blue  { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.badge-green { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.badge-gold  { background: var(--c-gold-tint); color: var(--c-gold-deep); border-color: rgba(249, 168, 37, .4); }
.badge-red   { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.badge-gray  { background: #F3F4F6; color: #6B7280; border-color: var(--border); }

.empty { padding: 48px 20px; text-align: center; color: var(--text-mute); font-size: 13px; }
.service-bar {
  margin-top: 12px; padding: 10px 14px; border-radius: var(--r-md);
  background: #fff; border: 1px solid var(--border);
  font-size: 12px; color: var(--text-sub);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.service-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-green-ok); flex-shrink: 0; }
.service-bar .dot.off { background: var(--c-gold); }
.service-bar b { color: var(--c-blue); font-family: var(--font-num); font-weight: 600; }
.hint-bar {
  margin-top: 20px; padding: 12px 16px; border-radius: var(--r-md);
  background: #EAF1F8; border-left: 3px solid var(--c-blue);
  font-size: 12px; color: var(--text-sub); line-height: 1.8;
}

/* ---------- 详情抽屉 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 42, 66, .35);
  z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 94vw;
  background: #fff; z-index: 41; box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .22s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.drawer-head h3 { margin: 0 0 4px; font-size: 17px; }
.drawer-head .code { font-family: var(--font-num); font-size: 11px; color: var(--text-mute); }
.drawer-close { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-mute); }
.drawer-body { padding: 20px 22px 28px; overflow-y: auto; flex: 1; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 13px; padding: 10px 0; border-bottom: 1px solid #F3F4F6; }
.kv dt { color: var(--text-sub); }
.kv dd { margin: 0; }
.sub-title { margin: 22px 0 10px; font-size: 14px; font-weight: 600; color: var(--c-blue); }
.l2-box { background: #F7FAFC; border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; font-size: 12px; line-height: 2; }
.l2-box b { font-family: var(--font-num); color: var(--c-teal); }
.drawer-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.drawer-foot .btn { flex: 1; }

/* ---------- 登录（原平台 AdminLogin） ---------- */
.login-view {
  min-height: calc(100vh - 64px); background: var(--grad-login);
  display: flex; align-items: center; justify-content: center; padding: 40px 20px;
}
.login-box { width: 100%; max-width: 400px; text-align: center; }
.login-mark {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%;
  background: rgba(255, 255, 255, .20); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.login-mark img { width: 48px; height: 48px; object-fit: contain; }
.login-box h2 { margin: 0 0 6px; color: #fff; font-size: 20px; font-weight: 700; }
.login-box .sub { margin: 0 0 24px; color: rgba(255, 255, 255, .72); font-size: 13px; }
.login-card { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 30px 28px; text-align: left; }
.login-card label { display: block; font-size: 12px; color: var(--text-sub); margin: 0 0 6px; }
.login-card input {
  width: 100%; height: 40px; border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 0 12px; margin-bottom: 16px; outline: none;
}
.login-card input:focus { border-color: var(--c-teal); box-shadow: 0 0 0 3px rgba(21, 104, 128, .12); }
.login-card .btn { width: 100%; margin-top: 4px; }
.login-tip { margin-top: 18px; text-align: center; font-size: 12px; color: rgba(255, 255, 255, .72); }

/* ---------- 页脚 ---------- */
.site-footer {
  background: #fff; border-top: 1px solid var(--border);
  padding: 22px 24px 26px; text-align: center;
}
.footer-name { font-size: 13px; font-weight: 600; color: var(--c-blue); margin-bottom: 6px; }
.footer-note { font-size: 11px; color: var(--text-mute); line-height: 1.9; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .table-head, .table-row { grid-template-columns: 44px minmax(190px, 2fr) 96px 96px 108px 100px 130px; }
  .col-spec, .cell-spec { display: none; }
  .hero-badges { display: none; }
}
@media (max-width: 820px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .nav a { white-space: nowrap; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 23px; }
  .hero { padding-bottom: 66px; }
  .table-head, .table-row { grid-template-columns: 36px minmax(150px, 2fr) 92px 96px 96px; }
  .col-region, .cell-region, .col-cat, .cell-cat, .col-status, .cell-status { display: none; }
  .filter-panel input { width: 100%; }
  .filter-count { width: 100%; margin-left: 0; }
}
