body {
  background: #f4f6f8;
  color: #1f2933;
}

a {
  text-decoration: none;
}

.container-fluid {
  max-width: 1440px;
}

.panel,
.metric-card {
  background: #fff;
  border: 1px solid #d9e1e8;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(31, 41, 51, 0.04);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e5eaf0;
}

.metric-card {
  padding: 16px;
  min-height: 112px;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.metric-label {
  color: #66788a;
  margin-top: 10px;
  font-size: 0.95rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px 14px;
  margin-bottom: 0;
}

.detail-grid dt {
  color: #66788a;
  font-weight: 600;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.timeline-item {
  border-left: 3px solid #0d6efd;
  padding: 0 0 18px 14px;
  margin-left: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid #edf1f5;
}

.timeline-item:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.script-box {
  border: 1px solid #d9e1e8;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fbfcfd;
}

.ai-detail-row td {
  background: #f8fafc;
}

.ai-analysis-box {
  border: 1px solid #d9e1e8;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.keyword-wrap,
.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.keyword-wrap {
  justify-content: flex-start;
}

.keyword-grid {
  align-items: stretch;
}

.keyword-card {
  text-align: left;
  min-width: 210px;
  max-width: 290px;
  white-space: normal;
}

.keyword-en,
.keyword-cn {
  display: block;
  line-height: 1.35;
}

.keyword-cn {
  color: #536878;
  font-size: 0.86rem;
  margin-top: 3px;
}

.generated-link {
  overflow-wrap: anywhere;
}

.field-list {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 12px;
  border-radius: 8px;
  background: #f4f6f8;
}

.bulk-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  min-height: 190px;
}

.table {
  min-width: 820px;
}

.preview-table {
  min-width: 1180px;
}

.preview-long {
  max-width: 280px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.network-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6c757d;
  transition: background 0.3s;
}

.network-ok { background: #198754; box-shadow: 0 0 4px rgba(25,135,84,0.5); }
.network-err { background: #dc3545; box-shadow: 0 0 4px rgba(220,53,69,0.5); }

.network-banner {
  border-radius: 8px;
  padding: 14px 18px;
  border: 1px solid;
}

.network-banner-warning {
  background: #fff7e6;
  border-color: #ffc107;
  color: #664d00;
}

.network-banner-error {
  background: #fdf0f0;
  border-color: #dc3545;
  color: #842029;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.86rem;
  font-weight: 500;
}

.tag-keyword {
  color: #1f2933;
  background: #e9ecf0;
  border: 1px solid #d9e1e8;
}

.tag-remove {
  margin-left: 4px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: #66788a;
}

.tag-remove:hover {
  color: #b42318;
}

.fb-kw-btn.active {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

@media (max-width: 767px) {
  .metric-card {
    min-height: 96px;
    padding: 14px;
  }

  .metric-value {
    font-size: 1.6rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .detail-grid dd {
    margin-bottom: 8px;
  }

  .table-actions {
    justify-content: flex-start;
  }
}
