.katex {
  font-size: 1em !important; 
}

.katex-display {
  font-size: 1.1em !important; 
  margin: 0.8em 0 !important;
}

.tool-content .katex-display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

.tool-content mjx-container:not([display="true"]),
.tool-content .katex {
  max-width: 100%;
  overflow-wrap: break-word;
}

.tool-content {
  max-width: 900px;
  margin: 40px auto;
  padding: 30px 25px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 2;
  color: #2d3748;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  word-wrap: break-word;
}

.tool-content h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1a202c;
  margin: 40px 0 18px;
  padding-bottom: 10px;
  border-bottom: 3px solid #4f46e5;
  line-height: 1.3;
}

.tool-content h2:first-child {
  margin-top: 0;
}

.tool-content h3 {
  font-size: 22px;
  font-weight: 600;
  color: #2d3748;
  margin: 32px 0 14px;
  padding-left: 12px;
  border-left: 4px solid #4f46e5;
  line-height: 1.4;
}

.tool-content h4 {
  font-size: 18px;
  font-weight: 600;
  color: #4a5568;
  margin: 24px 0 10px;
  line-height: 1.4;
}

.tool-content p {
  margin: 0 0 16px;
  font-size: 17px;
  color: #4a5568;
  line-height: 1.8;
}

.tool-content a {
  color: #4f46e5;
  text-decoration: none;
  border-bottom: 1px dashed #4f46e5;
  transition: all 0.2s ease;
}

.tool-content a:hover {
  color: #3730a3;
  border-bottom-style: solid;
}

.tool-content ul,
.tool-content ol {
  margin: 16px 0 20px;
  padding-left: 28px;
}

.tool-content ul li,
.tool-content ol li {
  margin-bottom: 10px;
  color: #4a5568;
  line-height: 1.7;
}

.tool-content ul li::marker {
  color: #4f46e5;
  font-size: 1.1em;
}

.tool-content ol li::marker {
  color: #4f46e5;
  font-weight: 600;
}

.tool-content ul ul,
.tool-content ol ol,
.tool-content ul ol,
.tool-content ol ul {
  margin: 8px 0;
}

.tool-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 16px;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.tool-content table thead {
  background: #4f46e5;
}

.tool-content table thead th {
  color: #ffffff;
  font-weight: 600;
  text-align: left;
  padding: 14px 16px;
  font-size: 16px;
  border: none;
}

.tool-content table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  color: #4a5568;
  vertical-align: top;
}

.tool-content table tbody tr:last-child td {
  border-bottom: none;
}

.tool-content table tbody tr:nth-child(even) {
  background: #f7fafc;
}

.tool-content table tbody tr:hover {
  background: #edf2f7;
  transition: background 0.2s ease;
}

.tool-content .note,
.tool-content .tip,
.tool-content .warning,
.tool-content .important {
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 8px;
  border-left: 5px solid;
  font-size: 16px;
  line-height: 1.7;
}

.tool-content .note {
  background: #ebf8ff;
  border-color: #3182ce;
  color: #2c5282;
}

.tool-content .tip {
  background: #f0fff4;
  border-color: #38a169;
  color: #276749;
}

.tool-content .warning {
  background: #fffaf0;
  border-color: #dd6b20;
  color: #9c4221;
}

.tool-content .important {
  background: #fff5f5;
  border-color: #e53e3e;
  color: #9b2c2c;
}

.tool-content .note strong,
.tool-content .tip strong,
.tool-content .warning strong,
.tool-content .important strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

.tool-content blockquote {
  margin: 20px 0;
  padding: 16px 22px;
  background: #f7fafc;
  border-left: 5px solid #a0aec0;
  font-style: italic;
  color: #4a5568;
  border-radius: 0 8px 8px 0;
}

.tool-content code {
  background: #edf2f7;
  color: #d53f8c;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
}

.tool-content pre {
  background: #1a202c;
  color: #e2e8f0;
  padding: 18px 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 20px 0;
  font-size: 15px;
  line-height: 1.6;
}

.tool-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 15px;
}

.tool-content hr {
  border: none;
  height: 1px;
  background: #e2e8f0;
  margin: 32px 0;
}

.tool-content strong {
  color: #1a202c;
  font-weight: 700;
}

.tool-content em {
  color: #4a5568;
}

.tool-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
  display: block;
}

@media (max-width: 768px) {
  .tool-content {
    padding: 20px 16px;
    margin: 20px auto;
    font-size: 16px;
    border-radius: 0;
  }

  .tool-content h2 {
    font-size: 23px;
    margin: 30px 0 14px;
  }

  .tool-content h3 {
    font-size: 19px;
    margin: 24px 0 12px;
  }

  .tool-content h4 {
    font-size: 17px;
  }

  .tool-content p,
  .tool-content ul li,
  .tool-content ol li {
    font-size: 16px;
  }

  .tool-content table {
    font-size: 14px;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    
  }

  .tool-content table thead th,
  .tool-content table tbody td {
    padding: 10px 12px;
  }

  .tool-content pre {
    font-size: 13px;
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .tool-content h2 {
    font-size: 20px;
  }

  .tool-content h3 {
    font-size: 17px;
  }

  .tool-content table {
    font-size: 13px;
  }
}

@media print {
  .tool-content {
    box-shadow: none;
    max-width: 100%;
  }
}
