  #version-badge {
    position: fixed; top: 0; left: 0; right: 0;
    background: #00ff88; color: #000;
    text-align: center; padding: 4px;
    font-size: 14px; font-weight: bold; z-index: 99999;
  }
  
/* 帮助按钮样式 */
.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff9800;
  color: white;
  border: none;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s;
}
.help-btn:hover {
  background: #f57c00;
  transform: scale(1.1);
}

/* 帮助弹窗样式 */
.help-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-content {
  background: #ffffff;
  color: #1a1a1a;
  border-radius: 12px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #ddd;
  background: #f8f8f8;
  border-radius: 12px 12px 0 0;
}
.help-header h3 {
  margin: 0;
  color: #222;
  font-size: 18px;
}
.help-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #666;
  cursor: pointer;
  line-height: 1;
}
.help-close:hover {
  color: #222;
}
.help-body {
  padding: 20px;
  color: #1a1a1a;
}
.help-section {
  margin-bottom: 20px;
}
.help-section h4 {
  color: #e65100;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #ffe0b2;
  font-size: 16px;
}
.formula-box {
  background: #fff8e1;
  color: #1a1a1a;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
  border: 1px solid #ffcc80;
}
.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.help-table td, .help-table th {
  padding: 10px 12px;
  border: 1px solid #ddd;
  color: #1a1a1a;
}
.help-table th {
  background: #f0f0f0;
  font-weight: 600;
  color: #222;
}
.help-table td:first-child {
  font-weight: 600;
  color: #e65100;
}
.example-box {
  background: #e8f5e9;
  color: #1a1a1a;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.8;
  border: 1px solid #a5d6a7;
}
.help-note {
  font-size: 13px;
  color: #666;
  margin: 8px 0 0 0;
}
.help-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
  color: #1a1a1a;
}
.help-list li {
  margin-bottom: 6px;
}


* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
  background: #0f1923;
  color: #e8e8e8;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ====== 顶部 ====== */
.topbar {
  background: linear-gradient(135deg, #1a2a3a 0%, #0d1f2d 100%);
  border-bottom: 3px solid #00bfff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.topbar h1 { font-size: 24px; color: #fff; }
.topbar h1 span { color: #00bfff; }
.topbar .subtitle { color: #5a7a8a; font-size: 13px; }
.topbar .badge {
  background: #00bfff;
  color: #000;
  font-size: 12px;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 12px;
}

/* ====== 导航 ====== */
.nav {
  display: flex;
  gap: 4px;
  padding: 10px 24px;
  background: #162231;
  flex-wrap: wrap;
}
.nav button {
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  background: #1a2a3a;
  color: #5a7a8a;
  transition: all 0.2s;
}
.nav button:hover { background: #00bfff; color: #000; }
.nav button.active { background: #00bfff; color: #000; }

/* ====== 主容器 ====== */
.main { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* ====== 面板 ====== */
.panel { display: none; }
.panel.active { display: block; }

/* ====== 搜索面板 ====== */
.search-wrap { margin-bottom: 16px; }
.search-wrap input {
  flex: 1; padding: 14px 18px; border: 2px solid #1a3a4a; border-radius: 10px;
  background: #162231; color: #fff; font-size: 16px;
}
.search-wrap input:focus { outline: none; border-color: #00bfff; }
.search-wrap select {
  padding: 12px 14px; border: 2px solid #1a3a4a; border-radius: 10px;
  background: #162231; color: #fff; font-size: 14px;
}
.search-wrap button {
  padding: 12px 28px; background: #00bfff; color: #000;
  border: none; border-radius: 10px; cursor: pointer; font-size: 16px; font-weight: bold;
}
.search-wrap button:hover { background: #00d4ff; }
.cat-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.cat-tag {
  padding: 5px 14px; border-radius: 20px; cursor: pointer; font-size: 13px;
  background: #1a2a3a; color: #5a7a8a; border: 1px solid #2a3a4a;
}
.cat-tag:hover { border-color: #00bfff; color: #fff; }
.cat-tag.active { background: #00bfff; color: #000; border-color: #00bfff; }



/* ====== 计算器通用卡片 ====== */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.calc-card {
  background: #162231; border-radius: 14px; padding: 20px;
  border: 1px solid #1a3a4a;
  transition: border-color 0.2s;
}
.calc-card:hover { border-color: #00bfff; }
.calc-card h3 { color: #00bfff; font-size: 16px; margin-bottom: 6px; }
.calc-card .subtitle { color: #5a7a8a; font-size: 12px; margin-bottom: 14px; }

/* ====== 输入框 ====== */
.field { margin-bottom: 10px; }
.field label { display: block; color: #7a9aaa; font-size: 13px; margin-bottom: 4px; }
.field label .hint { color: #445566; font-size: 11px; margin-left: 6px; }
.field input, .field select {
  width: 100%; padding: 10px 14px; border: 1px solid #2a3a4a; border-radius: 8px;
  background: #0d1f2d; color: #fff; font-size: 15px;
}
.field input:focus, .field select:focus { outline: none; border-color: #00bfff; }
.field input[type=number] { font-size: 18px; font-weight: bold; color: #00bfff; }
.row { display: flex; gap: 10px; }
.row .field { flex: 1; }

/* ====== 按钮 ====== */
.btn {
  width: 100%; padding: 12px; background: #00bfff; color: #000;
  border: none; border-radius: 10px; cursor: pointer; font-size: 16px; font-weight: bold;
  margin-top: 6px;
}
.btn:hover { background: #00d4ff; }
.btn-orange {
  background: #ff6b35; color: #fff;
}
.btn-orange:hover { background: #ff8555; }

/* ====== 结果框 ====== */
.result-box {
  margin-top: 14px; padding: 14px 18px; border-radius: 10px;
  font-size: 14px; line-height: 1.7;
}
.result-ok { background: #0a2a1a; border: 1px solid #00cc66; color: #00cc66; }
.result-warn { background: #2a1a0a; border: 1px solid #ffaa00; color: #ffaa00; }
.result-bad { background: #2a0a0a; border: 1px solid #ff4444; color: #ff4444; }
.result-info { background: #0a1a2a; border: 1px solid #00bfff; color: #00bfff; }
.big { font-size: 26px; font-weight: bold; }
.formula { color: #556677; font-family: 'Consolas', monospace; font-size: 12px; margin-top: 6px; background: #0d1f2d; padding: 6px 10px; border-radius: 6px; }
.tag-row { margin-top: 8px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; margin-right: 6px; }
.tag-green { background: #00cc66; color: #000; }
.tag-red { background: #ff4444; color: #fff; }
.tag-orange { background: #ffaa00; color: #000; }
.tag-blue { background: #00bfff; color: #000; }

/* ====== 速查表 ====== */
.ref-section { margin-bottom: 24px; }
.ref-section h3 { color: #00bfff; margin-bottom: 12px; font-size: 16px; border-left: 4px solid #00bfff; padding-left: 10px; }
.ref-table { width: 100%; border-collapse: collapse; background: #162231; border-radius: 10px; overflow: hidden; }
.ref-table th { background: #1a3a4a; color: #00bfff; padding: 10px 14px; text-align: left; font-size: 13px; }
.ref-table td { padding: 9px 14px; border-bottom: 1px solid #1a2a3a; font-size: 13px; color: #aabbaa; }
.ref-table tr:last-child td { border-bottom: none; }
.ref-table tr:hover td { background: #1a2a3a; }
.ref-table .val { color: #00bfff; font-weight: bold; font-size: 15px; }
.ref-table .dn { color: #ff6b35; font-weight: bold; }
.ref-table .note { color: #5a7a8a; font-size: 12px; }
.ref-table .mark { color: #00cc66; }

/* ====== 规范面板 ====== */
.std-item { background: #162231; border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; border-left: 4px solid #1a3a4a; }
.std-item:hover { border-left-color: #00bfff; }
.std-item h4 { color: #ff6b35; font-size: 14px; margin-bottom: 4px; }
.std-item p { color: #7a9aaa; font-size: 13px; }
.std-item .code { color: #00bfff; font-weight: bold; }

/* ====== 图示区 ====== */
.diagram {
  background: #0d1f2d; border-radius: 8px; padding: 12px; margin: 10px 0;
  font-family: 'Consolas', monospace; font-size: 13px; color: #00bfff;
  white-space: pre; overflow-x: auto; line-height: 1.4;
}

/* ====== 脚手架 ====== */
.scaffold { background: #0d1f2d; border-radius: 10px; padding: 16px; margin: 12px 0; }
.scaffold h4 { color: #ff6b35; font-size: 14px; margin-bottom: 10px; }
.scaffold-item { display: flex; gap: 12px; margin-bottom: 8px; align-items: flex-start; }
.scaffold-item .num { color: #00bfff; font-weight: bold; min-width: 24px; }
.scaffold-item .text { color: #aabbaa; font-size: 14px; }

/* ====== 底部 ====== */
.footer { text-align: center; padding: 24px; color: #334455; font-size: 12px; }
.tip-box { background: #162231; border: 1px solid #2a3a4a; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; color: #5a7a8a; }
.tip-box strong { color: #ff6b35; }

@media (max-width: 600px) {
  .calc-grid { grid-template-columns: 1fr; }
  .nav { padding: 8px; gap: 2px; }
  .nav button { padding: 8px 10px; font-size: 13px; }
  .topbar h1 { font-size: 18px; }
}

/* ====== AI 问答 ====== */
.quick-q {
  padding: 8px 16px; border-radius: 20px; cursor: pointer; font-size: 13px;
  background: #162231; color: #aabbaa; border: 1px solid #2a3a4a;
  transition: all 0.2s;
}
.quick-q:hover { border-color: #00bfff; color: #fff; background: #1a3040; }

.ai-msg {
  background: #162231; border-radius: 12px; padding: 16px 18px; margin-bottom: 12px;
  border-left: 4px solid #00bfff; line-height: 1.8; animation: fadeIn 0.3s;
}
.ai-msg.question { border-left-color: #ff6b35; }
.ai-msg.question .msg-label { color: #ff6b35; font-size: 12px; font-weight: bold; margin-bottom: 6px; }
.ai-msg .msg-label { color: #00bfff; font-size: 12px; font-weight: bold; margin-bottom: 6px; }
.ai-msg .msg-content { color: #e8e8e8; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.ai-msg .msg-sources { margin-top: 10px; padding-top: 10px; border-top: 1px solid #2a3a4a; }
.ai-msg .source-tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; margin: 2px 4px 2px 0; background: #1a3a4a; color: #00bfff; cursor: pointer; transition: all 0.2s; }
.ai-msg .source-tag:hover { background: #00bfff; color: #000; }
.source-detail { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; background: #0d1f2d; border-radius: 8px; padding: 0 12px; margin-top: 6px; border: 1px solid #1a3a4a; font-size: 13px; line-height: 1.7; color: #aabbaa; white-space: pre-wrap; word-break: break-word; }
.source-detail.open { max-height: 2000px; padding: 12px; }
.source-detail .src-title { font-size: 12px; color: #556677; margin-bottom: 4px; }
.ai-msg .msg-loading { color: #5a7a8a; font-style: italic; }
.ai-msg.error { border-left-color: #ff4444; }
.ai-msg.error .msg-label { color: #ff4444; }

/* ====== CUSTOM SCROLLBAR ====== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a1628; }
::-webkit-scrollbar-thumb { background: #1a3a4a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #00bfff; }

/* ====== GRADIENT TITLE ====== */
.topbar h1 span {
  background: linear-gradient(135deg, #00bfff, #00e5ff, #00ffa3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ====== CARD HOVER FLOAT ====== */
.calc-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.calc-card:hover {
  border-color: #00bfff;
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 191, 255, 0.15);
}

/* ====== INPUT FOCUS GLOW ====== */
.field input:focus, .field select:focus, .search-wrap input:focus {
  border-color: #00bfff;
  box-shadow: 0 0 12px rgba(0, 191, 255, 0.3);
}

/* ====== NUMBER HIGHLIGHT ====== */
.big, .val { color: #00e5ff !important; }


/* ====== TOOLBAR BUTTONS ====== */
.toolbar-btn {
  background: transparent; border: 1px solid #2a3a4a; color: #5a7a8a;
  padding: 4px 12px; border-radius: 6px; font-size: 12px; cursor: pointer;
  transition: all 0.2s;
}
.toolbar-btn:hover { border-color: #00bfff; color: #00bfff; }

/* ====== COPY TIP ====== */
.copy-tip {
  position: fixed; background: #00cc66; color: #000; padding: 6px 16px;
  border-radius: 8px; font-size: 13px; font-weight: bold; pointer-events: none;
  opacity: 0; transition: opacity 0.3s; z-index: 9999;
}
.copy-tip.show { opacity: 1; }

/* ====== FAVORITE TAGS ====== */
.fav-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 13px;
  background: #162231; color: #aabbaa; border: 1px solid #2a3a4a;
  transition: all 0.2s;
}
.fav-tag:hover { border-color: #ff6b35; color: #ff6b35; }
.fav-tag .remove-fav { font-size: 11px; opacity: 0.5; }
.fav-tag .remove-fav:hover { opacity: 1; }

/* ====== COPY RESULT BUTTON ====== */
.copy-result-btn {
  float: right; background: transparent; border: 1px solid #3a4a5a;
  color: #5a7a8a; padding: 2px 10px; border-radius: 4px; font-size: 11px;
  cursor: pointer; transition: all 0.2s;
}
.copy-result-btn:hover { border-color: #00bfff; color: #00bfff; }

/* ====== CALC HISTORY PANEL ====== */
.calc-history-panel {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  background: #162231; border: 1px solid #2a3a4a; border-right: none;
  border-radius: 10px 0 0 10px; padding: 12px; width: 200px;
  max-height: 300px; overflow-y: auto; z-index: 100;
  transition: transform 0.3s; box-shadow: -4px 0 15px rgba(0,0,0,0.3);
}
.calc-history-panel.hidden { transform: translateY(-50%) translateX(200px); }
.calc-history-panel h4 { color: #00bfff; font-size: 13px; margin-bottom: 8px; }
.calc-history-item {
  background: #0d1f2d; padding: 6px 8px; border-radius: 6px; margin-bottom: 4px;
  font-size: 12px; color: #aabbaa; cursor: pointer; transition: background 0.2s;
}
.calc-history-item:hover { background: #1a3a4a; }


/* ====== NEW PANEL FIELD textarea ====== */
.field textarea {
  width: 100%; padding: 10px 14px; border: 1px solid #2a3a4a; border-radius: 8px;
  background: #0d1f2d; color: #fff; font-size: 14px; min-height: 60px; resize: vertical;
}
.field textarea:focus { outline: none; border-color: #00bfff; }
/* ====== LOADING SPINNER ====== */
.loading-spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid #2a3a4a; border-top-color: #00bfff;
  border-radius: 50%; animation: spin 0.8s linear infinite;
  vertical-align: middle; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== SECTION DIVIDER ====== */
.section-divider {
  margin: 24px 0 16px; padding-bottom: 8px;
  border-bottom: 2px solid #1a3a4a;
}
.section-divider h3 {
  color: #ff6b35; font-size: 16px; border-left: 4px solid #ff6b35;
  padding-left: 10px;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
/* 管件查询表格 */.fit-table-wrap { overflow-x: auto; margin-top: 10px; }.fit-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }.fit-table thead { background: #e8f4f0; }.fit-table th { padding: 8px 10px; text-align: left; font-weight: 600; color: #2a4a5a; border-bottom: 2px solid #b0d0c0; }.fit-table td { padding: 7px 10px; border-bottom: 1px solid #e0e8e4; color: #333; }.fit-table tbody tr:hover { background: #f0f8f4; }.fit-table td:first-child { font-weight: 600; color: #2a6a5a; }

/* 帮助按钮样式 */
.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff9800;
  color: white;
  border: none;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s;
}
.help-btn:hover {
  background: #f57c00;
  transform: scale(1.1);
}

/* ====== Tab 导航分组 ====== */
.nav-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 24px;
  background: #0d1f2d;
  flex-wrap: wrap;
  border-bottom: 1px solid #1a3a4a;
}
.tab-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: bold;
  background: #1a2a3a;
  color: #5a7a8a;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-btn:hover { background: #00bfff; color: #000; }
.tab-btn.active { background: #00ff88; color: #000; }
.nav.hidden { display: none; }

@media (max-width: 600px) {
  .nav-tabs { padding: 8px; gap: 2px; }
  .tab-btn { padding: 8px 12px; font-size: 13px; }
}
