:root{
  /* 全新配色：紫+琥珀（避免与原蓝绿相似） */
  --bg: #1b1033;
  --panel: rgba(255,255,255,.78);
  --panel-solid: #ffffff;
  --stroke: rgba(43, 16, 96, .12);
  --text: #1f1147;
  --muted: rgba(31,17,71,.62);
  --brand: #7c3aed; /* 紫 */
  --brand-2: #f59e0b; /* 琥珀 */
  --ok: #059669;
  --warn: #d97706;
  --bad: #b91c1c;
  --shadow: 0 18px 55px rgba(27,16,51,.18);
}

/* 全局：更顺滑的滚动与字体渲染 */
html { scroll-behavior: smooth; }
body{
  background:
    radial-gradient(1200px 800px at 18% -10%, rgba(124,58,237,.18), transparent 60%),
    radial-gradient(900px 700px at 88% 0%, rgba(245,158,11,.14), transparent 55%),
    radial-gradient(900px 700px at 60% 120%, rgba(217,70,239,.10), transparent 55%),
    #fbf7ff;
  color: var(--text);
}

.font-mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
}

/* 卡片更现代，但不改布局结构（仍使用 Bootstrap 的 card） */
.card{
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.card-header{
  border-bottom: 1px solid var(--stroke) !important;
}

textarea.form-control,
input.form-control{
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.14);
  box-shadow: none !important;
}

textarea.form-control:focus,
input.form-control:focus{
  border-color: rgba(124,58,237,.55);
  box-shadow: 0 0 0 .25rem rgba(124,58,237,.14) !important;
}

.nav-pills .nav-link{
  border-radius: 999px;
  padding: 10px 16px;
  transition: background-color .18s ease, transform .12s ease;
}
.nav-pills .nav-link:active{ transform: translateY(1px); }

/* 表格：保持原结构（#extract-table）但重写风格 */
.table-responsive{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#extract-table{
  width: 100%;
  min-width: 900px;
  table-layout: fixed;
  /* 全网格线（所有列/所有单元格都有边框） */
  border-collapse: collapse;
  border: 1px solid rgba(31,17,71,.22);
  /* 需求：数据列表背景为白色 */
  background: #ffffff;
}

#extract-table thead th{
  position: sticky;
  top: 0;
  z-index: 1;
  /* 白底列表：表头用极浅灰白，避免发“亮白”刺眼 */
  background: linear-gradient(#ffffff, #f6f7fb);
  color: rgba(15,23,42,.85);
  border-bottom: 1px solid var(--stroke);
  font-weight: 700 !important; /* 确保表头字体加粗 */
}

#extract-table th,
#extract-table td{
  padding: 10px 12px;
  vertical-align: top;
  border: 1px solid rgba(31,17,71,.16);
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent; /* 让整行 hover/错误背景能覆盖到所有列 */
}

/* 长文本自动换行（保持你原来的 text-wrap 语义） */
#extract-table td.text-wrap{
  white-space: normal;
  word-break: break-word;
  line-height: 1.5;
  max-width: 0;
}

/* 行交互：更“丝滑”，不发绿（避免刺眼） */
#extract-table tbody tr{
  /* 需求：鼠标离开/切换行时高亮立即消失（不做渐变） */
  transition: none;
  cursor: pointer;
}

#extract-table tbody tr:hover{
  background: rgba(124,58,237,.06);
}

#extract-table tbody tr:hover td{
  background: rgba(124,58,237,.06);
}

#extract-table tbody tr.selected{
  background: rgba(124,58,237,.10);
  box-shadow: inset 0 0 0 1px rgba(124,58,237,.24);
}

#extract-table tbody tr.selected td{
  background: rgba(124,58,237,.10);
}

/* 搜索高亮（红色） */
.hl-red{
  background: rgba(185, 28, 28, .16);
  color: #b91c1c;
  font-weight: 700;
  border-radius: 4px;
  padding: 0 2px;
}

/* 成功行：不覆盖 hover/selected（与其它行高亮一致） */
#extract-table tbody tr.row-ok{
}
#extract-table tbody tr.row-ok td{
}

/* 错误行：不做任何专属配色（与其它行一致） */

/* 编辑：更清晰的编辑态 */
#extract-table td.editable{
  position: relative;
}
#extract-table td.editable:hover{
  /* 让“原数据”列也跟随整行 hover/selected 的背景色 */
  background: inherit;
}

#extract-table td.editable.editing{
  padding: 0;
  background-color: inherit;
}

#extract-table td.editable textarea.edit-input{
  width: 100%;
  min-height: 42px;
  /* 需求：删除编辑框“特殊样式”，看起来像单元格本身 */
  border: 0;
  padding: 10px 12px; /* 与单元格 padding 一致 */
  font: inherit;
  line-height: 1.5;
  resize: none;
  outline: none;
  box-shadow: none;
  border-radius: 0;
  /* 编辑框底色必须与同一行其它列高亮一致：用透明，直接显示 td 的背景色 */
  background-color: transparent !important;
  color: inherit !important;
  display: block;
}

/* 右键只弹“复制提示”按钮（不再弹菜单/浮层） */
.copy-tip-btn{
  position: fixed;
  z-index: 3000;
  display: none;
  border: 1px solid rgba(124,58,237,.22);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  color: #2a145e;
  box-shadow: 0 14px 44px rgba(27,16,51,.22);
  user-select: none;
}

.copy-tip-btn.show{ display: inline-flex; align-items:center; gap: 8px; }

.copy-tip-btn:hover{
  background: rgba(255,255,255,.98);
  border-color: rgba(124,58,237,.35);
}

.copy-tip-btn:active{ transform: translateY(1px); }

/* 回到顶部按钮（保留 ID，不改结构） */
#back-to-top{
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 16px 46px rgba(124,58,237,.32);
  display: none;
}
#back-to-top.show{ display: inline-flex; align-items:center; justify-content:center; }
#back-to-top:hover{ filter: brightness(.95); }

