html { scroll-behavior: smooth; }

/* ===== 强制4列网格布局（解决小屏幕显示问题）===== */
.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

:root {
  --brand-50: #ecfdf5;
  --brand-100: #d1fae5;
  --brand-500: #10b981;
  --brand-600: #059669;
  --brand-700: #047857;
  --brand-900: #064e3b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  word-break: break-word;
  background: #f5f5f5;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-root {
  max-width: 480px;
  margin: 0 auto;
  background: #f5f5f5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 绿色头部渐变背景 */
.header-bg {
  background: linear-gradient(135deg, #059669 0%, #10b981 50%, #0d9488 100%);
  color: white;
}

/* 底部安全区 */
.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* 底部导航激活状态 */
.tab-active {
  font-weight: 600;
  position: relative;
}

.tab-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: #10b981;
  border-radius: 0 0 2px 2px;
}

/* 工具项点击反馈 */
.tool-item:active {
  background-color: #f8fafc;
  transform: scale(0.96);
  transition: transform 0.1s ease;
}

/* 卡片阴影 */
.shadow-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* 搜索栏 */
.search-bar {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* PDF预览 */
.pdf-preview {
  height: 80vh;
  min-height: 520px;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}
.tag-tool { background: #ecfdf5; color: #065f46; }
.tag-video { background: #fff7ed; color: #9a3412; }
.tag-manual { background: #eff6ff; color: #1e40af; }
.tag-regulation { background: #faf5ff; color: #6b21a8; }

/* 收藏按钮 */
.star-btn {
  transition: transform 0.15s ease;
  cursor: pointer;
  font-size: 18px;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.star-btn:hover {
  transform: scale(1.15);
  background: rgba(251, 191, 36, 0.08);
}

/* 计算表格 */
.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.calc-table th,
.calc-table td {
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  text-align: center;
}
.calc-table th {
  background: #f1f5f9;
  font-weight: 600;
}

/* 结果卡片 */
.result-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  padding: 20px;
  border-radius: 12px;
}

/* Toast提示 */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 24, 40, 0.9);
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 100;
  animation: toastIn 0.2s ease;
  pointer-events: none;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* 横向滚动 */
.hscroll {
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.hscroll::-webkit-scrollbar { height: 6px; }
.hscroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* 输入框 */
.inp { transition: all 0.15s ease; }
.inp:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* 工具页面适配 */
@media (min-width: 481px) {
  .app-root {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
  }
}

/* ===== 品牌色覆盖：蓝→绿（覆盖预编译 Tailwind 的 brand-* 类）===== */
.bg-brand-50 { background-color: #ecfdf5 !important; }
.bg-brand-100 { background-color: #d1fae5 !important; }
.bg-brand-200 { background-color: #a7f3d0 !important; }
.bg-brand-500 { background-color: #10b981 !important; }
.bg-brand-600 { background-color: #059669 !important; }
.bg-brand-700 { background-color: #047857 !important; }
.bg-brand-900 { background-color: #064e3b !important; }

.text-brand-50 { color: #ecfdf5 !important; }
.text-brand-100 { color: #d1fae5 !important; }
.text-brand-200 { color: #a7f3d0 !important; }
.text-brand-500 { color: #10b981 !important; }
.text-brand-600 { color: #059669 !important; }
.text-brand-700 { color: #047857 !important; }
.text-brand-900 { color: #064e3b !important; }

.border-brand-50 { border-color: #ecfdf5 !important; }
.border-brand-100 { border-color: #d1fae5 !important; }
.border-brand-200 { border-color: #a7f3d0 !important; }
.border-brand-500 { border-color: #10b981 !important; }
.border-brand-600 { border-color: #059669 !important; }
.border-brand-700 { border-color: #047857 !important; }
.border-brand-900 { border-color: #064e3b !important; }

.hover\:bg-brand-50:hover { background-color: #ecfdf5 !important; }
.hover\:bg-brand-600:hover { background-color: #059669 !important; }
.hover\:text-brand-600:hover { color: #059669 !important; }
.hover\:border-brand-400:hover { border-color: #34d399 !important; }
.focus\:ring-brand-200:focus { --tw-ring-color: #a7f3d0 !important; box-shadow: 0 0 0 3px #a7f3d0 !important; }
.focus\:border-brand-400:focus { border-color: #34d399 !important; }

/* 品牌色渐变背景 */
.from-brand-50 { --tw-gradient-from: #ecfdf5 !important; }
.from-brand-100 { --tw-gradient-from: #d1fae5 !important; }
.from-brand-500 { --tw-gradient-from: #10b981 !important; }
.to-brand-100 { --tw-gradient-to: #d1fae5 !important; }
.to-brand-500 { --tw-gradient-to: #10b981 !important; }

/* ===== 小程序风格样式 ===== */

/* 头部绿色渐变 */
.header-gradient {
  background: linear-gradient(135deg, #07c160 0%, #06ad56 60%, #059669 100%);
}

/* 推荐卡片宽度 */
.w-72 { width: 18rem; }
.w-15 { width: 3.75rem; }
.h-15 { height: 3.75rem; }
.flex-2 { flex: 2 1 0%; }

/* 底部Tabbar */
.tabbar {
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

/* 卡片图标背景 */
.card-icon {
  transition: all 0.2s ease;
}

.card:active .card-icon {
  transform: scale(0.95);
}

/* 推荐卡片 */
.rec-card {
  transition: all 0.15s ease;
}

.rec-card:active {
  box-shadow: 0 4px 16px rgba(7, 193, 96, 0.08);
  transform: scale(0.98);
}

/* 数据卡片 */
.d-card {
  transition: all 0.15s ease;
}

.d-card:active {
  background-color: #f0fdf4;
}

/* 搜索框 */
.search-box {
  transition: all 0.2s ease;
}

/* 分组标题 */
.group-title {
  position: relative;
}

/* 工具卡片悬浮效果 */
.card {
  transition: all 0.15s ease;
}

.card:active {
  background-color: #f0fdf4;
  transform: scale(0.97);
}

/* 滚动条美化 */
.overflow-x-auto::-webkit-scrollbar {
  height: 4px;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 2px;
}

/* 表格样式 */
.table-row {
  transition: background-color 0.15s ease;
}

/* 结果项 */
.result-item {
  transition: all 0.15s ease;
}

/* 按钮点击效果 */
button:active {
  transform: scale(0.98);
}

/* 输入框聚焦效果 */
input:focus, select:focus {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* 品牌色阴影 */
.shadow-brand { --tw-shadow-color: rgba(16,185,129,0.2) !important; }

/* 品牌色透明度 */
.bg-brand-50\/50 { background-color: rgba(236,253,245,0.5) !important; }
.bg-brand-500\/10 { background-color: rgba(16,185,129,0.1) !important; }
.bg-brand-500\/20 { background-color: rgba(16,185,129,0.2) !important; }
.bg-brand-500\/30 { background-color: rgba(16,185,129,0.3) !important; }
.bg-brand-600\/10 { background-color: rgba(5,150,105,0.1) !important; }

/* Focus ring */
.focus\:ring-2.focus\:ring-brand-200:focus { box-shadow: 0 0 0 3px #a7f3d0 !important; }

/* ===== 手册内容 HTML 渲染样式 ===== */
.manual-content h1, .manual-content h2, .manual-content h3, .manual-content h4 {
  font-weight: 600;
  color: #0f172a;
  margin: 16px 0 8px;
  line-height: 1.4;
}
.manual-content h1 { font-size: 18px; }
.manual-content h2 { font-size: 16px; }
.manual-content h3 { font-size: 15px; }
.manual-content h4 { font-size: 14px; }

.manual-content p {
  margin: 8px 0;
  line-height: 1.7;
}

.manual-content ul, .manual-content ol {
  padding-left: 24px;
  margin: 8px 0;
}
.manual-content ul { list-style: disc; }
.manual-content ol { list-style: decimal; }
.manual-content li { margin: 4px 0; }

.manual-content strong {
  font-weight: 600;
  color: #059669;
}

.manual-content em {
  font-style: italic;
  color: #64748b;
}

.manual-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px 0;
}

.manual-content a {
  color: #059669;
  text-decoration: underline;
}
.manual-content a:hover {
  color: #047857;
}

.manual-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}
.manual-content th, .manual-content td {
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  text-align: left;
}
.manual-content th {
  background: #f1f5f9;
  font-weight: 600;
}

.manual-content blockquote {
  border-left: 4px solid #10b981;
  padding: 8px 16px;
  margin: 12px 0;
  background: #ecfdf5;
  color: #065f46;
  border-radius: 0 8px 8px 0;
}

.manual-content code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #0f172a;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.manual-content hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 16px 0;
}

/* ===== 小程序风格 - 底部Tabbar ===== */
.fixed.bottom-0 {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
}

.fixed.bottom-0 .grid {
  display: grid;
}

.fixed.bottom-0 > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  transition: all 0.15s ease;
}

.fixed.bottom-0 > div:active {
  opacity: 0.6;
}

.fixed.bottom-0 .text-xl {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 2px;
}

.fixed.bottom-0 .tab-active {
  color: #07c160 !important;
  font-weight: 600;
}

/* ===== 小程序首页风格 ===== */
.page {
  background: transparent;
  min-height: 100vh;
  padding-bottom: 120px;
}

/* 首页头部渐变 */
.header {
  background: linear-gradient(135deg, #07c160 0%, #06ad56 60%, #059669 100%);
  padding: 48px 28px 24px;
  position: relative;
}

/* 公告样式 */
.notice {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  margin-top: 18px;
  margin-bottom: 20px;
}

.notice-icon {
  font-size: 24px;
  margin-right: 10px;
  flex-shrink: 0;
}

.notice-m {
  flex: 1;
  height: 40px;
  overflow: hidden;
}

.notice-txt {
  font-size: 13px;
  color: #6b7280;
  white-space: nowrap;
  display: inline-block;
  line-height: 40px;
}

/* 推荐卡片 */
.rec-card {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  padding: 16px 20px;
  margin-right: 12px;
  width: 290px;
  box-sizing: border-box;
  vertical-align: top;
  white-space: normal;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: all 0.15s ease;
  cursor: pointer;
}

.rec-card:active {
  box-shadow: 0 4px 16px rgba(7, 193, 96, 0.08);
}

.rec-card-ic {
  width: 50px;
  height: 50px;
  background: #f0fdf4;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-right: 14px;
  flex-shrink: 0;
}

.rec-card-t {
  flex: 1;
  min-width: 0;
}

.rec-card-n {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  display: block;
  line-height: 1.2;
}

.rec-card-d {
  font-size: 12px;
  color: #9ca3af;
  display: block;
  margin-top: 2px;
}

/* 工具卡片网格 */
.grid-cols-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  cursor: pointer;
  transition: all 0.15s ease;
}

.card:active {
  background: #f0fdf4;
  box-shadow: 0 4px 16px rgba(7, 193, 96, 0.08);
  transform: scale(0.97);
}

.card-ic {
  width: 64px;
  height: 64px;
  background: #f0fdf4;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.card:active .card-ic {
  transform: scale(0.95);
}

.card-em {
  font-size: 34px;
  line-height: 1;
}

.card-n {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  text-align: center;
  line-height: 1.2;
}

/* 文档卡片 */
.d-row {
  display: flex;
  gap: 14px;
}

.d-card {
  flex: 1;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  padding: 20px 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  cursor: pointer;
  transition: all 0.15s ease;
}

.d-card:active {
  background: #f0fdf4;
}

.d-card-ic {
  width: 40px;
  height: 40px;
  font-size: 28px;
  margin-right: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.d-card-t {
  flex: 1;
  min-width: 0;
}

.d-card-n {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  display: block;
}

.d-card-d {
  font-size: 12px;
  color: #9ca3af;
  display: block;
  margin-top: 2px;
}

.d-card-ar {
  font-size: 22px;
  color: #ddd;
  flex-shrink: 0;
}

/* 分组标题 */
.group-tt {
  font-size: 13px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 2px;
  padding: 24px 0 12px;
  margin-top: 8px;
  border-top: 1px solid #f0f0f0;
  position: relative;
}

.group-tt::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 40px;
  height: 4px;
  background: linear-gradient(90deg, #07c160 0%, transparent 100%);
  border-radius: 2px;
}

/* 搜索框 */
.search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 14px 18px;
  transition: all 0.2s;
}

.search-box.active {
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.search-box.active .search-icon {
  color: #9ca3af;
}

.search-box.active .search-input {
  color: #1f2937;
}

.search-box.active .search-input::-webkit-input-placeholder {
  color: #d1d5db;
}

.search-box.active .search-cancel {
  color: #07c160;
}

.search-box.active .search-clear {
  background: #e5e7eb;
  color: #9ca3af;
}

.search-icon {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.5);
  margin-right: 12px;
  transition: color 0.2s;
}

.search-input {
  flex: 1;
  font-size: 14px;
  color: #fff;
  height: 32px;
  transition: color 0.2s;
  background: transparent;
  border: none;
  outline: none;
}

.search-input::-webkit-input-placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-clear {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
  margin-right: 8px;
  line-height: 1;
  cursor: pointer;
}

.search-cancel {
  font-size: 18px;
  color: #fff;
  font-weight: 500;
  padding: 4px 0 4px 12px;
  cursor: pointer;
}

/* 标题样式 */
.header-title {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: 1px;
}

.header-greet {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 400;
  margin-top: 6px;
}

.header-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  margin-left: 16px;
  cursor: pointer;
}

.header-icon:active {
  opacity: 0.7;
}

/* 分区标题 */
.sec-tt {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 16px;
}

.sec-n {
  font-size: 12px;
  color: #d1d5db;
  margin-left: 8px;
  font-weight: 400;
}

/* 推荐区 */
.rec-blk {
  margin-bottom: 28px;
}

.rec-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.rec-hd-t {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
}

.rec-hd-a {
  font-size: 12px;
  color: #07c160;
  font-weight: 500;
  cursor: pointer;
}

/* 搜索结果 */
.sr-hd {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 14px;
  margin-top: 8px;
}

.sr-n {
  font-size: 12px;
  color: #d1d5db;
  margin-left: 8px;
  font-weight: 400;
}

.sr-list {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.sr-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.sr-item:last-child {
  border-bottom: none;
}

.sr-item:active {
  background: #f0fdf4;
}

.sr-item-l {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.sr-item-ic {
  width: 44px;
  height: 44px;
  background: #f0fdf4;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-right: 14px;
  flex-shrink: 0;
}

.sr-item-im {
  width: 36px;
  height: 36px;
}

.sr-item-t {
  flex: 1;
  min-width: 0;
}

.sr-item-n {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  display: block;
}

.sr-item-d {
  font-size: 12px;
  color: #9ca3af;
  display: block;
  margin-top: 2px;
}

.sr-item-ar {
  font-size: 22px;
  color: #ddd;
  flex-shrink: 0;
}

.sr-ep {
  text-align: center;
  padding: 40px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.sr-ep-t {
  font-size: 12px;
  color: #d1d5db;
}

/* 响应式 */
@media (max-width: 375px) {
  .card-ic {
    width: 52px;
    height: 52px;
  }
  
  .card-em {
    font-size: 28px;
  }
  
  .card-n {
    font-size: 11px;
  }
  
  .rec-card {
    width: 260px;
  }
  
  .rec-card-ic {
    width: 44px;
    height: 44px;
  }
  
  .rec-card-im {
    width: 36px;
    height: 36px;
  }
}

