* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #E87722;
  --primary-light: #FDF0E6;
  --primary-dark: #B85C0E;
  --teal: #0F6E56;
  --teal-light: #E1F5EE;
  --teal-dark: #085041;
  --gray-bg: #F5F5F3;
  --gray-border: #E0DED7;
  --gray-text: #6B6A65;
  --dark-text: #2C2C2A;
  --red: #D85A30;
  --red-light: #FAECE7;
  --amber: #BA7517;
  --amber-light: #FAEEDA;
  --green: #3B6D11;
  --green-light: #EAF3DE;
  --white: #FFFFFF;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--gray-bg);
  color: var(--dark-text);
  font-size: 14px;
  line-height: 1.6;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #B85C0E 0%, #E87722 100%);
}
.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 48px 40px;
  width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  text-align: center;
}
.login-logo { font-size: 24px; font-weight: 600; color: var(--primary-dark); margin-bottom: 4px; }
.login-subtitle { font-size: 14px; color: var(--gray-text); margin-bottom: 32px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form input {
  padding: 12px 16px; border: 1px solid var(--gray-border); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; transition: border 0.2s;
}
.login-form input:focus { border-color: var(--primary); }
.btn-login { margin-top: 8px; width: 100%; padding: 12px; font-size: 15px; }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; }
.login-hint { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--gray-border); font-size: 12px; color: var(--gray-text); line-height: 1.8; }

.btn-primary {
  background: var(--primary); color: var(--white); border: none; border-radius: var(--radius-sm);
  padding: 9px 18px; font-size: 14px; cursor: pointer; transition: background 0.2s; font-weight: 500;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
  background: var(--white); color: var(--dark-text); border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm); padding: 9px 18px; font-size: 14px; cursor: pointer; transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--white); color: var(--red); border: 1px solid #F5C4B3; border-radius: var(--radius-sm); padding: 9px 18px; font-size: 14px; cursor: pointer; }
.btn-danger:hover { background: var(--red-light); }
.btn-sm { padding: 5px 12px; font-size: 13px; }

/* 来源线索跳转胶囊按钮（案件详情-取证/搜证tab） */
.lead-link-btn {
  display: inline-flex; align-items: center; gap: 6px; max-width: 420px;
  padding: 4px 14px; border: 1px solid var(--primary); border-radius: 999px;
  color: var(--primary); background: var(--white); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s; text-decoration: none; line-height: 1.6;
}
.lead-link-btn:hover { background: var(--primary); color: var(--white); }
.lead-link-btn .lead-link-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-link-btn .lead-link-arrow { flex-shrink: 0; font-size: 12px; transition: transform 0.15s; }
.lead-link-btn:hover .lead-link-arrow { transform: translateX(3px); }

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--white); border-right: 1px solid var(--gray-border);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
}
.sidebar-logo { display: flex; align-items: center; gap: 9px; padding: 11px 16px; border-bottom: 1px solid var(--gray-border); flex-shrink: 0; position: relative; }
.logo-icon {
  width: 28px; height: 28px; background: var(--primary); color: var(--white);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.logo-text { font-size: 14px; font-weight: 600; color: var(--dark-text); }
.sidebar-menu { flex: 1; padding: 7px 9px; overflow-y: auto; }
.menu-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--gray-text); font-size: 13px; line-height: 1.25; transition: all 0.15s; margin-bottom: 1px;
}
.menu-item:hover { background: var(--gray-bg); color: var(--dark-text); }
.menu-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 500; }
.menu-icon { width: 16px; text-align: center; font-size: 14px; flex-shrink: 0; }
.menu-sort-btn { padding: 5px 12px; margin-top: 4px; font-size: 12px; color: var(--gray-text); cursor: pointer; border-top: 1px solid var(--gray-border); transition: color 0.15s; }
.menu-sort-btn:hover { color: var(--primary); }
.sort-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--gray-border); border-radius: var(--radius-sm); margin-bottom: 6px; cursor: default; transition: border-color 0.15s, box-shadow 0.15s; user-select: none; }
.sort-row:hover { border-color: var(--primary); }
.sort-row.dragging { opacity: 0.4; }
.sort-row.drag-over { border-color: var(--primary); border-style: dashed; box-shadow: 0 0 0 2px rgba(74,108,212,0.15); }
.drag-handle { cursor: grab; color: var(--gray-text); font-size: 16px; line-height: 1; padding: 0 2px; }
.drag-handle:active { cursor: grabbing; }
.menu-group { margin-bottom: 4px; }
.menu-group-header {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--gray-text); font-size: 13px; transition: all 0.15s; user-select: none;
}
.menu-group-header:hover { background: var(--gray-bg); color: var(--dark-text); }
.menu-group-header .menu-icon { width: 18px; text-align: center; }
.menu-group-arrow { margin-left: auto; font-size: 11px; transition: transform 0.2s; color: var(--gray-text); }
.menu-group.expanded .menu-group-arrow { transform: rotate(90deg); }
.menu-group-items { display: none; padding-left: 28px; }
.menu-group.expanded .menu-group-items { display: block; }
.menu-group-items .menu-item { padding: 5px 12px; font-size: 12.5px; }
.menu-divider { height: 1px; background: var(--gray-border); margin: 8px 10px; }
.sidebar-user { padding: 9px 14px; border-top: 1px solid var(--gray-border); display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; flex-shrink: 0;
}
.user-detail { flex: 1; min-width: 0; }
.user-name { font-size: 12.5px; font-weight: 500; color: var(--dark-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11.5px; color: var(--gray-text); }
.btn-logout { background: none; border: 1px solid var(--gray-border); border-radius: 4px; padding: 3px 8px; font-size: 11.5px; color: var(--gray-text); cursor: pointer; }
.btn-logout:hover { color: var(--red); border-color: #F5C4B3; }

.main-content { flex: 1; margin-left: 220px; padding: 28px 32px; min-width: 0; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-title { font-size: 20px; font-weight: 600; color: var(--dark-text); }
.page-subtitle { font-size: 13px; color: var(--gray-text); margin-top: 2px; }

.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: var(--dark-text); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.stat-value { font-size: 30px; font-weight: 600; color: var(--primary-dark); }
.stat-label { font-size: 13px; color: var(--gray-text); margin-top: 4px; }
.stat-card.warn .stat-value { color: var(--amber); }
.stat-card.danger .stat-value { color: var(--red); }
.stat-card.success .stat-value { color: var(--teal); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 12px; font-size: 13px; font-weight: 500; color: var(--gray-text); border-bottom: 1px solid var(--gray-border); white-space: nowrap; }
td { padding: 12px; font-size: 13px; border-bottom: 1px solid var(--gray-border); }
tr:hover td { background: var(--gray-bg); }
.table-link { color: var(--primary); cursor: pointer; text-decoration: none; }
.table-link:hover { text-decoration: underline; }

.tag { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.tag-trademark { background: var(--primary-light); color: var(--primary-dark); }
.tag-patent { background: var(--teal-light); color: var(--teal-dark); }
.tag-copyright { background: #E6F1FB; color: #0C447C; }
.tag-unfair_competition { background: var(--amber-light); color: var(--amber); }
.tag-major { background: var(--red-light); color: var(--red); }
.tag-pending_review { background: var(--amber-light); color: var(--amber); }
.tag-in_progress { background: var(--primary-light); color: var(--primary-dark); }
.tag-closed { background: var(--green-light); color: var(--green); }
.tag-done { background: var(--green-light); color: var(--green); }
.tag-pending { background: var(--gray-bg); color: var(--gray-text); }
.tag-in_progress_node { background: var(--amber-light); color: var(--amber); }
.tag-skipped { background: var(--gray-bg); color: var(--gray-text); }
.tag-overdue { background: var(--red-light); color: var(--red); }

.progress-bar { width: 100%; height: 6px; background: var(--gray-bg); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.3s; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: var(--gray-text); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--gray-border); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; transition: border 0.2s; font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.filter-bar { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.filter-bar .form-input, .filter-bar .form-select { width: auto; min-width: 140px; }

.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: var(--gray-border); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -28px; top: 2px; width: 18px; height: 18px; border-radius: 50%; border: 3px solid; background: var(--white); }
.timeline-dot.done { border-color: var(--green); background: var(--green); }
.timeline-dot.in_progress { border-color: var(--amber); }
.timeline-dot.pending { border-color: var(--gray-border); }
.timeline-dot.skipped { border-color: var(--gray-border); background: var(--gray-border); }
.timeline-content { font-size: 13px; }
.timeline-title { font-weight: 500; color: var(--dark-text); }
.timeline-meta { font-size: 12px; color: var(--gray-text); margin-top: 2px; }
.timeline-notes { font-size: 12px; color: var(--gray-text); margin-top: 4px; padding: 6px 10px; background: var(--gray-bg); border-radius: 4px; }

.case-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.detail-item { display: flex; flex-direction: column; }
.detail-label { font-size: 12px; color: var(--gray-text); margin-bottom: 2px; }
.detail-value { font-size: 14px; color: var(--dark-text); }

/* v20261009a：案件详情「点击填写」单元格 —— 虚线下划线暗示可点击，悬停高亮 */
.cell-edit { border-bottom: 1px dashed var(--gray-border); cursor: pointer; padding-bottom: 1px; transition: color 0.15s, border-color 0.15s; }
.cell-edit:hover { color: var(--primary); border-bottom-color: var(--primary); }
/* v20261009a：成员多选拾取器（案件负责人 / 参与人）—— 勾选框列表，超出滚动 */
.member-pick { max-height: 168px; overflow-y: auto; border: 1px solid var(--gray-border); border-radius: 6px; padding: 6px 8px; background: var(--white); }
.member-pick-item { display: flex; align-items: center; gap: 6px; padding: 3px 2px; font-size: 13px; cursor: pointer; }
.member-pick-item.is-auto { color: var(--gray-text); cursor: default; }
.member-pick-item .pick-auto { font-size: 11px; color: var(--gray-text); border: 1px solid var(--gray-border); border-radius: 8px; padding: 0 5px; margin-left: auto; }
.section-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--gray-border); }
.tab { padding: 10px 18px; font-size: 14px; color: var(--gray-text); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; }
.tab:hover { color: var(--dark-text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.tab-content { display: none; }
.tab-content.active { display: block; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal-box { background: var(--white); border-radius: 12px; padding: 28px; width: 520px; max-width: 90vw; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: var(--dark-text); color: var(--white); padding: 12px 24px; border-radius: 8px; font-size: 14px; z-index: 300; box-shadow: var(--shadow-lg); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-text); font-size: 14px; }
.file-link { color: var(--primary); cursor: pointer; text-decoration: none; }
.file-link:hover { text-decoration: underline; }
.log-list { max-height: 300px; overflow-y: auto; }
.log-item { padding: 8px 0; border-bottom: 1px solid var(--gray-border); font-size: 13px; }
.log-item:last-child { border-bottom: none; }
.log-time { color: var(--gray-text); font-size: 12px; }
.log-action { font-weight: 500; }
.log-operator { color: var(--primary); }
.text-muted { color: var(--gray-text); }
.text-danger { color: var(--red); }
.font-bold { font-weight: 600; }
.mb-0 { margin-bottom: 0; }
.mt-12 { margin-top: 12px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.flex { display: flex; align-items: center; }
.cursor-pointer { cursor: pointer; }

/* Calendar */
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.calendar-nav-btn { background: var(--white); border: 1px solid var(--gray-border); border-radius: var(--radius-sm); padding: 8px 16px; cursor: pointer; font-size: 14px; color: var(--dark-text); transition: all 0.15s; }
.calendar-nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.calendar-title { font-size: 18px; font-weight: 600; color: var(--dark-text); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--gray-border); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--gray-border); }
.calendar-weekday { background: var(--gray-bg); padding: 10px 6px; text-align: center; font-size: 12px; font-weight: 600; color: var(--gray-text); }
.calendar-cell { background: var(--white); min-height: 90px; padding: 6px 8px; position: relative; cursor: default; transition: background 0.15s; }
.calendar-cell.other-month { background: var(--gray-bg); color: var(--gray-text); opacity: 0.5; }
.calendar-cell.today { background: var(--primary-light); }
.calendar-cell:hover { background: #FFFBF7; }
.calendar-cell.other-month:hover { background: var(--gray-bg); }
.calendar-day-num { font-size: 13px; font-weight: 500; color: var(--dark-text); margin-bottom: 4px; }
.calendar-cell.today .calendar-day-num { color: var(--primary-dark); font-weight: 700; }
.calendar-event { background: var(--primary); color: var(--white); border-radius: 4px; padding: 3px 6px; font-size: 11px; margin-bottom: 2px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: all 0.15s; max-width: 110px; }
.calendar-event:hover { background: var(--primary-dark); }
.calendar-event.past { background: var(--gray-border); color: var(--gray-text); }
.calendar-event.contract-event { background: #e67e22; color: var(--white); }
.calendar-event.contract-event:hover { background: #d35400; }
.calendar-event.contract-event.past { background: var(--gray-border); color: var(--gray-text); }
.calendar-legend { display: flex; gap: 16px; margin-top: 16px; font-size: 12px; color: var(--gray-text); }
.calendar-legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
.placeholder-page { text-align: center; padding: 80px 20px; }
.placeholder-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.placeholder-title { font-size: 18px; font-weight: 600; color: var(--dark-text); margin-bottom: 8px; }
.placeholder-desc { font-size: 14px; color: var(--gray-text); max-width: 400px; margin: 0 auto; line-height: 1.8; }

/* === 信箱 === */
.mail-fab { position: relative; width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 16px rgba(232,119,34,0.4); z-index: 900; transition: transform 0.2s, box-shadow 0.2s; }
.mail-fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(232,119,34,0.5); }
.mail-fab-icon { font-size: 22px; }
.mail-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); color: var(--white); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid var(--white); }
.mail-tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 2px solid var(--gray-border); }
.mail-tab { padding: 10px 20px; cursor: pointer; font-size: 14px; color: var(--gray-text); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; }
.mail-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.mail-tab:hover { color: var(--primary); }
.mail-list { max-height: 420px; overflow-y: auto; }
.mail-item { padding: 14px; border: 1px solid var(--gray-border); border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.mail-item:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.mail-item.unread { border-left: 3px solid var(--primary); background: var(--primary-light); }
.mail-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mail-item-from { font-weight: 600; font-size: 14px; color: var(--dark-text); }
.mail-item-time { font-size: 12px; color: var(--gray-text); }
.mail-item-preview { font-size: 13px; color: var(--gray-text); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mail-item-tags { display: flex; gap: 6px; margin-top: 6px; }
.mail-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.mail-tag-anon { background: var(--gray-bg); color: var(--gray-text); }
.mail-tag-unread { background: var(--primary); color: var(--white); }
.mail-tag-replied { background: var(--teal-light); color: var(--teal-dark); }
.mail-detail { padding: 16px; }
.mail-detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-border); }
.mail-detail-from { font-size: 15px; font-weight: 600; }
.mail-detail-time { font-size: 12px; color: var(--gray-text); }
.mail-detail-content { font-size: 14px; line-height: 1.8; color: var(--dark-text); margin-bottom: 16px; padding: 14px; background: var(--gray-bg); border-radius: var(--radius-sm); }
.mail-reply-box { padding: 14px; border: 1px solid var(--gray-border); border-radius: var(--radius-sm); background: var(--teal-light); }
.mail-reply-label { font-size: 13px; font-weight: 600; color: var(--teal-dark); margin-bottom: 8px; }
.mail-reply-content { font-size: 13px; line-height: 1.6; color: var(--dark-text); }
.mail-reply-time { font-size: 11px; color: var(--gray-text); margin-top: 4px; }
.mail-empty { text-align: center; padding: 40px 20px; color: var(--gray-text); font-size: 14px; }
.mail-compose-hint { font-size: 12px; color: var(--gray-text); margin-top: 6px; }
.mail-anon-toggle { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--gray-bg); border-radius: var(--radius-sm); cursor: pointer; }
.mail-anon-toggle input { width: 16px; height: 16px; cursor: pointer; }
.mail-anon-toggle label { font-size: 14px; cursor: pointer; }

/* === 许愿池 === */
.wish-fab { position: relative; width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, #8E5BD6 0%, #6B3FB0 100%); color: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 16px rgba(110,75,180,0.45); z-index: 900; transition: transform 0.2s, box-shadow 0.2s; }
.wish-fab:hover { transform: scale(1.08) rotate(8deg); box-shadow: 0 6px 22px rgba(110,75,180,0.55); }
.wish-fab-icon { font-size: 24px; line-height: 1; }
.wish-list { max-height: 480px; overflow-y: auto; }
.wish-card { padding: 14px 16px; border: 1px solid var(--gray-border); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--white); transition: border-color 0.15s, box-shadow 0.15s; }
.wish-card:hover { border-color: #B89AE8; box-shadow: 0 2px 10px rgba(110,75,180,0.1); }
.wish-card.is-mine { border-left: 3px solid #8E5BD6; background: #F8F4FE; }
.wish-card-content { font-size: 14px; line-height: 1.7; color: var(--dark-text); margin-bottom: 12px; word-break: break-word; }
.wish-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.wish-prob { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.wish-prob-label { font-size: 12px; color: var(--gray-text); white-space: nowrap; }
.wish-prob-bar { flex: 1; height: 8px; min-width: 60px; background: var(--gray-bg); border-radius: 4px; overflow: hidden; }
.wish-prob-fill { height: 100%; background: linear-gradient(90deg, #F0B840 0%, #E87722 100%); border-radius: 4px; transition: width 0.4s ease; }
.wish-prob-num { font-size: 12px; font-weight: 700; color: var(--primary-dark); white-space: nowrap; min-width: 32px; text-align: right; }
.wish-actions { display: flex; gap: 6px; flex-shrink: 0; }
.wish-vote-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border: 1px solid var(--gray-border); border-radius: 18px; background: var(--white); cursor: pointer; font-size: 13px; color: var(--gray-text); transition: all 0.15s; }
.wish-vote-btn:hover { border-color: var(--primary); color: var(--primary); }
.wish-vote-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.wish-vote-btn.dislike.active { border-color: var(--red); background: var(--red-light); color: var(--red); }
.wish-vote-btn b { font-weight: 700; }
.wish-vote-btn.wish-del { padding: 4px 10px; }
.wish-vote-btn.wish-del:hover { border-color: var(--red); background: var(--red-light); color: var(--red); }
.wish-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--gray-text); }
.wish-author { color: var(--gray-text); }
.wish-tag { font-size: 11px; padding: 1px 7px; border-radius: 4px; }
.wish-tag-mine { background: #EFE6FA; color: #6B3FB0; }
.wish-tag-hidden { background: var(--red-light); color: var(--red); }
.wish-time { margin-left: auto; }
.wish-compose-hint { font-size: 12px; color: var(--gray-text); margin-top: 6px; line-height: 1.6; padding: 10px 12px; background: var(--gray-bg); border-radius: var(--radius-sm); }

/* === 详情页信息网格（客户/供应商详情通用，v20260916 从客户页局部样式提升为全局） === */
.cust-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cust-kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 24px; }
.cust-kv { min-width: 0; }
.cust-kv-label { font-size: 12px; color: var(--gray-text); }
.cust-kv-value { font-size: 13px; color: var(--dark-text); font-weight: 500; margin-top: 2px; word-break: break-all; line-height: 1.5; }
.cust-kv-wide { grid-column: 1 / -1; }
.info-group-title { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; color: var(--gray-text); letter-spacing: 1px; margin: 4px 0 12px; }
.info-group-title::after { content: ''; flex: 1; height: 1px; background: var(--gray-border); }
.info-note-box { margin-top: 14px; background: var(--gray-bg, #f5f6fa); border-radius: 8px; padding: 10px 14px; font-size: 13px; white-space: pre-wrap; color: var(--dark-text); line-height: 1.7; }

/* === 紧凑表格（线索管理等宽表单屏显示，v20260919） === */
table.compact th, table.compact td { font-size: 12px; }
table.compact th { white-space: normal; word-break: keep-all; line-height: 1.3; }
table.compact td { word-break: break-word; line-height: 1.4; }
table.compact .tag { padding: 1px 7px; font-size: 11px; }
table.compact .btn-secondary { font-size: 11px !important; padding: 2px 8px !important; }

/* === 侧边栏紧凑化（导航一屏可见，v20260920b） ===
   默认档：14 项菜单总高约 595px，1366×768 / 1440×900 均无需滚动 */
/* 矮屏（可视高 < 740px）再压一档，兜底不出现滚动条 */
@media (max-height: 740px) {
  .sidebar-logo { padding: 8px 14px; }
  .logo-icon { width: 24px; height: 24px; font-size: 11px; }
  .logo-text { font-size: 13px; }
  .sidebar-menu { padding: 4px 8px; }
  .menu-item { padding: 4px 11px; font-size: 12.5px; gap: 7px; }
  .menu-icon { width: 15px; font-size: 13px; }
  .menu-sort-btn { padding: 3px 10px; margin-top: 3px; font-size: 11.5px; }
  .menu-group-header { padding: 4px 11px; font-size: 12.5px; }
  .menu-group-items .menu-item { padding: 3px 11px; font-size: 12px; }
  .sidebar-user { padding: 6px 12px; gap: 8px; }
  .user-avatar { width: 26px; height: 26px; font-size: 11px; }
  .user-name { font-size: 12px; }
  .user-role { font-size: 11px; }
  .btn-logout { padding: 2px 6px; font-size: 11px; }
}
/* 移动端：触控目标保底，避免过小不易点按 */
@media (max-width: 768px) {
  .menu-item { padding: 8px 12px; font-size: 13.5px; }
  .menu-sort-btn { padding: 7px 12px; font-size: 12.5px; }
}

/* === 工作日历（v20260917：三视图 + 待办拖拽排期） === */
.cal-view-group { display: flex; border: 1px solid var(--gray-border); border-radius: 8px; overflow: hidden; background: var(--white); }
.cal-view-btn { padding: 7px 16px; font-size: 13px; border: none; background: var(--white); cursor: pointer; color: var(--gray-text); transition: all 0.15s; }
.cal-view-btn + .cal-view-btn { border-left: 1px solid var(--gray-border); }
.cal-view-btn:hover { color: var(--primary-dark); background: var(--primary-light); }
.cal-view-btn.active { background: var(--primary); color: var(--white); font-weight: 600; }
.cal-layout { display: grid; grid-template-columns: 1fr 260px; gap: 14px; align-items: start; }
.cal-pending-panel { max-height: 640px; overflow-y: auto; }
.cal-pending-item { padding: 9px 11px; border: 1px solid var(--gray-border); border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 13px; cursor: grab; background: var(--gray-bg); transition: all 0.15s; }
.cal-pending-item:hover { border-color: var(--primary); background: var(--primary-light); }
.cal-pending-item:active { cursor: grabbing; }
.calendar-event.task-event { background: var(--primary); }
.calendar-event.task-event:hover { background: var(--primary-dark); }
.calendar-event.task-event.task-done { background: var(--gray-border); color: var(--gray-text); cursor: pointer; }
.calendar-event.task-event.task-done:hover { background: var(--gray-text); color: var(--white); }
.calendar-event.task-event.task-overdue { background: var(--red); }
.calendar-event.task-event { cursor: grab; }
.calendar-cell.drag-over { outline: 2px dashed var(--primary); outline-offset: -3px; background: var(--primary-light); }
.cal-pending-panel.drag-over { outline: 2px dashed var(--teal); outline-offset: -3px; background: var(--teal-light); }
@media (max-width: 900px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-pending-panel { max-height: 300px; }
  .cal-view-btn { padding: 6px 10px; }
}

/* === 布置任务悬浮按钮（v20260926b 纯图标公文包+靛蓝） === */
.task-fab { position: relative; width: 52px; height: 52px; padding: 0; border-radius: 50%; border: none; background: linear-gradient(135deg, #4F6BED 0%, #3450C8 100%); color: var(--white); font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 16px rgba(52,80,200,0.42); z-index: 900; display: flex; align-items: center; justify-content: center; transition: transform 0.2s, box-shadow 0.2s; }
.task-fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(52,80,200,0.52); }
.task-fab-icon { width: 24px; height: 24px; color: #C9D5FF; }

/* === 右下角悬浮按钮组收纳（v20260927b：平时收成三点，点击展开） === */
.fab-dock { position: fixed; bottom: 28px; right: 28px; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; z-index: 900; }
.fab-dock-items { display: none; flex-direction: column; align-items: center; gap: 12px; }
.fab-dock.expanded .fab-dock-items { display: flex; }
.fab-toggle { position: relative; width: 52px; height: 52px; border-radius: 50%; border: none; background: linear-gradient(135deg, #374151 0%, #1F2937 100%); color: var(--white); cursor: pointer; box-shadow: 0 4px 16px rgba(31,41,55,0.45); display: flex; align-items: center; justify-content: center; transition: transform 0.2s, box-shadow 0.2s; }
.fab-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(31,41,55,0.55); }
.fab-toggle-dots, .fab-toggle-arrow { display: flex; align-items: center; justify-content: center; height: 100%; }
.fab-toggle-arrow { display: none; }
.fab-dock.expanded .fab-toggle-dots { display: none; }
.fab-dock.expanded .fab-toggle-arrow { display: flex; }
.fab-toggle-dots .dot { width: 5px; height: 5px; border-radius: 50%; background: #FFFFFF; margin: 0 2.5px; opacity: 0.95; }
.fab-toggle-arrow svg { width: 22px; height: 22px; }
.fab-toggle-badge { position: absolute; top: -2px; right: -2px; width: 14px; height: 14px; border-radius: 50%; background: var(--red); border: 2px solid #FFFFFF; }
@media (max-width: 900px) { .fab-dock { bottom: 24px; right: 24px; } }

/* ---------- 拖拽上传区（drop-zone） ---------- */
.drop-zone { border: 1.5px dashed var(--gray-border, #c9cedd); border-radius: 10px; background: var(--gray-bg, #f8f9fc); cursor: pointer; transition: border-color .15s, background .15s; }
.drop-zone:hover { border-color: var(--primary, #3f6cff); }
.drop-zone--dragover { border-color: var(--primary, #3f6cff); background: rgba(63, 108, 255, .08); }
.drop-zone-hint { font-size: 12px; color: var(--gray-text, #8a90a3); pointer-events: none; }

/* === 移动端适配（v20260928f：侧边栏抽屉化 + 表格横向滚动 + 卡片单列堆叠） === */
.mobile-topbar { display: none; }
.mobile-mask { display: none; }
.sup-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
/* 窄桌面区间（769~1100px）：内容区被侧边栏挤窄，多列表格同样会顶破页面，卡片内横滚兜底 */
@media (min-width: 769px) and (max-width: 1100px) {
  .card { overflow-x: auto; }
  table { min-width: 480px; }
}
@media (max-width: 768px) {
  .mobile-topbar {
    display: flex; align-items: center; gap: 10px; position: fixed; top: 0; left: 0; right: 0; height: 48px;
    background: var(--white); border-bottom: 1px solid var(--gray-border); z-index: 990; padding: 0 12px;
  }
  .mobile-burger {
    background: none; border: 1px solid var(--gray-border); border-radius: 8px; width: 38px; height: 38px;
    font-size: 17px; cursor: pointer; color: var(--dark-text); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }
  .mobile-topbar-title { font-size: 14px; font-weight: 600; color: var(--dark-text); }
  /* 侧边栏收成抽屉 */
  .sidebar { width: 240px; transform: translateX(-102%); transition: transform .25s ease; z-index: 1001; }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: 8px 0 32px rgba(0,0,0,.18); }
  .mobile-mask.show { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.38); z-index: 1000; }
  /* 内容区整屏 */
  .main-content { margin-left: 0; padding: 60px 10px 18px; }
  .page-header { flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  .page-title { font-size: 17px; }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  /* 卡片内表格横向滚动，不顶破页面 */
  .card { padding: 14px; overflow-x: auto; }
  table { min-width: 480px; }
  .section-tabs { flex-wrap: wrap; overflow-x: auto; white-space: nowrap; }
  .section-tabs .tab { flex-shrink: 0; }
  /* v20261005a 移动端视觉修复（手机「看着像样」专项）：
     ① tab 条由横滑改为换行 —— 横滑时右侧 tab 被裁一半且无任何滚动提示，
        用户会以为只有这几个 tab（案件八阶段/搜证/成员管理实测全部中招）；
        换行后全部可见，与财务管理页签的换行表现一致
     ② 日历头部三段式 space-between 在 375px 下把月份标题挤到折行（「2026年 十/月」）、
        按钮「上/月」「今/天」也折行 —— 改为标题独占一行居中、按钮第二行两端 */
  .calendar-header { flex-wrap: wrap; gap: 8px; }
  .calendar-title { order: -1; width: 100%; text-align: center; font-size: 16px; }
  .calendar-nav-btn { padding: 7px 10px; font-size: 13px; white-space: nowrap; }
  /* ③ 表格首列（名称列）单行化 —— 首列被挤压时法院名会折成三行竖条
        （「武汉市江/汉区人民/法院」），极难读；单行后靠既有的卡片横滚阅读 */
  .card table th:first-child, .card table td:first-child { white-space: nowrap; }
  /* 法院库表格名称列在第 2 列（首列是评级），同样单行化 */
  .court-lib-table th:nth-child(2), .court-lib-table td:nth-child(2) { white-space: nowrap; }
  /* 管辖区域列给足最小宽 —— 否则名称列单行化后剩余宽度被压到 ~130px，
     区县列表会折成七八行、行高飙到 150px */
  .court-lib-table th:nth-child(5), .court-lib-table td:nth-child(5) { min-width: 175px; }
  /* ④ 抽屉底部小字放大（原 max-height:740px 紧凑档把角色/退出压到 11px，手机上过小） */
  .user-role { font-size: 12px; }
  .btn-logout { padding: 4px 9px; font-size: 12px; }
  /* 弹窗贴边 */
  .modal-box { width: calc(100vw - 20px); max-width: calc(100vw - 20px); padding: 18px; max-height: calc(100vh - 24px); }
  /* 供应商详情双卡片改单列 */
  .sup-cards { grid-template-columns: 1fr !important; }
}

/* v20261005h 移动端可用性：「操作」列钉在右侧（不随表格横滑移出屏幕）
   背景：列表页表格普遍超出手机屏宽（线索首页表宽 520px → 390px 屏要横滑 178px、
   375px 屏 193px），「操作」列（查看线索/编辑/删除）整个在屏幕外，且没有任何
   "可左右滑动"的提示 —— 用户以为点不进去，报障原话「手机打开网页怎么不能在线索管理页面上传线索」。
   做法：不改成卡片式（列表页保持传统表格是既定偏好），只把末列钉住 —— 横滑时按钮始终可见。
   打标由 app.js 的 markActionTables() 统一负责（判据＝表头最后一列文本为「操作」）。
   注意：无横滑时 sticky 无副作用（末列本来就在右边缘），所以桌面端保持原样。 */
.tbl-fix-act th:last-child, .tbl-fix-act td:last-child {
  position: sticky; right: 0; z-index: 2; background: var(--white);
  box-shadow: -8px 0 10px -8px rgba(0,0,0,.22);
}
.tbl-fix-act thead th:last-child { z-index: 3; background: var(--white); }
/* 行 hover 时钉住的单元格也要跟着变色，否则会留下一条白色"竖带" */
.tbl-fix-act tbody tr:hover td:last-child { background: var(--gray-bg); }

/* v20260928i 法官印象四区块：一排两个，窄屏一列 */
.judge-imp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 1100px) {
  .judge-imp-grid { grid-template-columns: 1fr; }
}

/* v20260921e 捉虫悬浮按钮 */
.bug-fab { position: relative; width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, #10B981 0%, #059669 100%); color: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 16px rgba(5,150,105,0.45); z-index: 900; transition: transform 0.2s, box-shadow 0.2s; }
.bug-fab:hover { transform: scale(1.08) rotate(-6deg); box-shadow: 0 6px 22px rgba(5,150,105,0.55); }
.bug-fab-icon { font-size: 24px; line-height: 1; }
/* 捉虫弹窗 */
.bug-cat-row { display: flex; gap: 8px; flex-wrap: wrap; }
.bug-cat { padding: 7px 14px; border: 1px solid var(--gray-border); border-radius: 18px; font-size: 13px; cursor: pointer; background: var(--white); color: var(--dark-text); transition: all .15s; }
.bug-cat.active { border-color: #059669; background: #ECFDF5; color: #047857; font-weight: 600; }
.bug-item { border: 1px solid var(--gray-border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 12.5px; line-height: 1.8; }
.bug-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.bug-reply-box { background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 6px; padding: 6px 10px; margin-top: 6px; color: #166534; white-space: pre-wrap; }

/* === 批量布置任务（v20260930a） === */
.batch-fab { position: relative; width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); color: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 16px rgba(217,119,6,0.45); z-index: 900; transition: transform 0.2s, box-shadow 0.2s; }
.batch-fab:hover { transform: scale(1.08) rotate(-6deg); box-shadow: 0 6px 22px rgba(217,119,6,0.55); }
.batch-fab-icon { font-size: 23px; line-height: 1; }

.ba-wrap { margin-top: 12px; border: 1px solid var(--gray-border); border-radius: 8px; overflow: auto; max-height: 46vh; }
.ba-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ba-table th { position: sticky; top: 0; background: #F7F9FC; font-size: 12px; font-weight: 600; text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--gray-border); z-index: 1; }
.ba-table td { padding: 5px 6px; border-bottom: 1px solid #EEF1F6; vertical-align: top; }
.ba-table tbody tr:last-child td { border-bottom: none; }
.ba-min { font-size: 12.5px !important; padding: 5px 7px !important; width: 100%; box-sizing: border-box; }
textarea.ba-min { resize: vertical; min-height: 44px; }
.ba-bad { border-color: #EF4444 !important; background: #FEF2F2 !important; }
.ba-row-bad td { background: #FFF7F7; }
.ba-row-note td { padding: 2px 8px 7px; background: #FFFBEB; }
.ba-warn { display: inline-block; font-size: 11.5px; color: #92400E; background: #FEF3C7; border-radius: 4px; padding: 1px 6px; margin-right: 6px; }
.ba-err { display: inline-block; font-size: 11.5px; color: #B91C1C; background: #FEE2E2; border-radius: 4px; padding: 1px 6px; margin-right: 6px; }
.ba-del { color: #94A3B8; font-size: 15px; text-decoration: none; padding: 0 6px; line-height: 1.6; }
.ba-del:hover { color: #B91C1C; }
@media (max-width: 900px) {
  .ba-wrap { max-height: none; }
  .ba-table { min-width: 880px; }
}

/* === 侧边栏折叠（v20260928n）：桌面端点击收起成图标条，再点展开；状态记忆 === */
.sb-toggle {
  position: absolute; top: 50%; right: -11px; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--gray-border);
  color: var(--gray-text); font-size: 13px; line-height: 1;
  cursor: pointer; padding: 0; flex-shrink: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.14);
  transition: color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.sb-toggle:hover {
  color: var(--primary); border-color: var(--primary);
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 2px 9px rgba(0,0,0,.18);
}
.sb-toggle svg { width: 12px; height: 12px; display: block; transition: transform .2s ease; }
body.sb-collapsed .sb-toggle svg { transform: rotate(180deg); }
@media (min-width: 769px) {
  .sidebar, .main-content { transition: width 0.2s ease, margin-left 0.2s ease; }
  body.sb-collapsed .sidebar { width: 54px; }
  body.sb-collapsed .main-content { margin-left: 54px; }
  /* v20260929b 圆钮双向同位贴边，无需重定位 */
  /* logo 区只留图标；用户区只留头像 */
  body.sb-collapsed .sidebar-logo { justify-content: center; padding: 11px 0; position: relative; }
  body.sb-collapsed .sidebar-logo > :not(.logo-icon):not(.sb-toggle) { display: none; }
  body.sb-collapsed .sidebar-user { justify-content: center; padding: 9px 0; }
  body.sb-collapsed .sidebar-user > :not([id="userAvatar"]) { display: none; }
  /* 菜单只留图标：文字/箭头/排序按钮/子项全隐 */
  body.sb-collapsed .menu-item > span:last-child,
  body.sb-collapsed .menu-group-header > span:last-child,
  body.sb-collapsed .menu-group-arrow,
  body.sb-collapsed .menu-sort-btn,
  body.sb-collapsed .menu-group-items { display: none; }
  body.sb-collapsed .menu-item,
  body.sb-collapsed .menu-group-header { justify-content: center; padding: 6px 0; }
  body.sb-collapsed .sidebar-menu { padding: 7px 5px; }
}
@media (max-width: 768px) { .sb-toggle { display: none; } }

/* v20260929d 数据授权界面：双栏布局，窄屏单列堆叠 */
.grant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .grant-grid { grid-template-columns: 1fr; } }

/* v20261007d 任务未读角标：任务名称右侧的红色小数字（未读动态数，打开任务详情即清零） */
.task-unread-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; vertical-align: 1px; }
.calendar-event .task-unread-badge { min-width: 14px; height: 14px; padding: 0 4px; margin-left: 4px; font-size: 10px; border-radius: 7px; }
.cal-pending-item .task-unread-badge { margin-left: 0; flex: none; }
