/* ===== 音著协流程管理系统 样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --bg: #f3f4f6;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.12);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
input, select, textarea, button { font-family: inherit; font-size: 14px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== 登录页 ===== */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}
.login-card {
  width: 380px;
  max-width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.login-logo {
  text-align: center;
  padding: 36px 24px 20px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
}
.login-logo .logo-mark {
  width: 60px; height: 60px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.login-logo h1 { font-size: 22px; font-weight: 700; }
.login-logo p { font-size: 13px; opacity: .85; margin-top: 4px; }
.login-form { padding: 28px 28px 32px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
  box-sizing: border-box;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.login-tip { color: var(--danger); font-size: 13px; margin-top: 10px; text-align: center; min-height: 18px; }

/* ===== 按钮 ===== */
.btn {
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: all .2s;
  font-weight: 500;
}
.btn:hover { background: #f9fafb; }
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-danger { color: var(--danger); border-color: #fecaca; background: #fef2f2; }
.btn-danger:hover { background: #fee2e2; }
.btn-success { color: var(--success); border-color: #bbf7d0; background: #f0fdf4; }
.btn-success:hover { background: #dcfce7; }

/* ===== 应用布局 ===== */
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: #111827;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 50;
}
.side-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.side-logo .logo-mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.side-title strong { display: block; font-size: 15px; }
.side-title small { font-size: 11px; color: #9ca3af; }
.side-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  color: #d1d5db;
  cursor: pointer;
  transition: all .15s;
  margin-bottom: 4px;
  font-size: 14px;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-icon { font-size: 16px; }
.side-bottom {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.side-user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  flex-shrink: 0;
}
.user-info strong { display: block; font-size: 14px; }
.user-info small { font-size: 11px; color: #9ca3af; }
.logout-btn {
  display: block;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  color: #9ca3af;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
}
.logout-btn:hover { background: rgba(239,68,68,.15); color: #f87171; }

/* ===== 主内容 ===== */
.main { flex: 1; margin-left: 220px; padding: 0 24px 40px; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  background: var(--bg);
}
.topbar-title { font-size: 22px; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

/* ===== 消息通知 ===== */
.notif-wrap { position: relative; }
.notif-btn {
  position: relative;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.notif-btn:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.notif-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px !important; height: 18px; padding: 0 4px;
  background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 600;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.notif-panel {
  position: absolute; right: 0; top: 44px;
  width: 340px; max-height: 420px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  z-index: 100;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.notif-readall { color: var(--primary); font-size: 12px; cursor: pointer; }
.notif-readall:hover { text-decoration: underline; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; cursor: pointer; }
.notif-item:hover { background: #f9fafb; }
.notif-item.unread { background: #eef2ff; }
.notif-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; flex-shrink: 0; }
.notif-content { font-size: 12px; color: #4b5563; margin-top: 3px; line-height: 1.5; }
.notif-time { font-size: 11px; color: #9ca3af; margin-top: 4px; }
.notif-empty { padding: 30px; text-align: center; color: #9ca3af; font-size: 13px; }

/* ===== 成员多选 ===== */
.user-checks { display: flex; flex-wrap: wrap; gap: 14px; padding: 6px 0; align-items: center; }
.user-checks-inline { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 260px !important; padding: 4px 0; align-items: center; gap: 10px; }
.user-check {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0;
  border: none;
  flex-shrink: 0;
  border-radius: 0;
  font-size: 13px;
  cursor: pointer;
  background: transparent;
  color: var(--text);
  transition: all .15s;
  white-space: nowrap;
  overflow: visible;
}
.user-check {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.user-check:hover {
  background: #f1f5f9;
}
.user-check input {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  min-width: 14px !important;
  min-height: 14px;
  border: 2px solid #4f46e5;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  margin: 0;
  position: relative;
  box-sizing: border-box;
  vertical-align: middle;
  display: inline-block;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
/* 弹窗内负责人圆圈统一为 14px */
.modal .user-check input {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
}
/* 更高优先级确保选中时圆圈填满蓝色 */
.modal .user-check.is-checked input,
.user-check.is-checked input,
.user-check input:checked {
  background: #4f46e5;
  background-color: #4f46e5;
  border-color: #4f46e5;
  box-shadow: inset 0 0 0 10px #4f46e5;
}
.user-check span { flex-shrink: 0; }

.search-box input {
  width: 240px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  outline: none;
  transition: all .2s;
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

/* ===== 面板 ===== */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.panel-head h3 { font-size: 15px; }
.panel-sub { font-size: 12px; color: var(--text-light); }
.panel-body { padding: 12px 18px; }
.empty-tip { text-align: center; color: var(--text-light); padding: 24px 0; font-size: 13px; }

/* ===== 统计卡 ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}
.stat-infringement::before { background: var(--danger); }
.stat-license::before { background: var(--success); }
.stat-overdue::before { background: var(--warning); }
.stat-closed::before { background: var(--primary); }
.stat-num { font-size: 32px; font-weight: 700; }
.stat-infringement .stat-num { color: var(--danger); }
.stat-license .stat-num { color: var(--success); }
.stat-overdue .stat-num { color: var(--warning); }
.stat-closed .stat-num { color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* ===== 双栏 ===== */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 待办列表 ===== */
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid #f3f4f6;
}
.todo-item:last-child { border-bottom: none; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.priority-urgent { background: var(--danger); }
.priority-high { background: var(--warning); }
.priority-medium { background: #60a5fa; }
.priority-low { background: #9ca3af; }
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-meta { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.todo-meta .case-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: #f3f4f6;
  color: var(--text-light);
  margin-right: 6px;
  font-size: 11px;
}
.due-overdue { color: var(--danger); font-weight: 600; }
.due-today { color: var(--warning); font-weight: 600; }
.todo-action { flex-shrink: 0; }

/* ===== 我的案件卡片 ===== */
.mycase-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background .15s;
  border-radius: 8px;
}
.mycase-card:hover { background: #f9fafb; }
.mycase-card:last-child { border-bottom: none; }
.flow-badge {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.flow-infringement { background: #fee2e2; }
.flow-license { background: #dcfce7; }
.mycase-info { flex: 1; min-width: 0; }
.mycase-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mycase-meta { font-size: 12px; color: var(--text-light); margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stage-pill {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 10px;
  font-size: 11px;
  color: #fff;
}
.task-count { font-size: 12px; }
.task-count.overdue { color: var(--danger); }

/* ===== 我的待办 / 我的案件：竖向列表，只显示前3条，超出右侧滚动 ===== */
#my-todo-list, #my-case-list {
  display: block;
  max-height: 198px;          /* 约3条卡片高度 */
  overflow-y: auto;           /* 右侧上下滚动 */
  overflow-x: hidden;
  padding-right: 6px;
  scrollbar-width: thin;
}
#my-todo-list .todo-item,
#my-case-list .mycase-card {
  width: 100%;
  border-bottom: 1px solid #f3f4f6;
  box-sizing: border-box;
  margin: 0;
}
#my-todo-list .empty-tip, #my-case-list .empty-tip { flex: 1; }

/* ===== 活动动态 ===== */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}
.activity-item:last-child { border-bottom: none; }
.activity-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
  flex-shrink: 0;
}
.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; line-height: 1.5; }
.activity-text .act-user { font-weight: 600; }
.activity-text .act-case { color: var(--primary); cursor: pointer; }
.activity-time { font-size: 11px; color: #9ca3af; margin-top: 2px; }

/* ===== 看板 ===== */
.kanban-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.kanban-tabs { display: flex; gap: 10px; }
.kanban-filter { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #374151; }
.kanban-filter select { padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; min-width: 120px; cursor: pointer; }
.kb-tab {
  padding: 9px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
}
.kb-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.kanban-wrap {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
}
.kb-col {
  flex: 0 0 240px;
  background: #eef0f4;
  border-radius: 10px;
  padding: 10px;
  min-height: 200px;
}
.kb-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 10px;
}
.kb-col-dot { width: 10px; height: 10px; border-radius: 50%; }
.kb-col-name { font-size: 13px; font-weight: 600; }
.kb-col-count {
  font-size: 11px;
  background: #d1d5db;
  color: #374151;
  border-radius: 10px;
  padding: 1px 8px;
}
.kb-card {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.kb-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.kb-card.infringement { border-left-color: var(--danger); }
.kb-card.license { border-left-color: var(--success); }
.kb-card-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-card-meta { font-size: 11px; color: var(--text-light); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kb-card-meta .meta-pill {
  background: #f3f4f6;
  border-radius: 4px;
  padding: 1px 6px;
}
.kb-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
}
.kb-card-owner { font-size: 11px; color: var(--text-light); display: flex; align-items: center; gap: 5px; }
.kb-card-owner .mini-avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #e0e7ff;
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 600;
}
.kb-card-tasks { font-size: 11px; }
.kb-card-tasks .td-overdue { color: var(--danger); font-weight: 600; }
.kb-card-advance {
  font-size: 11px;
  color: var(--primary);
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--primary-light);
  transition: all .15s;
}
.kb-card-advance:hover { background: var(--primary); color: #fff; }

/* ===== 任务列表 ===== */
.tasks-toolbar { margin-bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pager-bar { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 12px; border-top: 1px solid var(--border); }
.task-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
}
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #f3f4f6;
}
.task-row:last-child { border-bottom: none; }
.task-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  color: transparent;
  font-size: 13px;
}
.task-check:hover { border-color: var(--success); }
.task-check.done { background: var(--success); border-color: var(--success); color: #fff; }
.task-main { flex: 1; min-width: 0; }
.task-main.done .task-title { text-decoration: line-through; color: #9ca3af; }
.task-title { font-size: 14px; font-weight: 500; }
.task-meta { font-size: 12px; color: var(--text-light); margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-result { color: var(--primary); font-weight: 500; background: #f0f9ff; padding: 1px 6px; border-radius: 4px; }

/* ===== 数据表格 ===== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-light);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: #f9fafb;
  vertical-align: middle;
  white-space: nowrap;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
  vertical-align: middle;
}
/* 时间列：强制单行显示，保证最小宽度避免被挤压 */
.data-table .col-time {
  white-space: nowrap;
  min-width: 90px;
}
/* 电话列：限制最大宽度，防止超长内容撑宽列 */
.data-table .col-phone {
  max-width: 140px;
  word-break: break-all;
}
/* 数字列：右对齐，等宽数字更整齐 */
.data-table th.th-num { text-align: right; }
.data-table td.td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* 长文本列：截断显示，鼠标悬停可看完整（title） */
.data-table td.td-ellipsis {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table strong.td-ellipsis { display: inline-block; }
.data-table tr:hover td { background: #f9fafb; }
/* 表头：浅灰背景 + 深色文字，不固定滚动（避免遮挡数据行） */
#view-contracts .data-table thead,
#contract-bg-box .data-table thead,
#view-bars .data-table thead {
  background: #f9fafb;
}
#view-contracts .data-table th,
#contract-bg-box .data-table th,
#view-bars .data-table th {
  background: #f9fafb;
  color: #374151;
  font-weight: 700;
  border-bottom: 2px solid #d1d5db;
}
.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.badge-admin { background: #fee2e2; color: var(--danger); }
.badge-member { background: #e0e7ff; color: var(--primary); }
.badge-active { background: #dcfce7; color: #16a34a; }
.badge-disabled { background: #f3f4f6; color: #9ca3af; }
.badge-infringement { background: #fee2e2; color: var(--danger); }
.badge-license { background: #dcfce7; color: #16a34a; }
.badge-pending { background: #fef3c7; color: #b45309; }
.stage-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.link-btn { color: var(--primary); cursor: pointer; font-size: 13px; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }

/* ===== 酒吧标签 ===== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  background: #e0e7ff;
  color: var(--primary);
  margin-right: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
}

/* ===== 酒吧信息视图 ===== */
#view-contracts .data-table,
#view-bars .data-table {
  min-width: 1900px !important;
}
#view-contracts .data-table th,
#view-contracts .data-table td,
#view-bars .data-table th,
#view-bars .data-table td {
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
}
#view-contracts .data-table th,
#view-bars .data-table th {
  text-align: center;
  font-size: 13px;
  padding: 10px 8px;
}
#view-contracts .data-table td,
#view-bars .data-table td {
  font-size: 14px;
  padding: 10px 8px;
  line-height: 1.5;
}
#view-contracts .data-table td.col-office,
#view-contracts .data-table th.col-office,
#contract-bg-box .data-table td.col-office,
#contract-bg-box .data-table th.col-office {
  width: 170px !important;
  min-width: 170px !important;
  text-align: center;
  word-break: keep-all !important;
  white-space: nowrap !important;
}
#view-contracts .data-table td:nth-child(2),
#view-contracts .data-table th:nth-child(2) {
  width: 40px;
  text-align: center;
  white-space: nowrap;
}
#view-contracts .data-table td:nth-child(3),
#view-contracts .data-table th:nth-child(3) {
  width: 50px;
  text-align: center;
  white-space: nowrap;
}
#view-contracts .data-table td:nth-child(5),
#view-contracts .data-table th:nth-child(5) {
  min-width: 120px !important;
  max-width: 260px !important;
}
#view-contracts .data-table td:nth-child(6),
#view-contracts .data-table th:nth-child(6) {
  min-width: 160px !important;
  max-width: 240px !important;
}
#view-contracts .data-table td:nth-child(7),
#view-contracts .data-table th:nth-child(7) {
  width: 90px;
  text-align: center;
  white-space: nowrap;
}
#view-contracts .data-table td:nth-child(8),
#view-contracts .data-table th:nth-child(8) {
  min-width: 120px !important;
  max-width: 180px !important;
}
#view-contracts .data-table td:nth-child(9),
#view-contracts .data-table th:nth-child(9) {
  width: 60px;
  text-align: center;
  white-space: nowrap;
}
#view-contracts .data-table td:nth-child(10),
#view-contracts .data-table th:nth-child(10),
#view-contracts .data-table td:nth-child(11),
#view-contracts .data-table th:nth-child(11),
#view-contracts .data-table td:nth-child(12),
#view-contracts .data-table th:nth-child(12) {
  width: 60px;
  text-align: center;
  white-space: nowrap;
}
#view-contracts .data-table td:nth-child(13),
#view-contracts .data-table th:nth-child(13) {
  width: 80px;
  text-align: right;
  white-space: nowrap;
}
#view-contracts .data-table td:nth-child(14),
#view-contracts .data-table th:nth-child(14) {
  min-width: 160px !important;
  max-width: 260px !important;
}
#view-contracts .data-table td:nth-child(15),
#view-contracts .data-table th:nth-child(15) {
  width: 110px;
  text-align: center;
  word-break: keep-all;
}
#view-contracts .data-table td:nth-child(16),
#view-contracts .data-table th:nth-child(16) {
  width: 110px;
  text-align: center;
  word-break: keep-all;
}
#view-contracts .data-table td:nth-child(17),
#view-contracts .data-table th:nth-child(17) {
  width: 100px;
  text-align: center;
  word-break: keep-all;
}
#view-contracts .data-table td:nth-child(18),
#view-contracts .data-table th:nth-child(18) {
  width: 100px;
  text-align: center;
  word-break: keep-all;
}
#view-contracts .data-table td:nth-child(19),
#view-contracts .data-table th:nth-child(19) {
  width: 110px;
  text-align: right;
  word-break: keep-all;
}
#view-contracts .data-table td:nth-child(20),
#view-contracts .data-table th:nth-child(20) {
  width: 110px;
  text-align: center;
  word-break: keep-all;
}
#view-contracts .data-table td:nth-child(21),
#view-contracts .data-table th:nth-child(21) {
  width: 110px;
  text-align: center;
  word-break: keep-all;
}

/* 背景合同表格 */
#contract-bg-box .data-table {
  min-width: 1900px !important;
}
#contract-bg-box .data-table th,
#contract-bg-box .data-table td {
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
}
#contract-bg-box .data-table th {
  text-align: center;
  font-size: 13px;
  padding: 10px 8px;
}
#contract-bg-box .data-table td {
  font-size: 14px;
  padding: 10px 8px;
  line-height: 1.5;
}
#contract-bg-box .data-table td:nth-child(2),
#contract-bg-box .data-table th:nth-child(2) {
  width: 40px;
  text-align: center;
  white-space: nowrap;
}
#contract-bg-box .data-table td:nth-child(3),
#contract-bg-box .data-table th:nth-child(3) {
  width: 50px;
  text-align: center;
  white-space: nowrap;
}
#contract-bg-box .data-table td:nth-child(5),
#contract-bg-box .data-table th:nth-child(5) {
  min-width: 120px !important;
  max-width: 260px !important;
}
#contract-bg-box .data-table td:nth-child(6),
#contract-bg-box .data-table th:nth-child(6) {
  min-width: 160px !important;
  max-width: 240px !important;
}
#contract-bg-box .data-table td:nth-child(7),
#contract-bg-box .data-table th:nth-child(7) {
  width: 90px;
  text-align: center;
  white-space: nowrap;
}
#contract-bg-box .data-table td:nth-child(8),
#contract-bg-box .data-table th:nth-child(8) {
  width: 90px;
  text-align: center;
}
#contract-bg-box .data-table td:nth-child(9),
#contract-bg-box .data-table th:nth-child(9) {
  min-width: 120px !important;
  max-width: 180px !important;
}
#contract-bg-box .data-table td:nth-child(10),
#contract-bg-box .data-table th:nth-child(10) {
  width: 70px;
  text-align: center;
  white-space: nowrap;
}
#contract-bg-box .data-table td:nth-child(11),
#contract-bg-box .data-table th:nth-child(11) {
  width: 70px;
  text-align: center;
}
#contract-bg-box .data-table td:nth-child(12),
#contract-bg-box .data-table th:nth-child(12) {
  width: 70px;
  text-align: center;
}
#contract-bg-box .data-table td:nth-child(13),
#contract-bg-box .data-table th:nth-child(13) {
  width: 70px;
  text-align: center;
}
#contract-bg-box .data-table td:nth-child(14),
#contract-bg-box .data-table th:nth-child(14) {
  min-width: 120px !important;
}
#contract-bg-box .data-table td:nth-child(15),
#contract-bg-box .data-table th:nth-child(15) {
  width: 110px;
  text-align: center;
  word-break: keep-all;
}
#contract-bg-box .data-table td:nth-child(16),
#contract-bg-box .data-table th:nth-child(16) {
  width: 110px;
  text-align: center;
  word-break: keep-all;
}
#contract-bg-box .data-table td:nth-child(17),
#contract-bg-box .data-table th:nth-child(17) {
  width: 130px;
  word-break: keep-all;
}
#contract-bg-box .data-table td:nth-child(18),
#contract-bg-box .data-table th:nth-child(18) {
  width: 110px;
  text-align: center;
  word-break: keep-all;
}
#contract-bg-box .data-table td:nth-child(19),
#contract-bg-box .data-table th:nth-child(19) {
  width: 110px;
  text-align: center;
  word-break: keep-all;
}
#contract-bg-box .data-table td:nth-child(20),
#contract-bg-box .data-table th:nth-child(20) {
  width: 110px;
  text-align: center;
  word-break: keep-all;
}
#contract-bg-box .data-table td:nth-child(21),
#contract-bg-box .data-table th:nth-child(21) {
  width: 110px;
  text-align: center;
  word-break: keep-all;
}

/* 酒吧表格保持原有样式 */
#view-bars .data-table td:nth-child(4),
#view-bars .data-table td:nth-child(5) {
  min-width: 160px !important;
  max-width: 240px !important;
}

/* 查看详情按钮 */
.btn-view { background: #fff; color: #2563eb; border: 1px solid #93c5fd; }
.btn-view:hover { background: #eff6ff; }
/* 详情列表 */
.detail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.detail-item { display: flex; gap: 10px; padding: 10px 12px; background: #f9fafb; border-radius: 8px; }
.detail-item-full { grid-column: span 2; }
.detail-label { flex-shrink: 0; color: #6b7280; font-size: 13px; min-width: 70px; }
.detail-value { flex: 1; color: #1f2937; font-size: 14px; word-break: break-all; white-space: pre-wrap; }
.detail-input { flex: 1; min-width: 0; width: 100%; border: 1px solid #d1d5db; border-radius: 6px; padding: 7px 10px; font-size: 14px; box-sizing: border-box; background: #fff; }
.detail-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.12); }
.detail-textarea { min-height: 60px; resize: vertical; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.55);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  width: 560px;
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-lg { width: 1100px; max-width: 95vw; }
#result-input { min-height: 96px; resize: vertical; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-sub { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.modal-close {
  border: none;
  background: #f3f4f6;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-light);
  transition: all .15s;
}
.modal-close:hover { background: #e5e7eb; color: var(--text); }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field-full { grid-column: 1 / -1; }
.seg { display: flex; gap: 8px; }
.seg-btn {
  flex: 1;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
}
.seg-btn.active[data-type="infringement"] { background: #fee2e2; border-color: var(--danger); color: var(--danger); font-weight: 600; }
.seg-btn.active[data-type="license"] { background: #dcfce7; border-color: var(--success); color: #16a34a; font-weight: 600; }

/* ===== 案件详情 ===== */
.case-detail-grid { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) {
  .case-detail-grid { grid-template-columns: 1fr; }
}
.case-info-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #f1f5f9;
}
.case-info-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  gap: 12px;
  line-height: 1.5;
}
.case-info-row:last-child { border-bottom: none; }
.case-info-row .k { color: #64748b; flex-shrink: 0; min-width: 60px !important; font-weight: 500; }
.case-info-row .v { text-align: right; font-weight: 500; word-break: break-all; color: #334155; }
.case-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.case-actions .btn { width: 100%; font-size: 13px; padding: 10px 6px; border-radius: 8px; }
.case-actions .btn-success { grid-column: span 2; }

/* 阶段时间线 */
.stage-timeline { position: relative; padding-left: 28px; }
.stage-timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 8px; bottom: 8px;
  width: 2px;
  background: #e2e8f0;
  border-radius: 1px;
}
.stage-item { position: relative; padding-bottom: 20px; }
.stage-item::before {
  content: '';
  position: absolute;
  left: -28px; top: 5px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #cbd5e1;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #cbd5e1;
  z-index: 1;
}
.stage-item.done::before { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.stage-item.current::before {
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--primary), 0 0 0 6px rgba(79,70,229,.15);
}
.stage-item.done .stage-name { color: #64748b; }
.stage-item .stage-name { font-size: 14px; font-weight: 600; color: #1e293b; line-height: 1.5; }
.stage-item .stage-time { font-size: 11px; color: #94a3b8; margin-top: 3px; }
.stage-item .stage-result { display: inline-block; font-size: 11px; color: #ea580c; background: #fff7ed; border: 1px solid #fed7aa; padding: 2px 10px; border-radius: 12px; margin-left: 8px; vertical-align: middle; font-weight: 600; }
.stage-item .stage-desc { font-size: 12px; color: #64748b; margin-top: 5px; line-height: 1.5; }
.stage-tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 10px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 500;
}
.stage-tag.done { background: #dcfce7; color: #16a34a; }
.stage-tag.current { background: #e0e7ff; color: var(--primary); }
.stage-actions { margin-top: 10px; display: flex; gap: 8px; }

/* 右侧区域：阶段 + 任务 */
.case-detail-grid .detail-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.case-detail-grid .detail-right > .panel {
  margin-bottom: 0;
  border-radius: 12px;
}
.case-detail-grid .stage-panel .panel-body {
  max-height: 320px;
  overflow-y: auto;
  padding: 16px;
}
.case-detail-grid .tasks-panel .panel-body {
  max-height: 380px;
  overflow-y: auto;
  padding: 16px;
}
.case-detail-grid .panel-head {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.case-detail-grid .panel-head h3 {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

/* 详情区任务 */
.new-task-bar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.new-task-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.new-task-row input[type="text"] { flex: 1; min-width: 180px !important; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; outline: none; }
.new-task-row input[type="text"]:focus { border-color: var(--primary); }
.new-task-row select, .new-task-row input[type="date"] {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  outline: none; background: #fff; font-size: 13px; color: var(--text); cursor: pointer;
}
.new-task-row select:focus, .new-task-row input[type="date"]:focus { border-color: var(--primary); }
.new-task-row-bottom { justify-content: space-between; }
.new-task-row-bottom .btn { flex-shrink: 0; }
.task-actions { display: flex; gap: 6px; align-items: center; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111827;
  color: #fff;
  padding: 11px 24px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all .3s;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #16a34a; }
.toast.error { background: var(--danger); }

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .side-title, .side-bottom .user-info, .logout-btn { display: none; }
  .side-logo { justify-content: center; padding: 14px 8px; }
  .nav-item { justify-content: center; padding: 12px 8px; }
  .nav-icon { font-size: 18px; }
  .nav-item span:not(.nav-icon) { display: none; }
  .main { margin-left: 64px; padding: 0 12px 30px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .topbar-actions { width: 100%; }
  .search-box { flex: 1; }
  .search-box input { width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-num { font-size: 24px; }
  .kb-col { flex-basis: 200px; }
}
