/* ==========================================================================
   活动报名 · Web 管理后台
   配色 / 圆角 / 层次对齐 UI原型.html 第五节（城市代理后台）与第六节（总后台）
   主色 #07C160；辅助 橙 #ff7d00 / 红 #f53f3f / 蓝 #165dff
   字体使用系统字体栈，无任何外链资源
   ========================================================================== */

:root {
  --green: #07c160;
  --green-dark: #059b4d;
  --green-soft: #e8ffea;
  --orange: #ff7d00;
  --orange-soft: #fff7e8;
  --red: #f53f3f;
  --red-soft: #ffece8;
  --blue: #165dff;
  --blue-soft: #e8f3ff;
  --t1: #1f2329;
  --t2: #4e5969;
  --t3: #86909c;
  --line: #e5e6eb;
  --line-2: #f2f3f5;
  --bg: #f7f8fa;
  --bg-2: #fafbfc;
  --side-agent: #001529;
  --side-admin: #0d1b3e;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 4px rgba(0, 0, 0, .05);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, .16);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--t1);
  background: var(--bg);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.muted { color: var(--t3); }
.dim { color: var(--t2); }
.small { font-size: 11px; }
.strong { font-weight: 600; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; }
.flex-gap { display: flex; align-items: center; gap: 8px; }
.flex-1 { flex: 1; min-width: 0; }
.spacer { flex: 1; }

/* ==========================================================================
   登录页
   ========================================================================== */
.login-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(7, 193, 96, .14), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(22, 93, 255, .12), transparent 60%),
    #f0f2f5;
}
.login-card {
  width: 400px;
  max-width: 100%;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .10);
  overflow: hidden;
}
.login-brand {
  padding: 26px 28px 20px;
  background: linear-gradient(135deg, #07c160, #0ad071);
  color: #fff;
}
.login-brand .t { font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.login-brand .s { font-size: 12px; opacity: .88; margin-top: 6px; }
.login-body { padding: 22px 28px 26px; }
.login-tabs { display: flex; gap: 6px; background: var(--line-2); border-radius: 8px; padding: 4px; }
.login-tab {
  flex: 1; text-align: center; font-size: 12px; padding: 8px 0; border-radius: 6px;
  color: var(--t2); user-select: none;
}
.login-tab.on { background: #fff; color: var(--green); font-weight: 700; box-shadow: var(--shadow); }
.login-field { margin-top: 16px; }
.login-field label { display: block; font-size: 12px; color: var(--t2); margin-bottom: 6px; }
.login-hint { font-size: 11px; color: var(--t3); margin-top: 14px; line-height: 1.8; }
.login-hint b { color: var(--t2); font-weight: 600; }
.login-err {
  margin-top: 14px; font-size: 12px; color: var(--red); background: var(--red-soft);
  border-radius: 6px; padding: 8px 10px; line-height: 1.6;
}

.inp {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 12px;
  color: var(--t1);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.inp { height: auto; padding: 8px 10px; line-height: 1.6; resize: vertical; }
.inp:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(7, 193, 96, .12); }
.inp:disabled { background: var(--bg-2); color: var(--t3); cursor: not-allowed; }
.inp.lg { height: 40px; font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--t2);
  font-size: 12px; line-height: 1; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:hover { border-color: #c9cdd4; color: var(--t1); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.danger:hover { filter: brightness(.94); }
.btn.ghost { background: #fff; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.block { width: 100%; height: 38px; font-size: 13px; }
.btn.sm { height: 26px; padding: 0 10px; font-size: 11px; }
.btn.lg { height: 36px; padding: 0 18px; font-size: 13px; }

/* ==========================================================================
   后台主框架
   ========================================================================== */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.side {
  width: 202px; flex: none; display: flex; flex-direction: column;
  background: var(--side-agent); color: rgba(255, 255, 255, .65);
  overflow-y: auto;
}
.app-shell[data-role="admin"] .side { background: var(--side-admin); }
.side .logo {
  color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .4px;
  padding: 18px 18px 14px; border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.side .logo small { display: block; font-size: 11px; font-weight: 400; color: rgba(255, 255, 255, .55); margin-top: 4px; }
.side-nav { padding: 10px 0 16px; }
.mi {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 18px; font-size: 12.5px; cursor: pointer;
  border-left: 3px solid transparent; position: relative;
  transition: background .15s, color .15s;
}
.mi svg { flex: none; opacity: .9; }
.mi:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.mi.on { color: #fff; background: var(--green); border-left-color: rgba(255, 255, 255, .55); font-weight: 600; }
.mi.on:hover { background: var(--green); }
.side-foot { margin-top: auto; padding: 14px 18px 18px; font-size: 11px; color: rgba(255, 255, 255, .38); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.topbar {
  height: 52px; flex: none; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px; gap: 12px;
}
.topbar .tb-l { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar .tb-title { font-size: 15px; font-weight: 700; }
.topbar .tb-sub { font-size: 11px; color: var(--t3); }
.topbar .tb-r { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--t3); }
.topbar .who { color: var(--t2); font-weight: 600; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 3px 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--t2);
}
.chip.green { background: var(--green-soft); border-color: #b7f0c5; color: var(--green-dark); }

.content { flex: 1; overflow-y: auto; padding: 16px 20px 40px; }

/* ==========================================================================
   统计卡
   ========================================================================== */
.stat-row { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.stat {
  flex: 1 1 160px; min-width: 150px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .n { font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -.2px; }
.stat .t { font-size: 11px; color: var(--t3); margin-top: 5px; }
.stat .sub { font-size: 11px; color: var(--t3); margin-top: 3px; }
.stat .n.green { color: var(--green); }
.stat .n.orange { color: var(--orange); }
.stat .n.blue { color: var(--blue); }
.stat .n.red { color: var(--red); }

/* ==========================================================================
   面板 / 表格
   ========================================================================== */
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 14px;
}
.panel.flush { padding: 14px 0 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-title { font-size: 13.5px; font-weight: 700; }
.panel-title .muted { font-weight: 400; font-size: 11px; margin-left: 8px; }
.panel-sub { font-size: 11px; color: var(--t3); margin-top: 4px; }
.panel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th {
  text-align: left; color: var(--t3); font-weight: 400; white-space: nowrap;
  padding: 9px 10px; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
td { padding: 10px 10px; border-bottom: 1px solid var(--line-2); color: var(--t2); vertical-align: middle; }
tbody tr:hover td { background: #fcfdfe; }
tbody tr:last-child td { border-bottom: 1px solid var(--line-2); }
td .cell-title { color: var(--t1); font-weight: 600; font-size: 12px; }
td .cell-sub { color: var(--t3); font-size: 11px; margin-top: 3px; }
td .cell-price { color: var(--red); font-weight: 700; }
td .cell-money { color: var(--t1); font-weight: 600; }

.pill { display: inline-block; font-size: 10.5px; border-radius: 8px; padding: 1.5px 8px; line-height: 1.6; white-space: nowrap; }
.pill.g { background: var(--green-soft); color: #00b42a; }
.pill.o { background: var(--orange-soft); color: var(--orange); }
.pill.r { background: var(--red-soft); color: var(--red); }
.pill.b { background: var(--blue-soft); color: var(--blue); }
.pill.gray { background: var(--line-2); color: var(--t3); }

.link { color: var(--blue); cursor: pointer; margin-right: 10px; font-size: 12px; white-space: nowrap; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--red); }
.link.muted { color: var(--t3); }
.link.disabled { color: #c9cdd4; cursor: not-allowed; text-decoration: none; }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0 2px; }

/* ==========================================================================
   表单（活动编辑）
   ========================================================================== */
.f-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.f-item { flex: 1 1 200px; min-width: 0; }
.f-item.wide { flex: 1 1 100%; }
.f-item .fl { font-size: 11.5px; color: var(--t2); margin-bottom: 5px; display: flex; align-items: center; gap: 4px; }
.f-item .fl .req { color: var(--red); font-style: normal; }
.f-item .fh { font-size: 10.5px; color: var(--t3); margin-top: 4px; line-height: 1.6; }
.f-item.check { display: flex; align-items: flex-end; }

.switch-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--t2); margin-bottom: 12px; }
.switch-line { display: inline-flex; align-items: center; gap: 8px; }
.switch {
  width: 38px; height: 21px; border-radius: 11px; background: var(--green); position: relative;
  display: inline-block; vertical-align: middle; transition: background .18s; cursor: pointer; flex: none;
}
.switch::after {
  content: ""; position: absolute; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; top: 2px; right: 2px; transition: right .18s, left .18s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.switch.off { background: #c9cdd4; }
.switch.off::after { right: auto; left: 2px; }
.switch.disabled { opacity: .5; cursor: not-allowed; }
.switch-text { font-size: 11.5px; color: var(--t2); min-width: 30px; }

.rte-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.rte-tab { font-size: 11.5px; padding: 4px 12px; border-radius: 6px 6px 0 0; color: var(--t2); background: var(--line-2); cursor: pointer; }
.rte-tab.on { background: var(--green); color: #fff; font-weight: 600; }
.rte-preview {
  min-height: 180px; border: 1px dashed var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 12.5px; line-height: 1.9; color: var(--t2); background: #fff;
  overflow-x: auto;
}
.rte-preview h3 { font-size: 13.5px; color: var(--t1); margin: 12px 0 6px; }
.rte-preview p { margin: 6px 0; }
.rte-preview img { max-width: 100%; border-radius: 4px; }
.rte-preview ul, .rte-preview ol { padding-left: 20px; margin: 6px 0; }

/* 表单 schema 编辑器 */
.schema-table input.inp, .schema-table select.inp { height: 28px; font-size: 11.5px; padding: 0 6px; }
.schema-table td { padding: 6px 6px; }
.schema-table .col-mini { width: 60px; }
.schema-table .col-opt { min-width: 170px; }
.schema-table .col-act { width: 148px; white-space: nowrap; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 5px;
  background: #fff; color: var(--t2); font-size: 12px; line-height: 1;
}
.icon-btn:hover { border-color: var(--green); color: var(--green); }
.icon-btn.del:hover { border-color: var(--red); color: var(--red); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ==========================================================================
   筛选栏 / 分页 / 提示条
   ========================================================================== */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-bar .inp { width: auto; }
.filter-bar .inp.search { width: 220px; }
.filter-bar select.inp { min-width: 130px; padding-right: 4px; }

.note {
  font-size: 11.5px; color: var(--t3); background: #fffbe8;
  border: 1px solid #ffe58f; border-radius: var(--radius-sm);
  padding: 9px 12px; margin-bottom: 14px; line-height: 1.8;
}
.note b { color: var(--t2); }
.note.blue { background: var(--blue-soft); border-color: #bedaff; }
.note.green { background: var(--green-soft); border-color: #b7f0c5; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; flex-wrap: wrap; }
.pg-info { font-size: 11px; color: var(--t3); }
.pg-list { display: flex; align-items: center; gap: 4px; }
.pg {
  min-width: 28px; height: 26px; padding: 0 8px; border-radius: 5px;
  border: 1px solid var(--line); background: #fff; color: var(--t2); font-size: 11.5px;
}
.pg:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.pg.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.pg:disabled { opacity: .45; cursor: not-allowed; }
.pg-gap { color: var(--t3); padding: 0 2px; }

/* ==========================================================================
   加载 / 空态 / 错误
   ========================================================================== */
.state-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 44px 16px; color: var(--t3); font-size: 12px;
}
.state-block.empty .empty-ico { font-size: 26px; color: #c9cdd4; line-height: 1; }
.state-block .empty-t { font-size: 12.5px; color: var(--t2); }
.state-block .empty-h { font-size: 11px; color: var(--t3); }
.state-block.error .empty-ico {
  width: 26px; height: 26px; border-radius: 50%; background: var(--red-soft); color: var(--red);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--green);
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skel-wrap { padding: 6px 0; }
.skel-row { display: flex; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line-2); }
.skel {
  flex: 1; height: 12px; border-radius: 4px;
  background: linear-gradient(90deg, #f2f3f5 25%, #e9ebef 37%, #f2f3f5 63%);
  background-size: 400% 100%; animation: skel 1.3s ease infinite;
}
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ==========================================================================
   toast
   ========================================================================== */
.toast-host {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  max-width: 560px; padding: 9px 16px; border-radius: var(--radius-sm);
  background: #fff; color: var(--t1); font-size: 12.5px; line-height: 1.5;
  border: 1px solid var(--line); box-shadow: 0 6px 22px rgba(0, 0, 0, .14);
  opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: #b7f0c5; color: #00893a; background: #f2fff5; }
.toast.error { border-color: #ffc9c2; color: #c22c22; background: #fff6f4; }
.toast.warn { border-color: #ffe58f; color: #a86200; background: #fffdf2; }

/* ==========================================================================
   弹窗
   ========================================================================== */
dialog.dlg {
  border: none; border-radius: 10px; padding: 0; width: 460px; max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-lg); background: #fff; color: var(--t1); font-size: 13px;
}
dialog.dlg::backdrop { background: rgba(15, 22, 36, .42); }
.dlg-head { padding: 16px 20px 10px; }
.dlg-title { font-size: 14px; font-weight: 700; }
.dlg-main { padding: 0 20px 6px; max-height: 62vh; overflow-y: auto; }
.dlg-msg { font-size: 12.5px; color: var(--t2); line-height: 1.8; }
.dlg-field { margin-bottom: 12px; }
.dlg-label { display: block; font-size: 11.5px; color: var(--t2); margin-bottom: 5px; }
.dlg-label .req { color: var(--red); font-style: normal; }
.dlg-hint { font-size: 10.5px; color: var(--t3); margin-top: 4px; }
.dlg-err { margin: 4px 0 10px; font-size: 11.5px; color: var(--red); background: var(--red-soft); border-radius: 5px; padding: 7px 9px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; }
.chk-line { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--t2); cursor: pointer; }
.chk-line input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--green); }

/* ==========================================================================
   核销页
   ========================================================================== */
.verify-box { display: flex; gap: 10px; align-items: flex-start; }
.verify-box .inp { flex: 1; height: 40px; font-size: 14px; letter-spacing: 1px; }
.verify-box .btn { height: 40px; padding: 0 20px; font-size: 13px; }
.verify-result { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.verify-result .vr-head { background: var(--bg-2); padding: 10px 14px; font-size: 12px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.verify-result .vr-body { padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; }
.vr-item .k { font-size: 11px; color: var(--t3); margin-bottom: 3px; }
.vr-item .v { font-size: 12.5px; color: var(--t1); font-weight: 500; word-break: break-all; }
.vr-foot { padding: 0 14px 14px; display: flex; justify-content: flex-end; gap: 8px; }

/* ==========================================================================
   详情 / 键值展示
   ========================================================================== */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 18px; }
.kv .k { font-size: 11px; color: var(--t3); margin-bottom: 3px; }
.kv .v { font-size: 12.5px; color: var(--t1); word-break: break-all; }

.form-data-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.form-data-chips .fdc {
  font-size: 10.5px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 6px; color: var(--t2); white-space: nowrap;
}
.form-data-chips .fdc b { color: var(--t3); font-weight: 400; }

/* ==========================================================================
   其它
   ========================================================================== */
.badge-role {
  font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--green-soft);
  color: var(--green-dark); vertical-align: middle; margin-left: 6px; font-weight: 600;
}
.split { height: 1px; background: var(--line-2); margin: 14px 0; }
.inline-tip { font-size: 11px; color: var(--t3); line-height: 1.7; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1180px) {
  .two-col { grid-template-columns: 1fr; }
  .side { width: 176px; }
  .content { padding: 14px 14px 32px; }
}
@media (max-width: 860px) {
  .app-shell { flex-direction: column; height: auto; min-height: 100vh; }
  .side { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; }
  .side .logo { border-bottom: none; border-right: 1px solid rgba(255, 255, 255, .1); padding: 12px 14px; white-space: nowrap; }
  .side-nav { display: flex; padding: 0; }
  .mi { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .mi.on { border-left: none; border-bottom-color: #fff; }
  .side-foot { display: none; }
}
