/**
 * 全局视觉：与 pages/index.php 首页一致（背景、卡片、表单、状态样式）
 */

body {
  font-family: 'Inter', sans-serif;
  background: #f3f4f6;
}

.sem-card,
.editor-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metric-card {
  transition: all 0.2s;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.keyword-row {
  transition: background 0.15s;
  cursor: pointer;
}
.keyword-row:hover {
  background: #f8fafc;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #6b7280;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.rank-top3 {
  background: #dcfce7;
  color: #166534;
}
.rank-top10 {
  background: #dbeafe;
  color: #1e40af;
}
.rank-top20 {
  background: #e0e7ff;
  color: #3730a3;
}
.rank-top30 {
  background: #fef3c7;
  color: #92400e;
}
.rank-other {
  background: #f3f4f6;
  color: #6b7280;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot.status-done {
  background: #22c55e;
}
.status-dot.status-progress {
  background: #f59e0b;
}
.status-dot.status-pending {
  background: #d1d5db;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.status-badge.status-done {
  background: #d1fae5;
  color: #065f46;
}
.status-badge.status-progress {
  background: #fef3c7;
  color: #92400e;
}
.status-badge.status-pending {
  background: #f3f4f6;
  color: #6b7280;
}

.mhw-task-page .status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}
.mhw-task-page .status-badge.status-pending {
  background: #fef3c7;
  color: #92400e;
}
.mhw-task-page .status-badge.status-progress {
  background: #dbeafe;
  color: #1e40af;
}
.mhw-task-page .status-badge.status-completed {
  background: #dcfce7;
  color: #166534;
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}
.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.editor-dashboard-grid a.editor-card {
  transition: all 0.2s;
  border: 2px solid transparent;
}
.editor-dashboard-grid a.editor-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: #a855f7;
}

.module-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-pending {
  background: #fef3c7;
  color: #92400e;
}
.badge-done {
  background: #dcfce7;
  color: #166534;
}

.metric-positive {
  color: #10b981;
}
.metric-negative {
  color: #ef4444;
}

.module-title {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 2px solid #e2e8f0;
}
.submodule-title {
  background: #f8fafc;
  border-left: 4px solid #3b82f6;
}
.keyword-highlight {
  background: #fee2e2;
  color: #dc2626;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.section-divider {
  border-top: 2px dashed #e2e8f0;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.checkbox-wrapper input[type='checkbox'] {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}
.task-section {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.task-section:hover {
  border-color: #3b82f6;
}

.page {
  display: none;
}
.page.active {
  display: block;
}

.jump-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s;
}
.jump-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.mhw-page-timeline .timeline-wrapper {
  position: relative;
  padding: 40px 0;
}
.mhw-page-timeline .timeline-axis {
  position: absolute;
  left: 45%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}
.mhw-page-timeline .week-block {
  position: relative;
  margin-bottom: 32px;
  padding-top: 42px;
  display: flex;
  align-items: flex-start;
}
.mhw-page-timeline .week-block:last-child {
  margin-bottom: 0;
}
.mhw-page-timeline .week-left {
  width: 45%;
  padding-right: 40px;
  text-align: right;
}
.mhw-page-timeline .week-right {
  width: 55%;
  padding-left: 40px;
}
.mhw-page-timeline .week-label {
  position: absolute;
  left: 45%;
  top: 0;
  transform: translateX(-50%);
  background: #475569;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 16px;
  white-space: nowrap;
  z-index: 20;
}
.mhw-page-timeline .week-node {
  position: absolute;
  left: 45%;
  top: 52px;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  border: 3px solid;
  z-index: 15;
  margin-left: -20px;
}
.mhw-page-timeline .week-node.up {
  border-color: #22c55e;
}
.mhw-page-timeline .week-node.down {
  border-color: #ef4444;
}
.mhw-page-timeline .week-node.stable {
  border-color: #94a3b8;
}
.mhw-page-timeline .week-node.start {
  border-color: #64748b;
  background: #e2e8f0;
}
.mhw-page-timeline .rank-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.mhw-page-timeline .action-card {
  background: white;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.mhw-page-timeline .action-card:last-child {
  margin-bottom: 0;
}
.mhw-page-timeline .action-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.mhw-page-timeline .action-dot.tdh {
  background: #3b82f6;
}
.mhw-page-timeline .action-dot.content {
  background: #10b981;
}
.mhw-page-timeline .action-dot.internal {
  background: #f59e0b;
}
.mhw-page-timeline .action-dot.external {
  background: #ec4899;
}
.mhw-page-timeline .action-dot.ad {
  background: #f97316;
}
.mhw-page-timeline .action-dot.other {
  background: #6b7280;
}
.mhw-page-timeline .action-content {
  flex: 1;
}
.mhw-page-timeline .action-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.mhw-page-timeline .action-name {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}
.mhw-page-timeline .action-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.mhw-page-timeline .action-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}
.mhw-page-timeline .action-status.status-done {
  background: #dbeafe;
  color: #1e40af;
}
.mhw-page-timeline .action-status.status-progress {
  background: #fef3c7;
  color: #92400e;
}
.mhw-page-timeline .action-status.status-online {
  background: #d1fae5;
  color: #065f46;
}
.mhw-page-timeline .action-status.status-pending {
  background: #f3f4f6;
  color: #6b7280;
}
.mhw-page-timeline .rank-number {
  font-size: 36px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
}
.mhw-page-timeline .rank-change {
  font-size: 18px;
  font-weight: 600;
}
.mhw-page-timeline .rank-up {
  color: #22c55e;
}
.mhw-page-timeline .rank-down {
  color: #ef4444;
}
.mhw-page-timeline .date-tag {
  display: inline-block;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.mhw-page-timeline .week-block:nth-child(odd) .rank-card,
.mhw-page-timeline .week-block:nth-child(odd) .action-card {
  background: #f8fafc;
}
.mhw-page-timeline .week-block:nth-child(even) .rank-card,
.mhw-page-timeline .week-block:nth-child(even) .action-card {
  background: #ffffff;
}

@media (max-width: 768px) {
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
  .responsive-hide {
    display: none;
  }
  .mhw-page-keyword-dashboard .grid-cols-2,
  .mhw-page-keyword-dashboard .grid-cols-4 {
    grid-template-columns: 1fr;
  }
  .mhw-page-keyword-dashboard .border-r {
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding-right: 0;
    padding-bottom: 16px;
    margin-bottom: 16px;
  }
  .mhw-page-timeline .week-block {
    flex-direction: column;
  }
  .mhw-page-timeline .week-left,
  .mhw-page-timeline .week-right {
    width: 100%;
    padding: 0;
  }
  .mhw-page-timeline .week-left {
    margin-bottom: 16px;
    text-align: left;
    padding-left: 40px;
  }
  .mhw-page-timeline .week-right {
    padding-left: 40px;
  }
  .mhw-page-timeline .timeline-axis {
    left: 20px;
  }
  .mhw-page-timeline .week-label {
    left: 20px;
    top: 0;
  }
  .mhw-page-timeline .week-node {
    left: 20px;
    top: 46px;
    margin-left: 0;
  }
}
