/*
实现原理：定义本机爬虫日志页面的任务列表、日志内容和搜索高亮样式。
如何使用：index.html 加载后，app_crawler_logs.js 渲染的 class 自动套用本样式。
*/
.crawler-logs-page {
  display: grid;
  gap: 12px;
}

.crawler-logs-shell {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 12px;
}

.crawler-log-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.crawler-log-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.crawler-log-panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.crawler-job-list {
  display: grid;
  max-height: 68vh;
  overflow: auto;
}

.crawler-job-item {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  padding: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  box-shadow: none;
  text-align: left;
}

.crawler-job-item.active {
  background: #f0efff;
  color: var(--accent);
}

.crawler-job-title,
.crawler-log-title {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.crawler-log-title,
.crawler-log-meta {
  padding: 8px 10px 0;
}

.crawler-job-meta,
.crawler-log-meta {
  color: #69708a;
  font-size: 12px;
}

.crawler-log-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.crawler-log-tools input {
  width: min(260px, 100%);
  min-height: 40px;
  font-size: 14px;
}

.crawler-log-content {
  height: 68vh;
  margin: 0;
  padding: 10px;
  overflow: auto;
  background: #10131d;
  color: #e7ebf7;
  font: 13px/1.55 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
}

.crawler-log-line {
  display: block;
  min-height: 20px;
  overflow-wrap: anywhere;
}

.crawler-log-line.warn {
  color: #f6b44b;
}

.crawler-log-line.error {
  color: #ff7a72;
}

.crawler-log-mark {
  background: #ffe066;
  color: #1b1d27;
}

@media (max-width: 760px) {
  .crawler-logs-shell {
    grid-template-columns: 1fr;
  }

  .crawler-job-list,
  .crawler-log-content {
    max-height: none;
    height: 46vh;
  }
}
