/* ========== 色彩系统（科技素雅） ========== */
:root {
  --primary:     #2563eb;   /* 主蓝：明快但不刺眼 */
  --primary-lt:  #eff6ff;   /* 浅蓝背景 */
  --primary-bd:  #bfdbfe;   /* 蓝色边框 */
  --icon-a:      #2563eb;   /* 图标色 A：主蓝 */
  --icon-b:      #0891b2;   /* 图标色 B：青蓝 */
  --icon-c:      #475569;   /* 图标色 C：深灰蓝（中性） */
  --bg:          #f1f5f9;   /* 页面背景：冷白灰 */
  --card-bg:     #ffffff;
  --border:      #e2e8f0;
  --text-1:      #1e293b;   /* 主文本 */
  --text-2:      #64748b;   /* 次文本 */
  --text-3:      #94a3b8;   /* 辅助文本 */
}

/* ========== 通用 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* 悬浮返回首页按钮 */
.back-home {
  position: fixed;
  left: 20px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
  transition: all 0.2s;
  z-index: 9999;
}
.back-home:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37,99,235,0.45);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: all 0.22s; }

/* ========== 顶部导航 ========== */
.site-nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.site-nav .layui-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-left .nav-brand {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin-right: 8px;
}

.nav-left a:not(.nav-brand) {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
}

.nav-left a:not(.nav-brand):hover { color: var(--primary); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-special {
  font-size: 13px;
  color: var(--text-2);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 16px;
  transition: all 0.22s;
}
.nav-special:hover { border-color: var(--primary); color: var(--primary); }

.nav-fav {
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.nav-fav:hover { color: var(--primary); }

/* 移动端显示的关于入口 */
.nav-about-mobile {
  font-size: 13px;
  color: var(--text-2);
  display: none;
}
.nav-about-mobile:hover { color: var(--primary); }

/* ========== 品牌区 ========== */
.hero-section {
  background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 55%, #1e4d8c 100%);
  color: #fff;
  padding: 16px 0 16px;
  text-align: center;
}

.hero-content { max-width: 600px; margin: 0 auto; }

.hero-logo {
  font-size: 46px;
  line-height: 1;
  margin-bottom: 10px;
  display: block;
  filter: grayscale(0.1);
}

.site-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 8px;
  color: #f0f6ff;
}

.site-title .domain {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.45;
  margin-left: 10px;
  letter-spacing: 0;
}

.site-slogan {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 2px;
  margin-bottom: 22px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 22px;
}

.hero-btn {
  padding: 8px 28px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  border: 1.5px solid #2563eb;
}
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

.btn-outline {
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: 1.5px solid rgba(255,255,255,0.3);
}
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.55); }

.site-warning {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.06);
  padding: 6px 18px;
  border-radius: 20px;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.1);
}

/* ========== 快捷分类 ========== */
.quick-tabs {
  background: #fff;
  padding: 0;
  border-bottom: 1px solid var(--border);
}

.quick-tabs .layui-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.qtab {
  display: inline-block;
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.qtab:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ========== Section 标题 ========== */
.section-hd {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  position: relative;
  padding-left: 12px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}

.recruit-warn {
  font-size: 11px;
  color: #dc2626;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
  vertical-align: middle;
}

.section-sub {
  font-size: 12px;
  color: var(--text-3);
}

/* ========== 最近使用 ========== */
.recent-section {
  background: #fff;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.recent-tools { display: flex; gap: 8px; flex-wrap: wrap; }

.recent-tool-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--primary-lt);
  border: 1px solid var(--primary-bd);
  border-radius: 14px;
  color: var(--primary);
  font-size: 12px;
}
.recent-tool-item:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ========== 在线工具 ========== */
.tools-section {
  padding: 32px 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

/* ========== 工具分类 ========== */
.tool-category { margin-bottom: 28px; }
.tool-category:last-child { margin-bottom: 0; }

.cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.cat-icon { font-size: 20px; line-height: 1; }

.cat-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: 0.3px;
}

.cat-count {
  font-size: 11px;
  background: var(--bg);
  color: var(--text-3);
  padding: 2px 10px;
  border-radius: 10px;
  margin-left: auto;
  font-weight: 600;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  background: var(--card-bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: all 0.22s;
  cursor: pointer;
  width: 100%;
  min-width: 0;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-bd);
  box-shadow: 0 6px 18px rgba(37,99,235,0.1);
}

.tc-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0;
}
.tc-icon.cyan  { background: #cffafe; color: #0e7490; }
.tc-icon.slate { background: #e2e8f0; color: #334155; }

.tc-info h5 {
  font-size: 14px;
  color: var(--text-1);
  font-weight: 600;
  margin-bottom: 3px;
}

.tc-info p {
  font-size: 12px;
  color: var(--text-3);
}

/* ========== 专业导航区 ========== */
.nav-section {
  background: var(--card-bg);
  padding: 32px 0;
  border-top: 6px solid var(--bg);
}

.nav-category {
  margin-bottom: 38px;
}
.nav-category:last-child { margin-bottom: 0; }

.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.nav-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.22s;
  overflow: hidden;
}

.nav-card:hover {
  border-color: var(--primary-bd);
  background: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,0.08);
  transform: translateY(-2px);
}

/* 图标：浅色背景 + 深色文字，轻盈现代 */
.nc-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.5px;
  /* 默认：浅蓝背景 + 主蓝文字 */
  background: #dbeafe;
  color: #1d4ed8;
}
/* 三种语义变体，用 class 控制 */
.nc-icon.cyan  { background: #cffafe; color: #0e7490; }
.nc-icon.slate { background: #e2e8f0; color: #334155; }
.nc-icon.green { background: #dcfce7; color: #166534; }

.nc-info {
  flex: 1;
  min-width: 0;
}

.nc-info h5 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nc-info p {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 地区标签 */
.nav-tag {
  position: absolute;
  top: 5px;
  right: 6px;
  padding: 1px 5px;
  font-size: 10px;
  border-radius: 3px;
  font-weight: 500;
  line-height: 1.5;
}

/* 标签也降饱和 */
.nav-tag.cn   { background: #fef2f2; color: #b91c1c; }
.nav-tag.intl { background: #eff6ff; color: #1d4ed8; }
.nav-tag.who  { background: #f0fdf4; color: #166534; }

/* ========== 悬浮返回顶部 ========== */
.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 72px;
  width: 42px;
  height: 42px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  box-shadow: 0 4px 14px rgba(37,99,235,0.3);
  transition: all 0.22s;
  z-index: 999;
}
.back-to-top:hover { background: #1d4ed8; transform: translateY(-2px); }

/* ========== 底部 ========== */
.site-footer {
  background: #1d2b3a;
  color: rgba(255,255,255,0.65);
  padding: 24px 0;
  text-align: center;
}

.site-footer p { font-size: 13px; margin-bottom: 6px; }
.site-footer a { color: rgba(255,255,255,0.5); }
.site-footer a:hover { color: #fff; }
.site-footer .copyright { font-size: 12px; opacity: 0.5; margin-top: 6px; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .site-title { font-size: 26px; }
  .hero-logo { font-size: 40px; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-grid { grid-template-columns: repeat(2, 1fr); }
  .back-to-top { right: 16px; bottom: 56px; width: 40px; height: 40px; font-size: 17px; }
  .nav-left .nav-brand { font-size: 15px; }
  .nav-left a:not(.nav-brand) { display: none; }
  .nav-about-mobile { display: inline-block; }
}

/* ========== 子页面样式 ========== */
body.tool-page { background: #f4f6f9; }

/* 表单标签宽度：确保超过3个字不折行 */
.tool-form .layui-form-label {
  min-width: 120px;
  padding: 9px 10px;
  white-space: nowrap;
}

/* ========== About 页面样式 ========== */
body.about-page { background: var(--bg); }

.about-header {
  background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 55%, #1e4d8c 100%);
  color: #fff;
  padding: 40px 0 32px;
  text-align: center;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 0;
}

.about-section {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.about-section h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.about-section p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.8;
  margin-bottom: 10px;
}

.about-section ul {
  list-style: none;
  padding: 0;
}

.about-section ul li {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.8;
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
}

.about-section ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.tool-header {
  background: linear-gradient(120deg, #1890ff 0%, #36cfc9 100%);
  color: #fff;
  padding: 30px 0;
  text-align: center;
}
.tool-header h2 { font-size: 26px; margin-bottom: 10px; }
.tool-header .source { font-size: 13px; opacity: 0.9; margin-bottom: 6px; }
.tool-header .disclaimer {
  font-size: 12px;
  background: rgba(255,255,255,0.2);
  padding: 8px 16px;
  border-radius: 20px;
  display: inline-block;
}

.tool-container {
  background: #fff;
  border-radius: 10px;
  padding: 30px;
  margin: 24px auto;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  max-width: 700px;
}

.tool-form { margin-bottom: 20px; }

.tool-result {
  background: #f0f7ff;
  border: 1px solid #91d5ff;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  margin-top: 20px;
}

.result-label { font-size: 14px; color: #666; margin-bottom: 8px; }
.result-value { font-size: 48px; font-weight: bold; color: #1890ff; margin: 10px 0; }
.result-tip {
  margin-top: 16px;
  padding: 12px;
  background: #fff;
  border-radius: 6px;
  text-align: left;
  font-size: 14px;
  color: #555;
}

.tool-footer { text-align: center; padding: 20px 0; color: #999; font-size: 12px; }
.tool-footer a { color: #1890ff; }
.bmi-reference { background: #fafafa; padding: 20px; border-radius: 8px; }

/* Braden */
.score-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13px; }
.score-table th, .score-table td { border: 1px solid #e2e8f0; padding: 10px 8px; text-align: center; }
.score-table th { background: #f0f7ff; color: #333; font-weight: 600; }
.score-table td:first-child { background: #fafafa; font-weight: 500; text-align: left; }
.score-item { margin-bottom: 16px; }
.score-item label { font-weight: 600; color: #333; margin-bottom: 8px; display: block; }
.score-item .layui-input-block { margin-left: 0; }

/* 住院天数 */
.date-range { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.date-range .layui-input-inline { flex: 1; min-width: 180px; }
.days-result { text-align: center; padding: 20px; background: linear-gradient(135deg, #1890ff, #36cfc9); border-radius: 10px; color: #fff; }
.days-result .days-number { font-size: 56px; font-weight: bold; line-height: 1.2; }
.days-result .days-label { font-size: 14px; opacity: 0.9; }

/* 检验换算 */
.unit-tabs { margin-bottom: 20px; }
.unit-group { margin-bottom: 24px; }
.unit-group h4 { color: #1890ff; margin-bottom: 12px; padding-left: 10px; border-left: 3px solid #1890ff; }
.unit-item { display: flex; align-items: center; padding: 10px; background: #fafbfc; border-radius: 6px; margin-bottom: 8px; }
.unit-item .unit-name { width: 120px; font-weight: 500; color: #333; }
.unit-item .unit-value { flex: 1; color: #666; font-size: 13px; }

/* 儿童用药 */
.pediatric-method { display: flex; gap: 20px; margin-bottom: 20px; }
.pediatric-method .method-card { flex: 1; padding: 16px; border: 2px solid #e2e8f0; border-radius: 8px; cursor: pointer; transition: all 0.3s; text-align: center; }
.pediatric-method .method-card.active { border-color: #1890ff; background: #f0f7ff; }
.pediatric-method .method-card h5 { font-size: 15px; margin-bottom: 6px; }
.pediatric-method .method-card p { font-size: 12px; color: #999; }
.method-form { display: none; }
.method-form.active { display: block; }

/* ========== 工具页面移动端适配 ========== */
@media (max-width: 768px) {
  /* 容器边距调整 */
  .tool-container {
    padding: 20px 15px;
    margin: 15px auto;
    border-radius: 8px;
  }
  
  /* 表单标签：移动端改为块级显示 */
  .tool-form .layui-form-label {
    min-width: auto;
    width: 100%;
    text-align: left;
    padding: 8px 0;
    float: none;
    display: block;
  }
  
  /* 输入框撑满宽度 */
  .tool-form .layui-input-inline {
    width: 100%;
    float: none;
    display: block;
    margin-left: 0;
  }
  
  .tool-form .layui-input-block {
    margin-left: 0;
  }
  
  /* 辅助文字换行 */
  .tool-form .layui-form-mid {
    display: block;
    float: none;
    padding: 5px 0 0;
    margin-left: 0;
  }
  
  /* 按钮组移动端适配 */
  .tool-form .layui-input-block .layui-btn {
    display: block;
    width: 100%;
    margin: 8px 0;
  }
  
  /* 结果区域字体缩小 */
  .tool-result .result-value {
    font-size: 36px;
  }
  
  /* 表格横向滚动 */
  .tool-container .layui-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  /* 头部标题缩小 */
  .tool-header {
    padding: 20px 15px;
  }
  .tool-header h2 {
    font-size: 20px;
  }
  .tool-header .disclaimer {
    font-size: 11px;
    padding: 6px 12px;
  }
  
  /* 肌酐清除率页面特殊适配 */
  .crcl-form {
    padding: 0;
  }
  .crcl-card {
    padding: 15px;
  }
  .crcl-result .crcl-score {
    font-size: 32px;
  }
  .dose-table {
    font-size: 12px;
  }
  .dose-table th,
  .dose-table td {
    padding: 5px 6px;
  }
  
  /* 返回首页按钮位置调整 */
  .back-home {
    left: 12px;
    bottom: 16px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  /* 底部footer */
  .tool-footer {
    padding: 15px 10px;
    font-size: 11px;
  }
  
  /* ========== 评分类工具移动端适配 ========== */
  /* 评分选项卡片 */
  .score-option {
    padding: 12px 10px;
    font-size: 13px;
  }
  .score-option label {
    font-size: 14px;
  }
  .score-value {
    padding: 2px 6px;
    font-size: 11px;
  }
  
  /* 评分结果 */
  .result-score,
  .gcs-result .total-score {
    font-size: 36px;
  }
  .risk-level {
    font-size: 28px;
  }
  
  /* GCS详情横向排列改为纵向 */
  .gcs-detail {
    flex-direction: column;
    gap: 6px;
  }
  
  /* ========== 疼痛评分移动端适配 ========== */
  /* NRS数字按钮 */
  .nrs-scale {
    gap: 4px;
  }
  .nrs-num {
    width: 32px;
    height: 32px;
    line-height: 32px;
    font-size: 13px;
  }
  
  /* VAS滑动条 */
  .vas-container {
    gap: 8px;
  }
  .vas-value {
    font-size: 18px;
    min-width: 40px;
  }
  
  /* FLACC表格 */
  .flacc-table {
    font-size: 12px;
  }
  .flacc-table th,
  .flacc-table td {
    padding: 6px 4px;
  }
  .flacc-opt {
    padding: 3px 6px;
    font-size: 11px;
  }
  
  /* ========== 倒计时工具移动端适配 ========== */
  .countdown-card {
    padding: 20px 15px;
  }
  .countdown-display {
    font-size: 48px;
    letter-spacing: 2px;
  }
  .countdown-task {
    font-size: 16px;
  }
  .countdown-controls .layui-btn {
    padding: 0 15px;
    font-size: 13px;
  }
  
  /* ========== 儿童用药/单位换算等页面 ========== */
  /* 方法选择卡片 */
  .pediatric-method {
    flex-direction: column;
    gap: 10px;
  }
  .pediatric-method .method-card {
    padding: 12px;
  }
  
  /* 单位换算项目 */
  .unit-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .unit-item .unit-name {
    width: auto;
    font-size: 13px;
  }
  .unit-item .unit-value {
    font-size: 12px;
  }
  
  /* 日期范围 */
  .date-range {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .date-range .layui-input-inline {
    min-width: auto;
    width: 100%;
  }
  .days-result .days-number {
    font-size: 42px;
  }
}
