/* ===== COMPARISON TOOL (cmp- prefixed) ===== */
.cmp-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cmp-search-input {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  width: 260px;
}
.cmp-filters {
  display: flex;
  gap: 8px;
}
.cmp-filter-btn {
  padding: 6px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.cmp-filter-btn.active {
  background: #4472c4;
  color: #fff;
  border-color: #4472c4;
}
.cmp-filter-btn:hover:not(.active) {
  background: #f0f0f0;
}
.cmp-filter-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  min-width: 150px;
}
.cmp-result-count {
  font-size: 13px;
  color: #888;
  margin-left: 8px;
}

#cmp-global-filter-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-left: 4px solid #4472c4;
}
section[id^='cmp-'] {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  min-width: 0;
}
section[id^='cmp-'] h2 {
  font-size: 20px;
  margin-bottom: 16px;
  color: #1a1a2e;
  border-left: 4px solid #4472c4;
  padding-left: 12px;
}

#mapping-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}
#mapping-table td:last-child {
  width: 1%;
  white-space: nowrap;
}
#mapping-table th:nth-child(2) {
  width: 40px;
  background: #e8f0ff;
}
#mapping-table td:first-child {
  font-family: Consolas, monospace;
  color: #c0392b;
  background: #fff8f8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#mapping-table td:nth-child(3) {
  font-family: Consolas, monospace;
  color: #2980b9;
  background: #f8faff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#mapping-table th,
#mapping-table td {
  padding: 10px 14px;
  border: 1px solid #e8e8e8;
  text-align: left;
}
#mapping-table th {
  background: #f0f4ff;
  font-weight: 600;
  text-align: center;
}
#mapping-table th:nth-child(2) {
  width: 40px;
  background: #e8f0ff;
}
#mapping-table td:first-child {
  font-family: Consolas, monospace;
  color: #c0392b;
  background: #fff8f8;
  white-space: nowrap;
}
#mapping-table td:nth-child(2) {
  text-align: center;
  color: #999;
  background: #fafafa;
  font-weight: bold;
}
#mapping-table td:nth-child(3) {
  font-family: Consolas, monospace;
  color: #2980b9;
  background: #f8faff;
  white-space: nowrap;
}
#mapping-body tr.modified {
  background-color: #fff3cd;
}
#mapping-body tr.modified td:first-child {
  background-color: #fff3cd;
}
#mapping-body tr.modified td:nth-child(2) {
  background-color: #fff3cd;
}
#mapping-body tr.modified td:nth-child(3) {
  background-color: #fff3cd;
}
#mapping-body tr.confirmed {
  background-color: #d0e8ff;
}
#mapping-body tr.confirmed td:first-child {
  background-color: #d0e8ff;
}
#mapping-body tr.confirmed td:nth-child(2) {
  background-color: #d0e8ff;
}
#mapping-body tr.confirmed td:nth-child(3) {
  background-color: #d0e8ff;
}
#mapping-body td:last-child {
  width: 1%;
  white-space: nowrap;
}
.cmp-rule-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
}
tr.modified .cmp-rule-input {
  border-color: #e6c200;
  background: #fffde6;
}
tr.confirmed .cmp-rule-input {
  border-color: #3498db;
  background: #ebf5fb;
}
.cmp-rule-text {
  display: block;
  min-height: 24px;
  line-height: 24px;
  font-size: 13px;
}
.cmp-mapping-btn {
  padding: 4px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-right: 4px;
  background: #fff;
  transition: all 0.15s;
  display: inline-block;
}
.cmp-mapping-btn:hover {
  background: #f0f0f0;
}
.cmp-mapping-btn.btn-edit {
  border-color: #f39c12;
  color: #f39c12;
}
.cmp-mapping-btn.btn-edit:hover {
  background: #fef5e7;
}
.cmp-mapping-btn.btn-confirm {
  border-color: #3498db;
  color: #3498db;
}
.cmp-mapping-btn.btn-confirm:hover {
  background: #ebf5fb;
}
.cmp-mapping-btn.btn-save {
  border-color: #27ae60;
  color: #27ae60;
}
.cmp-mapping-btn.btn-save:hover {
  background: #eafaf1;
}
.cmp-mapping-btn.btn-cancel {
  border-color: #e74c3c;
  color: #e74c3c;
}
.cmp-mapping-btn.btn-cancel:hover {
  background: #fdedec;
}
.cmp-mapping-btn.btn-unconfirm {
  border-color: #95a5a6;
  color: #95a5a6;
}
.cmp-mapping-btn.btn-unconfirm:hover {
  background: #f5f5f5;
}
.cmp-mapping-btn.btn-delete {
  border-color: #e74c3c;
  color: #e74c3c;
}
.cmp-mapping-btn.btn-delete:hover {
  background: #fdedec;
}
.cmp-mapping-btn.btn-add {
  border-color: #27ae60;
  color: #27ae60;
  font-size: 13px;
  padding: 6px 20px;
}
.cmp-mapping-btn.btn-add:hover {
  background: #eafaf1;
}
.custom-row {
  background-color: #f0f8ff;
}
.custom-row td:first-child {
  background-color: #f0f8ff;
}
.custom-row td:nth-child(2) {
  background-color: #f0f8ff;
}
.custom-row td:nth-child(3) {
  background-color: #f0f8ff;
}
.cmp-add-row td {
  background-color: #f9f9f9;
  padding: 12px !important;
}
.cmp-add-row .cmp-rule-input {
  border-style: dashed;
}
.cmp-add-row-placeholder td {
  background-color: #f9f9f9;
}

.cmp-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  max-height: 70vh;
}
#cleaned-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 2000px;
}
#cleaned-data-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}
#cleaned-data-table th {
  background: #4472c4;
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  border: 1px solid #3a61b3;
  font-weight: 600;
  font-size: 11px;
}
#cleaned-data-table td {
  padding: 8px 12px;
  border: 1px solid #e8e8e8;
  white-space: nowrap;
  font-family: Consolas, monospace;
  font-size: 11px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
#cleaned-data-table tbody tr:nth-child(even) {
  background: #f8faff;
}
#cleaned-data-table tbody tr:hover {
  background: #e3f2fd;
}

/* section 标题旁副文本（如当前选中文件名） */
.cmp-section-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: normal;
}
/* 原始数据提示框（info 卡片：浅蓝底 + 左边框） */
.raw-info-hint {
  margin: 10px 0;
  padding: 12px 14px 12px 16px;
  background: #eef5ff;
  border-left: 3px solid #4472c4;
  border-radius: 4px;
  color: #2c4a6e;
  font-size: 13px;
  line-height: 1.6;
}

/* ===== 原始数据展示表（cmp-raw-data-section）=====
   镜像 cleaned-data-table 风格；列数动态（常 30+），表头 sticky 顶部，
   前 3 列（序号/状态/part_no）sticky 左侧便于横向滚动时对照。 */
#raw-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
#raw-data-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}
#raw-data-table th {
  background: #4472c4;
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  border: 1px solid #3a61b3;
  font-weight: 600;
  font-size: 11px;
}
#raw-data-table td {
  padding: 8px 12px;
  border: 1px solid #e8e8e8;
  white-space: nowrap;
  font-family: Consolas, monospace;
  font-size: 11px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
#raw-data-table tbody tr:nth-child(even) {
  background: #f8fbff;
}
#raw-data-table tbody tr:hover {
  background: #eef4fb;
}
/* 前 3 列 sticky 左侧（横向滚动时固定） */
#raw-data-table th:nth-child(-n+3),
#raw-data-table td:nth-child(-n+3) {
  position: sticky;
  z-index: 2;
}
#raw-data-table thead th:nth-child(-n+3) {
  z-index: 12;
}
#raw-data-table th:nth-child(1),
#raw-data-table td:nth-child(1) { left: 0; width: 52px; min-width: 52px; }
#raw-data-table th:nth-child(2),
#raw-data-table td:nth-child(2) { left: 52px; width: 92px; min-width: 92px; }
#raw-data-table th:nth-child(3),
#raw-data-table td:nth-child(3) {
  left: 144px; width: 180px; min-width: 180px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.10);
}
/* sticky 列不透明背景（覆盖横滚内容；与 zebra/hover 同步） */
#raw-data-table td:nth-child(-n+3) { background: #fff; }
#raw-data-table tbody tr:nth-child(even) td:nth-child(-n+3) { background: #f1f6fc; }
#raw-data-table tbody tr:hover td:nth-child(-n+3) { background: #dceafb; }
/* 固定列语义：序号灰右对齐 / part_no 高亮 / 状态色块 */
#raw-data-table td:nth-child(1) { color: #9aa3ad; text-align: right; }
#raw-data-table td:nth-child(3) { font-weight: 600; color: #1a4d8f; }
#raw-data-table td.raw-status.is-valid { color: #1e8e3e; font-weight: 600; }
#raw-data-table td.raw-status.is-invalid { color: #d93025; font-weight: 600; }
/* 占位行（加载中/错误/空）：解除 sticky 列规则，居中铺满 */
#raw-data-table td.raw-placeholder {
  position: static;
  width: auto;
  left: auto;
  text-align: center;
  color: #888;
  padding: 30px;
  background: #fff;
}
#raw-data-table td.raw-placeholder-error { color: #d93025; padding: 16px; }

.cmp-compare-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.cmp-compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #fafafa;
  cursor: pointer;
  border-bottom: 1px solid #e0e0e0;
}
.cmp-compare-header .opn {
  font-family: Consolas, monospace;
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmp-badge {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.cmp-badge-match {
  background: #e8f5e9;
  color: #2e7d32;
}
.cmp-badge-transformed {
  background: #e3f2fd;
  color: #1565c0;
}
.cmp-badge-diff {
  background: #fff3e0;
  color: #e65100;
}

.cmp-compare-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 0;
}
.cmp-compare-panel {
  padding: 12px 16px;
  min-width: 0;
  overflow: hidden;
}
.cmp-compare-panel:first-child {
  border-right: 1px solid #e0e0e0;
  background: #fffbf0;
}
.cmp-compare-panel:last-child {
  background: #f5f8ff;
}
.cmp-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cmp-field-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px dashed #f0f0f0;
  min-width: 0;
}
.cmp-field-row:last-child {
  border-bottom: none;
}
.cmp-field-key {
  color: #555;
  font-weight: 500;
  min-width: 140px;
  font-size: 12px;
  flex-shrink: 0;
}
.cmp-field-val {
  color: #333;
  font-family: Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmp-field-status {
  margin-left: 6px;
  font-size: 12px;
  font-weight: bold;
}
.status-ok {
  color: #2e7d32;
}
.status-warn {
  color: #e65100;
}

.cmp-new-fields {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e8e8e8;
}
.cmp-new-field-item {
  display: inline-block;
  background: #e3f2fd;
  color: #1565c0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin: 2px 4px 2px 0;
  font-family: Consolas, monospace;
}

.cmp-missing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.cmp-missing-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
}
.cmp-missing-card h3 {
  font-size: 15px;
  margin-bottom: 8px;
  color: #1a1a2e;
}
.cmp-missing-count {
  font-size: 24px;
  font-weight: 700;
  color: #4472c4;
  margin-bottom: 8px;
}
.cmp-missing-card ul {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
}
.cmp-missing-card li {
  font-size: 12px;
  font-family: Consolas, monospace;
  padding: 2px 0;
  color: #555;
  border-bottom: 1px solid #f5f5f5;
}

#pagination,
#cleaned-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}
.cmp-page-btn {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.cmp-page-btn.active {
  background: #4472c4;
  color: #fff;
  border-color: #4472c4;
}
.cmp-page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.cmp-page-ellipsis {
  padding: 0 4px;
  color: #999;
  font-size: 14px;
}
.cmp-page-jump {
  width: 50px;
  padding: 4px 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
}
.cmp-page-info {
  font-size: 12px;
  color: #888;
}

/* ===== AI Mapping Chat ===== */
.ai-chat-section {
  margin-bottom: 24px;
}
.ai-chat-container {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.ai-chat-messages {
  max-height: 360px;
  overflow-y: auto;
  padding: 16px;
  background: #fafbfc;
}
.ai-chat-msg {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.6;
  max-width: 85%;
  word-break: break-word;
}
.ai-chat-msg.user-msg {
  background: #dceaf5;
  color: var(--text);
  margin-left: auto;
}
.ai-chat-msg.ai-msg {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
}
.ai-chat-msg.ai-thinking {
  color: var(--text-light);
  font-style: italic;
}
.ai-chat-input-area {
  display: flex;
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  gap: 10px;
  background: var(--white);
}
.ai-chat-input-area textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  resize: vertical;
  font-family: inherit;
  outline: none;
  min-height: 42px;
}
.ai-chat-input-area textarea:focus {
  border-color: var(--primary-light);
}
.ai-chat-input-area .ai-send-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.ai-chat-input-area .ai-send-btn:hover {
  background: var(--primary-dark);
}
.ai-chat-input-area .ai-send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.ai-chat-detail {
  margin-top: 6px;
  padding: 8px 10px;
  background: #f0f4ff;
  border-radius: 6px;
  font-size: 13px;
  color: var(--primary);
}
.ai-chat-stats {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-light);
}
.ai-chat-sample {
  margin-top: 6px;
  padding: 6px 10px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 12px;
  color: #666;
  font-family: Consolas, monospace;
}

/* ===== 选型助手 (Advisor) ===== */
.advisor-layout {
  display: flex;
  gap: 16px;
  max-width: 1800px;
  margin: 0 auto;
  padding: 18px 24px;
  align-items: flex-start;
  min-height: 0;
}
.advisor-chat {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
}
.advisor-chat .ai-chat-messages {
  /* 高度由 flex 填满剩余空间；勿用固定 vh，避免顶破外层 */
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #f7f9fc;
  padding: 14px;
  scroll-behavior: smooth;
}
/* 消息气泡 + 头像 */
.advisor-chat .ai-chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 97%;
  margin-bottom: 12px;
}
.advisor-chat .user-msg {
  margin-left: auto;
  flex-direction: row-reverse;
}
.advisor-chat .msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}
.advisor-chat .ai-msg .msg-avatar {
  background: linear-gradient(135deg, #0369a1, #1a5276);
  color: #fff;
}
.advisor-chat .user-msg .msg-avatar {
  background: #dceaf5;
  color: #1a5276;
}
.advisor-chat .msg-bubble {
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
  min-width: 0;
}
.advisor-chat .ai-msg .msg-bubble {
  background: var(--white);
  border: 1px solid var(--border);
  border-top-left-radius: 3px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.advisor-chat .user-msg .msg-bubble {
  background: #dceaf5;
  color: var(--text);
  border-top-right-radius: 3px;
}
.advisor-chat .msg-bubble .advisor-ul {
  margin: 6px 0;
  padding-left: 20px;
}
.advisor-chat .msg-bubble .advisor-ul li {
  margin: 3px 0;
}
.advisor-chat .msg-bubble code {
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: Consolas, monospace;
  font-size: 12.5px;
  color: #0f172a;
}
.advisor-chat .msg-bubble strong {
  color: #0369a1;
}
/* 打字动画 */
.advisor-typing {
  display: inline-flex;
  gap: 5px;
  padding: 6px 3px;
  align-items: center;
}
.advisor-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7aa3c9;
  animation: advisorBounce 1.2s infinite ease-in-out;
}
.advisor-typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.advisor-typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes advisorBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}
/* 头部 */
.advisor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
}
.advisor-header .title-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.advisor-header .title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.advisor-header .title-icon {
  font-size: 17px;
}
.advisor-header .title {
  font-weight: 700;
  color: #0369a1;
  font-size: 15px;
}
.advisor-header .subtitle {
  font-size: 11px;
  color: #64748b;
}
.advisor-header .back-link {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid transparent;
}
.advisor-header .back-link:hover {
  background: rgba(3, 105, 161, 0.08);
  border-color: rgba(3, 105, 161, 0.15);
}
/* 结果区 */
.advisor-results-head {
  font-size: 12.5px;
  color: #0369a1;
  font-weight: 600;
  margin: 14px 0 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.advisor-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.advisor-results .param-chip {
  margin: 0;
  box-shadow: none;
}
.advisor-more {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
}
.advisor-more a {
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
}
/* 快速回复分组 */
.advisor-chip-group {
  margin-top: 12px;
}
.advisor-chip-label {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.advisor-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.advisor-quick-reply {
  background: #eef4ff;
  border: 1px solid #c7d8f5;
  color: #1a5276;
  border-radius: 18px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.advisor-quick-reply:hover {
  background: #dceaf5;
  border-color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(26, 82, 118, 0.12);
}
.advisor-quick-reply.clarify {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}
.advisor-quick-reply.clarify:hover {
  background: #ffedd5;
}
/* 开场示例 */
.advisor-examples {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.advisor-example {
  text-align: left;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid #2980b9;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}
.advisor-example:hover {
  border-left-color: #0369a1;
  background: #f8fafc;
  transform: translateX(2px);
}
.advisor-example .ex-tag {
  display: inline-block;
  font-size: 10px;
  color: #0369a1;
  background: #e0f2fe;
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 7px;
  vertical-align: middle;
}
/* 需求清单 */
.advisor-slots {
  width: 300px;
  flex-shrink: 0;
  align-self: flex-start;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: static;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  height: auto;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.advisor-slots .slots-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.advisor-slots h3 {
  font-size: 14px;
  margin: 0;
  color: var(--text);
  flex: 1;
}
.advisor-slots .slot-count {
  font-size: 11px;
  color: #fff;
  background: #0369a1;
  border-radius: 10px;
  padding: 2px 9px;
  font-weight: 600;
}
.advisor-slots .slot-count.zero {
  background: #cbd5e1;
}
.advisor-slots .slot-group {
  margin-bottom: 13px;
}
.advisor-slots .slot-group-title {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 5px;
  letter-spacing: 0.3px;
}
.advisor-slots .slot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.advisor-slots .slot-chip {
  background: #f0f4ff;
  color: #1a5276;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.advisor-slots .slot-chip:hover {
  background: #fee2e2;
  color: #b91c1c;
}
.advisor-slots .slot-chip:hover::after {
  content: ' ×';
  font-weight: 700;
}
.advisor-slots .slot-empty {
  font-size: 13px;
  color: var(--text-light);
  padding: 24px 8px;
  text-align: center;
  line-height: 1.7;
}
.advisor-slots .slot-empty .icon {
  font-size: 26px;
  display: block;
  margin-bottom: 8px;
  opacity: 0.6;
}
.advisor-slots .slot-hint {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.5;
}
/* 回到底部按钮 */
.advisor-scroll-bottom {
  position: absolute;
  right: 20px;
  bottom: 118px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--primary);
  z-index: 5;
}
.advisor-scroll-bottom.show {
  display: flex;
}
.advisor-input-hint {
  font-size: 11px;
  color: var(--text-light);
  padding: 0 16px 8px;
  text-align: right;
}
/* 结果包装：国产/进口标签 + 命中徽章 + 操作按钮 + 展开区 */
.advisor-result-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 10px 6px;
  background: #fff;
}
.advisor-result-wrap .mfr-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  z-index: 2;
  font-weight: 700;
}
.advisor-result-wrap .mfr-tag.dom {
  background: #dcfce7;
  color: #15803d;
}
.advisor-result-wrap .mfr-tag.imp {
  background: #f1f5f9;
  color: #475569;
}
.advisor-tag-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.tag-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}
.tag-badge.automotive {
  background: #dcfce7;
  color: #15803d;
}
.tag-badge.space {
  background: #ede9fe;
  color: #6d28d9;
}
.tag-badge.eol {
  background: #fee2e2;
  color: #b91c1c;
}
.tag-badge.nrnd {
  background: #fef3c7;
  color: #b45309;
}
.tag-badge.preview {
  background: #dbeafe;
  color: #1d4ed8;
}
.advisor-why {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 2px 0;
  align-items: center;
}
.advisor-why .why-label {
  font-size: 11px;
  color: var(--text-light);
}
.advisor-why .why-badge {
  font-size: 11px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 1px 8px;
}
.advisor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 2px 2px;
}
.adv-act {
  font-size: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: #334155;
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.adv-act:hover {
  background: #eef4ff;
  border-color: #c7d8f5;
  color: #1a5276;
}
.adv-act.loading {
  color: var(--text-light);
  opacity: 0.7;
}
.advisor-expand {
  margin: 2px 2px 4px;
}
.alt-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 6px;
  background: #fbfdff;
  font-size: 12.5px;
}
.alt-item .alt-pn {
  font-weight: 700;
  color: #1a5276;
}
.alt-item .alt-mfr {
  color: var(--text-light);
  font-size: 11px;
}
.alt-item .alt-match {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 55%;
}
.alt-item .alt-match span {
  background: #ecfdf5;
  color: #047857;
  border-radius: 8px;
  padding: 1px 6px;
  font-size: 10px;
}
.alt-empty {
  font-size: 12px;
  color: var(--text-light);
  padding: 8px 4px;
}
.alt-title {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 2px;
}
/* datasheet 问答 */
.ds-qa {
  border-top: 1px dashed var(--border);
  margin-top: 8px;
  padding-top: 8px;
}
.ds-qa-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.ds-qa-row input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12.5px;
  outline: none;
  font-family: inherit;
}
.ds-qa-row input:focus {
  border-color: var(--primary-light);
}
.ds-qa-row button {
  font-size: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.ds-answer {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 10px;
  white-space: pre-wrap;
}
.ds-answer .ds-cursor {
  display: inline-block;
  width: 6px;
  height: 13px;
  background: #0369a1;
  vertical-align: text-bottom;
  animation: dscursor 1s steps(2) infinite;
}
.ds-answer.done .ds-cursor {
  display: none;
}
.ds-meta {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 4px;
}
@keyframes dscursor {
  50% {
    opacity: 0;
  }
}
/* 头部操作组 */
.advisor-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.advisor-export {
  background: #fff;
  border: 1px solid var(--border);
  color: #334155;
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 12px;
  cursor: pointer;
}
.advisor-export:hover {
  background: #f8fafc;
  border-color: var(--primary-light);
  color: var(--primary);
}
@media (max-width: 900px) {
  .advisor-layout {
    flex-direction: column;
    padding: 14px;
  }
  .advisor-slots {
    width: 100%;
    flex: 0 0 auto;
    max-width: none;
    max-height: 28vh;
    position: static;
  }
  .advisor-chat .ai-chat-msg {
    max-width: 100%;
  }
}

/* ===== 活动 (Activities) ===== */
.page-activities-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 40px 48px;
}
.act-stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
}
.act-stat-card {
  flex: 1;
  background: linear-gradient(135deg, #0369a1, #1a5276);
  color: #fff;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 4px 14px rgba(3, 105, 161, 0.18);
}
.act-stat-card .num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}
.act-stat-card .lbl {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 4px;
}
.act-intro {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 18px;
}
.act-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.act-tab {
  padding: 10px 18px;
  font-size: 14px;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.act-tab.active {
  color: #0369a1;
  border-bottom-color: #0369a1;
  font-weight: 600;
}
.act-tab:hover {
  color: var(--primary);
}
.act-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.act-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}
.act-card:hover {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
  border-color: #bae6fd;
}
.act-card .act-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  margin-bottom: 10px;
}
.act-loc {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 4px;
}
.act-loc .pin {
  color: #0369a1;
}
.act-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin: 8px 0 6px;
  min-height: 46px;
}
.act-date {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}
.act-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 10px;
  font-weight: 600;
  margin-bottom: 10px;
  align-self: flex-start;
}
.act-badge.upcoming {
  background: #dbeafe;
  color: #1d4ed8;
}
.act-badge.ongoing {
  background: #dcfce7;
  color: #15803d;
}
.act-badge.ended {
  background: #f1f5f9;
  color: #64748b;
}
.act-stats {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.act-stat-item {
  display: flex;
  align-items: center;
  gap: 3px;
}
.act-reg {
  margin-top: auto;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.act-reg:hover {
  background: var(--primary-dark);
}
.act-reg:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}
.act-reg.registered {
  background: #16a34a;
}
.act-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
  font-size: 14px;
}
.act-empty .icon {
  font-size: 40px;
  display: block;
  margin-bottom: 10px;
  opacity: 0.5;
}
.act-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.act-page {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  padding: 0 8px;
}
.act-page.active {
  background: #0369a1;
  color: #fff;
  border-color: #0369a1;
}
.act-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
@media (max-width: 900px) {
  .act-grid {
    grid-template-columns: 1fr;
  }
  .act-stats-bar {
    flex-direction: column;
  }
  .page-activities-wrap {
    padding: 16px;
  }
}

/* ===== 活动管理弹窗 ===== */
.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-modal-box {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}
.admin-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}
.am-field {
  margin-bottom: 12px;
}
.am-field label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}
.am-field input,
.am-field select,
.am-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.am-field input:focus,
.am-field select:focus,
.am-field textarea:focus {
  border-color: var(--primary-light);
}
.am-row {
  display: flex;
  gap: 12px;
}
.am-row .am-field {
  flex: 1;
}
.am-error {
  color: var(--danger, #dc2626);
  font-size: 13px;
  min-height: 18px;
  margin: 4px 0;
}
.am-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Digi-Key 来源标记 */
.digikey-badge {
  background: #e8f4fd;
  color: #0066cc;
  border: 1px solid #b3d9f2;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  margin-left: 6px;
  display: inline-block;
  vertical-align: middle;
}
.digikey-indicator {
  margin-top: 8px;
  padding: 8px 14px;
  background: #e8f4fd;
  border-left: 3px solid #0066cc;
  border-radius: 4px;
  font-size: 13px;
  color: #0066cc;
}
.btn-datasheet {
  display: inline-block;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 6px;
  text-decoration: none;
  margin-left: 8px;
  cursor: pointer;
  vertical-align: middle;
}
.btn-datasheet:hover {
  background: var(--primary);
  color: #fff;
}
.btn-digikey-search {
  display: inline-block;
  padding: 8px 20px;
  font-size: 14px;
  color: #0066cc;
  border: 1px solid #0066cc;
  border-radius: 6px;
  background: #e8f4fd;
  cursor: pointer;
  margin-top: 10px;
}
.btn-digikey-search:hover {
  background: #0066cc;
  color: #fff;
}
.digikey-loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #b3d9f2;
  border-top-color: #0066cc;
  border-radius: 50%;
  animation: digikey-spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes digikey-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==================== 外部 API 获取进度遮罩 ==================== */
.external-api-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ext-fade-in 0.2s ease-out;
}
@keyframes ext-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.external-api-card {
  width: 90%;
  max-width: 440px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px 24px;
  text-align: left;
}
.external-api-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.external-api-icon {
  font-size: 28px;
  line-height: 1;
}
.external-api-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}
.external-api-sub {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 22px;
  word-break: break-all;
}
.external-api-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.external-api-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-light);
  transition: color 0.3s;
}
.external-api-step.step-active,
.external-api-step.step-done {
  color: var(--text);
}
.external-api-step-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.step-pending .external-api-step-icon {
  border: 2px solid #d0d7de;
  color: transparent;
}
.step-active .external-api-step-icon {
  border: 2px solid #b3d9f2;
  border-top-color: #0066cc;
  color: transparent;
  animation: digikey-spin 0.8s linear infinite;
}
.step-done .external-api-step-icon {
  background: var(--success);
  color: #fff;
  border: 2px solid var(--success);
}
.step-done .external-api-step-icon::before {
  content: '\2713';
}
.external-api-progress {
  width: 100%;
  height: 6px;
  background: #eef1f5;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.external-api-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4dabf5, var(--primary));
  border-radius: 3px;
  transition: width 0.6s ease-out;
}
.external-api-eta {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 18px;
}
.external-api-cancel {
  display: block;
  margin: 0 auto;
  padding: 8px 22px;
  border: 1px solid #d0d7de;
  background: #fff;
  color: var(--text-light);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.external-api-cancel:hover {
  background: #f6f8fa;
  color: var(--danger);
  border-color: var(--danger);
}

/* ============================================================
   UI 完善：全局视觉统一 + 响应式 + 细节打磨
   ============================================================ */
/* 基础：选中色 / 滚动条 */
::selection {
  background: rgba(26, 82, 118, 0.18);
  color: #0e3a56;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: #c7ced8;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
  background-clip: padding-box;
}
* {
  scrollbar-width: thin;
  scrollbar-color: #c7ced8 transparent;
}

/* 焦点态统一（无障碍） */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
.act-tab:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 1px;
  border-radius: 6px;
}

/* 按钮统一过渡 + 微交互 */
.btn,
.btn-sm,
.ai-send-btn,
.usb-search-btn,
.search-btn,
.act-reg,
.adv-act,
.advisor-export,
.back-link {
  transition:
    transform 0.12s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}
.btn:hover,
.btn-sm:hover,
.act-reg:hover,
.adv-act:hover,
.advisor-export:hover {
  transform: translateY(-1px);
}
.btn:active,
.btn-sm:active {
  transform: translateY(0);
}

/* 卡片 hover 上浮（统一动效） */
.cat-item,
.act-card,
.stat-card,
.advisor-result-wrap,
.alt-item {
  transition:
    box-shadow 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease;
}

/* 顶栏导航交互 */
.header-nav a {
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease;
  border-radius: 6px;
  padding: 6px 10px;
}
.header-nav a:hover {
  color: var(--primary-light);
  background: rgba(41, 128, 185, 0.06);
}
.section-title {
  letter-spacing: 0.2px;
}

/* 空状态统一 */
.act-empty,
.slot-empty {
  color: var(--text-light);
}

/* —— 响应式 ≤ 900px —— */
@media (max-width: 900px) {
  .header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
  }
  .header-nav {
    order: 3;
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 2px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .header-nav a {
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 13px;
  }
  .header-right {
    margin-left: auto;
  }
  .hero {
    padding: 24px 14px;
  }
  .hero h1 {
    font-size: 22px;
  }
  .search-box {
    flex-wrap: wrap;
  }
  .search-box .search-input {
    min-width: 0;
    flex: 1 1 100%;
  }
  .stats-bar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .stat-card {
    flex: 1 1 40%;
  }
  .cat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .unified-search-bar {
    flex-wrap: wrap;
  }
  .usb-input {
    min-width: 0;
    flex: 1 1 100%;
  }
  /* 后台侧栏 → 顶部横向滚动标签 */
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 8px;
    gap: 4px;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 5;
  }
  .admin-sidebar a,
  .admin-sidebar .section-label {
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 8px 12px;
  }
  .admin-sidebar .section-label {
    border-bottom: none;
  }
  /* 表格横向滚动 */
  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .data-table thead,
  .data-table tbody {
    display: table;
    width: 100%;
    min-width: 560px;
  }
  /* 页面内边距收紧（覆盖内联 padding） */
  [style*='max-width:1200px'],
  [style*='max-width:1280px'] {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}

/* —— 响应式 ≤ 600px —— */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 20px;
  }
  .hero p {
    font-size: 13px;
  }
  .stats-bar {
    flex-direction: column;
  }
  .stat-card {
    flex: 1 1 100%;
  }
  .cat-grid {
    grid-template-columns: 1fr !important;
  }
  /* 弹窗贴底、全宽 */
  .admin-modal {
    padding: 0;
    align-items: flex-end;
  }
  .admin-modal-box {
    width: 100%;
    max-width: 100% !important;
    border-radius: 14px 14px 0 0;
    max-height: 92vh;
  }
  .am-row {
    flex-direction: column;
    gap: 0;
  }
  .act-stats-bar {
    flex-direction: column;
  }
}

/* ===== 系统健康监控面板（admin-only） ===== */
.sh-toolbar{display:flex;align-items:center;gap:10px;margin-bottom:14px;flex-wrap:wrap;}
.sh-updated{font-size:12px;color:var(--text-light);}
.sh-banner{display:flex;align-items:center;gap:10px;padding:12px 16px;border-radius:var(--radius);margin-bottom:16px;font-size:15px;}
.sh-banner-ok{background:#e8f5e9;color:#1b5e20;}
.sh-banner-down{background:#fbe9e7;color:#b71c1c;}
.sh-banner-dot{width:10px;height:10px;border-radius:50%;background:currentColor;flex-shrink:0;}
.sh-banner-sub{font-size:12px;opacity:.85;margin-left:6px;}
.sh-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px;}
.sh-card{background:var(--white);border:1px solid var(--border);border-radius:var(--radius);padding:14px 16px;}
.sh-card-wide{grid-column:1 / -1;}
.sh-card-head{display:flex;align-items:center;gap:8px;margin-bottom:10px;padding-bottom:8px;border-bottom:1px solid var(--border);}
.sh-card-title{font-weight:600;color:var(--primary);font-size:14px;}
.sh-dot{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0;}
.sh-dot-ok{background:#2e7d32;}
.sh-dot-down{background:#c62828;}
.sh-dot-unknown{background:#bbb;}
.sh-row{display:flex;justify-content:space-between;gap:12px;padding:3px 0;font-size:13px;}
.sh-k{color:var(--text-light);}
.sh-v{color:var(--text);text-align:right;word-break:break-all;}
.sh-loading,.sh-error{padding:30px;text-align:center;color:var(--text-light);font-size:14px;}
.sh-error{color:#c62828;}

/* ===== 浏览/搜索历史（悬浮按钮 + 弹层） ===== */
#uh-fab{position:fixed;right:22px;bottom:22px;z-index:1000;width:52px;height:52px;border-radius:50%;
  border:none;background:var(--primary);color:#fff;font-size:24px;cursor:pointer;
  box-shadow:0 4px 14px rgba(0,0,0,.22);display:flex;align-items:center;justify-content:center;transition:transform .15s;}
#uh-fab:hover{transform:translateY(-2px);}
.uh-fab-badge{position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;
  background:#e74c3c;color:#fff;font-size:11px;font-weight:600;display:flex;align-items:center;justify-content:center;}
.uh-overlay{position:fixed;inset:0;z-index:1100;background:rgba(0,0,0,.45);display:none;align-items:center;justify-content:center;padding:16px;}
.uh-overlay.show{display:flex;}
.uh-modal{background:var(--white);border-radius:12px;width:100%;max-width:680px;max-height:84vh;display:flex;flex-direction:column;
  box-shadow:0 12px 40px rgba(0,0,0,.3);}
.uh-modal-head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid var(--border);}
.uh-modal-head h3{margin:0;font-size:16px;color:var(--primary);}
.uh-close{background:none;border:none;font-size:20px;color:var(--text-light);cursor:pointer;line-height:1;padding:4px;}
.uh-close:hover{color:var(--text);}
.uh-body{display:flex;gap:16px;padding:16px;overflow:auto;}
.uh-col{flex:1;min-width:0;}
.uh-col-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;font-size:13px;color:var(--text-light);font-weight:600;}
.uh-clear{background:none;border:none;color:var(--text-light);font-size:12px;cursor:pointer;text-decoration:underline;}
.uh-clear:hover{color:var(--primary);}
.uh-list{display:flex;flex-direction:column;gap:4px;}
.uh-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px;border-radius:6px;cursor:pointer;}
.uh-item:hover{background:var(--bg-secondary);}
.uh-item-main{display:flex;align-items:center;gap:6px;min-width:0;flex:1;}
.uh-title{font-size:13px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.uh-badge{font-size:11px;background:#eaf2f8;color:var(--primary);padding:1px 6px;border-radius:4px;flex-shrink:0;}
.uh-icon{flex-shrink:0;}
.uh-sub{font-size:11px;color:var(--text-light);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.uh-time{font-size:11px;color:var(--text-light);flex-shrink:0;}
.uh-empty{padding:24px 8px;text-align:center;color:var(--text-light);font-size:13px;}
.uh-foot{padding:10px 18px;border-top:1px solid var(--border);font-size:11px;color:var(--text-light);text-align:center;}
@media (max-width:560px){.uh-body{flex-direction:column;}}

/* ===== C1 数据来源标签 ===== */
.cq-src-tag{display:inline-block;padding:2px 8px;border-radius:10px;font-size:11px;line-height:1.5;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-light);}
.cq-src-digikey{color:#1a5276;border-color:#2980b9;background:#eaf2f8;}
.cq-src-crawl{color:#7d6608;border-color:#f1c40f;background:#fef9e7;}
.cq-src-import{color:#6c3483;border-color:#8e44ad;background:#f5eef8;}
.cq-src-none{color:var(--text-light);}

/* ===== B5 收藏夹页 ===== */
.fav-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid var(--border);border-radius:8px;margin-bottom:8px;background:var(--white);}
.fav-item:hover{border-color:var(--primary);box-shadow:0 1px 4px rgba(0,0,0,.04);}
.fav-main{flex:1;min-width:0;cursor:pointer;}
.fav-pn{font-size:15px;font-weight:600;color:var(--text);word-break:break-all;}
.fav-sub{font-size:12px;color:var(--text-light);margin-top:2px;}
.fav-del{flex-shrink:0;border:1px solid var(--border);background:var(--white);color:var(--text-light);padding:5px 12px;border-radius:6px;font-size:12px;cursor:pointer;}
.fav-del:hover{border-color:#e74c3c;color:#e74c3c;}
.fav-empty{padding:48px 16px;text-align:center;color:var(--text-light);font-size:14px;border:1px dashed var(--border);border-radius:8px;}

/* ===== P2 详情页扩展动作：收藏/分享/纠错 + 悬浮按钮 ===== */
.ca-action-btn{border:1px solid var(--border);background:var(--white);color:var(--text);cursor:pointer;font-size:13px;}
.ca-action-btn:hover{border-color:var(--primary);color:var(--primary);}
.ca-action-btn.active{border-color:var(--primary);color:var(--primary);background:#eaf4fb;}
#ca-fab{position:fixed;right:24px;bottom:96px;width:48px;height:48px;border-radius:50%;border:none;
  background:var(--primary);color:#fff;font-size:20px;cursor:pointer;box-shadow:0 4px 14px rgba(0,0,0,.18);
  z-index:1000;display:flex;align-items:center;justify-content:center;}
#ca-fab:hover{background:var(--primary-dark,#1a5276);}
.uh-item-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;}
@media (max-width:560px){#ca-fab{right:14px;bottom:84px;}}

/* ===== P2 首页运营内容：平台优势 ===== */
.vp-section{margin-top:8px;}
.vp-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-top:12px;}
.vp-card{background:var(--bg-card,#fff);border:1px solid var(--border,#eee);border-radius:10px;padding:18px 16px;transition:box-shadow .15s,transform .15s;}
.vp-card:hover{box-shadow:0 4px 14px rgba(0,0,0,.08);transform:translateY(-2px);}
.vp-icon{font-size:26px;line-height:1;margin-bottom:8px;}
.vp-name{font-size:15px;font-weight:600;color:var(--text);margin-bottom:6px;}
.vp-desc{font-size:13px;line-height:1.55;color:var(--text-light,#666);}
@media (max-width:768px){.vp-grid{grid-template-columns:repeat(2,1fr);}}
@media (max-width:560px){.vp-grid{grid-template-columns:1fr;}}

/* ===== 数据治理（admin） ===== */
.dg-card{background:var(--bg-card,#fff);border:1px solid var(--border,#eee);border-radius:10px;padding:16px;margin-bottom:16px;}
.dg-card-title{display:flex;justify-content:space-between;align-items:center;font-size:15px;font-weight:600;color:var(--text);margin-bottom:4px;}
.dg-sub{font-size:12.5px;color:var(--text-light,#666);margin-bottom:12px;line-height:1.5;}
.dg-health-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.dg-section-h{font-size:13px;font-weight:600;margin-bottom:8px;color:var(--text);}
.dg-badge{display:inline-block;background:var(--bg-alt,#f0f3f6);color:var(--text);font-size:12px;padding:1px 8px;border-radius:10px;margin-left:6px;font-weight:600;}
.dg-list{max-height:320px;overflow:auto;border:1px solid var(--border,#eee);border-radius:6px;padding:6px;font-size:12.5px;}
.dg-row{display:flex;gap:8px;align-items:center;padding:4px 2px;border-bottom:1px solid #f2f2f2;}
.dg-row:last-child{border-bottom:none;}
.dg-pn{font-weight:600;color:var(--primary,#1a5276);min-width:120px;}
.dg-tag,.dg-types,.dg-mfrs{color:var(--text-light,#666);word-break:break-all;}
.dg-types{color:var(--danger,#c0392b);}
.dg-loading,.dg-empty{color:var(--text-light,#999);padding:8px;font-size:12.5px;}
.dg-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px;margin-bottom:12px;}
.dg-form label{display:flex;flex-direction:column;font-size:12px;color:var(--text-light,#666);gap:4px;}
.dg-form select,.dg-form input{padding:6px 8px;border:1px solid var(--border,#ccc);border-radius:6px;font-size:13px;color:var(--text);}
.dg-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.dg-result{font-size:13px;font-weight:600;}
.dg-sample{margin-top:10px;font-size:12.5px;}
.dg-sample-h{color:var(--text-light,#666);margin-bottom:4px;}
.dg-sample-row{display:flex;gap:8px;padding:3px 2px;border-bottom:1px solid #f3f3f3;}
@media (max-width:768px){.dg-health-grid{grid-template-columns:1fr;}}

/* ===== 搜索框输入联想下拉（A3） ===== */
.ss-dropdown{position:absolute;top:calc(100% + 2px);left:0;right:0;z-index:3000;background:#fff;border:1px solid var(--border,#e2e8f0);border-radius:8px;box-shadow:0 8px 24px rgba(15,23,42,.14);max-height:340px;overflow-y:auto;display:none;}
.ss-item{display:flex;align-items:center;gap:8px;padding:9px 12px;cursor:pointer;font-size:14px;color:var(--text,#1e293b);border-bottom:1px solid #f3f4f6;}
.ss-item:last-child{border-bottom:none;}
.ss-item.ss-active,.ss-item:hover{background:var(--bg,#f1f5f9);}
.ss-icon{font-size:14px;flex-shrink:0;}
.ss-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.ss-tag{font-size:11px;color:#64748b;background:#eef2ff;border-radius:4px;padding:1px 6px;flex-shrink:0;}
.ss-tag-cnt{font-size:11px;color:#0f766e;background:#ccfbf1;border-radius:4px;padding:1px 6px;flex-shrink:0;}
.ss-tag-mfr{font-size:11px;color:#9a3412;background:#ffedd5;border-radius:4px;padding:1px 6px;flex-shrink:0;}
@media (max-width:768px){.ss-dropdown{position:fixed;left:8px;right:8px;}}

/* ===== P0-B/P1-D 精准型号搜索：家族归并徽章 + 变体清单 ===== */
.badge-exact{display:inline-block;padding:1px 8px;border-radius:10px;font-size:10px;font-weight:600;color:#fff;background:#16a34a;margin-left:4px;vertical-align:middle;}
.badge-family{display:inline-block;padding:1px 8px;border-radius:10px;font-size:10px;font-weight:600;color:#fff;background:#2563eb;margin-left:4px;vertical-align:middle;}
.variant-list{margin-top:10px;border:1px dashed var(--border,#e2e8f0);border-radius:8px;padding:6px 10px;font-size:12px;background:var(--bg,#f8fafc);}
.variant-list summary{cursor:pointer;color:var(--primary,#1d4ed8);font-weight:600;user-select:none;list-style:none;}
.variant-list summary::-webkit-details-marker{display:none;}
.variant-list summary::before{content:'▸ ';font-size:10px;}
.variant-list[open] summary::before{content:'▾ ';}
.variant-list ul{margin:8px 0 2px;padding:0;list-style:none;display:flex;flex-direction:column;gap:4px;}
.variant-list li{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.vl-pn{font-weight:600;color:var(--text,#1e293b);}
.vl-mfr{color:#64748b;}
.vl-pkg{font-size:11px;color:#475569;background:#e2e8f0;border-radius:4px;padding:0 6px;}
.vl-more{color:var(--text-light,#94a3b8);}

/* ===== 型号交叉检索 (#xref) ===== */
.xref-hero{background:var(--white);border:1px solid var(--border);border-radius:var(--radius-lg);padding:22px 24px;margin-bottom:18px;}
.xref-hero h2{margin:0 0 6px;color:var(--primary);font-size:20px;}
.xref-hero-sub{margin:0 0 16px;color:var(--text-light);font-size:13px;}
.xref-search-bar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;}
/* 嵌入式交叉检索区工具行（搜索页 #xrefSection 内） */
.xref-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px;padding:10px 14px;background:var(--white);border:1px solid var(--border);border-radius:var(--radius);}
.xref-toolbar select{padding:8px 10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--white);font-size:13px;}
.xref-toolbar .btn{padding:8px 14px;font-size:13px;}
.xref-toolbar .btn:disabled{opacity:.5;cursor:not-allowed;}
.xref-search-bar input[type=text]{flex:1;min-width:220px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius);font-size:14px;}
.xref-search-bar select{padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--white);font-size:14px;}
.xref-toggle{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--text-light);cursor:pointer;}
.xref-empty{text-align:center;padding:50px 20px;color:var(--text-light);background:var(--white);border:1px solid var(--border);border-radius:var(--radius);}
.xref-source{background:var(--white);border:1px solid var(--border);border-left:4px solid var(--primary);border-radius:var(--radius);padding:14px 18px;margin-bottom:16px;}
.xref-source-pn{font-size:20px;font-weight:700;color:var(--primary);}
.xref-source-meta{margin-top:4px;font-size:13px;color:var(--text-light);}
.xref-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px;margin-bottom:22px;}
.xref-card{background:var(--white);border:1px solid var(--border);border-radius:var(--radius);padding:14px 16px;display:flex;flex-direction:column;gap:8px;transition:box-shadow .15s,border-color .15s;}
.xref-card:hover{border-color:var(--primary-light);box-shadow:0 2px 10px rgba(26,82,118,.10);}
.xref-card-top{display:flex;justify-content:space-between;align-items:center;gap:10px;}
.xref-pn{font-weight:700;color:var(--primary);cursor:pointer;font-size:15px;}
.xref-pn:hover{text-decoration:underline;}
.xref-compat{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;flex-shrink:0;}
.xref-compat-bar{width:60px;height:7px;background:var(--border);border-radius:4px;overflow:hidden;}
.xref-compat-bar i{display:block;height:100%;}
.xref-compat.good{color:var(--success);}
.xref-compat.good .xref-compat-bar i{background:var(--success);}
.xref-compat.mid{color:#d68910;}
.xref-compat.mid .xref-compat-bar i{background:#d68910;}
.xref-compat.low{color:var(--danger);}
.xref-compat.low .xref-compat-bar i{background:var(--danger);}
.xref-card-meta{display:flex;align-items:center;flex-wrap:wrap;gap:6px;font-size:12px;}
.xref-mfr{color:#34495e;}
.xref-tag{font-size:11px;padding:1px 7px;border-radius:4px;}
.xref-tag.xref-dom{background:#e6f7ed;color:var(--success);}
.xref-tag.xref-imp{background:#eef2ff;color:#4a6fa5;}
.xref-tag.xref-more-vendor{background:#fff7e6;color:#b07900;}
.xref-country{color:var(--text-light);}
.xref-pin-badge{font-size:11px;background:var(--success);color:#fff;padding:1px 7px;border-radius:4px;font-weight:600;}
.xref-level{font-size:12px;color:var(--primary-light);}
.xref-reasons{font-size:12px;color:var(--text-light);line-height:1.5;}
.xref-foc{font-size:12px;color:var(--text-light);line-height:1.5;word-break:break-all;}
.xref-foc-label{display:inline-block;font-size:11px;color:var(--primary);background:var(--bg-soft,#f4f6fa);padding:1px 6px;border-radius:4px;margin-right:4px;font-weight:600;}
.xref-source .xref-foc{margin-top:6px;}
.xref-specs{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;}
.xref-spec-chip{display:inline-flex;align-items:baseline;gap:5px;font-size:12px;background:var(--bg-soft,#f4f6fa);border:1px solid var(--border);border-radius:4px;padding:2px 8px;color:#34495e;max-width:100%;}
.xref-spec-k{font-size:11px;color:var(--text-light);white-space:nowrap;}
.xref-spec-chip .xref-spec-ai{font-size:10px;font-weight:700;background:linear-gradient(135deg,#7c3aed,#db2777);color:#fff;border-radius:3px;padding:0 4px;cursor:help;}
.xref-card-actions{margin-top:auto;}
.xref-detail{font-size:12px;color:var(--primary-light);cursor:pointer;}
.xref-detail:hover{text-decoration:underline;}
.xref-table-title{font-size:14px;font-weight:600;color:var(--primary);margin:4px 0 10px;}
.xref-table-wrap{overflow-x:auto;background:var(--white);border:1px solid var(--border);border-radius:var(--radius);}
.xref-param-table{width:100%;border-collapse:collapse;font-size:13px;min-width:520px;}
.xref-param-table th,.xref-param-table td{padding:9px 12px;border-bottom:1px solid var(--border);text-align:left;vertical-align:top;white-space:nowrap;}
.xref-param-table thead th{background:var(--bg);font-size:12px;color:var(--primary);position:sticky;top:0;}
.xref-th-sub{font-weight:400;color:var(--text-light);font-size:11px;}
.xref-param-table tbody tr:hover{background:#fafbfd;}
.xref-field{color:#34495e;font-weight:500;background:#fafbfc;}
.xref-src-col,.xref-src-cell{background:#f0f6fa;font-weight:500;}
.xref-cell.ok{color:var(--success);}
.xref-cell.no{color:var(--danger);}
.xref-mark{font-weight:700;}
.xref-na{color:var(--text-light);}
@media (max-width:768px){.xref-search-bar input[type=text]{min-width:160px;}.xref-cards{grid-template-columns:1fr;}}

/* ===== 交叉检索 LLM 替代逻辑分析（.xref-llm-*）===== */
.xref-llm-panel{background:linear-gradient(135deg,#f8fbff, #f4f8fc);border:1px solid #cfe0ef;border-radius:var(--radius);padding:14px 16px;margin:0 0 22px;display:flex;flex-direction:column;gap:10px;}
.xref-llm-loading{color:var(--text-light);font-size:13px;padding:6px 0;}
.xref-llm-error{color:var(--text-light);font-size:13px;padding:6px 0;}
.xref-llm-logic{font-size:13px;line-height:1.7;color:#34495e;}
.xref-llm-tag{display:inline-block;background:var(--primary);color:#fff;font-size:11px;padding:2px 8px;border-radius:10px;margin-right:8px;vertical-align:1px;}
.xref-llm-tag-warn{background:#b8860b;}
.xref-llm-table{width:100%;border-collapse:collapse;font-size:12.5px;}
.xref-llm-table th{background:#eaf2f9;color:var(--primary);padding:7px 10px;text-align:left;font-weight:600;}
.xref-llm-table td{padding:7px 10px;border-bottom:1px solid #e4ecf3;vertical-align:top;}
.xref-llm-table tr:last-child td{border-bottom:none;}
.xref-llm-pn{font-weight:600;font-family:var(--font-mono,monospace);white-space:nowrap;}
.xref-llm-pct{font-weight:700;font-size:13px;}
.xref-llm-pct.good{color:var(--success);}
.xref-llm-pct.mid{color:#e67e22;}
.xref-llm-pct.low{color:#95a5a6;}
.xref-llm-reason{color:#4a5a6a;line-height:1.5;}
.xref-llm-caveats{font-size:12.5px;color:#7d6608;line-height:1.6;background:#fdf9e7;border:1px solid #f0e2a8;border-radius:6px;padding:8px 10px;}
.xref-llm-mark{font-size:10px;font-weight:700;color:#fff;background:var(--primary);border-radius:3px;padding:1px 4px;margin-right:2px;}
@media (max-width:768px){.xref-llm-table{font-size:11.5px;}.xref-llm-reason{max-width:200px;}}

/* ===== 数据资产目录（.dac-*）===== */
.dac-stats{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin-bottom:16px;}
.dac-stat-card{background:var(--bg-card,#fff);border:1px solid var(--border,#eee);border-radius:10px;padding:14px 12px;text-align:center;}
.dac-stat-val{font-size:24px;font-weight:700;color:var(--primary,#1a5276);line-height:1.2;}
.dac-stat-label{font-size:13px;color:var(--text);margin-top:4px;}
.dac-stat-unit{font-size:11px;color:var(--text-light,#999);}
.dac-loading,.dac-empty{color:var(--text-light,#999);padding:12px;font-size:13px;}

.dac-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px;}
.dac-search{flex:1;min-width:240px;padding:7px 10px;border:1px solid var(--border,#ccc);border-radius:6px;font-size:13px;color:var(--text);}
.dac-chk{display:inline-flex;align-items:center;gap:4px;font-size:13px;color:var(--text-light,#666);cursor:pointer;}

.dac-type-list{display:flex;flex-direction:column;gap:8px;}
.dac-type-item{background:var(--bg-card,#fff);border:1px solid var(--border,#eee);border-radius:8px;overflow:hidden;}
.dac-type-head{display:flex;align-items:center;gap:10px;padding:10px 12px;cursor:pointer;user-select:none;flex-wrap:wrap;}
.dac-type-head:hover{background:var(--bg-alt,#f7f9fb);}
.dac-caret{color:var(--text-light,#999);width:14px;flex-shrink:0;}
.dac-type-name{font-weight:600;color:var(--text);font-size:14px;}
.dac-table-name{font-size:12px;color:var(--primary,#1a5276);background:var(--bg-alt,#eef3f8);padding:2px 6px;border-radius:4px;}
.dac-type-stats{display:inline-flex;gap:4px;flex-wrap:wrap;flex:1;}
.dac-type-time{font-size:12px;color:var(--text-light,#999);margin-left:auto;white-space:nowrap;}

/* Mongo→PG 全量补空同步：进度面板 */
.dac-sync-panel{background:var(--bg-card,#fff);border:1px solid var(--border,#eee);border-radius:8px;padding:12px 14px;margin-bottom:14px;}
.dac-sync-head{font-size:13px;color:var(--text);display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.dac-sync-bar{height:8px;background:var(--bg-alt,#eef3f8);border-radius:4px;overflow:hidden;margin:8px 0;}
.dac-sync-bar-fill{height:100%;background:var(--primary,#1a5276);transition:width .3s;}
.dac-sync-cur{font-size:13px;color:var(--primary,#1a5276);margin:2px 0;}
.dac-sync-err{font-size:12px;color:#c0392b;margin:6px 0;}
.dac-sync-per{margin-top:8px;overflow:auto;}
.dac-sync-note{font-size:11px;color:var(--text-light,#999);margin-top:8px;}

.dac-badge{display:inline-block;font-size:11.5px;padding:2px 8px;border-radius:10px;font-weight:600;white-space:nowrap;}
.dac-b-row{background:rgba(26,82,118,.12);color:var(--primary,#1a5276);}
.dac-b-field{background:var(--bg-alt,#f0f3f6);color:var(--text);}
.dac-b-num{background:rgba(39,174,96,.15);color:#1e8449;}
.dac-b-val{background:rgba(91,44,184,.13);color:#5b2cb8;}
.dac-b-orphan{background:rgba(233,120,52,.18);color:#b35410;}
.dac-b-meta{background:#eee;color:var(--text-light,#888);}

.dac-type-body{padding:0 12px 12px;border-top:1px solid var(--border,#eee);}
.dac-field-wrap{overflow-x:auto;margin-top:10px;}
.dac-field-table{width:100%;border-collapse:collapse;font-size:12.5px;min-width:760px;}
.dac-field-table th{background:var(--primary,#1a5276);color:#fff;font-weight:600;padding:7px 8px;text-align:left;position:sticky;top:0;white-space:nowrap;}
.dac-field-table td{padding:6px 8px;border-bottom:1px solid #f0f0f0;color:var(--text);vertical-align:top;}
.dac-field-row:hover{background:var(--bg-alt,#fafbfc);}
.dac-field-meta{color:var(--text-light,#888);}
.dac-field-orphan{background:rgba(233,120,52,.06);}
.dac-idx{color:var(--text-light,#999);text-align:right;white-space:nowrap;}
.dac-col code{font-size:12px;color:var(--primary,#1a5276);}
.dac-orphan-key{color:#b35410;font-weight:600;font-size:12px;}
.dac-muted{color:var(--text-light,#bbb);}
.dac-dtype{white-space:nowrap;color:var(--text-light,#666);}
.dac-flags{white-space:nowrap;}
.dac-flags .dac-badge{margin-right:3px;}
.dac-desc{color:var(--text-light,#666);max-width:280px;}

@media (max-width:900px){
  .dac-stats{grid-template-columns:repeat(2,1fr);}
  .dac-type-time{display:none;}
}
