:root {
  --bg: #edf1f0;
  --surface: #ffffff;
  --surface-soft: #f5f7f6;
  --ink: #172421;
  --muted: #697672;
  --line: #dce4e1;
  --sidebar: #102421;
  --sidebar-muted: #b8cbc4;
  --accent: #168a68;
  --accent-soft: #dff4ec;
  --blue: #327fc9;
  --blue-soft: #e8f2fc;
  --orange: #b96e16;
  --orange-soft: #fbf0e2;
  --red: #be4750;
  --red-soft: #fae9eb;
  --shadow: 0 16px 42px rgba(21, 50, 43, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
}

.hidden {
  display: none !important;
}

.login-page {
  position: relative;
  padding-bottom: 76px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(320px, 520px);
  align-items: center;
  justify-content: center;
  gap: clamp(32px, 7vw, 100px);
  padding: 32px;
  background:
    radial-gradient(circle at 18% 20%, rgba(46, 167, 126, 0.16), transparent 28%),
    linear-gradient(135deg, #eef3f0 0%, #e6ece9 100%);
}

.login-intro {
  max-width: 440px;
}

.login-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.login-intro h1 {
  margin: 12px 0 14px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.13;
  letter-spacing: -0.04em;
}

.login-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.login-intro .login-product-name {
  margin: -6px 0 16px;
  color: #33433e;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.login-points {
  margin-top: 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.login-point {
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(23, 36, 33, 0.08);
  color: #34433f;
  font-size: 12px;
}

.login-card {
  background: var(--surface);
  border: 1px solid rgba(23, 36, 33, 0.09);
  border-radius: 18px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 0;
  font-size: 22px;
}

.login-card .sub {
  margin: 6px 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.field > label,
.field-label {
  color: var(--muted);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 11px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #67ad94;
  box-shadow: 0 0 0 3px rgba(22, 138, 104, 0.1);
}

textarea {
  min-height: 82px;
  resize: vertical;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 13px;
  background: var(--surface);
  color: var(--ink);
}

.btn:hover {
  border-color: #9bb9ae;
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.btn.primary:hover {
  background: #116e54;
}

.btn.danger {
  color: var(--red);
}

.btn.small {
  padding: 5px 9px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
  margin-top: 20px;
  padding: 10px;
}

.login-error {
  min-height: 20px;
  margin-top: 10px;
  color: var(--red);
  font-size: 12px;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 14px;
  background: var(--sidebar);
  color: #f4faf7;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}

.brand-mark {
  width: 40px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #8ce0bd;
  color: var(--sidebar);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.brand strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.brand small {
  color: var(--sidebar-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav button {
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  color: var(--sidebar-muted);
  text-align: left;
}

.nav button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.nav button.active {
  background: #e2f5ed;
  color: #153129;
  font-weight: 600;
}

.nav-index {
  width: 21px;
  color: inherit;
  font-size: 10px;
  opacity: 0.62;
  font-variant-numeric: tabular-nums;
}

/* 板块内的二级入口（线索跟进、发布回收…）：宽度、内边距和父级一致，
   只是把编号位换成箭头，文字自动和上一级对齐 */
.nav-sub {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 9px;
  padding: 8px 12px;
  color: var(--sidebar-muted);
  font-size: 12px;
  text-decoration: none;
}

.nav-sub:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.nav-sub-mark {
  width: 21px;
  flex: none;
  font-size: 10px;
  opacity: 0.5;
}

.sidebar-user {
  margin-top: auto;
  padding: 15px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.sidebar-user strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.sidebar-user span {
  display: block;
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 11px;
}

.sidebar-user button {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sidebar-muted);
  text-decoration: underline;
  font-size: 11px;
}

.main-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.city-filter {
  display: flex;
  gap: 6px;
}

.chip {
  border: 0;
  border-radius: 999px;
  padding: 6px 11px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.role-pill {
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
}

.notice-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--orange);
}

.content {
  max-width: 1500px;
  margin: 0 auto;
  padding: 22px 24px 48px;
}

/* 内容雷达整页嵌入：去掉内容区内边距，让 iframe 铺满 */
.content.flush {
  max-width: none;
  margin: 0;
  padding: 0;
  height: calc(100vh - 65px);
  overflow: hidden;
}

.studio-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.page-head h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.page-head p {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.page-tag {
  flex: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 11px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 14px;
}

.metric {
  width: 100%;
  color: var(--ink);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font: inherit;
  cursor: pointer;
}

.metric:hover {
  border-color: #90b6a8;
  background: #fbfdfc;
}

.metric-label {
  color: var(--muted);
  font-size: 11px;
}

.metric-value {
  margin-top: 4px;
  font-size: 25px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.metric-note {
  color: var(--muted);
  font-size: 11px;
}

.flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 14px;
}

.flow-step {
  position: relative;
  min-width: 0;
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
}

.flow-step:hover {
  background: var(--accent-soft);
}

.flow-step:last-child {
  border-right: 0;
}

.flow-step::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.22;
}

.flow-step strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.flow-step span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.8fr);
  gap: 12px;
}

.panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-head-aside {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.panel-head span {
  color: var(--muted);
  font-size: 11px;
}

.task-list {
  display: grid;
  gap: 8px;
}

.task {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 9px;
  background: var(--surface-soft);
}

.task-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.task-dot.danger {
  background: var(--red);
}

.task-dot.warning {
  background: var(--orange);
}

.task-title {
  font-size: 12px;
  font-weight: 500;
}

.task-detail {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.task-time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.flow-note {
  display: grid;
  gap: 9px;
}

.flow-note-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.flow-note-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.flow-note-row strong {
  color: var(--ink);
  font-weight: 500;
}

.form-card {
  margin-bottom: 14px;
}

.mode-switch {
  display: flex;
  gap: 7px;
  margin: -2px 0 14px;
}

.studio-frame-panel {
  padding: 0;
  overflow: hidden;
}

.studio-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 210px);
  min-height: 760px;
  border: 0;
  background: var(--surface-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

/* 线索录入表单字段多，三列排布能把面板高度压掉近一半，把屏幕让给看板 */
.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-2 {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

/* 筛选条改成弹性换行：日期框给足最小宽度，窄了就换行，不会互相压住 */
.lead-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 13px;
}

.lead-toolbar .field {
  flex: 1 1 150px;
  min-width: 0;
  margin-top: 0;
}

.lead-toolbar .field input,
.lead-toolbar .field select {
  width: 100%;
  min-width: 0;
}

.lead-toolbar .btn {
  min-height: 38px;
}

.lead-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.assignment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.assignment-group {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.assignment-group > strong {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.assignment-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assignment-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 11px;
}

.assignment-option input {
  width: auto;
  margin: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 11px;
}

.list {
  display: grid;
  gap: 8px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.list-row > div {
  min-width: 0;
}

.list-row:hover {
  border-color: #a8beb6;
}

.list-title {
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.list-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.tag {
  display: inline-flex;
  align-items: center;
  margin-right: 5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.tag.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag.warning {
  background: var(--orange-soft);
  color: var(--orange);
}

.tag.danger {
  background: var(--red-soft);
  color: var(--red);
}

.tag.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

/* 九个阶段分两行平铺，一屏看全，不再横向滚动把后几列切在视口外 */
.kanban {
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr));
  align-items: start; /* 空列不再被拉成和最高的一列一样高 */
  gap: 9px;
}

.kanban-divider {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0 9px;
  color: var(--muted);
  font-size: 11px;
}

.kanban-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* 线索详情抽屉里的商务跟进卡：报价、定金、成交和跟进节奏 */
.biz-follow {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.biz-follow > strong,
.biz-follow > div > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
}

.biz-follow details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
}

.biz-follow details[open] summary {
  margin-bottom: 6px;
}

/* 岗位权限矩阵：行是权限项，列是岗位，直接勾 */
.perm-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.perm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.perm-table th,
.perm-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.perm-table th:first-child,
.perm-table td:first-child {
  min-width: 150px;
  text-align: left;
}

.perm-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.perm-table .perm-group td {
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 500;
  text-align: left;
}

.perm-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.perm-table .btn.small {
  margin-top: 4px;
  padding: 3px 7px;
  min-height: 0;
  font-size: 10px;
}

.kanban-col {
  min-height: 0;
  padding: 8px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.kanban-col h3 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.kanban-col h3 b {
  color: var(--ink);
}

.kanban-card {
  min-width: 0;
  padding: 9px;
  margin-bottom: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.kanban-card:hover {
  border-color: #9db9af;
}

.kanban-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

/* 客户名过长时省略，避免把 SLA 标签挤到换行处叠在一起 */
.kanban-title > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-title > span:last-child {
  flex: none;
}

.kanban-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  min-width: 0;
}

/* 每行只放一行字，超出就省略——宁可截断也不允许文字互相压住 */
.kanban-meta > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funnel {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  align-items: end;
  gap: 6px;
  min-height: 150px;
}

.funnel-step {
  text-align: center;
}

.funnel-value {
  font-size: 12px;
  font-weight: 600;
}

.funnel-bar {
  min-height: 6px;
  margin: 5px auto 7px;
  border-radius: 5px 5px 0 0;
  background: var(--accent);
  opacity: 0.68;
}

.funnel-label {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.asset-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 13px;
}

.asset-toolbar select,
.asset-toolbar input {
  width: auto;
  min-width: 120px;
  padding: 7px 9px;
  font-size: 12px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 11px;
}

.asset-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.asset-preview {
  height: 118px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(23, 138, 104, 0.2), rgba(50, 127, 201, 0.08)),
    var(--surface-soft);
  color: #46645b;
  font-size: 13px;
  font-weight: 600;
}

.asset-preview img,
.asset-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-body {
  padding: 10px;
}

.asset-title {
  font-size: 12px;
  font-weight: 500;
}

.asset-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.asset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(12, 28, 24, 0.28);
}

.drawer {
  position: fixed;
  z-index: 21;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 94vw);
  padding: 22px;
  overflow-y: auto;
  background: var(--surface);
  box-shadow: -16px 0 40px rgba(15, 36, 31, 0.13);
}

.drawer-close {
  float: right;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
}

.drawer h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.drawer .sub {
  color: var(--muted);
  font-size: 12px;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.kv span:first-child {
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 0;
  margin-top: 16px;
}

.timeline-row {
  position: relative;
  padding: 0 0 15px 17px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.timeline-row::before {
  content: "";
  position: absolute;
  top: 4px;
  left: -5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.content-output {
  margin: 10px 0 0;
  padding: 12px;
  max-height: 360px;
  overflow: auto;
  border-radius: 9px;
  background: var(--surface-soft);
  color: #33443f;
  font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

details summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.empty {
  padding: 42px 12px;
  color: var(--muted);
  text-align: center;
}

.notice-banner {
  margin-bottom: 14px;
  padding: 11px 13px;
  border-radius: 9px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 12px;
}

.analytics-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.range-pills,
.analytics-dates {
  display: flex;
  align-items: center;
  gap: 6px;
}

.analytics-dates {
  color: var(--muted);
  font-size: 11px;
}

.analytics-dates input {
  width: auto;
  padding: 6px 8px;
  font-size: 12px;
}

.analytics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 12px;
}

.analytics-funnel {
  display: grid;
  gap: 10px;
}

.analytics-funnel-row {
  display: grid;
  grid-template-columns: 72px minmax(100px, 1fr) 42px 52px;
  align-items: center;
  gap: 9px;
}

.analytics-funnel-name {
  color: var(--muted);
  font-size: 11px;
}

.analytics-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.analytics-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  opacity: 0.72;
}

.analytics-value {
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.analytics-rate {
  text-align: right;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.trend-chart {
  min-height: 190px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
  overflow: hidden;
}

.trend-day {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.trend-day i {
  width: 100%;
  max-width: 20px;
  display: block;
  border-radius: 4px 4px 0 0;
  background: var(--accent);
  opacity: 0.65;
}

.trend-day span {
  color: var(--muted);
  font-size: 9px;
  writing-mode: vertical-rl;
}

.analytics-breakdowns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.analytics-block {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.quality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quality-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
}

.quality-item strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 9px 7px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 15px);
  padding: 10px 16px;
  border-radius: 9px;
  background: var(--sidebar);
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 960px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .funnel {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    row-gap: 18px;
  }

  .lead-toolbar .field {
    flex: 1 1 130px;
  }

  .analytics-layout,
  .analytics-breakdowns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .login-page {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 22px 16px;
  }

  .login-intro h1 {
    font-size: 38px;
  }

  .login-points {
    display: none;
  }

  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 13px 12px;
    gap: 12px;
  }

  .brand {
    padding: 0 2px;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav button {
    justify-content: center;
    padding: 9px 4px;
    font-size: 11px;
  }

  .nav-index,
  .sidebar-user {
    display: none;
  }

  .topbar {
    position: static;
    flex-wrap: wrap;
    padding: 10px 14px;
  }

  .topbar-right {
    margin-left: auto;
  }

  .content {
    padding: 16px 13px 36px;
  }

  .page-head h1 {
    font-size: 23px;
  }

  .page-tag {
    display: none;
  }

  .flow {
    grid-template-columns: 1fr;
  }

  .flow-step {
    display: grid;
    grid-template-columns: 26px 1fr;
    column-gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .flow-step:last-child {
    border-bottom: 0;
  }

  .flow-step strong {
    grid-column: 2;
  }

  .flow-step span {
    grid-column: 2;
  }

  .flow-step::after {
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    height: auto;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .kanban {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assignment-grid {
    grid-template-columns: 1fr;
  }

  .analytics-toolbar {
    align-items: flex-start;
  }

  .range-pills {
    flex-wrap: wrap;
  }

  .analytics-dates {
    width: 100%;
  }

  .analytics-dates input {
    flex: 1;
    min-width: 0;
  }

  .quality-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .funnel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .asset-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .asset-toolbar input,
  .asset-toolbar select {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 430px) {
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .task-time {
    grid-column: 2;
  }

  .asset-grid {
    grid-template-columns: 1fr;
  }

  .studio-frame {
    height: 980px;
    min-height: 980px;
  }

  .funnel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------------------------------------------------------------- 本周分发 */
.week-band {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}

.week-band b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.week-band span {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.metric-unit {
  margin-left: 5px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.prog {
  height: 4px;
  margin: 8px 0 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.prog i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent, #168a68);
  transition: width 0.3s ease;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day-card {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-card.today {
  border-color: var(--accent, #168a68);
  box-shadow: 0 0 0 2px rgba(22, 138, 104, 0.12);
  background: #f4fbf7;
}

.day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.day-head strong {
  font-size: 13px;
}

.day-head span {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.today-tag {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 3px;
  border-radius: 999px;
  background: var(--accent, #168a68);
  color: #fff;
  font-size: 10px;
  font-style: normal;
}

.day-row {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}

.day-row b {
  display: block;
  margin-bottom: 2px;
  color: var(--accent, #168a68);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.day-row:last-child b {
  color: #327fc9;
}

.acct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.acct-card {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.acct-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  min-height: 34px;
}

.acct-top strong {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}

.acct-num {
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--muted);
}

.acct-num b {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.acct-pct {
  float: right;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.acct-role {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

/* 内容雷达 iframe：任何宽度下都铺满内容区 */
.content.flush .studio-frame {
  height: 100%;
  min-height: 0;
}

@media (max-width: 1180px) {
  .week-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .week-band {
    flex-wrap: wrap;
  }

  .week-band span {
    margin-left: 0;
  }
}

/* 本周内容结构 */
.pillar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pillar-row {
  display: grid;
  grid-template-columns: 180px minmax(80px, 1fr) 76px;
  align-items: center;
  gap: 10px 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.pillar-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.pillar-name {
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.pillar-name em {
  font-style: normal;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--soft, #f5f7f6);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
}

.pillar-row .prog {
  margin: 0;
}

.pillar-num {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pillar-hint {
  grid-column: 1 / -1;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: -4px;
}

@media (max-width: 760px) {
  .pillar-row {
    grid-template-columns: minmax(0, 1fr) 70px;
  }

  .pillar-row .prog {
    grid-column: 1 / -1;
    order: 3;
  }
}

.day-edit {
  margin-top: auto;
  padding: 5px 9px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.day-edit:hover {
  border-style: solid;
  border-color: var(--accent, #168a68);
  color: var(--accent, #168a68);
  background: #f2fbf7;
}

/* ===== 账号操作：改密码 / 停用 / 重置密码 ===== */
.user-acts {
  display: flex;
  gap: 14px;
  margin-top: 6px;
}

.sidebar-user .user-acts button {
  margin-top: 0;
}

.row-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  /* 手机上原来把用户区整块隐藏了，导致没有退出入口，这里改成横排保留 */
  .sidebar-user {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 10px;
    padding: 10px 8px 0;
  }

  .sidebar-user strong,
  .sidebar-user span {
    display: inline;
    margin: 0;
  }

  .user-acts {
    margin: 0 0 0 auto;
  }
}

/* 初始密码提醒：超管仍在用演示口令时显示在顶栏 */
.weak-pwd {
  border: 1px solid #eccfc9;
  background: #fdf2f1;
  color: #b3402f;
  border-radius: 99px;
  padding: 3px 11px;
  font-size: 12px;
  cursor: pointer;
}

.weak-pwd:hover {
  background: #f9e2de;
}

/* 无权进入的分区入口：直接禁用，避免点击后才弹「当前岗位不能进入该分区」 */
.metric:disabled,
.flow-step:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.metric:disabled:hover {
  border-color: var(--line);
  background: var(--surface);
}
.flow-step:disabled:hover {
  background: transparent;
}

/* 内容任务：卡片选择与批量删除 */
.kanban-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.kanban-pick{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:var(--muted);cursor:pointer}
.bulk-bar{display:flex;align-items:center;gap:10px;margin:8px 0}

/* 手机版入口：侧栏按钮 + 二维码弹层 */
.sidebar-mobile{margin-top:auto;padding:12px 8px 0;display:flex;flex-direction:column;gap:8px}
.sidebar-mobile a.mobile-entry{text-decoration:none}
.sidebar-user{margin-top:10px}
.mobile-entry{
  display:flex;align-items:center;gap:9px;width:100%;padding:10px;border-radius:10px;
  border:1px solid rgba(255,255,255,.22);background:rgba(255,255,255,.09);
  color:#fff;text-align:left;cursor:pointer;transition:background .15s,border-color .15s
}
.mobile-entry:hover{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.3)}
.mobile-entry-icon{font-size:16px;line-height:1}
.mobile-entry-text strong{display:block;font-size:13px;font-weight:600}
.mobile-entry-text small{display:block;font-size:11px;color:var(--sidebar-muted);margin-top:1px}
.qr-modal{
  position:fixed;inset:0;z-index:80;display:none;align-items:center;justify-content:center;
  background:rgba(16,36,33,.55);padding:20px
}
.qr-modal.on{display:flex}
.qr-card{
  position:relative;width:100%;max-width:300px;background:#fff;border-radius:16px;
  padding:22px 20px 18px;box-shadow:0 24px 60px rgba(0,0,0,.28);text-align:center
}
.qr-card h3{margin:0 0 14px;font-size:15px;color:#172421}
.qr-card img{width:190px;height:190px;display:block;margin:0 auto;border-radius:8px}
.qr-url{margin:12px 0 0;font-size:12px;color:#697672;word-break:break-all;font-variant-numeric:tabular-nums}
.qr-tip{margin:8px 0 14px;font-size:11.5px;line-height:1.6;color:#8b9793}
.qr-open{display:inline-block;font-size:12.5px;color:#168a68;text-decoration:none;font-weight:600}
.qr-open:hover{text-decoration:underline}
.qr-close{
  position:absolute;top:8px;right:10px;width:26px;height:26px;border-radius:50%;border:0;
  background:#f0f3f2;color:#697672;font-size:16px;line-height:1;cursor:pointer
}
.qr-close:hover{background:#e4e9e7}
@media (max-width:900px){.sidebar-mobile{display:none}.sidebar-user{margin-top:auto}}


/* 备案号（工信部要求，页脚常驻） */
.login-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: #7a8a83;
  letter-spacing: 0.2px;
}
.login-footer a {
  color: #6d7d76;
  text-decoration: none;
  border-bottom: 1px solid rgba(109, 125, 118, 0.35);
  padding-bottom: 1px;
}
.login-footer a:hover { color: #2ea77e; border-bottom-color: #2ea77e; }
.login-footer-dot { color: #b3c0ba; }
@media (max-width: 900px) {
  .login-footer { position: static; margin-top: 24px; flex-wrap: wrap; row-gap: 4px; }
}
