/* 个人工作台 - 全局样式（靛蓝紫配色，白底黑字） */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --purple: #8b5cf6;
  --text-main: #1f2937;
  --text-sub: #4b5563;
  --text-weak: #9ca3af;
  --border: #e5e7eb;
  --border-light: #eef0f3;
  --bg-side: #fafbfc;
  --danger: #ef4444;
  --radius-lg: 16px;
  --radius-md: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: var(--text-main);
  background: #fff;
  font-size: 15px;
  line-height: 1.6;
}

/* 登录页布局 */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-side);
  padding: 24px;
  position: relative;
}

.icp-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-weak);
}

.icp-footer a {
  color: var(--text-weak);
  text-decoration: none;
}

.icp-footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo .logo-mark {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-logo h1 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 12px;
}

.auth-logo p {
  font-size: 14px;
  color: var(--text-weak);
  margin-top: 2px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 6px;
  font-weight: 500;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus {
  border-color: var(--primary);
}

.btn {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn:hover {
  opacity: 0.9;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: var(--text-sub);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #f9fafb;
  color: var(--text-main);
}

.btn-danger-outline {
  background: #fff;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.btn-danger-outline:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.btn-danger-outline:disabled {
  color: #cbd5e1;
  border-color: #e5e7eb;
  cursor: not-allowed;
}

.error-msg {
  color: var(--danger);
  font-size: 14px;
  margin: 0 0 12px;
  min-height: 18px;
}

.hint {
  font-size: 13px;
  color: var(--text-weak);
  text-align: center;
  margin-top: 12px;
}

/* 验证码行：输入框 + 获取按钮 */
.code-row {
  display: flex;
  gap: 8px;
}

.code-row input {
  flex: 1;
  letter-spacing: 6px;
  text-align: center;
}

.code-row .btn-send {
  width: auto;
  padding: 10px 16px;
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.code-row .btn-send:disabled {
  color: var(--text-weak);
  border-color: var(--border);
  cursor: not-allowed;
}

/* 滑块校验 */
.slider-wrap {
  margin-bottom: 16px;
}

.slider-track {
  position: relative;
  height: 40px;
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  user-select: none;
}

.slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--primary-light);
  width: 0;
}

.slider-target {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 28px;
  background: var(--primary);
  border-radius: 2px;
}

.slider-knob {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 600;
  z-index: 2;
}

.slider-track.done {
  background: #e8f5ee;
  border-color: #34c07c;
}

.slider-track.done .slider-knob {
  border-color: #34c07c;
  color: #34c07c;
}

/* 占位待办页 */
.workbench-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-light);
}

.workbench-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
}

.workbench-header .brand .logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.workbench-body {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
}

.placeholder-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.placeholder-text {
  color: var(--text-weak);
  margin-bottom: 24px;
}

/* ===== 待办主界面 ===== */
.workbench-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 28px;
}

/* 分类统计栏 */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* 待办顶部栏：标签筛选（左）+ 搜索框（右） */
.todo-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.todo-topbar .filter-tags {
  flex: 1;
  min-width: 0;
}

.todo-topbar .todo-search-input {
  flex: 0 1 300px;
  min-width: 180px;
  margin-left: auto;
}

.stats-bar .stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stats-bar .stat-chip b {
  font-weight: 700;
}

/* 快捷输入区 */
.todo-input-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  border-top: 3px solid var(--primary);
}

.todo-input-card textarea {
  width: 100%;
  border: none;
  resize: none;
  font-size: 15px;
  padding: 0;
  outline: none;
  font-family: inherit;
  line-height: 1.6;
}

.todo-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.todo-input-row select,
.todo-input-row input[type="text"] {
  font-size: 14px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
}

.todo-input-row input[type="text"] {
  flex: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary:hover {
  opacity: 0.9;
}

/* 文字链接式按钮（管理分类等） */
.btn-link {
  background: none;
  border: none;
  color: var(--primary-dark);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 6px;
  white-space: nowrap;
  text-decoration: underline;
}

.btn-link:hover {
  opacity: 0.8;
}

/* 列表标题栏 */
.todo-list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.todo-list-header .count-badge {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
}

/* 待办卡片 */
.todo-card {
  border: none;
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
  padding: 8px 10px;
  margin-bottom: 0;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.todo-card:hover {
  background: #f8fafc;
}

.todo-card .todo-content {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-main);
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.todo-card .todo-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  flex-wrap: wrap;
}

.tag-category {
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
}

/* 三个分类的区分色 */
.tag-category.cat-daily {
  background: #eef2ff;   /* 淡靛蓝 */
  color: #4f46e5;
}

.tag-category.cat-key {
  background: #fef3c7;   /* 淡琥珀 */
  color: #b45309;
}

.tag-category.cat-bid {
  background: #fee2e2;   /* 淡红 */
  color: #dc2626;
}

/* 标签点选区 */
.tag-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0;
}

.tag-option {
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.tag-option:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.tag-option.selected {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  border-color: transparent;
}

.tag-normal {
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
}

/* BD 记录标题下的分类标签容器 */
.bd-tags {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.todo-time {
  font-size: 13px;
  color: var(--text-weak);
}

.todo-empty {
  text-align: center;
  color: var(--text-weak);
  padding: 40px 0;
  font-size: 15px;
}

/* 左右分栏布局 */
.todo-columns {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

.todo-column {
  min-width: 0;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--border-light);
}

/* 待办栏：淡蓝底 */
.todo-column.col-todo {
  background: #f7f9ff;
  border-color: #dde3fb;
}

/* 已完成栏：淡绿底 */
.todo-column.col-done {
  background: #f4faf7;
  border-color: #d5ebe0;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  border-bottom: none;
}

.col-todo .column-header {
  background: #eef2ff;
}

.col-done .column-header {
  background: #e6f6ef;
}

/* 已完成栏 header 可点击折叠 */
#done-header {
  cursor: pointer;
  user-select: none;
}

#done-header:hover {
  filter: brightness(0.97);
}

.collapse-arrow {
  display: inline-block;
  font-size: 12px;
  width: 16px;
  text-align: center;
  transition: transform 0.2s ease;
  color: #059669;
}

.collapse-arrow.expanded {
  transform: rotate(90deg);
}

.column-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.col-todo .column-title {
  color: #4f46e5;
}

.col-done .column-title {
  color: #059669;
}

.count-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  background: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
}

.col-done .count-badge {
  color: #059669;
}

.column-list {
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

/* 栏内待办卡片在白底卡片底色上更柔和 */
.todo-column .todo-card {
  background: #fff;
}

/* 手机端上下堆叠 */
@media (max-width: 720px) {
  .todo-columns {
    flex-direction: column;
  }
  .column-list {
    max-height: none;
  }
}

/* 完成/撤销按钮 */
.btn-complete,
.btn-reopen {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-complete:hover {
  color: var(--primary-dark);
  border-color: var(--primary);
  background: var(--primary-light);
}

.btn-reopen:hover {
  color: #059669;
  border-color: #34d399;
  background: #ecfdf5;
}

/* 已完成卡片 */
.todo-card.done .todo-content {
  color: var(--text-weak);
  text-decoration: line-through;
}

.todo-time.done-time {
  color: #059669;
}

/* ===== 搜索 + 筛选栏 ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: #f6f7fb;
  border: 1px solid var(--border-light);
  border-radius: 12px;
}

.search-input {
  flex: 1;
  min-width: 180px;
  padding: 9px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
}

.filter-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tag {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.filter-tag:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.filter-tag.active {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  border-color: transparent;
}

/* ===== 待办操作按钮组 ===== */
.todo-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-complete,
.btn-reopen,
.btn-delete,
.btn-edit {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

/* 「完成」按钮用反色（实心主色底 + 白字）突出显示 */
.btn-complete {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 500;
}

.btn-complete:hover {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.btn-reopen:hover {
  color: #059669;
  border-color: #34d399;
  background: #ecfdf5;
}

.btn-delete:hover {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fee2e2;
}

.btn-edit:hover {
  color: #b45309;
  border-color: #fcd34d;
  background: #fef3c7;
}

/* ===== 编辑表单 ===== */
.edit-form {
  flex: 1;
}

.edit-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  line-height: 1.6;
}

.edit-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.edit-row select,
.edit-row input[type="text"] {
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
}

.edit-row input[type="text"] {
  flex: 1;
}

.edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* ===== 分类管理弹窗 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 90%;
  max-width: min(440px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
}

.modal-close {
  border: none;
  background: none;
  font-size: 22px;
  color: var(--text-weak);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
}

.category-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.category-add-row input {
  flex: 1;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.category-item .tag-category {
  flex: 1;
  text-align: center;
}

.btn-rename,
.btn-del-cat {
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.btn-rename:hover {
  color: #b45309;
  border-color: #fcd34d;
}

.btn-del-cat:hover {
  color: #dc2626;
  border-color: #fca5a5;
}

/* 分类颜色兜底：新增分类用中性灰 */
.tag-category.cat-other {
  background: #f3f4f6;
  color: #4b5563;
}

/* ===== 左侧导航布局 ===== */
.workbench-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 210px;
  background: #1e1b3a;
  color: #cbd5e1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.sidebar .brand .logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
}

.sidebar .brand span {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  background: #6366f1;
  color: #fff;
}

.nav-icon {
  font-size: 15px;
  width: 16px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 12px;
}

.nav-item.nav-logout {
  color: #cbd5e1;
}

.nav-item.nav-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.content-area {
  flex: 1;
  min-width: 0;
  background: #fff;
  height: 100vh;
  overflow-y: auto;
}

/* 全局日期时间栏（固定，内容区滚动时不随之下移） */
.datetime-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #1e1b3a;
  position: sticky;
  top: 0;
  z-index: 10;
}

.datetime-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.datetime-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== 全局搜索框 ===== */
.global-search {
  position: relative;
  display: flex;
  align-items: center;
}

.global-search-icon {
  position: absolute;
  left: 12px;
  font-size: 13px;
  color: #9ca3af;
  pointer-events: none;
}

.global-search-input {
  width: 360px;
  height: 34px;
  padding: 0 12px 0 34px;
  font-size: 13px;
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  outline: none;
  transition: all 0.15s;
}

.global-search-input::placeholder {
  color: #9ca3af;
}

.global-search-input:focus {
  background: rgba(255, 255, 255, 0.14);
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.global-search-dropdown {
  position: absolute;
  top: 42px;
  right: 0;
  width: 560px;
  max-height: 560px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  padding: 6px;
}

.global-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}

.global-search-item:hover {
  background: var(--primary-light);
}

.global-search-item-icon {
  flex: none;
  font-size: 16px;
}

.global-search-item-body {
  flex: 1;
  min-width: 0;
}

.global-search-item-title {
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-search-item-sub {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.global-search-badge {
  flex: none;
  font-size: 11px;
  color: var(--primary-dark);
  background: var(--primary-light);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}

.global-search-empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--text-sub);
  font-size: 13px;
}



.datetime-date {
  font-size: 15px;
  color: #cbd5e1;
  font-weight: 500;
}

.datetime-time {
  font-size: 16px;
  color: #ffffff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.btn-logout-top {
  font-size: 13px;
  color: #cbd5e1;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 5px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-logout-top:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(252, 165, 165, 0.6);
  color: #fca5a5;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

/* ===== 客户管理 ===== */
/* 客户管理列多，放宽容器最大宽度，避免横向滚动 */
#panel-customer .workbench-main {
  max-width: 1600px;
}

.customer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.customer-header .search-input {
  flex: 1;
  min-width: 180px;
}

.customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.customer-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}

.customer-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.customer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.customer-avatar.grade-S { background: #f0b400; }
.customer-avatar.grade-A { background: #a78bfa; }
.customer-avatar.grade-B { background: #3b82f6; }
.customer-avatar.grade-C { background: #9ca3af; }

.customer-main {
  flex: 1;
  min-width: 0;
}

.customer-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
}

.customer-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.grade-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  color: #fff;
}

.grade-badge.grade-S { background: #f0b400; color: #fff; }
.grade-badge.grade-A { background: #a78bfa; color: #fff; }
.grade-badge.grade-B { background: #3b82f6; }
.grade-badge.grade-C { background: #9ca3af; }

.status-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-block;
}

.status-badge.st-潜在 { background: #fef3c7; color: #b45309; }
.status-badge.st-跟进中 { background: #fee2e2; color: #dc2626; }
.status-badge.st-已合作 { background: #eef2ff; color: #4f46e5; }
.status-badge.st-已流失 { background: #f3f4f6; color: #6b7280; }

/* 应标材料状态徽标（中标=橙、未中标=灰、进行中=蓝） */
.status-badge.bid-status-won { background: #ffedd5; color: #c2410c; }
.status-badge.bid-status-lost { background: #f3f4f6; color: #6b7280; }
.status-badge.bid-status-ongoing { background: #dbeafe; color: #1d4ed8; }

/* 应标材料：项目名称 + 备注摘要 */
.bid-project-name {
  font-weight: 600;
  color: var(--text-main);
}

.bid-note-preview {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-sub);
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 应标材料：金额 */
.bid-amount {
  color: #b45309;
  font-weight: 500;
  white-space: nowrap;
}

.customer-contacts {
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
  margin-top: 4px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
}

.contact-row .contact-name {
  color: var(--text-main);
}

.contact-row .contact-title {
  color: var(--text-weak);
  font-size: 13px;
}

.customer-contacts-empty {
  font-size: 13px;
  color: var(--text-weak);
  padding: 4px 0;
}

.customer-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-sm {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 7px;
  border: 0.5px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  cursor: pointer;
  white-space: nowrap;
}

.btn-sm:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.btn-sm.btn-del:hover {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fee2e2;
}

/* 预览按钮（可内联预览的文件） */
.btn-sm.btn-preview {
  color: #2563eb;
  border-color: #93c5fd;
  background: #eff6ff;
}

.btn-sm.btn-preview:hover {
  color: #1d4ed8;
  border-color: #60a5fa;
  background: #dbeafe;
}

.customer-empty {
  text-align: center;
  color: var(--text-weak);
  padding: 60px 0;
  font-size: 15px;
}

/* 客户表格列表 */
.customer-table-wrap {
  border: 0.5px solid var(--border-light);
  border-radius: 10px;
  overflow-x: auto;
  background: #fff;
}

.customer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 900px;
}

.customer-table th,
.customer-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 0.5px solid var(--border-light);
  vertical-align: top;
}

.customer-table thead th {
  background: #f9fafb;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.customer-table tbody tr:last-child td {
  border-bottom: none;
}

.customer-table tbody tr:hover {
  background: #fafbff;
}

.cell-grade {
  width: 48px;
  text-align: center;
}

.cell-grade .grade-badge {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  padding: 0;
  border-radius: 5px;
  font-size: 12px;
}

.cell-name {
  font-weight: 600;
  color: var(--text-main);
  min-width: 130px;
}

.cell-status {
  white-space: nowrap;
  min-width: 70px;
}

.cell-text {
  color: var(--text-sub);
  min-width: 110px;
  max-width: 220px;
  word-break: break-word;
  white-space: normal;
  line-height: 1.55;
}

.cell-contacts {
  min-width: 130px;
}

.cell-contacts .contact-line {
  display: block;
  white-space: nowrap;
  color: var(--text-sub);
  line-height: 1.65;
}

.cell-contacts .contact-line .contact-title {
  color: var(--text-weak);
  font-size: 11px;
}

.cell-actions {
  white-space: nowrap;
  min-width: 96px;
}

.cell-actions .btn-sm {
  margin-right: 4px;
}

.cell-actions .btn-sm:last-child {
  margin-right: 0;
}

/* 置顶行高亮 + 置顶按钮 */
tr.row-pinned {
  background: #fdf6e3;
}
tr.row-pinned:hover {
  background: #f8ecd0;
}
.btn-pin {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  margin-right: 4px;
  color: #7aa2d9;
  vertical-align: middle;
  transition: color 0.15s;
}
.btn-pin:hover {
  color: #d4a017;
}
.btn-pin.pinned {
  color: #d4a017;
}
.todo-card.pinned {
  border-left: 3px solid #d4a017;
  background: #fdf6e3;
}

/* 报价模板备注可编辑单元格 */
.cell-remark {
  cursor: pointer;
  min-width: 120px;
}
.cell-remark:hover {
  background: #f1f5f9;
}
.cell-remark .remark-input {
  width: 100%;
  min-width: 120px;
  box-sizing: border-box;
  padding: 4px 6px;
  font-size: 13px;
  border: 1px solid var(--primary, #4f46e5);
  border-radius: 4px;
  outline: none;
}

/* 财务文件名称可编辑单元格 */
.cell-name-editable {
  cursor: pointer;
  min-width: 120px;
}
.cell-name-editable:hover {
  background: #f1f5f9;
}
.cell-name-editable .remark-input {
  width: 100%;
  min-width: 120px;
  box-sizing: border-box;
  padding: 4px 6px;
  font-size: 13px;
  border: 1px solid var(--primary, #4f46e5);
  border-radius: 4px;
  outline: none;
}

/* 报价模板分类可编辑单元格 */
.cell-category {
  cursor: pointer;
  white-space: nowrap;
}
.cell-category:hover {
  background: #f1f5f9;
}
.cell-category .category-select {
  width: 100%;
  min-width: 90px;
  box-sizing: border-box;
  padding: 4px 6px;
  font-size: 13px;
  border: 1px solid var(--primary, #4f46e5);
  border-radius: 4px;
  outline: none;
  background: #fff;
}

/* 客户新增/编辑弹窗 */
.customer-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
}

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

.form-field label {
  display: block;
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-field input,
.form-field select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.form-field textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  resize: vertical;
  line-height: 1.6;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--primary);
}

.form-row-2 {
  display: flex;
  gap: 12px;
}

.form-row-2 .form-field {
  flex: 1;
}

/* ===== 客户弹窗横向布局（标签左、输入右） ===== */
.customer-modal-wide {
  max-width: min(720px, 92vw);
}

.price-modal-wide {
  max-width: min(880px, 92vw);
}

/* 客户单价弹窗：标签不换行，输入框更宽松 */
.price-form-body {
  padding: 20px 24px;
}

.price-form-body .form-row-h-item {
  gap: 12px;
}

.price-form-body .form-row-h-item label {
  white-space: nowrap;
}

.form-row-h {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row-h > label {
  flex: none;
  width: 84px;
  padding-top: 8px;
  font-size: 14px;
  color: var(--text-sub);
  font-weight: 500;
  text-align: right;
}

.form-row-h > input,
.form-row-h > select,
.form-row-h > textarea,
.form-row-h .form-row-h-input {
  flex: 1;
  min-width: 0;
}

.form-row-h > input,
.form-row-h > select,
.form-row-h > textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  width: auto;
}

.form-row-h > textarea {
  font-family: inherit;
  resize: vertical;
  line-height: 1.6;
}

.form-row-h > input:focus,
.form-row-h > select:focus,
.form-row-h > textarea:focus {
  border-color: var(--primary);
}

.form-row-h .form-row-h-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row-h .form-row-h-input > input[type="file"] {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}

/* 双列行：两个「标签+输入」并排 */
.form-row-h-2 {
  display: flex;
  gap: 16px;
}

.form-row-h-2 .form-row-h-item {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.form-row-h-2 .form-row-h-item label {
  flex: none;
  width: auto;
  white-space: nowrap;
  padding-top: 8px;
  font-size: 14px;
  color: var(--text-sub);
  font-weight: 500;
  text-align: right;
}

.form-row-h-2 .form-row-h-item select,
.form-row-h-2 .form-row-h-item input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.form-row-h-2 .form-row-h-item select:focus,
.form-row-h-2 .form-row-h-item input:focus {
  border-color: var(--primary);
}

@media (max-width: 720px) {
  .form-row-h {
    flex-direction: column;
    align-items: stretch;
  }
  .form-row-h > label {
    width: auto;
    text-align: left;
    padding-top: 0;
  }
  .form-row-h-2 {
    flex-direction: column;
  }
  .form-row-h-2 .form-row-h-item label {
    width: auto;
    text-align: left;
  }
}

/* 三列行：三个「标签+输入」并排（客户单价表单用） */
.form-row-h-3 {
  display: flex;
  gap: 16px;
}

.form-row-h-3 .form-row-h-item {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.form-row-h-3 .form-row-h-item label {
  flex: none;
  width: auto;
  white-space: nowrap;
  padding-top: 8px;
  font-size: 14px;
  color: var(--text-sub);
  font-weight: 500;
  text-align: right;
}

.form-row-h-3 .form-row-h-item select,
.form-row-h-3 .form-row-h-item input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.form-row-h-3 .form-row-h-item select:focus,
.form-row-h-3 .form-row-h-item input:focus {
  border-color: var(--primary);
}

@media (max-width: 720px) {
  .form-row-h-3 {
    flex-direction: column;
  }
  .form-row-h-3 .form-row-h-item label {
    width: auto;
    text-align: left;
  }
}

/* 客户单价表格辅助样式 */
.price-table .cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price-empty {
  color: #cbd5e1;
}

.contact-editor-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.contact-editor-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.contact-editor-row input:focus {
  border-color: var(--primary);
}

.btn-add-contact {
  font-size: 13px;
  color: var(--primary-dark);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: underline;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* 手机端侧边栏收窄 + 顶部横滑导航 */
@media (max-width: 720px) {
  .workbench-shell {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar .brand {
    margin-bottom: 0;
    margin-right: 12px;
    flex-shrink: 0;
  }
  .nav-menu {
    flex-direction: row;
    gap: 4px;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }
  .nav-item {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 9px 12px;
    font-size: 15px;
  }
  .sidebar-footer {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
    margin-left: auto;
    flex-shrink: 0;
  }
  .content-area {
    height: auto;
    overflow-y: visible;
  }
  .datetime-bar {
    position: static;
  }
  /* 隐藏横向滚动条但保留滚动能力 */
  .sidebar::-webkit-scrollbar {
    display: none;
  }
  .sidebar {
    scrollbar-width: none;
  }
}

/* ===== 登录日志模块 ===== */
.logs-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

/* 仪表盘底部的登录日志区块 */
.dash-logs-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.logs-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.logs-sub {
  font-size: 13px;
  color: var(--text-weak);
  flex: 1;
}

.logs-table-wrap {
  border: 0.5px solid var(--border-light);
  border-radius: 10px;
  overflow-x: auto;
  background: #fff;
}

.logs-table {
  min-width: 760px;
}

.logs-table th,
.logs-table td {
  white-space: nowrap;
}

.log-cell-time {
  font-variant-numeric: tabular-nums;
  color: var(--text-sub);
}

.log-cell-ip {
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
  font-weight: 500;
}

.log-cell-loc {
  color: var(--text-sub);
}

.log-cell-user {
  color: var(--text-main);
  font-weight: 500;
}

/* 结果徽章 */
.log-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
}

.log-badge.log-ok {
  background: #e6f7ee;
  color: #16a34a;
}

.log-badge.log-bad {
  background: #fee2e2;
  color: #dc2626;
}

.log-badge.log-warn {
  background: #fef3c7;
  color: #b45309;
}

.log-badge.log-info {
  background: #e0e7ff;
  color: #4f46e5;
}

/* 异常标记 */
.log-abnormal {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #dc2626;
  border: 0.5px solid #dc2626;
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* 分页 */
.logs-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  justify-content: flex-end;
}

.pager-info {
  font-size: 13px;
  color: var(--text-weak);
  margin-right: 4px;
}

.logs-pager .btn-sm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== 文件存储模块 ===== */
.files-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.files-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.files-filter .search-input {
  flex: 1;
}

/* 分类平铺标签栏 */
.files-cat-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.files-cat-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.files-cat-tag:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.files-cat-tag.active {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  border-color: transparent;
}

/* 分类标签行（带维度标签，用于业务分类 + 行业分类两行） */
.files-cat-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.files-cat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  padding-right: 4px;
  flex-shrink: 0;
}

/* 批量下载栏 */
.files-batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  min-height: 32px;
}

.files-batch-info {
  font-size: 13px;
  color: var(--text-sub);
}

/* 底部计数统计栏 */
.files-count-bar {
  margin-top: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-sub);
  background: #f9fafb;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  text-align: right;
}

.files-count-bar .count-num {
  font-weight: 700;
  color: var(--primary);
  margin: 0 2px;
}

.file-cell-check {
  width: 34px;
  text-align: center;
  padding-right: 0;
}

.file-cell-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  vertical-align: middle;
}

.files-table-wrap {
  border: 0.5px solid var(--border-light);
  border-radius: 10px;
  overflow-x: auto;
  background: #fff;
}

.files-table {
  min-width: 780px;
}

.file-cell-icon {
  font-size: 20px;
  width: 40px;
  text-align: center;
}

.file-cell-name {
  font-weight: 500;
  color: var(--text-main);
  max-width: 340px;
}

.file-cell-name .file-name-inner {
  display: flex;
  align-items: center;
  gap: 4px;
}

.file-cell-name .file-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.file-cell-name .file-dup-badge {
  flex-shrink: 0;
}

.file-cell-ext {
  white-space: nowrap;
}

.cell-ext {
  white-space: nowrap;
}

.file-cell-cat {
  color: var(--text-sub);
  white-space: nowrap;
}

.file-cell-size {
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.file-cell-time {
  color: var(--text-weak);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.file-download-btn {
  display: inline-block;
  text-decoration: none;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 0.5px solid var(--border);
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
}

.file-download-btn:hover {
  background: var(--primary);
  color: #fff;
}

.file-del-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 0.5px solid var(--border);
  background: #fff;
  color: #dc2626;
  cursor: pointer;
  white-space: nowrap;
}

.file-del-btn:hover {
  background: #dc2626;
  color: #fff;
}

.file-cat-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 0.5px solid var(--border);
  background: #fff;
  color: #b45309;
  cursor: pointer;
  white-space: nowrap;
}

.file-cat-btn:hover {
  background: #b45309;
  color: #fff;
}

/* 重复文件名高亮 */
.customer-table tbody tr.file-row-dup {
  background: #fef2f2;   /* 淡红色背景 */
}

.customer-table tbody tr.file-row-dup:hover {
  background: #fee2e2;
}

.file-dup-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  margin-left: 4px;
  border-radius: 4px;
  background: #dc2626;
  color: #fff;
  white-space: nowrap;
  vertical-align: middle;
}

/* 文件类型徽标（如 PDF/PPTX），不同类型不同颜色 */
.file-ext-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  vertical-align: middle;
  letter-spacing: 0.3px;
  line-height: 1.4;
}

/* Excel 绿 */
.file-ext-badge.ext-green {
  background: #dcfce7;
  color: #16a34a;
  border: 0.5px solid #bbf7d0;
}

/* Word 蓝 */
.file-ext-badge.ext-blue {
  background: #dbeafe;
  color: #2563eb;
  border: 0.5px solid #bfdbfe;
}

/* PPT 橙 */
.file-ext-badge.ext-orange {
  background: #ffedd5;
  color: #ea580c;
  border: 0.5px solid #fed7aa;
}

/* PDF 红 */
.file-ext-badge.ext-red {
  background: #fee2e2;
  color: #dc2626;
  border: 0.5px solid #fecaca;
}

/* 图片紫 */
.file-ext-badge.ext-purple {
  background: #f3e8ff;
  color: #9333ea;
  border: 0.5px solid #e9d5ff;
}

/* 视频青 */
.file-ext-badge.ext-teal {
  background: #cffafe;
  color: #0d9488;
  border: 0.5px solid #a5f3fc;
}

/* 其他/压缩包灰 */
.file-ext-badge.ext-gray {
  background: #f3f4f6;
  color: #6b7280;
  border: 0.5px solid #e5e7eb;
}

/* 无扩展名 */
.file-ext-badge.ext-none {
  background: #fafafa;
  color: #d1d5db;
  border: 0.5px solid #f0f0f0;
}

/* 上传进度条 */
.upload-progress {
  margin: 12px 0;
}

.upload-progress-track {
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  height: 8px;
}

.upload-progress-bar {
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.2s;
}

.upload-progress-text {
  display: block;
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 4px;
}

/* ===== 欠款跟踪模块 ===== */
.debt-summary {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #f9fafb;
  border: 0.5px solid var(--border-light);
  border-radius: 8px;
}

.debt-summary b {
  color: #dc2626;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.cell-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-main);
}

.debt-amount {
  font-variant-numeric: tabular-nums;
}

.cell-amount.debt-unpaid-pos .debt-amount {
  color: #dc2626;
  font-weight: 600;
}

.cell-amount.debt-unpaid-zero .debt-amount {
  color: #16a34a;
}

.cell-date {
  white-space: nowrap;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
}

/* 欠款状态徽章 */
.status-badge.debt-未还 { background: #fee2e2; color: #dc2626; }
.status-badge.debt-部分还款 { background: #fef3c7; color: #b45309; }
.status-badge.debt-已结清 { background: #e6f7ee; color: #16a34a; }

/* 欠款附件 */
.debt-att-badge {
  display: inline-block;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #eef2ff;
  color: #4f46e5;
  cursor: pointer;
  white-space: nowrap;
  margin-right: 4px;
  border: 0.5px solid #c7d2fe;
}

.debt-att-badge:hover {
  background: #e0e7ff;
}

.btn-attach {
  border: 1px solid var(--border);
  background: #fff;
  color: #4f46e5;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  margin-right: 4px;
}

.btn-attach.has-att {
  border-color: #c7d2fe;
  background: #eef2ff;
  font-weight: 500;
}

.btn-attach:hover {
  color: #4f46e5;
  border-color: #6366f1;
  background: #eef2ff;
}

.debt-attach-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.debt-attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 0.5px solid var(--border-light);
  border-radius: 8px;
  background: #f9fafb;
}

.debt-attach-name {
  flex: 1;
  font-size: 13px;
  color: var(--primary-dark);
  text-decoration: none;
  word-break: break-all;
  min-width: 0;
}

.debt-attach-name:hover {
  text-decoration: underline;
}

/* 附件重复文件高亮（各模块附件弹窗，兼容 debt-attach-item 与 attach-item 两种结构） */
.debt-attach-item.attach-item-dup,
.attach-item.attach-item-dup {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* ===== 待办附件弹窗 ===== */
.attach-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  max-height: 320px;
  overflow-y: auto;
}

.attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #f9fafb;
}

.attach-item .attach-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-main);
  word-break: break-all;
  min-width: 0;
}

.attach-item .attach-size {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
}

.attach-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.debt-attach-size {
  font-size: 12px;
  color: var(--text-weak);
  white-space: nowrap;
}

.debt-attach-upload {
  margin-top: 8px;
}

.debt-attach-upload input {
  font-size: 13px;
}

.debt-attach-hint {
  font-size: 12px;
  color: var(--text-weak);
  margin-top: 4px;
}

/* ===== 仪表盘模块 ===== */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dash-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.dash-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  background: #fff;
  border-top: 3px solid var(--primary);
}

.dash-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
}

.dash-card-label {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.dash-card-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  word-break: break-all;
}

.dash-card-sub {
  font-size: 12px;
  color: var(--text-weak);
  margin-top: 6px;
}

/* 卡片配色 */
.dash-card.card-todo { border-top-color: #6366f1; }
.dash-card.card-bd { border-top-color: #8b5cf6; }
.dash-card.card-debt { border-top-color: #f59e0b; }
.dash-card.card-alert { border-top-color: #ef4444; }
.dash-card.card-alert .dash-card-value { color: #dc2626; }
.dash-card.card-ok { border-top-color: #10b981; }
.dash-card.card-files { border-top-color: #06b6d4; }
.dash-card.card-potential { border-top-color: #94a3b8; }
.dash-card.card-following { border-top-color: #f59e0b; }
.dash-card.card-cooperated { border-top-color: #22c55e; }
.dash-card.card-contact { border-top-color: #14b8a6; }

/* 快捷列表双栏 */
.dash-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dash-col {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  background: #fff;
}

.dash-col-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
}

.dash-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-side);
  font-size: 13px;
}

.dash-list-text {
  color: var(--text-main);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-pin {
  flex-shrink: 0;
}

.dash-chip {
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.dash-empty {
  font-size: 13px;
  color: var(--text-weak);
  text-align: center;
  padding: 16px 0;
}

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

/* ===== 报价单模块 ===== */
.quote-type-select {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quote-type-item {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.12s ease;
}

.quote-type-item:hover {
  border-color: var(--primary);
}

.quote-type-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.quote-type-item input {
  margin: 0;
  cursor: pointer;
}

.quote-items-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
}

.quote-items-head {
  display: grid;
  grid-template-columns: 0.5fr 1.6fr 2.6fr 0.8fr 1fr 1.4fr 0.5fr;
  gap: 6px;
  font-size: 12px;
  color: var(--text-weak);
  margin-bottom: 6px;
}

.quote-item-row {
  display: grid;
  grid-template-columns: 0.5fr 1.6fr 2.6fr 0.8fr 1fr 1.4fr 0.5fr;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}

.quote-item-row input {
  font-size: 13px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 0;
}

.quote-item-row .qi-check {
  width: 18px;
  height: 18px;
  justify-self: center;
  cursor: pointer;
}

.quote-total {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  padding: 8px 0;
}

/* 业务产品分组 */
.quote-group-section {
  margin-bottom: 10px;
}

.quote-group-title {
  font-size: 13px;
  font-weight: 600;
  color: #4f46e5;
  padding: 6px 8px;
  background: #f5f3ff;
  border-left: 3px solid #4f46e5;
  border-radius: 4px;
  margin-bottom: 6px;
}

/* ===== 合同模板模块 ===== */
.contract-hint {
  font-size: 12px;
  color: var(--text-weak);
  margin-bottom: 6px;
}

.contract-hint code {
  background: var(--primary-light);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.contract-gen-hint {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.contract-result {
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  max-height: 50vh;
  overflow-y: auto;
  color: var(--text-main);
}

/* ===== 公司信息模块 ===== */
.company-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  background: #fff;
}

.company-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.company-save-bar {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

/* ===== 手机端通用适配 ===== */
@media (max-width: 720px) {
  /* 主内容区收窄边距，充分利用小屏 */
  .workbench-main {
    padding: 16px 14px;
  }

  /* 日期时间栏边距收窄 */
  .datetime-bar {
    padding: 8px 14px;
  }

  /* 弹窗：占满宽度，避免超出屏幕 */
  .modal {
    width: 94%;
    max-width: 94%;
    max-height: 86vh;
    border-radius: 12px;
  }
  .modal-header {
    padding: 14px 16px;
  }
  .modal-body {
    padding: 14px 16px;
  }

  /* 按钮与触控区加大，便于手指点击（≥44px） */
  .btn-primary,
  .btn-secondary {
    min-height: 42px;
    padding: 10px 16px;
  }
  .btn-pin {
    padding: 8px 10px;
    font-size: 16px;
  }
  .btn-complete,
  .btn-reopen {
    padding: 8px 14px;
  }

  /* 仪表盘卡片单列更紧凑 */
  .dash-cards {
    gap: 10px;
  }
}

/* ===== 团队 KPI 模块 ===== */
.team-section {
  margin-bottom: 22px;
}

.team-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.team-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

/* 汇总统计 */
.team-summary-line {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.team-summary-chip {
  font-size: 13px;
  color: var(--text-sub);
  background: #f3f4f6;
  padding: 6px 14px;
  border-radius: 999px;
}

.team-summary-chip b {
  color: var(--primary);
  font-size: 15px;
}

.team-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.team-stat-card {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}

.team-stat-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.team-stat-role {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-weak);
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 4px;
}

.team-stat-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.team-stat-unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-weak);
}

.team-stat-kpi {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

/* 成员卡片网格 */
.team-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.team-member-card {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.team-member-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.team-member-card.member-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.team-member-card .btn-pin {
  position: absolute;
  top: 8px;
  right: 8px;
}

.team-member-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  padding-right: 28px;
  margin-bottom: 2px;
}

.team-member-role {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.member-status {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
}

.member-status.member-on {
  color: #16a34a;
  background: #ecfdf5;
}

.member-status.member-off {
  color: #6b7280;
  background: #f3f4f6;
}

.team-member-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}

/* KPI 数值单元格 */
.cell-kpi {
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

/* 手机端成员卡片单列 */
@media (max-width: 720px) {
  .team-member-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 项目管理（第十八阶段）===== */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  transition: box-shadow 0.15s;
}

.project-card:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.project-card.pinned {
  border-color: var(--primary);
  background: #fafaff;
}

.project-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.project-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.project-status {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-ongoing { background: #e0f2fe; color: #0369a1; }
.status-done { background: #dcfce7; color: #15803d; }
.status-paused { background: #fef3c7; color: #b45309; }
.status-other { background: #f3f4f6; color: #6b7280; }

.project-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.project-card-actions .btn-edit,
.project-card-actions .btn-delete {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.project-card-actions .btn-edit:hover {
  color: var(--primary-dark);
  border-color: var(--primary);
}

.project-card-actions .btn-delete:hover {
  color: #dc2626;
  border-color: #fca5a5;
}

.project-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.proj-customer {
  font-size: 13px;
  color: var(--primary);
  background: var(--primary-light, #eef2ff);
  padding: 2px 10px;
  border-radius: 6px;
}

.proj-date {
  font-size: 12px;
  color: var(--text-sub);
}

.proj-desc {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 8px;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* 附件类型徽标 */
.proj-file-type {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.type-contract { background: #fee2e2; color: #b91c1c; }
.type-bid { background: #ede9fe; color: #6d28d9; }
.type-quote { background: #dcfce7; color: #15803d; }
.type-plan { background: #e0f2fe; color: #0369a1; }
.type-accept { background: #fef3c7; color: #b45309; }
.type-other { background: #f3f4f6; color: #6b7280; }

.attach-remark {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}




/* ===== 机密事件表格 ===== */
td.cell-pin {
  width: 36px;
  text-align: center;
}

td.cell-content {
  max-width: 320px;
  white-space: normal;
  word-break: break-word;
  color: var(--text-sub);
}

/* ===== 短彩信利润计算 ===== */
.panel-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.calc-body {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calc-category {
  display: flex;
  gap: 8px;
}

.calc-cat-btn {
  padding: 8px 20px;
  font-size: 14px;
  color: var(--text-sub);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.calc-cat-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.calc-cat-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 500;
}

.calc-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.calc-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calc-field label {
  font-size: 13px;
  color: var(--text-sub);
}

.calc-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-main);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.calc-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.calc-result {
  height: 38px;
  line-height: 38px;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  background: var(--primary-light);
  border-radius: 8px;
}

.calc-card-profit {
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  padding: 24px 20px;
}

.calc-profit-label {
  font-size: 14px;
  color: var(--text-sub);
}

.calc-profit-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  margin: 6px 0;
}

.calc-profit-value.pos {
  color: #16a34a;
}

.calc-profit-value.neg {
  color: #dc2626;
}

.calc-profit-sub {
  font-size: 12px;
  color: var(--text-sub);
}

.calc-ratio-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.calc-ratio-item {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.calc-ratio-label {
  font-size: 12px;
  color: var(--text-sub);
}

.calc-ratio-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.calc-ratio-value.pos {
  color: #16a34a;
}

.calc-ratio-value.neg {
  color: #dc2626;
}

.calc-formula {
  margin-top: 16px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-align: left;
}

.calc-formula-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.calc-formula-line {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.8;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* ===== 视图切换 tabs ===== */
.calc-view-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}

.calc-tab {
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-sub);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.calc-tab:hover {
  color: var(--primary);
}

.calc-tab.active {
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ===== 两列字段网格 ===== */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.calc-save-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.calc-note-input {
  flex: 1;
}

/* ===== 批量表格 ===== */
.calc-batch-table-wrap {
  overflow-x: auto;
}

.calc-batch-table th,
.calc-batch-table td {
  min-width: 80px;
}

.calc-batch-table .calc-batch-input {
  width: 100%;
  min-width: 60px;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
}

.calc-batch-table .calc-batch-input:focus {
  border-color: var(--primary);
}

.calc-batch-table .calc-batch-cat {
  height: 32px;
  padding: 0 6px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
}

.calc-batch-profit {
  font-weight: 600;
  white-space: nowrap;
}

/* ===== 批量汇总 ===== */
.calc-batch-summary {
  display: flex;
  gap: 12px;
}

.calc-summary-item {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.calc-summary-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
}

.calc-summary-profit .calc-summary-value.pos {
  color: #16a34a;
}

.calc-summary-profit .calc-summary-value.neg {
  color: #dc2626;
}

/* ===== 附件表格（列表形式 + 多选）===== */
.attach-table-wrap {
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}

.attach-table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
}

.attach-table-toolbar .toolbar-info {
  flex: 1;
  font-size: 12px;
  color: var(--text-sub);
}

.attach-table-toolbar .toolbar-info strong {
  color: var(--primary-dark);
}

.attach-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.attach-table thead th {
  text-align: left;
  padding: 8px 12px;
  background: #f1f5f9;
  color: var(--text-sub);
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.attach-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.attach-table tbody tr:last-child td {
  border-bottom: none;
}

.attach-table tbody tr:hover {
  background: #f8fafc;
}

.attach-table tbody tr.attach-item-dup {
  background: #fef2f2;
}

.attach-table tbody tr.attach-item-dup:hover {
  background: #fee2e2;
}

.attach-table .attach-check-cell {
  width: 32px;
  text-align: center;
}

.attach-table .attach-name-cell {
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 220px;
  padding-right: 16px;
}

.attach-table .attach-name-cell a {
  color: var(--primary-dark);
  text-decoration: none;
}

.attach-table .attach-name-cell a:hover {
  text-decoration: underline;
}

.attach-table .attach-ext-cell {
  white-space: nowrap;
  width: 70px;
  color: var(--text-sub);
  font-size: 12px;
}

.attach-table .attach-size-cell {
  white-space: nowrap;
  color: var(--text-sub);
  font-size: 12px;
  width: 90px;
}

.attach-table .attach-actions-cell {
  white-space: nowrap;
  text-align: right;
  width: 150px;
}

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

.attach-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-sub);
  font-size: 13px;
}

/* ===== 折叠屏展开态适配（iPhone Duo 内屏等，640–1024px） ===== */
@media (max-width: 1024px) {
  /* 侧边栏：保持文字，整体变窄 */
  .sidebar {
    width: 150px;
    padding: 16px 8px;
  }
  .sidebar .brand {
    gap: 8px;
    margin-bottom: 18px;
    padding: 0 4px;
  }
  .sidebar .brand .logo-mark {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }
  .sidebar .brand span {
    font-size: 12px;
    line-height: 1.25;
  }
  .nav-item {
    gap: 6px;
    padding: 8px 10px;
    font-size: 14px;
  }
  .nav-icon {
    font-size: 14px;
    width: 15px;
  }

  /* 内容区：确保不横向溢出 */
  .content-area {
    min-width: 0;
    overflow-x: hidden;
  }
  .workbench-main {
    padding: 20px 16px;
  }

  /* 顶部日期时间栏：允许换行，搜索框自适应 */
  .datetime-bar {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .datetime-right {
    flex-wrap: wrap;
    gap: 8px;
  }
  .global-search {
    flex: 1;
    min-width: 200px;
  }

  /* 模块顶栏（搜索+按钮）：允许换行 */
  .customer-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* 表格容器：宽度自适应，保留横向滚动 */
  .customer-table-wrap {
    max-width: 100%;
    overflow-x: auto;
  }
  .customer-table {
    min-width: 0;
  }
}

