/* 运营后台视觉：暖白纸底 + 墨色侧栏 + 品牌橙，信息密度高于小程序端 */

:root {
  --bg: #f4efe7;
  --surface: #fffdf9;
  --surface-2: #faf5ed;
  --surface-3: #f2ebe1;
  --ink: #1b1510;
  --ink-2: #4f443a;
  --muted: #736859;
  --muted-2: #968b7f;
  --line: #e8dfd3;
  --line-2: #d9cfc1;
  --brand: #fc6800;
  --brand-deep: #d95500;
  --brand-soft: #fdeee2;
  --jade: #2f7d5c;
  --jade-soft: #e7f1ec;
  --gold: #b9892f;
  --gold-soft: #f8f0df;
  --danger: #b8452c;
  --danger-soft: #fbeae4;
  --shadow-1: 0 1px 2px rgba(64, 40, 18, 0.05), 0 10px 24px -20px rgba(64, 40, 18, 0.28);
  --shadow-2: 0 24px 60px -28px rgba(30, 20, 10, 0.4);
  --page-max: 1800px;
  --page-pad: 34px;
  --grid-gap: 16px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.num,
.mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}

.muted {
  color: var(--muted);
}

.ink2 {
  color: var(--ink-2);
}

.small {
  font-size: 12px;
}

/* ---------- 布局 ---------- */

.app {
  min-height: 100vh;
}

.rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 236px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  color: #fff;
  background:
    radial-gradient(120% 60% at 10% 0%, rgba(252, 104, 0, 0.16), transparent 55%),
    linear-gradient(180deg, #241c15 0%, #171109 100%);
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 20px;
}

.rail-brand img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  box-shadow: 0 8px 18px -10px rgba(252, 104, 0, 0.8);
}

.rail-brand b {
  display: block;
  font-size: 15px;
  letter-spacing: -0.2px;
}

.rail-brand span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.42);
}

.rail-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 12px;
  scrollbar-width: none;
}

.rail-nav::-webkit-scrollbar {
  display: none;
}

.nav-title {
  padding: 12px 12px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.28);
}

.nav-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 37px;
  padding: 0 11px;
  margin-bottom: 1px;
  border-radius: 10px;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.62);
  transition: all 0.16s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
}

.nav-item.on {
  background: rgba(252, 104, 0, 0.14);
  color: #fff;
  font-weight: 600;
}

.nav-item.on::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2.5px;
  border-radius: 2px;
  background: var(--brand);
}

.nav-item svg {
  width: 15px;
  height: 15px;
  flex: none;
  opacity: 0.72;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.nav-item.on svg {
  opacity: 1;
  color: var(--brand);
}

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.rail-foot {
  padding: 14px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.38);
}

.rail-foot b {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.66);
}

.main {
  margin-left: 236px;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 62px;
  padding: 0;
  background: rgba(244, 239, 231, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(30, 20, 12, 0.06);
}

.topbar-inner {
  width: 100%;
  max-width: var(--page-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
}

.crumbs b {
  color: var(--ink);
  font-weight: 600;
}

.crumbs .sep {
  color: var(--muted-2);
}

.top-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.snapshot {
  font-size: 12px;
  color: var(--muted-2);
}

.top-btn {
  height: 32px;
  padding: 0 13px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.top-btn:hover {
  border-color: var(--line-2);
  background: #fff;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: linear-gradient(150deg, #4c4038, #221b16);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.top-user b {
  display: block;
  font-size: 12.5px;
}

.top-user em {
  display: block;
  font-style: normal;
  margin-top: 1px;
  font-size: 12px;
  color: var(--muted);
}

.view {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 26px var(--page-pad) 68px;
}

/* ---------- 通用排版 ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.page-head h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.7px;
}

.page-head .sub {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: linear-gradient(180deg, #ff822f 0%, #fc6800 55%, #ef5c00 100%);
  color: #fff;
  box-shadow: 0 10px 20px -12px rgba(236, 90, 0, 0.8);
}

.btn.ghost {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.btn.ghost:hover {
  border-color: var(--line-2);
  background: #fff;
}

.btn.soft {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.btn.danger-soft {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn.sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: 8px;
}

.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.link {
  color: var(--brand-deep);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}

/* ---------- 药丸 / 标签 ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--muted);
}

.pill.jade {
  background: var(--jade-soft);
  color: var(--jade);
}

.pill.brand {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.pill.gold {
  background: var(--gold-soft);
  color: var(--gold);
}

.pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.pill.mute {
  background: var(--surface-3);
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}

.sev {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
}

.sev .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.sev.red .dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(184, 69, 44, 0.12);
}

.sev.orange .dot {
  background: var(--brand);
}

.sev.yellow .dot {
  background: var(--gold);
}

.trend-up {
  color: var(--jade);
  font-size: 12px;
  font-weight: 600;
}

.trend-down {
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}

/* ---------- 卡片 / 指标 ---------- */

.card {
  background: var(--surface);
  border: 1px solid rgba(30, 20, 12, 0.055);
  border-radius: 16px;
  box-shadow: var(--shadow-1);
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(30, 20, 12, 0.055);
  border-radius: 16px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.1px;
}

.panel-head .panel-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.panel-body {
  padding: 14px 18px;
}

.panel-body.flush {
  padding: 0;
}

/* 直接挂在面板下的进度列表与商圈卡片需要内边距，避免贴边 */
.panel > .target-list,
.panel > .district-cards {
  padding: 16px 18px 18px;
}

.alert-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 18px;
  margin-bottom: var(--grid-gap);
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid rgba(184, 69, 44, 0.16);
  border-left: 3px solid var(--danger);
  box-shadow: var(--shadow-1);
}

.alert-banner .big {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--danger);
}

.alert-banner .body {
  flex: 1;
  min-width: 0;
}

.alert-banner b {
  display: block;
  font-size: 13.5px;
}

.alert-banner p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.alert-banner .acts {
  display: flex;
  gap: 8px;
  flex: none;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--grid-gap);
  margin-bottom: var(--grid-gap);
}

.kpi {
  padding: 15px 17px 16px;
  background: var(--surface);
  border: 1px solid rgba(30, 20, 12, 0.055);
  border-radius: 16px;
  box-shadow: var(--shadow-1);
}

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.kpi-head b {
  font-size: 13px;
  font-weight: 700;
}

.kpi-head span {
  font-size: 12px;
  color: var(--muted);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 12px;
}

.kpi-item {
  min-width: 0;
  cursor: pointer;
}

.kpi-item:hover .kpi-num {
  color: var(--brand-deep);
}

.kpi-num {
  display: block;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
}

.kpi-num em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
  margin-left: 2px;
}

.kpi-label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.kpi-delta {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}

.progress {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 8px;
}

.progress .bar {
  height: 100%;
  border-radius: 3px;
  background: var(--brand);
}

.progress .bar.jade {
  background: var(--jade);
}

.progress .bar.danger {
  background: var(--danger);
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--grid-gap);
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
}

/* ---------- 表格 ---------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--ink-2);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr.row-link {
  cursor: pointer;
  transition: background 0.12s;
}

.table tbody tr.row-link:hover {
  background: #fbf6ef;
}

.table td .strong {
  color: var(--ink);
  font-weight: 600;
}

.table td .sub {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.table .right {
  text-align: right;
}

.table .nowrap {
  white-space: nowrap;
}

.empty {
  padding: 48px 20px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted-2);
}

/* ---------- 工具条 ---------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.search {
  height: 34px;
  width: 250px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  outline: none;
}

.search:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(252, 104, 0, 0.12);
}

.seg {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.seg button {
  height: 27px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.seg button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(40, 25, 10, 0.1);
}

.chip {
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.chip.on {
  background: var(--brand-soft);
  border-color: rgba(252, 104, 0, 0.34);
  color: var(--brand-deep);
}

.chip .count {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 仪表盘 ---------- */

.todo-list {
  display: flex;
  flex-direction: column;
}

.todo {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.todo:last-child {
  border-bottom: none;
}

.todo .mark {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin-top: 1px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.todo .mark.orange {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.todo .mark.jade {
  background: var(--jade-soft);
  color: var(--jade);
}

.todo b {
  display: block;
  font-size: 13px;
}

.todo p {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.todo .time {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted-2);
  white-space: nowrap;
}

.target-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.target-row .line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
}

.target-row .line b {
  font-size: 16px;
  letter-spacing: -0.4px;
}

.target-row .line span {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 运营总览 ---------- */

.scope-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.scope-row .label {
  font-size: 12px;
  color: var(--muted);
  margin-right: 2px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--grid-gap);
  margin-bottom: var(--grid-gap);
}

.metric {
  padding: 16px 17px;
  background: var(--surface);
  border: 1px solid rgba(30, 20, 12, 0.055);
  border-radius: 16px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: all 0.15s ease;
}

.metric:hover {
  transform: translateY(-1px);
  border-color: rgba(252, 104, 0, 0.28);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 9px;
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -1.4px;
  line-height: 1;
}

.metric-value small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.metric-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
  font-size: 12px;
  color: var(--muted-2);
}

.district-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.district-card {
  padding: 14px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s ease;
}

.district-card:hover,
.district-card.on {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.district-card b {
  display: block;
  font-size: 14px;
}

.district-card .owner {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.district-card .nums {
  display: flex;
  gap: 8px;
  margin-top: 11px;
}

.district-card .nums span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.district-card .nums strong {
  display: block;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.4px;
}

.alert-list {
  display: flex;
  flex-direction: column;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.alert-item:last-child {
  border-bottom: none;
}

.alert-item .body {
  flex: 1;
  min-width: 0;
}

.alert-item b {
  display: block;
  font-size: 12.5px;
}

.alert-item p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.alert-item .time {
  font-size: 12px;
  color: var(--muted-2);
  white-space: nowrap;
}

