* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #FF6B35;
  --primary-dark: #E15500;
  --bg: #FBF7F4;
  --text: #2B2420;
  --muted: #837A74;
  --line: #F1EAE4;
  --card: #fff;
}
html, body { height: 100%; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }

/* 登录 */
.login-mask { position: fixed; inset: 0; background: linear-gradient(135deg, #FF8A4C, #FF5E3A); display: flex; align-items: center; justify-content: center; z-index: 100; }
.login-box { background: #fff; border-radius: 20px; padding: 40px 36px; width: 320px; box-shadow: 0 20rpx 60rpx rgba(0,0,0,0.2); }
.login-logo { font-size: 26px; font-weight: 800; text-align: center; }
.login-sub { text-align: center; color: var(--muted); margin: 6px 0 24px; font-size: 14px; }
.login-input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; margin-bottom: 14px; font-size: 14px; outline: none; }
.login-input:focus { border-color: var(--primary); }
.login-btn { width: 100%; height: 44px; border: none; border-radius: 10px; background: var(--primary); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.login-err { color: #C0392B; font-size: 13px; margin-top: 12px; text-align: center; min-height: 18px; }

/* 布局 */
.app { display: flex; height: 100vh; }
.sidebar { width: 248px; background: #171B26; border-right: 0; display: flex; flex-direction: column; color:#fff; }
.brand { font-size: 18px; font-weight: 800; padding: 24px 20px 18px; color: #fff; border-bottom:1px solid rgba(255,255,255,.08); }
.nav { flex: 1; overflow-y: auto; padding: 8px; }
.nav-group { font-size: 12px; color: var(--muted); padding: 14px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom:3px; border-radius: 9px; cursor: pointer; font-size: 14px; color: #C9CDD8; }
.nav-item:hover { background: rgba(255,255,255,.07); color:#fff; }
.nav-item.active { background: linear-gradient(135deg,var(--primary),#ff865d); color: #fff; font-weight: 600; box-shadow:0 7px 18px rgba(255,107,53,.25); }
.side-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: #A9AFBE; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 64px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; }
.crumb { font-size: 16px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.theme-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--primary); display: inline-block; }
.content { flex: 1; overflow-y: auto; padding: 28px; background:#F7F8FA; }

/* 子标签 */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 8px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }

/* 区块标题 */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 16px; font-weight: 700; }
.btn { border: none; border-radius: 10px; padding: 9px 18px; font-size: 14px; cursor: pointer; font-weight: 600; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 13px; }

/* 表格/卡片列表 */
.card { background: var(--card); border-radius: 14px; box-shadow: 0 4rpx 18rpx rgba(43,36,32,0.05); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: #FBF7F4; color: var(--muted); font-weight: 600; font-size: 13px; }
.table tr:hover td { background: #FFFCF9; }
.row-actions { display: flex; gap: 8px; }
.link-btn { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 13px; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: #FFF1E6; color: var(--primary-dark); }
.tag-off { background: #EFEFEF; color: #999; }
.tag-green { background: #E7F7EE; color: #1A9C5B; }
.tag-red { background: #FDECEC; color: #C0392B; }
.tag-danger { background: #FDECEC; color: #C0392B; }
.tag-warn { background: #FFF4E0; color: #B7791F; }
.swatch { width: 18px; height: 18px; border-radius: 4px; display: inline-block; vertical-align: middle; border: 1px solid var(--line); }

/* 弹层 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 60; }
.modal { background: #fff; border-radius: 16px; width: 520px; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* 表单 */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input[type=text], .field input[type=number], .field input[type=date], .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 14px; outline: none; font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); }
.field textarea { min-height: 72px; resize: vertical; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }
.inline { display: flex; align-items: center; gap: 8px; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] { width: 44px; height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
.check-list { display: flex; flex-wrap: wrap; gap: 10px; }
.check-item { display: flex; align-items: center; gap: 6px; font-size: 13px; }

.toast { position: fixed; left: 50%; top: 30px; transform: translateX(-50%); background: rgba(43,36,32,0.92); color: #fff; padding: 10px 20px; border-radius: 10px; font-size: 14px; z-index: 200; }
.preview-bar { height: 14px; border-radius: 8px 8px 0 0; }
.ro-val { padding: 9px 12px; font-size: 14px; color: var(--muted); background: #FAF7F4; border: 1px dashed var(--line); border-radius: 8px; word-break: break-all; }
.image-field input[type=file]{margin-bottom:8px}
.upload-tip{font-size:12px;color:#999;margin-bottom:8px}
.image-preview{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.image-preview img{width:86px;height:70px;object-fit:cover;border-radius:8px;border:1px solid #eee}
.ex-group{margin:12px 0;padding:14px 16px}
.ex-group-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.ex-checks{display:flex;flex-wrap:wrap;gap:8px 18px}
.ex-item{display:flex;align-items:center;gap:6px;font-size:14px;cursor:pointer}
/* 运营活动/站点/风控 模块样式 */
.ops-group{margin:18px 0}
.ops-group h3{font-size:15px;color:var(--primary,#FF6B35);margin:10px 2px}
.ops-card{border:1px solid #eee;border-radius:12px;padding:14px 16px;margin:10px 0;background:#fff}
.ops-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:6px}
.ops-head .muted{font-size:12px}
.ops-row{display:flex;flex-wrap:wrap;gap:10px 16px;align-items:center;margin-top:8px}
.ops-row .num{width:70px;padding:5px 8px;border:1px solid #ddd;border-radius:8px;font-size:14px}
.ops-row span{font-size:13px;color:#555;display:flex;align-items:center;gap:4px}
.inline{display:flex;align-items:center;gap:6px;font-size:13px}
.ops-save{margin-left:auto}
/* 运营活动二级分类 */
.cat-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.cat-tab{border:1px solid #eee;background:#fff;border-radius:20px;padding:6px 14px;font-size:13px;color:#555;cursor:pointer}
.cat-tab.on{background:var(--primary,#FF6B35);color:#fff;border-color:var(--primary,#FF6B35)}
.ops-global{display:flex;flex-wrap:wrap;align-items:center;gap:12px;background:#fff;border:1px solid #eee;border-radius:12px;padding:12px 16px;margin:10px 0}
.ops-global .num{width:80px;padding:5px 8px;border:1px solid #ddd;border-radius:8px}
.ops-list{margin-top:8px}
.tag-sub{background:#eef;border:1px solid #dce;border-radius:6px;font-size:12px;color:#557;padding:1px 8px}
.ops-row .sel,.ops-row .txt{padding:5px 8px;border:1px solid #ddd;border-radius:8px;font-size:14px}
.ops-row .txt{width:90px}

/* 新后台信息架构 */
.page-intro{display:flex;align-items:center;gap:14px;background:linear-gradient(135deg,#fff7f2,#fff);border:1px solid #ffe2d5;border-radius:14px;padding:16px 20px;margin-bottom:18px}
.page-intro b{font-size:18px;color:#222;white-space:nowrap}.page-intro span{font-size:13px;color:#7d746f}
.ops-subnav{display:flex;gap:8px;background:#fff;border-radius:12px;padding:6px;margin-bottom:18px;border:1px solid #eceef2;width:max-content}
.ops-sub{border:0;background:transparent;border-radius:8px;padding:9px 18px;color:#667085;cursor:pointer;font-weight:600}.ops-sub.on{background:var(--primary);color:#fff}
.ops-workspace{display:grid;grid-template-columns:180px minmax(0,1fr);gap:18px;align-items:start}
.activity-side{background:#fff;border:1px solid #eceef2;border-radius:14px;padding:8px;display:flex;flex-direction:column;gap:3px;position:sticky;top:0}
.activity-side .cat-tab{border:0;border-radius:8px;text-align:left;padding:11px 13px;background:transparent}.activity-side .cat-tab:hover{background:#fff4ee}.activity-side .cat-tab.on{background:#fff0e8;color:var(--primary);font-weight:700}
.ops-main{min-width:0}.ops-card{border-color:#E7E9EE;padding:18px 20px;box-shadow:0 4px 16px rgba(16,24,40,.04)}
.ops-head b{font-size:16px}.ops-row{background:#FAFAFB;border-radius:10px;padding:10px 12px}.ops-save{min-width:84px}
.simple-config{margin-top:12px;padding:14px;background:#FFF9F5;border:1px solid #FFE7D8;border-radius:10px;display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-end}
.simple-config>b{width:100%;font-size:14px}.simple-config .help{width:100%;font-size:12px;color:#8b817c}.simple-config label{font-size:12px;color:#667085;display:flex;flex-direction:column;gap:5px}.simple-config input,.simple-config select,.simple-config textarea{border:1px solid #dfe2e8;border-radius:7px;padding:7px 9px;background:#fff;min-width:145px}.simple-config textarea{width:100%;min-height:86px;resize:vertical}
.settings-card{background:#fff;border:1px solid #eceef2;border-radius:14px;padding:18px 20px;display:flex;flex-wrap:wrap;gap:14px;align-items:flex-end;margin-bottom:20px}.settings-card label{display:flex;flex-direction:column;gap:6px;font-size:12px;color:#667085}.settings-card input,.settings-card select{height:38px;border:1px solid #dfe2e8;border-radius:8px;padding:0 10px;min-width:170px}
.set-row{display:flex;align-items:center;gap:12px;font-size:13px;color:#344054}
.seg-toggle{display:inline-flex;border:1px solid #dfe2e8;border-radius:9px;overflow:hidden}
.seg-btn{background:#fff;border:none;padding:8px 16px;cursor:pointer;font-size:13px;color:#667085}
.seg-btn.on{background:var(--primary);color:#fff}
.set-hint{width:100%;font-size:12px;color:#98a2b3}
.split-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.metric-grid{display:grid;grid-template-columns:repeat(4,minmax(120px,1fr));gap:14px;margin-bottom:20px}.metric{background:#fff;border:1px solid #eceef2;border-radius:14px;padding:20px}.metric b{display:block;font-size:28px;color:#1d2939}.metric span{font-size:13px;color:#98a2b3;margin-top:6px;display:block}
.data-card{padding:20px}.data-card h3{margin-bottom:14px}.data-card p{font-size:13px;color:#667085;margin-bottom:16px}.data-card .btn{margin-right:8px}.data-row{display:flex;justify-content:space-between;padding:10px 0;border-bottom:1px solid #f0f1f3}.empty-state{padding:50px;text-align:center;background:#fff;border-radius:14px;color:#98a2b3}.danger{color:#d92d20}
/* 运营活动编辑器（签到 / 转盘 / 答题 / 礼品 / 门店） */
.ops-edit{border:1px solid #E7E9EE;border-radius:12px;padding:18px 20px;margin:10px 0;background:#fff;box-shadow:0 4px 16px rgba(16,24,40,.04)}
.cfg-title{font-weight:600;margin:14px 0 6px;color:#344054;font-size:14px}
.cfg-scalar{display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center;margin:8px 0}
.cfg-scalar span{font-size:13px;color:#555;display:flex;align-items:center;gap:5px}
.cfg-scalar .num{width:72px;padding:5px 8px;border:1px solid #ddd;border-radius:8px;font-size:14px}
.cfg-list{display:flex;flex-direction:column;gap:8px;margin:8px 0}
.cfg-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;background:#FAFAFB;border:1px solid #eee;border-radius:9px;padding:9px 11px}
.cfg-row span{font-size:13px;color:#555;display:flex;align-items:center;gap:5px}
.cfg-row .num{width:74px;padding:5px 8px;border:1px solid #ddd;border-radius:8px;font-size:14px}
.cfg-row input[type=text]{width:180px;padding:5px 8px;border:1px solid #ddd;border-radius:8px;font-size:14px}
.qn-block input[type=text]{width:200px}
.q-rewards{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.inv-row{display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid #f2f3f5}
.inv-row .num{width:84px;padding:5px 8px;border:1px solid #ddd;border-radius:8px}
.exchange-metrics{margin-top:16px}.metric-warn{border-color:#fed7aa;background:#fffaf5}.metric-warn b,.text-danger{color:#d92d20!important}
.goods-cell{display:flex;align-items:center;gap:10px;min-width:190px}.goods-cell img,.goods-thumb{width:44px;height:44px;flex:0 0 44px;border-radius:10px;object-fit:cover;background:#fff4e8;display:flex;align-items:center;justify-content:center;font-size:22px}.goods-cell b,.goods-cell small{display:block}.goods-cell small{max-width:210px;margin-top:4px;color:#98a2b3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mode-choice{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:18px}.mode-choice-item{position:relative;padding:14px;border:1px solid #e4e7ec;border-radius:12px;cursor:pointer}.mode-choice-item:has(input:checked){border-color:#ff7a32;background:#fff8f2;box-shadow:0 0 0 1px #ff7a32}.mode-choice-item input{position:absolute;right:12px;top:12px}.mode-choice-item b,.mode-choice-item small{display:block;padding-right:20px}.mode-choice-item small{margin-top:6px;color:#98a2b3;line-height:1.45}
.form-help{margin-top:7px;color:#98a2b3;font-size:12px;line-height:1.5}.config-tip{padding:12px 14px;color:#69533e;background:#fff8ed;border:1px solid #ffead0;border-radius:10px;line-height:1.6}.mode-detail input,.mode-detail select{margin-top:8px}.delivery-info{max-width:260px;white-space:normal;line-height:1.5}
@media(max-width:1100px){.sidebar{width:210px}.ops-workspace{grid-template-columns:150px minmax(0,1fr)}.split-grid{grid-template-columns:1fr}.metric-grid{grid-template-columns:repeat(2,1fr)}}

/* 订单流转审计模块 */
.pager{display:flex;align-items:center;gap:14px;justify-content:center;padding:16px 0}
.pager .muted{font-size:13px}
.trace-box{margin:4px 0 14px;background:#FAFAFB;border:1px solid #eceef2;border-radius:12px;padding:12px 14px}
.trace-card .data-row{padding:8px 0;border-bottom:1px dashed #eee}
.trace-card .data-row:last-child{border-bottom:none}
.trace-logs{margin-top:10px;max-height:280px;overflow-y:auto;border-top:1px solid #eee;padding-top:8px}
.trace-log{display:flex;gap:10px;align-items:baseline;padding:7px 0;border-bottom:1px dashed #f0f1f3;font-size:12.5px;line-height:1.5}
.trace-log:last-child{border-bottom:none}
.trace-warn{background:#FFF6F5;border-radius:6px;padding:7px 8px;margin:2px -8px}
.tl-time{color:#98a2b3;white-space:nowrap;min-width:138px}
.tl-event{color:#FF6B35;font-weight:600;min-width:96px;white-space:nowrap}
.tl-move{color:#475467;min-width:120px;white-space:nowrap}
.tl-detail{color:#667085;flex:1;word-break:break-all}

/* 看视频 / 分享 / 闯关 / 邀请 编辑器 */
.src-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.src-f{display:flex;align-items:center;gap:4px}
.src-f input{width:120px;padding:5px 8px;border:1px solid #ddd;border-radius:8px}
.tw-from,.tw-to{width:80px;padding:5px 8px;border:1px solid #ddd;border-radius:8px}
.cfg-row .lv-num{width:60px}.cfg-row .lv-reward{width:90px}
.ms-count{width:70px}.ms-bal{width:90px}.ms-pts{width:70px}

/* ===== 数据管理仪表盘 ===== */
.dash-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:16px}
.dash-card{padding:16px 18px;cursor:default}
.dash-card.dragging{opacity:.45}
.dash-card.drag-over{outline:2px dashed #4f7cff;outline-offset:2px}
.dash-head{display:flex;align-items:center;gap:8px;margin-bottom:12px;flex-wrap:wrap}
.dash-head b{font-size:15px;color:#243044}
.dash-head-right{margin-left:auto;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.dash-drag{cursor:grab;color:#b6bfd0;font-size:15px;user-select:none}
.dash-drag:active{cursor:grabbing}
.dash-input{padding:5px 8px;border:1px solid #ddd;border-radius:8px;font-size:13px;background:#fff;color:#243044}
.dash-sep{color:#8a94a6;font-size:12px}
.dash-metrics{display:flex;gap:20px;flex-wrap:wrap;margin-bottom:10px}
.dash-metric b{display:block;font-size:24px;font-weight:700;color:#243044;line-height:1.2}
.dash-metric span{font-size:12px;color:#8a94a6}
.dash-metric-hero b{font-size:30px;color:#4f7cff}
.dash-up{color:#ef5b6b!important}
.dash-down{color:#2fbf71!important}
.dash-chart-title{font-size:12.5px;color:#667085;margin:6px 0 4px}
.dash-chart{width:100%;height:auto;display:block}
.dash-pie-wrap{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.dash-pie{width:150px;height:150px;flex:none}
.dash-legend{font-size:13px;color:#475467;display:flex;flex-direction:column;gap:8px}
.dash-legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:6px}
.dash-sub{font-size:12px;color:#98a2b3;margin-top:8px}
.dash-yoy{display:flex;gap:16px;flex-wrap:wrap;font-size:12.5px;color:#667085;margin-top:6px}
.seg-mini{display:inline-flex;background:#f2f4f8;border-radius:8px;padding:2px}
.seg-mini-btn{border:none;background:transparent;padding:4px 12px;font-size:12.5px;border-radius:6px;cursor:pointer;color:#667085}
.seg-mini-btn.active{background:#fff;color:#4f7cff;font-weight:600;box-shadow:0 1px 3px rgba(16,24,40,.12)}
@media(max-width:1100px){.dash-grid{grid-template-columns:1fr}}
.master-metrics{grid-template-columns:repeat(3,minmax(150px,1fr))}
.master-panel{padding:20px}
.health-item{display:flex;align-items:center;justify-content:space-between;padding:13px 0;border-bottom:1px solid #f0f1f3;color:#667085}
.health-item:last-child{border-bottom:0}.health-item b{color:#344054}.health-item.warn b{color:#d97706}
.master-settings{max-width:760px;padding:24px}.settings-subtitle{margin-top:24px!important}
.master-settings .config-tip{margin:18px 0}.master-settings>.btn{margin-top:6px}
@media(max-width:800px){.master-metrics{grid-template-columns:repeat(2,1fr)}}
.activity-metrics{grid-template-columns:repeat(5,minmax(120px,1fr))}
.ops-guide{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin-bottom:16px;padding:12px 16px;border:1px solid #ffead0;border-radius:12px;background:#fffaf3;color:#7a5b3b;font-size:13px}
.ops-guide span:first-child{font-weight:700;color:#d65d14}.cat-tab{display:flex;align-items:center;justify-content:space-between;gap:8px}.cat-tab em{min-width:22px;padding:2px 7px;border-radius:12px;background:#f2f4f7;color:#667085;font-style:normal;font-size:11px;text-align:center}.cat-tab.on em{background:#ffdbc8;color:#d84f0d}
.activity-meta{display:flex;flex-wrap:wrap;gap:7px;margin:9px 0}.activity-meta span{padding:4px 8px;border-radius:6px;background:#f5f6f8;color:#667085;font-size:12px}.activity-result{display:flex;flex-wrap:wrap;gap:20px;margin:12px 0;padding:11px 13px;border-radius:9px;background:#f8fafc;color:#667085;font-size:12px}.activity-result b{margin-left:4px;color:#344054}
@media(max-width:1200px){.activity-metrics{grid-template-columns:repeat(3,1fr)}}@media(max-width:800px){.activity-metrics{grid-template-columns:repeat(2,1fr)}}
