:root {
  --brand: #ff7a18;
  --brand-2: #ff9a3c;
  --brand-soft: #fff3e8;
  --brand-deep: #d85f0a;
  --bg: #fbf7f3;
  --panel: #ffffff;
  --text: #2c2420;
  --muted: #8a7d74;
  --border: #f0e6dd;
  --ok: #2bb673;
  --danger: #e85b4a;
  --shadow: 0 6px 24px rgba(255, 122, 24, 0.12);
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo { font-size: 34px; }
.topbar h1 { margin: 0; font-size: 20px; letter-spacing: 1px; }
.subtitle { margin: 2px 0 0; font-size: 12px; opacity: .9; }
.topbar-right { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #ffe; display: inline-block; }
.dot.on { background: #2bff9a; }
.health-text { opacity: .95; }

.tabs { display: flex; gap: 6px; padding: 12px 28px 0; background: var(--panel); border-bottom: 1px solid var(--border); }
.tab {
  border: none; background: transparent; padding: 12px 18px; cursor: pointer;
  font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 600;
}
.tab:hover { color: var(--brand); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

main { padding: 22px 28px; max-width: 1280px; margin: 0 auto; }
.panel { display: none; animation: fade .25s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar h2 { margin: 0; font-size: 17px; }
.hint { color: var(--muted); font-size: 12px; }
.toolbar input, .toolbar select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: #fff;
}
.toolbar input { min-width: 240px; }

.btn {
  border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: .15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-deep); color: #fff; }
.btn.danger { color: var(--danger); border-color: #f3c7c0; }
.btn.sm { padding: 5px 10px; font-size: 12px; }

.table-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
tbody tr:hover { background: #fffaf4; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; background: var(--brand-soft); color: var(--brand-deep); }
.status-待联系 { background:#eef2f7;color:#5b6b7d;}
.status-已联系 { background:#e7f1ff;color:#2b6fd6;}
.status-高意向 { background:#fff1da;color:#c47e0a;}
.status-已签约 { background:#e9f8ef;color:#1f9d57;}
.status-已开播 { background:#f3e9ff;color:#7b3fd6;}
.status-已流失 { background:#fdeaea;color:#d6453a;}

.reward-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 14px; }
.reward-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); border-top: 4px solid var(--brand); }
.reward-card h3 { margin: 0 0 6px; font-size: 16px; }
.reward-card .amount { font-size: 24px; font-weight: 700; color: var(--brand); }
.reward-card .cond { color: var(--muted); font-size: 12px; margin: 6px 0; }
.reward-card input { width: 100%; margin-top: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; }

.task-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 14px; }
.task-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.task-card .meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.task-card .title { font-weight: 600; font-size: 15px; }
.task-card .content { margin: 6px 0; color: #4a403a; }
.task-card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.kpi .num { font-size: 28px; font-weight: 800; color: var(--brand); }
.kpi .lbl { color: var(--muted); font-size: 12px; margin-top: 4px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 12px; font-size: 14px; color: var(--brand-deep); }
.card canvas { max-height: 260px; }

.modal-mask { position: fixed; inset: 0; background: rgba(40,30,20,.45); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 520px; max-width: 94vw; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: none; background: transparent; font-size: 24px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.form-row > div { flex: 1; }
.form-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit;
}
.form-full { margin-bottom: 12px; }
.form-full label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.form-full input, .form-full select, .form-full textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; }

.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: #2c2420; color: #fff; padding: 12px 22px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .25s; z-index: 80; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { text-align: center; color: var(--muted); padding: 40px; }
