:root {
  /* 主色调和强调色 - 用于按钮、链接、高亮等 */
  --primary-blue: #00a8ff;        /* 主要蓝色 - 用于主要按钮和重要元素 */
  --secondary-blue: #0097e6;      /* 次要蓝色 - 用于悬停状态和次要元素 */
  --accent-blue: #4cd137;         /* 蓝色强调色 - 用于成功状态和特殊标记 */
  --primary-orange: #ff9500;      /* 主要橙色 - 用于警告和提示 */
  --accent-orange: #ff7a00;       /* 橙色强调色 - 用于高亮和重点标记 */

  /* 深色主题变量 */
  --dark-bg: #0a0e17;             /* 深色主题背景色 */
  --dark-card-bg: #101623;        /* 深色主题卡片背景色 */
  --dark-text-light: #ffffff;     /* 深色主题主要文本颜色 */
  --dark-text-muted: #b0b3b8;     /* 深色主题次要文本颜色 */
  --dark-border-dark: rgba(255, 255, 255, 0.15); /* 深色主题边框颜色 */
  --dark-bg-light: #151c2e;       /* 深色主题浅色背景(用于表头、分隔等) */
  --dark-bg-hover: #1a233a;       /* 深色主题悬停背景色 */
  --dark-toolbar-bg: rgba(10, 14, 23, 0.95); /* 深色主题工具栏背景色 */
  --dark-toolbar-border: rgba(255, 255, 255, 0.1); /* 深色主题工具栏边框色 */

  /* 浅色主题变量 */
  --light-bg: #f5f7fa;            /* 浅色主题背景色 */
  --light-card-bg: #ffffff;       /* 浅色主题卡片背景色 */
  --light-text-light: #333333;    /* 浅色主题主要文本颜色 */
  --light-text-muted: #666666;    /* 浅色主题次要文本颜色 */
  --light-border-dark: #e0e0e0;   /* 浅色主题边框颜色 */
  --light-bg-light: #f0f2f7;      /* 浅色主题浅色背景(用于表头、分隔等) */
  --light-bg-hover: #e3e8f0;      /* 浅色主题悬停背景色 */
  --light-toolbar-bg: rgba(252, 248, 240, 0.98); /* 浅色主题工具栏背景色 */
  --light-toolbar-border: rgba(210, 180, 140, 0.3); /* 浅色主题工具栏边框色 */

  /* 当前使用的主题变量 - 默认使用深色主题 */
  --bg: var(--dark-bg);           /* 当前背景色 */
  --card-bg: var(--dark-card-bg); /* 当前卡片背景色 */
  --text-light: var(--dark-text-light); /* 当前主要文本颜色 */
  --text-muted: var(--dark-text-muted); /* 当前次要文本颜色 */
  --border-dark: var(--dark-border-dark); /* 当前边框颜色 */
  --bg-light: var(--dark-bg-light); /* 当前浅色背景 */
  --bg-hover: var(--dark-bg-hover); /* 当前悬停背景色 */
  --toolbar-bg: var(--dark-toolbar-bg); /* 当前工具栏背景色 */
  --toolbar-border: var(--dark-toolbar-border); /* 当前工具栏边框色 */
  --text-color: var(--dark-text-light); /* 当前文本颜色 */
  --border-color: rgba(255, 255, 255, 0.2); /* 当前输入框边框色 */
  --input-bg: rgba(255, 255, 255, 0.05); /* 当前输入框背景色 */
}
/* 主题切换过渡动画 - 使主题切换时平滑过渡 */
html {
  transition: background-color 0.3s ease, color 0.3s ease;
}
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}
/* 按钮组件样式 */
/* 通用操作按钮样式 */
.action-btn {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all .3s ease;
  white-space: nowrap;
  text-align: center;
}
/* 轴承类型切换按钮 */
.bearing-type-toggle-btn {
  background: var(--primary-blue);
  color: white;
  box-shadow: 0 1px 3px rgba(0, 168, 255, 0.2);
  width: auto;
}
.bearing-type-toggle-btn:hover {
  background: var(--secondary-blue);
  box-shadow: 0 2px 6px rgba(0, 168, 255, 0.3);
}
.bearing-type-toggle-btn.closed-type {
  background:#02c502;
  box-shadow: 0 1px 3px rgba(0, 168, 255, 0.2);
}
.bearing-type-toggle-btn.closed-type:hover {
  background:#02c502;
  box-shadow: 0 2px 6px rgba(0, 168, 255, 0.3);
}

/* 更多参数按钮激活状态样式 */
.more-params-toggle-btn.active {
  background: #00a8ff; /* 青色 */
  color: white;
  box-shadow: 0 1px 3px rgba(0, 168, 255, 0.2);
}

.more-params-toggle-btn.active:hover {
  background: #0095e6; /* 稍深的青色 */
  box-shadow: 0 2px 6px rgba(0, 168, 255, 0.3);
}
/* 浅色主题样式规则 - 当应用.light-theme类时激活 */
.light-theme {
  /* 覆盖默认的深色主题变量 */
  --bg: var(--light-bg);
  --card-bg: var(--light-card-bg);
  --text-light: var(--light-text-light);
  --text-muted: var(--light-text-muted);
  --border-dark: var(--light-border-dark);
  --border-color: #999999;
  --bg-light: var(--light-bg-light);
  --bg-hover: var(--light-bg-hover);
  --toolbar-bg: var(--light-toolbar-bg);
  --toolbar-border: var(--light-toolbar-border);
  --text-color: var(--light-text-light);
  --input-bg: white;
}
/* 浅色主题 - 容器和表单样式 */
.light-theme #processResultsContainer {
  border: 1px solid var(--light-bg);
}

/* 历史销售价与采购价功能样式 */
.price-ref-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 10000; align-items: center; justify-content: center; padding: 6px; }
.price-ref-content { background: var(--card-bg); border-radius: 8px; width: 99%; max-width: 1400px; max-height: 100vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.price-ref-header { display: flex; justify-content: center; align-items: center; padding: 10px 20px; background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue)); color: var(--text-light); position: relative; }
.price-ref-header h3 { margin: 0; font-size: 18px; }
.price-ref-close { position: absolute; right: 10px; top: 20px; background: none; border: none; color: var(--text-light); font-size: 26px; cursor: pointer; padding: 8px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.price-ref-close:hover { background: rgba(255,255,255,0.1); border-radius: 4px; }
.price-ref-tabs { display: flex; border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
.price-ref-tab { padding: 10px 20px; font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.8); cursor: pointer; border: none; background: rgba(255, 255, 255, 0.1); margin: 5px; border-radius: 6px 6px 0 0; transition: all .3s ease; font-family: inherit; white-space: nowrap; }
.price-ref-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.2); }
.price-ref-tab.active { color: #fff; background: rgba(255, 255, 255, 0.25); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
.price-ref-panel { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.price-ref-panel.active { display: flex; }
.price-ref-search { display: flex; flex-wrap: wrap; gap: 10px; padding: 15px 10px; background: var(--bg-light); border-bottom: 1px solid var(--border-dark); align-items: flex-end; }
.price-ref-filter { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 150px; }
.price-ref-filter label { font-size: 12px; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.price-ref-filter select, .price-ref-filter input { height: 34px; padding: 0 8px; border: 1px solid var(--border-dark); border-radius: 4px; font-size: 13px; color: var(--text-light); outline: none; background: var(--input-bg); transition: border-color .2s; width: 100%; font-family: inherit; }
.price-ref-filter select:focus, .price-ref-filter input:focus { border-color: var(--primary-blue); background: var(--input-bg); }
.price-ref-btn-group { display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.price-ref-btn-group .btn-secondary { height: 34px; font-size: 13px; padding: 0 16px; border: 1px solid var(--border-dark); border-radius: 4px; background: var(--input-bg); color: var(--text-light); cursor: pointer; font-family: inherit; transition: all .3s ease; }
.price-ref-stats { padding: 10px 20px; font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 10px; background: var(--bg-light); border-bottom: 1px solid var(--border-dark); }
.price-ref-stats strong { color: var(--primary-blue); font-size: 15px; font-weight: 600; }
.price-ref-red strong { color: var(--error-red); }
.price-ref-page-size { height: 26px; padding: 0 6px; border: 1px solid var(--border-dark); border-radius: 4px; font-size: 13px; color: var(--text-light); outline: none; cursor: pointer; vertical-align: middle; background: var(--input-bg); }
.price-ref-table-wrap { flex: 1; overflow: auto; display: flex; flex-direction: column; }
.price-ref-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.price-ref-table-wrap thead { background: var(--bg-light); color: var(--text-light); position: sticky; top: 0; }
.price-ref-table-wrap th { padding: 10px 12px; text-align: center; font-weight: 600; cursor: pointer; white-space: nowrap; border-bottom: 1px solid var(--border-dark); }
.price-ref-table-wrap th:hover { background: var(--bg-hover); }
.price-ref-si { margin-left: 4px; opacity: 0.5; font-size: 11px; }
.price-ref-table-wrap th.asc .price-ref-si::after { content: ' ▲'; opacity: 1; }
.price-ref-table-wrap th.desc .price-ref-si::after { content: ' ▼'; opacity: 1; }
.price-ref-table-wrap th:not(.asc):not(.desc) .price-ref-si::after { content: ' ⇅'; }
.price-ref-table-wrap td { padding: 8px 12px; vertical-align: middle; text-align: center; border-bottom: 1px solid var(--border-dark); color: var(--text-light); }
.price-ref-table-wrap tbody tr:nth-child(even) { background: var(--bg-light); }
.price-ref-table-wrap tbody tr:hover { background: var(--bg-hover); }
.price-ref-cust, .price-ref-supplier { font-weight: 500; color: var(--primary-blue); text-align: center; }
.price-ref-prod, .price-ref-goods, .price-ref-spec { font-family: Consolas, monospace; font-size: 12.5px; text-align: center; }
.price-ref-price { text-align: center; font-weight: 700; color: var(--error-red); white-space: nowrap; }
.price-ref-sp { text-align: center; }
.price-ref-sp-badge { display: inline-block; background: rgba(76, 209, 55, 0.2); color: var(--accent-blue); padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.price-ref-remark { color: var(--text-muted); font-size: 12px; max-width: 200px; text-align: center; }
.price-ref-no-data { text-align: center; padding: 60px; color: var(--text-muted); font-size: 15px; }
.price-ref-pagination { padding: 12px 20px; border-top: 1px solid var(--border-dark); }
.price-ref-pagination .pagination { display: flex; justify-content: center; gap: 4px; flex-wrap: nowrap; }
.price-ref-pagination .pagination button { min-width: 32px; height: 32px; border: 1px solid var(--border-dark); border-radius: 4px; background: var(--input-bg); color: var(--text-light); cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; transition: all .3s ease; }
.price-ref-pagination .pagination button:hover:not(:disabled) { border-color: var(--primary-blue); color: var(--primary-blue); }
.price-ref-pagination .pagination button.active { background: var(--primary-blue); border-color: var(--primary-blue); color: var(--text-light); font-weight: 600; }
.price-ref-pagination .pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* 响应式布局 */
@media (max-width: 768px) {
  .price-ref-search { padding: 12px; gap: 6px; flex-wrap: wrap; }
  .price-ref-filter { min-width: calc(50% - 3px); }
  .price-ref-filter label { font-size: 11px; }
  .price-ref-filter input, .price-ref-filter select { font-size: 11px; height: 30px; }
  .price-ref-btn-group .btn-secondary { height: 30px; font-size: 11px; padding: 0 12px; }
  .price-ref-btn-group { min-width: calc(50% - 3px); margin-top: 0; align-self: flex-end; }
}

/* 浅色主题适配 */
.light-theme .price-ref-content { background: var(--light-card-bg); }
.light-theme .price-ref-tabs { background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue)); border-bottom-color: rgba(255, 255, 255, 0.2); }
.light-theme .price-ref-tab { color: rgba(255, 255, 255, 0.8); }
.light-theme .price-ref-tab:hover { color: #fff; }
.light-theme .price-ref-tab.active { color: #fff; border-bottom-color: #fff; }
.light-theme .price-ref-search { background: var(--light-bg-light); border-bottom-color: var(--light-border-dark); }
.light-theme .price-ref-filter label { color: var(--light-text-muted); }
.light-theme .price-ref-filter select, .light-theme .price-ref-filter input { border-color: var(--light-border-dark); background: #fff; color: var(--light-text-light); }
.light-theme .price-ref-filter select:focus, .light-theme .price-ref-filter input:focus { border-color: var(--primary-blue); background: #fff; }
.light-theme .price-ref-stats { background: var(--light-bg-light); border-bottom-color: var(--light-border-dark); color: var(--light-text-muted); }
.light-theme .price-ref-page-size { border-color: var(--light-border-dark); background: #fff; color: var(--light-text-light); }
.light-theme .price-ref-table-wrap thead { background: var(--light-bg-light); color: var(--light-text-light); }
.light-theme .price-ref-table-wrap th { border-bottom-color: var(--light-border-dark); }
.light-theme .price-ref-table-wrap th:hover { background: var(--light-bg-hover); }
.light-theme .price-ref-table-wrap td { border-bottom-color: var(--light-border-dark); color: var(--light-text-light); }
.light-theme .price-ref-table-wrap tbody tr:nth-child(even) { background: var(--light-bg-light); }
.light-theme .price-ref-table-wrap tbody tr:hover { background: var(--light-bg-hover); }
.light-theme .price-ref-cust, .light-theme .price-ref-supplier { color: var(--primary-blue); }
.light-theme .price-ref-sp-badge { background: rgba(76, 209, 55, 0.2); color: #2e7d32; }
.light-theme .price-ref-remark { color: var(--light-text-muted); }
.light-theme .price-ref-no-data { color: var(--light-text-muted); }
.light-theme .result-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.light-theme #moreParamsSection {
  border-color: var(--light-border-dark);
}
.light-theme .form-container {
  border: 1px solid var(--light-border-dark);
}
/* 浅色主题 - 输入框和交互元素样式 */
.light-theme input[type="text"]:focus,
.light-theme input[type="number"]:focus,
.light-theme .more-params-input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(0, 168, 255, 0.2);
  background: var(--input-bg);
}

/* 浅色主题 - select元素样式 */
.light-theme select.more-params-input {
  background: var(--input-bg);
  color: var(--light-text-light);
}

/* 浅色主题 - select下拉菜单样式 */
.light-theme select.more-params-input option {
  background: white;
  color: #333;
}

.light-theme .radio-item label:hover {
  background-color: var(--light-bg-hover);
  border-color: var(--primary-blue);
}
/* 浅色主题 - 表格样式 */
.light-theme .process-table {
  border-color: var(--light-border-dark);
}
.light-theme .process-table th {
  background-color: var(--light-bg-light);
  color: var(--light-text-light);
  border-color: var(--light-border-dark);
}
.light-theme .process-table td {
  color: var(--light-text-light);
  border-color: var(--light-border-dark);
}
.light-theme .process-table tbody tr:hover td {
  background-color: var(--light-bg-hover);
}
.process-detail-table.wide-layout td:first-child {
  color: var(--text-light, var(--light-text-light));
}
.process-detail-table.wide-layout td:last-child {
  color: var(--text-light, var(--light-text-light));
}
.light-theme #clearanceStatsTable,
.light-theme #vibrationStatsTable,
.light-theme #priceStatsTable {
  border-color: var(--light-border-dark);
}
.light-theme #clearanceStatsTable thead,
.light-theme #vibrationStatsTable thead,
.light-theme #priceStatsTable thead {
  background-color: #f0f2f7;
}
.light-theme #clearanceStatsTable th,
.light-theme #vibrationStatsTable th {
  background-color: rgba(255, 149, 0, 0.15);
  color: #333;
  border-bottom: 2px solid var(--primary-orange);
  border-right: 1px solid #e0e0e0;
}
.light-theme #clearanceStatsTable td,
.light-theme #vibrationStatsTable td {
  color: var(--light-text-light);
  border-color: var(--light-border-dark);
}
.light-theme #clearanceStatsTable tbody tr:nth-child(even) td,
.light-theme #vibrationStatsTable tbody tr:nth-child(even) td {
  background-color: var(--light-bg-light);
}
.light-theme .process-detail-table {
  border: 1px solid var(--light-border-dark);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
.light-theme .process-detail-key::before {
  background-color: var(--light-primary-blue);
}
.light-theme .process-detail-value {
  color: var(--light-text-light);
}
.light-theme .process-detail-table tr:hover {
  background-color: rgba(52, 152, 219, 0.1);
}
.light-theme .process-detail-table td[data-type="value"] {
  color: var(--light-text-light);
}
.light-theme .process-detail-table td[data-type="value"]::before {
  background-color: var(--light-primary-blue);
}
.light-theme .process-detail-title {
  color: var(--light-primary-blue);
  font-weight: 600;
}
.light-theme .process-detail-close {
  color: var(--light-text-muted);
  background-color: rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}
.light-theme .process-detail-close:hover {
  background-color: var(--light-bg-hover);
  color: var(--light-text-light);
}
.light-theme #processDetailModal::-webkit-scrollbar-track {
  background-color: var(--light-bg-light);
}
.light-theme #processDetailModal::-webkit-scrollbar-thumb {
  background-color: var(--light-border-dark);
}
.light-theme #processDetailModal::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary-blue);
}
.light-theme .critical-info {
  color: var(--light-text-light);
  border-color: rgba(255, 149, 0, 0.3);
}
.light-theme .data-highlight {
  color: var(--primary-orange);
}
.light-theme .customers-popup,
.light-theme .vibration-popup {
  background-color: var(--light-card-bg);
  border-color: var(--light-border-dark);
}
.light-theme .popup-title,
.light-theme .vibration-title,
.light-theme .price-params-title {
  color: var(--light-text-light);
}
.light-theme .popup-close {
  color: var(--light-text-muted);
}
.light-theme .popup-overlay {
  background-color: rgba(0, 0, 0, 0.5);
}
.light-theme .bottom-toolbar {
  background-color: var(--light-toolbar-bg);
  border-top-color: var(--light-toolbar-border);
}
.light-theme .toolbar-button:hover {
  background: rgba(241, 166, 5, 0.945);
}
/* 浅色主题 - 模态框样式 */
.light-theme .modal-content {
  background-color: var(--light-card-bg);
  border-color: var(--light-border-dark);
}
.light-theme .about-info p,
.light-theme .about-section li {
  color: var(--light-text-light);
}
.about-section li {
  margin-bottom: 10px;
}
.light-theme .product-card {
  background-color: var(--light-card-bg);
  border-color: var(--light-border-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.light-theme .card-model {
  color: var(--light-text-light);
}
.light-theme .card-part-number {
  color: var(--light-text-muted);
}
.light-theme .card-clearance,
.light-theme .card-vibration {
  color: #006400;
}
.light-theme .card-info {
  color: var(--light-text-muted);
}
/* 深色主题 - 结果容器样式（默认主题） */
#processResultsContainer {
  border-radius: 12px;
  border: 1px solid var(--bg);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  margin: 15px 0;
}
/* 表格组件样式 */
/* 工艺详情表格样式 */
.process-detail-table {
  border: 1px solid rgba(210, 210, 214, 0.1);
}
.process-detail-key,
.process-detail-value {
  padding: 12px 10px;
  text-align: center;
  line-height: 1.4;
  border: 1px solid rgba(170, 170, 243, 0.1);
}
.process-detail-key {
  letter-spacing: 0.2px;
  color: #00a8ff;
  font-weight: 600;
}
.process-detail-value {
  color: #e4e6eb;
}
.process-detail-title {
  color: var(--primary-blue);
}
.critical-info {
  border-left: 4px solid var(--primary-blue);
  padding: 15px;
  margin: 15px 0;
  border-radius: 0 6px 6px 0;
}
.data-highlight {
  border-left: 3px solid var(--accent-orange);
  padding: 12px;
  margin: 10px 0;
  border-radius: 0 6px 6px 0;
  font-weight: 600;
}
.process-detail-params-title {
  color: var(--primary-blue);
  position: relative;
  padding-left: 12px;
}
.process-detail-params-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  background-color: var(--accent-orange);
  border-radius: 50%;
  transform: translateY(-50%);
}
/* 弹窗组件样式 */
/* 顾客弹窗和振动弹窗基础样式 */
.customers-popup {
  display: none; /* 默认隐藏 */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* 居中定位 */
  color: #ecf0f1;
  padding: 20px;
  border-radius: 8px;
  z-index: 1000; /* 确保在最上层 */
  width: 75%;
  max-width: 75%;
  max-height: 70vh;
  overflow-y: auto; /* 内容过多时可滚动 */
  border: 1px solid rgba(0, 168, 255, 0.3);
  font-size: 15px;
}
/* 弹窗头部和标题样式 */
.popup-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
  position: relative;
}
.popup-title {
  margin: 0;
  color: var(--primary-blue);
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-blue);
  margin-bottom: 20px;
  width: 100%;
}
.vibration-title {
  color: var(--accent-orange);
  border-bottom: 2px solid var(--accent-orange);
}
.popup-close {
  position: absolute;
  right: 0;
  top: -15px;
  font-size: 1.8rem;
  cursor: pointer;
  color: #e4e6eb;
  transition: all 0.3s ease;
  padding: 5px;
  border-radius: 50%;
}
.popup-content {
  line-height: 1.6;
  font-size: 15px;
}
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}
.customer-list {
  margin: 0;
  padding-left: 20px;
  font-size: 16px;
}
.customer-item {
  margin-bottom: 5px;
  font-size: 16px;
  color: var(--accent-blue);
}
.process-table.wide-layout {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(255, 149, 0, 0.1);
  width: 100%;
}
/* 工具栏组件样式 */
/* 底部工具栏样式 */
.bottom-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background-color: var(--toolbar-bg);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0;
  z-index: 1000; /* 确保在最上层 */
  transition: background-color 0.2s ease;
}
/* 工具栏按钮样式 */
.toolbar-button {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex: 1; /* 平均分配空间 */
  height: 100%;
  background: transparent;
  border: 0.5px solid var(--toolbar-border);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
  position: relative;
  font-size: 16px;
  font-weight: 800;
  gap: 6px; /* 图标和文字间距 */
}
.toolbar-icon {
  font-size: 20px;
  line-height: 1;
  transition: transform 0.2s ease;
}
.toolbar-button:hover {
  background: rgba(241, 166, 5, 0.945);
}
.toolbar-button.active {
  background: rgba(241, 166, 5, 0.945);
  transform: scale(0.98);
}
.toolbar-button.active .toolbar-text {
  color: var(--primary-blue);
}
/* 基础布局样式 */
body {
  font-family: "Roboto", "Microsoft YaHei", sans-serif;
  padding: 50px 20px 20px; /* 上、左右、下内边距 */
  margin: 0;
  background: var(--bg);
  color: var(--text-color);
  min-height: 100vh; /* 确保内容不足时也占满屏幕高度 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* 关于页面列表样式 */
.about-list {
  list-style-type: none; /* 删除列表项前面的小黑点 */
  padding: 0; /* 重置默认内边距 */
  margin: 0; /* 重置默认外边距 */
}

.about-list li {
  padding-left: 6px; /* 增加左边距6px */
}

/* 容器布局 */
.container {
  max-width: 1200px; /* 最大宽度限制 */
  margin: auto; /* 水平居中 */
  background: var(--card-bg);
  border-radius: 12px;
  position: relative;
}
/* 响应式内容布局 */
.content-wrapper {
  display: flex; /* 弹性布局 */
  flex-wrap: wrap; /* 响应式换行 */
  align-items: stretch; /* 子元素高度相等 */
  height: 100%;
}
.form-section,
.result-section {
  flex: 1; /* 平均分配空间 */
  min-width: 300px; /* 最小宽度，确保响应式效果 */
}
/* 表单区域布局 */
.form-section {
  display: flex;
  flex-direction: column; /* 垂直方向排列 */
  height: 100%;
}
.form-container {
  padding: 16px;
  border-radius: 12px;
  flex: 1; /* 占用剩余空间 */
  display: flex;
  flex-direction: column; /* 垂直方向排列 */
  box-sizing: border-box; /* 包含内边距和边框 */
  min-height: 0; /* 允许内容收缩 */
  border: none;
}
.form-container form {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.label {
  display: block;
  color: var(--text-color);
  font-weight: 500;
  margin: 16px 0 8px;
  font-size: 14px;
}
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--input-bg);
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}
input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
}
.radio-group {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  gap: 15px 8px;
}
.radio-item {
  flex: 1;
  min-width: 100px;
}
.radio-item input[type="radio"],
.radio-item input[type="checkbox"] {
  display: none
}
.radio-item label {
  display: block;
  padding: 10px 0;
  font-size: 14px;
  text-align: center;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.radio-item input[type="radio"]:checked+label,
.radio-item input[type="checkbox"]:checked+label {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}
.radio-item label:hover {
  background: rgba(0, 168, 255, 0.2);
  border-color: #00a8ff;
}
button {
  margin: 0;
  padding: 8px;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: normal;
  transition: all .3s ease;
  width: 100%;
}
.form-input-base {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(0, 168, 255, 0.3);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  font-size: 16px;
  font-weight: 500;
  box-sizing: border-box;
  transition: all .3s ease;
}
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 18px var(--btn-hover-shadow);
}
button {
  background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
  --btn-hover-shadow: rgba(0, 168, 255, 0.6);
}
button:hover {
  background: linear-gradient(135deg, var(--secondary-blue), var(--primary-blue));
}
.more-params-input {
  padding: 6px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(0, 168, 255, 0.5);
  border-radius: 4px;
  background: rgba(26, 31, 46, 0.7);
  color: var(--text-light);
  font-size: 14px;
  transition: all .3s ease;
  height: 30px
}
/* 深色主题 - select元素样式 */
select.more-params-input {
  background: var(--input-bg);
  color: var(--text-light);
}

/* 深色主题 - select下拉菜单样式 */
select.more-params-input option {
  background: #1a1f2e;
  color: #e6e6e6;
}

/* 响应式参数行布局 */
.params-row-container {
  display: flex; /* 弹性布局 */
  flex-direction: row; /* 水平方向排列 */
  flex-wrap: nowrap; /* 不换行 */
  gap: 10px; /* 元素间距 */
}
.params-row-container>div {
  flex: 1; /* 每个子元素平均分配空间 */
}
.more-params-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 8px rgba(0, 168, 255, 0.5);
  background: rgba(26, 31, 46, 0.9);
}
/* 结果区域布局 */
#result {
  margin: 0 0 50px; /* 底部边距为50px，避免被底部工具栏遮挡 */
  padding: 25px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  flex: 1; /* 占用剩余空间 */
  display: flex;
  flex-direction: column; /* 垂直方向排列 */
  min-height: 0; /* 允许内容收缩 */
  box-sizing: border-box; /* 包含内边距和边框 */
}
#result p {
  margin-left: 10px;
}
.result-table,
.process-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border-radius: 6px;
  overflow: hidden;
}
.process-table th {
  background-color: var(--dark-bg-light);
  color: var(--dark-text-light);
  border: 1px solid var(--dark-border-dark);
  padding: 12px;
  text-align: center;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}
.result-table thead {
  background-color: #151c2e;
}
.light-theme .result-table thead {
  background-color: #f0f2f7;
}
#clearanceStatsTable thead,
#vibrationStatsTable thead,
#priceStatsTable thead {
  background-color: #151c2e;
}
.process-table td {
  color: var(--dark-text-light);
  border: 1px solid var(--dark-border-dark);
  padding: 12px 8px;
  text-align: center;
  transition: all 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.process-table tbody tr:hover td {
  background-color: var(--dark-bg-hover);
}
.process-table.recommendation-table {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-dark);
}
.light-theme .process-table.recommendation-table {
  border-color: var(--light-border-dark);
  background-color: var(--light-bg-dark);
}
.result-table td {
  padding: 10px;
  line-height: 1.5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 15px;
}

.param-label {
  font-weight: bold;
  width: 55%;
  color: var(--primary-blue);
}
.param-value {
  width: 45%;
  text-align: right;
  color: var(--accent-blue);
}
.icon {
  display: inline-block;
  margin-right: 8px;
  width: 16px;
  text-align: center;
  font-size: 16px
}
.label-with-icon {
  display: flex;
  align-items: baseline;
  margin-bottom: 0;
  font-size: 16px
}
.copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}
.copy-btn:active,
.copy-success {
  transform: translateY(0)
}
.copy-success {
  background: linear-gradient(135deg, #00a8ff, #0097e6)
}
.result-content {
  border-radius: 8px;
  padding: 5px;
  font-size: 14px
}
.result-row {
  cursor: pointer;
  transition: all .2s ease
}
.result-row:hover {
  background: rgba(0, 168, 255, 0.1);
  border-radius: 4px
}
.row-copied {
  background: rgba(76, 209, 55, 0.2);
  border-radius: 4px;
  animation: rowCopied 1s ease
}
@keyframes rowCopied {
  0%,
  100% {
    background: rgba(76, 209, 55, 0.2);
    transform: scale(1);
    opacity: 1;
  }
  50% {
    background: rgba(76, 209, 55, 0.4);
    transform: scale(1.01);
    opacity: 0.95;
  }
}
.model-input-group {
  display: flex;
  flex-direction: column;
}
.model-input-row {
  display: flex;
  align-items: center;
  width: 100%;
}
/* 响应式输入行布局 */
.input-row {
  display: flex; /* 弹性布局 */
  flex-wrap: nowrap; /* 不换行 */
  gap: 10px; /* 元素间距 */
  width: 100%;
  margin-bottom: 15px;
}
.input-row>* {
  flex: 1; /* 每个子元素平均分配空间 */
  display: flex;
  align-items: center;
  justify-content: center;
}
.model-input-label {
  flex: 0 0 auto;
}
.dimension-input-group.compact {
  display: contents;
}
.dimension-inputs-compact {
  flex: 1;
  min-width: 0;
  border-radius: 4px;
  color: var(--text-light);
  transition: all .3s ease;
}

.compact-dimension-btn:hover {
  background: var(--secondary-blue);
  transform: translateY(-1px);
}
.dimension-results-container {
  max-height: 570px;
  overflow-y: auto;
  margin-top: 15px
}
.dimension-result-item {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 6px;
  transition: all .2s ease;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  background: transparent;
}
.dimension-result-item:hover {
  background: rgba(0, 168, 255, 0.1)
}
.dimension-result-item.selected {
  background: rgba(76, 209, 55, 0.2);
  border-left: 3px solid var(--accent-blue)
}
.dimension-match-level {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 13px;
  margin-left: 8px;
  font-weight: bold
}
.match-perfect {
  background: rgba(76, 209, 55, 0.3);
  color: var(--accent-blue)
}
.match-good {
  background: rgba(0, 168, 255, 0.3);
  color: var(--primary-blue)
}
.match-fair {
  background: rgba(255, 193, 7, 0.3);
  color: #ffc107
}
.recommendation-item {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  transition: all .2s ease;
  font-size: 14px
}
.recommendation-item:hover {
  background: rgba(0, 168, 255, 0.1)
}
.param-row .param-label {
  min-width: 120px;
}
#moreParamsSection {
  display: block;
}
.dimension-input-group.compact {
  flex: 1;
  min-width: 0;
}
.model-input-group {
  margin-bottom: 20px;
}
.label-with-icon .label {
  visibility: visible;
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
  color: var(--text-light);
  opacity: 1;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  overflow: visible;
}
.label-with-icon .label .short-text {
  display: none;
}
.label-with-icon .label .full-text {
  display: inline;
}
.process-detail-table th {
  color: var(--primary-blue);
  font-weight: bold;
  background: rgba(255, 255, 255, 0.05);
}
.hidden-row {
  display: none;
}
#processQuerySection {
  margin: 15px;
  padding: 15px 10px;
}
#processQuerySection>div:first-child {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 5px;
  margin: 0 auto 15px;
  box-sizing: border-box;
}
@media (max-width: 768px) {
  body {
    padding: 0;
  }
  .content-wrapper {
    flex-direction: column;
  }
  .param-label,
  .param-value {
    font-size: 16px;
  }
  #result {
    padding: 5px 0;
  }
  #processQuerySection {
    margin: 0 0 30px;
  }
  .process-table th,
  .process-table td {
    padding: 5px 6px;
    font-size: 0.9rem;
  }
  #processResultsContainer {
    margin: 0;
    padding: 0;
    border-radius: 8px;
  }
  #processResultsContainer::-webkit-scrollbar {
    width: 6px;
  }
  #processResultsContainer::-webkit-scrollbar-track {
    background: transparent;
  }
  #processResultsContainer::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    border: none;
  }
  #processResultsContainer::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
  }
  .radio-item label .short-text,
  .label-with-icon .label .short-text {
    display: inline;
  }
  .radio-item label .full-text,
  .label-with-icon .label .full-text {
    display: none;
  }
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 15px 20px;
  }
  .form-container {
    padding: 15px;
  }
  .title-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left
  }
  .title-container>div {
    flex: 1;
    min-width: auto
  }
  .model-input-group {
    width: 100%;
  }
  .bearing-type-toggle-btn {
    width: auto;
    margin: 0;
  }
  .dimension-inputs-compact {
    width: 100%
  }
  .process-pagination {
    margin-top: 10px;
    text-align: center;
  }
  .process-pagination button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
  }
  .process-pagination button:disabled {
    cursor: not-allowed;
  }
  .process-pagination .page-info {
    color: var(--text-light);
  }
  .label-with-icon .icon {
    display: none;
  }
  .radio-item {
    display: inline-block;
    margin: 5px 0;
    padding: 0;
    min-width: 100px;
    flex: 1;
  }
  .radio-item label {
    display: block;
    width: 100%;
    padding: 8px 6px;
    font-size: 13px;
    text-align: center;
    box-sizing: border-box;
    word-break: keep-all;
    white-space: nowrap;
    background: transparent;
    border: 1px solid rgba(0, 168, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all .3s ease;
    color: #e4e6eb;
    height: auto;
    line-height: normal;
  }
  #queryForm>div:not(.model-input-group):not(.dimension-inputs-row):not(.input-row) {
    margin-bottom: 10px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .label-with-icon {
    display: inline-block;
    margin-bottom: 0;
    margin-right: 8px;
  }
  #queryForm>div>.radio-group,
  #materialParamsSection>div>.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
    flex: 1;
  }
  #materialParamsSection>div {
    margin-bottom: 0;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .label-with-icon .label {
    display: inline;
    font-size: 14px;
    white-space: nowrap;
    vertical-align: middle;
    margin-left: 0;
  }
  input[type="radio"]:checked+label {
    color: #fff;
  }
  input[type="radio"]:checked+label span {
    color: #fff;
  }
  .radio-item input[type="radio"] {
    position: relative;
    z-index: 3;
  }
}
.about-title {
  text-align: center;
}
.about-version,
.about-date {
  text-align: center;
}
.about-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}
.about-section {
  flex: 1;
  margin: 0;
  padding: 12px;
  background-color: var(--card-bg);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.about-section-title {
  font-size: 16px;
  text-align: center;
}
.update-container {
  text-align: center;
}
.update-status {
  margin-bottom: 10px;
  font-weight: bold;
}
.update-progress {
  display: none;
  margin-top: 10px;
}
.download-status {
  font-size: 13px;
  margin-bottom: 4px;
}
.progress-bar-container {
  width: 100%;
  height: 6px;
  background-color: var(--bg-light);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--accent-blue);
  transition: width 0.3s ease;
}
.progress-percentage {
  font-size: 12px;
  margin-top: 3px;
}
.update-actions {
  display: none;
  margin-top: 12px;
}
.update-install-btn {
  padding: 7px 14px;
  font-size: 13px;
  background-color: var(--accent-blue);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 8px;
}
.update-cancel-btn {
  padding: 7px 14px;
  font-size: 13px;
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  cursor: pointer;
}