/* ========== 趣来米网页版 · 全局样式 ========== */
:root {
  --primary: #EF5800;
  --primary-dark: #D84F00;
  --primary-light: #FFF0E8;
  --blue: #0279CD;
  --green: #43B244;
  --red: #E24B4A;
  --amber: #EF9F27;
  --gray: #888780;
  --text: #2C2C2A;
  --text-2: #5F5E5A;
  --text-3: #B4B2A9;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --border: #EDEBE4;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(0,0,0,.05);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}
a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #FFF0E8 0%, #F5F6F8 55%);
  padding: 20px;
}
.login-card {
  width: 400px;
  max-width: 94vw;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 40px 36px 32px;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.login-logo .logo-badge {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.login-title { font-size: 22px; font-weight: 600; color: var(--text); }
.login-sub { color: var(--text-2); font-size: 13px; margin-bottom: 26px; }
.login-tip {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

/* ---------- 主布局 ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 208px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar .brand .logo-badge {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary); color: #fff;
  font-size: 17px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.sidebar .brand .brand-name { font-size: 17px; font-weight: 600; }
.sidebar .brand .brand-sub { font-size: 11px; color: var(--text-3); }
.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  border: none; background: none;
  width: 100%;
  text-align: left;
  transition: background .15s;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.nav-item .nav-ico { width: 20px; text-align: center; font-size: 15px; }
.nav-group-title {
  padding: 14px 12px 6px;
  font-size: 11px;
  color: var(--text-3);
}
.sidebar-foot {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
}
.sidebar-foot .user-line { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sidebar-foot .logout-btn {
  width: 100%;
  padding: 7px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
}
.sidebar-foot .logout-btn:hover { border-color: var(--red); color: var(--red); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.main-topbar .page-title { font-size: 17px; font-weight: 600; }
.main-topbar .topbar-right { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-2); }
/* 主体：中间操作台（左右两栏式：侧边导航 + 操作区） */
.main-body { flex: 1; display: flex; min-height: 0; }
.main-content { padding: 20px 24px 40px; flex: 1; min-width: 0; }

/* 页脚备案信息 */
.app-footer {
  padding: 8px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3, #999);
  border-top: 1px solid var(--border);
  background: var(--card, #fff);
}
.app-footer a { color: inherit; text-decoration: none; }

/* 登录页备案信息 */
.login-beian {
  text-align: center;
  font-size: 12px;
  color: var(--text-3, #999);
  margin-top: 18px;
}
.login-beian a { color: inherit; text-decoration: none; }

/* 移动端顶栏导航 */
.mobile-nav {
  display: none;
  position: sticky; top: 0; z-index: 30;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
}
.mobile-nav .m-top { display: flex; align-items: center; justify-content: space-between; }
.mobile-nav .m-scroll { display: flex; gap: 4px; overflow-x: auto; padding-top: 8px; }
.mobile-nav .m-item {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.mobile-nav .m-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .mobile-nav { display: block; }
  .main-topbar { display: none; }
  .main-content { padding: 14px 14px 40px; }
}

/* ---------- 卡片 / 统计 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color .15s;
}
.stat-card:hover { border-color: var(--primary); }
.stat-card .stat-num { font-size: 26px; font-weight: 600; line-height: 1.2; }
.stat-card .stat-label { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.stat-card.c-orange .stat-num { color: var(--primary); }
.stat-card.c-red .stat-num { color: var(--red); }
.stat-card.c-blue .stat-num { color: var(--blue); }
.stat-card.c-green .stat-num { color: var(--green); }
.stat-card.c-gray .stat-num { color: var(--gray); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  line-height: 1.3;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 3px 10px rgba(239,88,0,.28); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-plain { background: #fff; border-color: var(--border); color: var(--text-2); }
.btn-plain:hover { border-color: var(--text-3); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 3px 9px; font-size: 11px; border-radius: 7px; }
.btn-block { width: 100%; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 13px; color: var(--text-2); }
.form-field label .req { color: var(--red); margin-left: 2px; }
.form-field input, .form-field select, .form-field textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(239,88,0,.1);
}
.form-field textarea { resize: vertical; min-height: 72px; }
.form-field .hint { font-size: 12px; color: var(--text-3); }

/* ---------- 可搜索客户选择器 ---------- */
.customer-picker { position: relative; }
.cp-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  min-height: 40px;
}
.cp-field:hover { border-color: var(--text-3); }
.cp-field.has-value { cursor: default; }
.cp-placeholder { color: var(--text-3); font-size: 14px; }
.cp-arrow { color: var(--text-3); font-size: 12px; }
.cp-selected { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.cp-selected-name { font-weight: 500; font-size: 14px; }
.cp-selected-meta { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-clear {
  margin-left: auto;
  border: none; background: none;
  color: var(--text-3); font-size: 14px;
  cursor: pointer; padding: 2px 6px;
}
.cp-clear:hover { color: var(--red); }
.cp-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: none;
  overflow: hidden;
}
.cp-dropdown.show { display: block; }
.cp-search {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  outline: none;
}
.cp-search:focus { background: #FDF8F5; }
.cp-list { max-height: 260px; overflow-y: auto; }
.cp-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #F7F7F5;
  transition: background .12s;
}
.cp-item:last-child { border-bottom: none; }
.cp-item:hover { background: var(--primary-light); }
.cp-item-main {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cp-item-name { font-weight: 500; font-size: 14px; }
.cp-item-serial { font-size: 11px; color: var(--text-3); font-family: ui-monospace, monospace; }
.cp-item-tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.cp-item-lead { background: #E6F1FB; color: var(--blue); }
.cp-item-contact { background: var(--primary-light); color: var(--primary); }
.cp-item-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.cp-empty { padding: 20px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ---------- 列表 ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.toolbar .search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.toolbar .search-box input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  outline: none;
}
.toolbar .search-box input:focus { border-color: var(--primary); }
.toolbar .search-box .s-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-group select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  outline: none;
  cursor: pointer;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
}
.contact-row:hover { box-shadow: 0 3px 12px rgba(0,0,0,.09); }
.contact-row .c-main { flex: 1; min-width: 0; }
.contact-row .c-name-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.contact-row .c-name { font-size: 15px; font-weight: 500; }
.contact-row .c-sub { font-size: 12px; color: var(--text-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-row .c-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.contact-row .c-right { text-align: right; flex-shrink: 0; }
.contact-row .c-right .due-badge { display: block; margin-bottom: 5px; }
.contact-row .c-right .c-code { font-size: 11px; color: var(--text-3); font-family: ui-monospace, monospace; }

/* ---------- 徽章 / 芯片 ---------- */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar.lg { width: 56px; height: 56px; font-size: 24px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--bg);
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 7px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.due-badge { font-size: 11px; padding: 2px 9px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.due-overdue { background: #FCEBEB; color: var(--red); }
.due-today { background: #FAEEDA; color: var(--amber); }
.due-soon { background: #FAEEDA; color: #B15E0A; }
.due-ok { background: #EAF3DE; color: #3B6D11; }
.type-badge { font-size: 11px; padding: 2px 8px; border-radius: 6px; }
.type-lead { background: #E6F1FB; color: var(--blue); }
.type-contact { background: var(--primary-light); color: var(--primary); }
.stage-badge { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: #EEEDFE; color: #534AB7; }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn .15s;
}
.modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: popIn .18s;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-x { font-size: 22px; color: var(--text-3); cursor: pointer; line-height: 1; padding: 2px 4px; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { padding: 0 20px 18px; display: flex; justify-content: flex-end; gap: 10px; }
.modal-overlay .dialog { width: 380px; max-width: 92vw; }
.dialog-title { font-size: 16px; font-weight: 600; padding: 20px 20px 8px; }
.dialog-body { padding: 4px 20px 18px; color: var(--text-2); font-size: 14px; white-space: pre-line; }
.dialog-actions { padding: 0 20px 20px; display: flex; justify-content: flex-end; gap: 10px; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(8px); } }

/* ---------- Toast ---------- */
#toast-root {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 20px;
  border-radius: 10px;
  background: rgba(44,44,42,.92);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-8px);
  transition: all .22s;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: rgba(67,178,68,.95); }
.toast-error { background: rgba(226,75,74,.95); }

/* ---------- 分页 ---------- */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.page-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-2);
}
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-dots { color: var(--text-3); padding: 0 2px; }
.page-info { font-size: 12px; color: var(--text-3); margin-left: 8px; }

/* ---------- 空态 / 加载 ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty-icon { font-size: 36px; margin-bottom: 10px; color: var(--border); }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px; color: var(--text-2); }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 表格 ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-2);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  font-size: 12px;
  white-space: nowrap;
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #FBFBF9; }

/* ---------- 详情页 ---------- */
.detail-head {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.detail-head .d-info { flex: 1; min-width: 220px; }
.detail-head .d-name { font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-head .d-sub { color: var(--text-2); font-size: 13px; margin-top: 6px; line-height: 1.7; }
.detail-head .d-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 20px; }
.kv-item .kv-label { font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.kv-item .kv-value { font-size: 14px; word-break: break-all; }
.kv-item.full { grid-column: 1 / -1; }

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 10px 18px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* 时间线 */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -26px;
  top: 2px;
  width: 20px; height: 20px;
  border-radius: 7px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.tl-item.stage .tl-dot { background: #EEEDFE; color: #534AB7; }
.tl-item.tier .tl-dot { background: #FAEEDA; color: var(--amber); }
.tl-item.task .tl-dot { background: #E6F1FB; color: var(--blue); }
.tl-item.attachment .tl-dot { background: #EAF3DE; color: var(--green); }
.tl-date { font-size: 11px; color: var(--text-3); }
.tl-title { font-size: 13px; font-weight: 500; margin: 1px 0; }
.tl-desc { font-size: 12px; color: var(--text-2); white-space: pre-line; }

/* 互动记录 */
.ia-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.ia-item:last-child { border-bottom: none; }
.ia-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.ia-summary { font-size: 14px; margin-top: 6px; }
.ia-content { font-size: 13px; color: var(--text-2); margin-top: 4px; white-space: pre-line; }
.ia-att { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.att-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  border: 1px solid var(--border);
}
.att-file:hover { border-color: var(--blue); color: var(--blue); }

/* 互动记录 AI 故事 */
.ia-story {
  background: #FFF7F0;
  border: 1px solid #FFE3CE;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
}
.ia-story-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 10px;
  white-space: pre-line;
}
.ia-story-hint {
  font-size: 11px;
  color: var(--text-3);
  margin: 8px 0 4px;
  font-weight: 600;
}
.ia-story-li {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}
.ia-story-li.need { color: #4A6FA5; }
.ia-story-li.act { color: #3E8E5A; }

/* 记录互动弹窗 AI 草稿 */
.ai-quick-box textarea {
  min-height: 90px;
  resize: vertical;
}
.ia-draft-title {
  font-size: 12px;
  font-weight: 600;
  color: #B87333;
  margin-bottom: 8px;
}
.ia-draft-story {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 10px;
  white-space: pre-line;
}
.ia-draft-sub {
  font-size: 11px;
  color: var(--text-3);
  margin: 8px 0 4px;
  font-weight: 600;
}
.ia-draft-li {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}
.ia-draft-li.need { color: #4A6FA5; }
.ia-draft-li.act { color: #3E8E5A; }

/* 标签选择 */
.tag-pick-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 8px; }
.tag-pick {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: all .12s;
}
.tag-pick:hover { border-color: var(--primary); }
.tag-pick.active {
  background: #3D3D3B;
  color: #fff;
  border-color: #3D3D3B;
  box-shadow: 0 3px 8px rgba(0,0,0,.22);
}
.tag-pick.active::after { content: ' ✓'; }

/* 阶段选择 */
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stage-opt {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  background: #fff;
  transition: all .12s;
  text-align: left;
}
.stage-opt:hover { border-color: var(--primary); }
.stage-opt.active { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 3px 10px rgba(239,88,0,.15); }
.stage-opt .so-name { font-size: 14px; font-weight: 500; }
.stage-opt .so-desc { font-size: 11px; color: var(--text-2); margin-top: 3px; }

/* 提醒列表 */
.remind-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.remind-item:last-child { border-bottom: none; }
.remind-item .r-main { flex: 1; min-width: 0; }
.remind-item .r-name { font-weight: 500; }
.remind-item .r-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* 任务 */
.task-item {
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  align-items: flex-start;
}
.task-item .t-status { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.task-item.t-pending .t-status { background: var(--amber); }
.task-item.t-done .t-status { background: var(--green); }
.task-item.t-cancelled .t-status { background: var(--gray); }
.task-item .t-main { flex: 1; min-width: 0; }
.task-item .t-title { font-weight: 500; }
.task-item .t-meta { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.task-item .t-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* 上传区 */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
  background: #FBFBF9;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.drop-zone .dz-ico { font-size: 34px; margin-bottom: 8px; }

/* 其他 */
.badge-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-left: 4px; }
.muted { color: var(--text-3); font-size: 12px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb16 { margin-bottom: 16px; }
.text-right { text-align: right; }
.scroll-x { overflow-x: auto; }

/* ========== 每日工作台 ========== */
.wb-grid { display: grid; grid-template-columns: 340px 1fr 1fr; grid-template-areas: 'progress week review' 'today today review'; gap: 16px; align-items: start; }
.wb-card-progress { grid-area: progress; }
.wb-card-week { grid-area: week; }
.wb-card-review { grid-area: review; }
.wb-card-today { grid-area: today; }
.wb-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.wb-card-title { font-size: 14px; font-weight: 600; }
.wb-date { font-size: 12px; color: var(--text-3); }
.wb-ring { display: flex; flex-direction: column; align-items: center; padding: 6px 0 2px; }
.wb-ring-num { font-size: 40px; font-weight: 700; fill: var(--text); }
.wb-ring-den { font-size: 13px; fill: var(--text-3); }
.wb-ring-label { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.wb-mini-stats { display: flex; margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.wb-mini { flex: 1; text-align: center; }
.wb-mini b { display: block; font-size: 20px; font-weight: 600; }
.wb-mini span { font-size: 11px; color: var(--text-2); }
.wb-week { display: flex; justify-content: space-between; align-items: flex-end; padding: 4px 6px 0; }
.wb-week-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wb-week-bar-wrap { height: 60px; display: flex; align-items: flex-end; }
.wb-week-bar { width: 22px; border-radius: 5px 5px 2px 2px; background: #E8E2D6; min-height: 4px; }
.wb-week-bar.hit { background: var(--primary); }
.wb-week-bar.today { box-shadow: 0 0 0 2px var(--primary-light); }
.wb-week-num { font-size: 11px; color: var(--text-2); min-height: 14px; }
.wb-week-day { font-size: 11px; color: var(--text-3); }
.wb-week-day.today { color: var(--primary); font-weight: 600; }
.wb-week-tip { font-size: 11px; margin-top: 10px; text-align: center; }
.wb-review-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.wb-ai-box { margin-top: 14px; background: linear-gradient(180deg, var(--primary-light), #fff); background: var(--primary-light); border: 1px solid #F5D8C4; border-radius: 10px; padding: 12px 14px; }
.wb-ai-title { font-size: 12px; font-weight: 600; color: var(--primary); margin-bottom: 6px; }
.wb-ai-text { font-size: 13px; line-height: 1.7; color: var(--text); white-space: pre-wrap; }
.wb-card-sub { font-size: 13px; font-weight: 600; margin: 14px 0 8px; }
.wb-today-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.wb-today-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.wb-today-item:hover { background: var(--bg); }
.wb-today-main { flex: 1; min-width: 0; }
.wb-today-name { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.wb-today-name a { color: var(--text); text-decoration: none; }
.wb-today-name a:hover { color: var(--primary); }
.wb-today-summary { font-size: 12px; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-today-side { text-align: right; flex-shrink: 0; }
.wb-today-time { font-size: 12px; color: var(--text-2); }
.wb-ch { font-size: 11px; padding: 1px 6px; border-radius: 6px; }
.wb-ch.ok { background: #EAF3DE; color: var(--green); }
.wb-ch.try { background: #F5F6F8; color: var(--gray); }
.wb-task-ico { font-size: 15px; width: 28px; text-align: center; }
@media (max-width: 1100px) { .wb-grid { grid-template-columns: 1fr 1fr; grid-template-areas: 'progress week' 'review review' 'today today'; } }
@media (max-width: 720px) { .wb-grid { grid-template-columns: 1fr; grid-template-areas: 'progress' 'week' 'today' 'review'; } }

/* ========== 内容文案库 ========== */
.ct-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ct-tabs { display: flex; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.ct-tab { padding: 6px 16px; border-radius: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.ct-tab:hover { color: var(--text); }
.ct-tab.active { background: var(--primary); color: #fff; font-weight: 500; }
.ct-tab-ico { font-size: 12px; }
.ct-actions { display: flex; align-items: center; gap: 8px; }
.ct-select { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; background: #fff; color: var(--text-2); }
.ct-list { display: flex; flex-direction: column; gap: 12px; }
.ct-item { padding: 16px 18px; }
.ct-item-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.ct-item-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ct-item-name { font-size: 14px; font-weight: 600; }
.ct-ai-tag { font-size: 11px; background: var(--blue); color: #fff; padding: 1px 6px; border-radius: 6px; font-weight: 500; }
/* 选题场景标签：口播 / 朋友圈 */
.ct-scene-oral { background: #FDEEE2 !important; color: #C24A0F !important; }
.ct-scene-mm { background: #E8F1FB !important; color: #1D5FAD !important; }
.ct-status { font-size: 11px; padding: 1px 8px; border-radius: 6px; }
.ct-status.st-draft { background: #F5F6F8; color: var(--gray); }
.ct-status.st-ready { background: #FAEEDA; color: #854F0B; }
.ct-status.st-pub { background: #EAF3DE; color: var(--green); }
.ct-item-ops { display: flex; gap: 6px; flex-shrink: 0; }
.ct-item-content { font-size: 13px; line-height: 1.8; color: var(--text); white-space: pre-wrap; background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.ct-item-note { font-size: 12px; color: var(--text-2); margin-top: 8px; }
.ct-item-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 12px; flex-wrap: wrap; gap: 6px; }
.ct-platforms { display: flex; gap: 4px; }
.ct-del:hover { color: var(--red); border-color: var(--red); }
.ce-platforms { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-check { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.chip-check input { accent-color: var(--primary); }
.chip-check:has(input:checked) { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.ca-tip { font-size: 12px; line-height: 1.6; }

/* 内容中心：子栏（类型/操作）与选题、提示词组件 */
.ct-subbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ct-subtabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.ct-subtab { padding: 5px 14px; border-radius: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.ct-subtab.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.ct-topic-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.ct-topic-dot.used { background: var(--green); }
.ct-used-head { font-size: 12px; margin: 20px 0 10px; }
.ct-item-used { opacity: .75; }
.pm-group-title { font-size: 12px; color: var(--text-3); margin: 16px 0 8px; letter-spacing: 1px; }
.pm-group-title:first-of-type { margin-top: 0; }

/* ========== 创意灵感：收录框 / 创意卡片 / 简报 / 来源账号 ========== */
.idea-collect { margin-bottom: 14px; }
.idea-collect-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.idea-textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.7; font-family: inherit; resize: vertical; background: var(--bg); }
.idea-textarea:focus { outline: none; border-color: var(--primary); background: #fff; }
.idea-collect-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.idea-save-tip { background: #fff7e8; border: 1px solid #f5d78e; color: #9a6b00; border-radius: 8px; padding: 8px 12px; font-size: 12px; line-height: 1.6; margin-bottom: 12px; }
.ct-dir-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ct-dir-card { border: 2px solid var(--border); border-radius: 12px; background: #fff; padding: 18px 14px; text-align: center; cursor: pointer; transition: all .15s; font-family: inherit; }
.ct-dir-card:hover { border-color: var(--primary); }
.ct-dir-card.active { border-color: var(--primary); background: #fff8f3; }
.ct-dir-ico { font-size: 22px; margin-bottom: 6px; }
.ct-dir-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.ct-dir-desc { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.idea-select { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; background: #fff; color: var(--text); max-width: 220px; }
.idea-link-input { flex: 1; min-width: 180px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.idea-filter-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.idea-q-input { flex: 1; min-width: 200px; max-width: 360px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 13px; background: #fff; }
.idea-topic-mark { color: var(--primary); font-size: 14px; }
.idea-ori { font-size: 11px; cursor: default; }
.idea-ori-growth { background: var(--primary-light, #eef4ff); color: var(--primary); border: 1px solid var(--primary); }
.idea-ori-vertical { background: #f2f4f7; color: var(--text-2); }
.idea-angle { font-size: 13px; color: var(--text-2); line-height: 1.7; margin-bottom: 8px; }
.idea-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.idea-foot { font-size: 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.idea-raw-toggle { cursor: pointer; color: var(--primary); font-size: 12px; }
.idea-raw { margin-top: 8px; font-size: 12px; color: var(--text-2); line-height: 1.7; white-space: pre-wrap; background: var(--bg); border-radius: 10px; padding: 10px 12px; max-height: 220px; overflow-y: auto; }
.idea-digest-head { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.idea-digest-body { font-size: 13px; line-height: 2; color: var(--text); }
.idea-src-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.idea-src-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.idea-src-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.idea-src-name { font-weight: 600; font-size: 13px; }
.idea-src-add { display: flex; gap: 8px; flex-wrap: wrap; }
.idea-src-add input, .idea-src-add select { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; flex: 1; min-width: 120px; }
.idea-src-add input:focus, .idea-src-add select:focus { outline: none; border-color: var(--primary); }

/* ========== 工作台化：分组导航 + 快捷入口 ========== */
.nav-group-title { font-size: 11px; color: var(--text-3); padding: 14px 22px 6px; letter-spacing: 1px; user-select: none; }
.nav-group-title:first-child { padding-top: 4px; }
.wb-card-quick { margin-bottom: 16px; }
.wb-quick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.wb-quick-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 12px; border-radius: 12px; background: var(--bg); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 500; transition: all .15s; border: 1px solid transparent; }
.wb-quick-item:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); transform: translateY(-1px); }
.wb-quick-ico { font-size: 20px; line-height: 1; }
@media (max-width: 720px) { .wb-quick-grid { grid-template-columns: repeat(3, 1fr); } }

/* ========== AI 文案：建议卡片 / 修改历史 ========== */
.ct-suggest-list { display: flex; flex-direction: column; gap: 12px; }
.ct-suggest { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: #fff; }
.ct-suggest-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ct-suggest-type { font-size: 11px; background: var(--primary-light); color: var(--primary); padding: 2px 8px; border-radius: 6px; font-weight: 500; flex-shrink: 0; }
.ct-suggest-title { font-size: 13px; font-weight: 600; flex: 1; }
.ct-suggest-content { font-size: 13px; line-height: 1.8; color: var(--text); white-space: pre-wrap; }
.ct-suggest-note { font-size: 12px; color: var(--text-3); margin-top: 8px; }
.ct-card-text { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; padding: 10px 14px; background: var(--primary-light); border-left: 3px solid var(--primary); border-radius: 8px; font-size: 15px; font-weight: 600; color: var(--text); }
.ct-card-label { font-size: 11px; font-weight: 500; color: var(--primary); border: 1px solid var(--primary); border-radius: 6px; padding: 1px 6px; flex-shrink: 0; }
.rv-history { display: flex; flex-direction: column; gap: 6px; max-height: 120px; overflow-y: auto; }
.rv-history-item { font-size: 12px; color: var(--text-2); background: var(--bg); border-radius: 8px; padding: 6px 10px; }

/* ========== 图片库（内容素材图片） ========== */
.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.ig-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: all .15s; }
.ig-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-2px); }
.ig-thumb { position: relative; width: 100%; padding-top: 75%; cursor: zoom-in; background: var(--bg); }
.ig-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ig-meta { padding: 10px 12px 6px; flex: 1; min-width: 0; }
.ig-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-sub { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.ig-ops { display: flex; gap: 6px; padding: 0 12px 12px; }
.ig-ops .btn { padding: 3px 10px; font-size: 11px; }
.ig-count { font-style: normal; font-size: 11px; color: var(--text-3); margin-left: 4px; }
.ig-preview { text-align: center; background: var(--bg); border-radius: 10px; padding: 10px; }
.ig-preview img { max-width: 100%; max-height: 62vh; object-fit: contain; border-radius: 6px; }
.ig-mgr-list { display: flex; flex-direction: column; gap: 8px; }
.ig-mgr-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg); border-radius: 10px; }
.ig-mgr-name { font-size: 13px; font-weight: 500; flex: 1; }
.ig-mgr-count { font-size: 12px; color: var(--text-3); }
.ig-mgr-ops { display: flex; gap: 6px; }

/* ---------- 任务：个人任务 / 每日重复 ---------- */
.tk-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 500; vertical-align: 1px; }
.tk-badge-personal { background: #EEF2FF; color: #4353C9; }
.tk-badge-daily { background: #FFF4E5; color: #B25E09; margin-left: 4px; }
.tk-badge-touch { background: #E8F8F0; color: #1E7F4F; margin-left: 4px; }

/* ---------- 晨播互动任务：模板建议 + AI 开场话术 ---------- */
.tk-advice { margin-top: 6px; padding: 8px 10px; background: #F8FAF9; border-radius: 8px; font-size: 12px; color: var(--text-2, #555); line-height: 1.7; white-space: pre-line; border-left: 3px solid #1E7F4F; }
.tk-ai-advice { margin-top: 6px; padding: 10px 12px; background: #FFF7ED; border-radius: 8px; font-size: 12px; line-height: 1.8; }
.tk-ai-advice .ai-opener { font-size: 14px; color: #B25E09; font-weight: 600; background: #fff; padding: 6px 10px; border-radius: 6px; border: 1px dashed #E4B889; margin: 6px 0; }
.tk-ai-advice .ai-reason { color: var(--text-2, #555); }
.tk-type-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.tk-type-label { margin: 0; }
.tk-radio { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.tk-radio input { width: auto; }
.tk-daily-label input { accent-color: var(--blue, #2E6BE6); }

/* ---------- 客户档案附件缩略图 ---------- */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.att-card { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; transition: box-shadow .15s; }
.att-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.att-thumb { width: 100%; height: 140px; object-fit: cover; display: block; background: #F5F6F8; }
.att-icon { width: 100%; height: 140px; display: flex; align-items: center; justify-content: center; font-size: 48px; background: #F5F6F8; }
.att-meta { padding: 10px 12px; }
.att-name { font-size: 13px; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-remark { font-size: 12px; color: var(--blue); margin-top: 2px; }
.att-sub { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.att-del { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .15s; background: rgba(255,255,255,0.9); border-radius: 6px; }
.att-card:hover .att-del { opacity: 1; }
