/* 基础样式 */
body {
  font-family: 'Microsoft YaHei', Arial, sans-serif;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: all 0.3s ease;
}

/* 深色主题 */
body.dark-theme {
  background-color: #1a1a1a;
  color: #f0f0f0;
}

body.dark-theme .tool-container {
  background-color: #252525;
  border-color: #404040;
}

body.dark-theme .tool-container h4 {
  color: #f0f0f0;
  border-bottom-color: #404040;
}

body.dark-theme .form-control {
  background-color: #333;
  color: #f0f0f0;
  border-color: #555;
}

body.dark-theme .form-control::placeholder {
  color: #999;
}

body.dark-theme .form-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

body.dark-theme .btn {
  background-color: #444;
  color: #f0f0f0;
  border-color: #555;
}

body.dark-theme .btn:hover {
  background-color: #555;
  border-color: #666;
}

body.dark-theme .btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

body.dark-theme .btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

body.dark-theme .ad-placeholder-container {
  background-color: #252525;
  border-color: #404040;
}

body.dark-theme .dropdown-menu {
  background-color: #333;
  border-color: #444;
}

body.dark-theme .dropdown-item {
  color: #f0f0f0;
}

body.dark-theme .dropdown-item:hover {
  background-color: #444;
}

body.dark-theme .navbar {
  background-color: #252525 !important;
}

body.dark-theme .navbar-nav .nav-link {
  color: #f0f0f0;
}

body.dark-theme .navbar-nav .nav-link:hover {
  color: #fff;
}

body.dark-theme .navbar-nav .nav-link.active {
  color: #0d6efd;
}

body.dark-theme .crawler-status {
  background-color: #333;
  color: #f0f0f0;
  border-color: #555;
}

body.dark-theme .output-area {
  background: #2d2d2d;
  color: #f8f8f2;
}

body.dark-theme .form-label {
  color: #f0f0f0;
}

body.dark-theme p {
  color: #e0e0e0;
}

body.dark-theme .alert {
  background-color: #333;
  color: #f0f0f0;
  border-color: #555;
}

body.dark-theme #crawlerStatus {
  background-color: #333;
  color: #f0f0f0;
  border-color: #555;
}

.container {
  flex: 1;
}

pre {
  user-select: text;
  /* 允许选中文字 */
  cursor: text;
  /* 鼠标悬停时显示文本光标 */
  white-space: pre;
  /* 保持换行和空格 */
  overflow-x: auto;
  /* 允许横向滚动 */
}


/* 导航栏样式 */
.navbar-brand {
  font-weight: 600;
  font-size: 1.25rem;
}

.navbar {
  justify-content: center;
}

.navbar .container-fluid {
  max-width: 1400px;
}

.navbar-collapse {
  justify-content: center;
}

.navbar-nav {
  margin: 0 auto;
}

/* 工具区域卡片 */
.tool-container {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  max-width: 100%;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  overflow: hidden;
}

.tool-container:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.tool-container h4 {
  text-align: center;
  color: #333;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.tool-container .mb-3 {
  margin-bottom: 15px !important;
}



/* 内容区域优化 */
.tool-section {
  padding: 0;
}

.tool-container {
  padding: 20px;
  margin-top: 0;
  margin-bottom: 20px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  border: 1px solid #e9ecef;
  background-color: white;
}

/* 广告占位容器样式 */
.ad-placeholder-container {
  height: fit-content;
  min-height: 400px;
  background-color: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  margin: 0 10px;
  padding: 20px;
}

/* 调整输入输出区域高度 */
.row[style*="height"] {
  height: 50vh !important;
}

/* 输入框和输出区域优化 */
.form-control {
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #ced4da;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
}

/* 广告样式 */
.ad-container {
  padding: 15px 0;
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
  border-bottom: 1px solid #e9ecef;
  margin: 20px 0;
}

.ad-unit {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.ad-placeholder {
  background-color: #e9ecef;
  border-radius: 8px;
  padding: 40px 20px;
  color: #6c757d;
  font-size: 14px;
  text-align: center;
  border: 1px dashed #ced4da;
}

.media-net-ad {
  border-top: none;
  margin-top: 0;
}

.baidu-union-ad {
  border-bottom: none;
  margin-bottom: 0;
}

/* 响应式广告 */
@media (max-width: 768px) {
  .ad-container {
    padding: 10px 0;
    margin: 10px 0;
  }
  
  .ad-placeholder {
    padding: 30px 15px;
    font-size: 12px;
  }
}

/* 输出区域 */
.output-area {
  background: #2d2d2d;
  color: #f8f8f2;
  border-radius: 6px;
  padding: 12px;
  min-height: 180px;
  white-space: pre-wrap;
  word-wrap: break-word;
  position: relative;
  font-size: 13px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* 输出区域 textarea 样式 */
.output-area.form-control {
  background: #2d2d2d;
  color: #f8f8f2;
  border: 1px solid #444;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
  padding: 12px;
}

.output-area.form-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

body.dark-theme .output-area.form-control {
  background: #2d2d2d;
  color: #f8f8f2;
  border-color: #444;
}

/* 输出区域中的表格样式 */
.output-area table {
  color: #f8f8f2;
}

.output-area table th,
.output-area table td {
  background-color: #2d2d2d;
  border-color: #444;
  color: #f8f8f2;
}

.output-area table th {
  background-color: #333;
  font-weight: bold;
}

/* 复制按钮样式 - 右上角 */
.copy-btn-container {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 10;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.copy-btn-container:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 按钮组 */
.btn-group .btn {
  margin-right: 5px;
}

.tool-container {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

.nav-tabs .nav-link {
  color: #495057;
  border-radius: 8px 8px 0 0;
}

.nav-tabs .nav-link.active {
  font-weight: 600;
  color: #0d6efd;
}

.dropdown-menu {
  max-height: 400px;
  overflow-y: auto;
}

.tool-section {
  display: none;
}

.tool-section.active {
  display: block;
}

/* SQL 语法高亮 */
.sql-keyword {
  color: #ff79c6;
  font-weight: bold;
}

.sql-function {
  color: #8be9fd;
  font-weight: bold;
}

.sql-string {
  color: #f1fa8c;
}

.sql-number {
  color: #bd93f9;
}

.sql-comment {
  color: #6272a4;
  font-style: italic;
}

.sql-operator {
  color: #ff79c6;
}

.sql-identifier {
  color: #50fa7b;
}

.sql-type {
  color: #ffb86c;
}

.sql-mysql-func {
  color: #50fa7b;
}

.sql-sqlserver-func {
  color: #ffb86c;
}

.sql-oracle-func {
  color: #bd93f9;
}

.sql-postgresql-func {
  color: #ff5555;
}

.sql-sqlite-func {
  color: #50fa7b;
}

/* JSON 语法高亮 */
.json-key {
  color: #9cdcfe;
  font-weight: 600;
}

.json-string {
  color: #ce9178;
}

.json-number {
  color: #b5cea8;
}

.json-boolean {
  color: #569cd6;
  font-weight: bold;
}

.json-null {
  color: #569cd6;
  font-style: italic;
}

.json-bracket {
  color: #ffd700;
}

/* XML 语法高亮 */
.xml-tag-bracket {
  color: #808080;
}

.xml-tag-name {
  color: #569cd6;
  font-weight: 600;
}

.xml-attr-name {
  color: #9cdcfe;
}

.xml-attr-value {
  color: #ce9178;
}

.xml-declaration {
  color: #569cd6;
  font-style: italic;
}

.xml-comment {
  color: #6a9955;
  font-style: italic;
}

.xml-text {
  color: #d4d4d4;
}

.xml-empty {
  color: #858585;
  font-style: italic;
}

.xml-attrs {
  font-size: 11px;
}

/* XML 树形视图 */
.xml-tree .xml-tag-name {
  color: #569cd6;
  font-weight: 600;
}

.xml-tree .xml-attrs {
  color: #9cdcfe;
}

.xml-tree .xml-text {
  color: #d4d4d4;
}

/* JSON 树形视图 */
.json-tree {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.6;
}

.json-tree-node {
  margin-left: 20px;
  padding: 2px 0;
}

.json-toggle {
  cursor: pointer;
  user-select: none;
  display: inline-block;
  width: 16px;
  color: #858585;
  transition: transform 0.2s;
}

.json-toggle:hover {
  color: #007acc;
}

.json-key-text {
  color: #9cdcfe;
  font-weight: 600;
}

.json-colon {
  color: #d4d4d4;
}

.json-children {
  margin-left: 10px;
  border-left: 1px solid #404040;
  padding-left: 5px;
}

.json-count {
  color: #858585;
  font-size: 11px;
}

/* JSON 表格视图 */
.json-table table {
  font-size: 13px;
  margin-bottom: 0;
}

.json-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.json-table td {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.json-table td code {
  font-size: 11px;
  color: #d63384;
  background-color: #f8f9fa;
  padding: 2px 4px;
  border-radius: 3px;
}

.json-table .badge {
  font-size: 11px;
}

/* 深色主题下的 JSON 样式 */
body.dark-theme .json-key {
  color: #9cdcfe;
}

body.dark-theme .json-string {
  color: #ce9178;
}

body.dark-theme .json-number {
  color: #b5cea8;
}

body.dark-theme .json-boolean,
body.dark-theme .json-null {
  color: #569cd6;
}

body.dark-theme .json-bracket {
  color: #ffd700;
}

body.dark-theme .xml-tag-bracket {
  color: #808080;
}

body.dark-theme .xml-tag-name {
  color: #569cd6;
}

body.dark-theme .xml-attr-name {
  color: #9cdcfe;
}

body.dark-theme .xml-attr-value {
  color: #ce9178;
}

body.dark-theme .xml-declaration {
  color: #569cd6;
}

body.dark-theme .xml-comment {
  color: #6a9955;
}

body.dark-theme .xml-text {
  color: #d4d4d4;
}

body.dark-theme .xml-empty {
  color: #858585;
}

/* JSON 树形视图 */
body.dark-theme .json-children {
  border-left-color: #555;
}

body.dark-theme #jsonTreeView,
body.dark-theme #jsonTableView {
  background-color: #1e1e1e;
  border-color: #404040;
  color: #d4d4d4;
}

body.dark-theme .json-table table {
  color: #d4d4d4;
  border-color: #404040;
}

body.dark-theme .json-table th {
  background-color: #2d2d2d;
  color: #ffffff;
  border-color: #404040;
}

body.dark-theme .json-table td {
  background-color: #1e1e1e;
  border-color: #404040;
}

body.dark-theme .json-table td code {
  background-color: #2d2d2d;
  color: #ce9178;
}

body.dark-theme .json-table .text-muted {
  color: #6c757d !important;
}

/* 搜索高亮 */
mark.bg-warning {
  background-color: #ffc107;
  color: #000;
  padding: 1px 2px;
  border-radius: 2px;
}

body.dark-theme mark.bg-warning {
  background-color: #ffeb3b;
  color: #000;
}

/* MD5 输出区域样式 */
.output-area-md5 {
  min-height: 80px;
  padding: 10px;
}

/* 文本对比工具样式 */
.diff-input {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  resize: vertical;
}

.diff-output-container {
  margin-top: 20px;
}

.diff-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.diff-stats {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

.diff-stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.diff-stat-item .badge {
  font-size: 12px;
  padding: 4px 10px;
}

.diff-compare-panel {
  display: flex;
  gap: 0;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
}

.diff-panel {
  flex: 1;
  min-width: 0;
}

.diff-panel-header {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  font-weight: 600;
  font-size: 14px;
}

.diff-panel.left .diff-panel-header {
  background-color: #fff3cd;
  border-bottom: 1px solid #ffeeba;
}

.diff-panel.right .diff-panel-header {
  background-color: #d4edda;
  border-bottom: 1px solid #c3e6cb;
}

.diff-panel.left .diff-panel-header .label {
  color: #856404;
}

.diff-panel.right .diff-panel-header .label {
  color: #155724;
}

.diff-content {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: auto;
}

.diff-line-numbers {
  display: inline-block;
  min-width: 50px;
  padding: 8px 5px;
  background-color: #f8f9fa;
  border-right: 1px solid #e9ecef;
  text-align: right;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  color: #6c757d;
  user-select: none;
  vertical-align: top;
}

.diff-line-content {
  display: inline-block;
  padding: 8px 12px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.5;
  min-width: calc(100% - 60px);
  vertical-align: top;
  white-space: pre;
  word-wrap: break-word;
  word-break: break-all;
}

.diff-line {
  display: flex;
  border-bottom: 1px solid #f1f3f4;
  transition: background-color 0.2s;
}

.diff-line:hover {
  background-color: #f8f9fa;
}

.diff-line.added {
  background-color: #e8f5e9;
}

.diff-line.removed {
  background-color: #ffebee;
}

.diff-line.changed {
  background-color: #fff3e0;
}

.diff-line.added .diff-line-content {
  color: #155724;
}

.diff-line.removed .diff-line-content {
  color: #c62828;
}

.diff-line.changed .diff-line-content {
  color: #e65100;
}

.diff-char-add {
  background-color: #a5d6a7;
  border-radius: 2px;
  padding: 0 2px;
}

.diff-char-remove {
  background-color: #ef9a9a;
  border-radius: 2px;
  padding: 0 2px;
}

.diff-empty-line {
  color: #ccc;
  font-style: italic;
}

.diff-legend {
  display: flex;
  gap: 15px;
  font-size: 12px;
}

.diff-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.diff-legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.diff-legend-color.added {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
}

.diff-legend-color.removed {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
}

.diff-legend-color.changed {
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
}

/* 深色主题下的文本对比样式 */
body.dark-theme .diff-header {
  background-color: #2d2d2d;
  border-color: #444;
}

body.dark-theme .diff-compare-panel {
  border-color: #444;
}

body.dark-theme .diff-panel.left .diff-panel-header {
  background-color: #3d3d29;
  border-bottom-color: #4d4d39;
}

body.dark-theme .diff-panel.right .diff-panel-header {
  background-color: #293d29;
  border-bottom-color: #394d39;
}

body.dark-theme .diff-panel.left .diff-panel-header .label {
  color: #ffd54f;
}

body.dark-theme .diff-panel.right .diff-panel-header .label {
  color: #81c784;
}

body.dark-theme .diff-line-numbers {
  background-color: #2d2d2d;
  border-right-color: #444;
  color: #888;
}

body.dark-theme .diff-line {
  border-bottom-color: #3a3a3a;
}

body.dark-theme .diff-line:hover {
  background-color: #3a3a3a;
}

body.dark-theme .diff-line.added {
  background-color: #2e4a2e;
}

body.dark-theme .diff-line.removed {
  background-color: #4a2e2e;
}

body.dark-theme .diff-line.changed {
  background-color: #4a402e;
}

body.dark-theme .diff-line.added .diff-line-content {
  color: #81c784;
}

body.dark-theme .diff-line.removed .diff-line-content {
  color: #e57373;
}

body.dark-theme .diff-line.changed .diff-line-content {
  color: #ffb74d;
}

body.dark-theme .diff-char-add {
  background-color: #4caf50;
}

body.dark-theme .diff-char-remove {
  background-color: #f44336;
}

/* 文本统计信息样式 */
.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background-color: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 10px;
}

.stat-label {
  font-weight: 500;
  color: #6c757d;
}

.stat-value {
  font-weight: 600;
  color: #0d6efd;
  font-size: 1.25rem;
}

body.dark-theme .stat-item {
  background-color: #2d2d2d;
}

body.dark-theme .stat-label {
  color: #999;
}

body.dark-theme .stat-value {
  color: #64b5f6;
}
