/* ===================================================
 * gitee-widgets-v7.css — 迭代 7 组件样式
 * 审批流 / 代码片段 / 数据分析 / 留言板 / 数据导出
 * =================================================== */

/* ----- 审批流 Review ----- */
.review-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.review-stat-item {
  flex: 1;
  min-width: 80px;
  padding: 12px 10px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e1e4e8);
  border-radius: 8px;
  text-align: center;
}

.review-stat-icon { font-size: 20px; display: block; margin-bottom: 4px; }
.review-stat-value { font-size: 22px; font-weight: 700; display: block; }
.review-stat-label { font-size: 11px; color: var(--text-light, #6a737d); margin-top: 2px; }

.review-actions-bar {
  display: flex;
  gap: 8px;
  margin: 12px 0 20px;
  flex-wrap: wrap;
}

.review-btn {
  padding: 8px 16px;
  border: 1px solid;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  background: var(--card-bg, #fff);
  transition: all 0.15s;
}
.review-btn:hover { filter: brightness(0.95); }
.review-btn.approve { color: #10b981; border-color: #10b981; }
.review-btn.approve:hover { background: #ecfdf5; }
.review-btn.changes { color: #f59e0b; border-color: #f59e0b; }
.review-btn.changes:hover { background: #fffbeb; }
.review-btn.comment { color: #6366f1; border-color: #6366f1; }
.review-btn.comment:hover { background: #eef2ff; }

.review-card {
  border: 1px solid var(--border-color, #e1e4e8);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--card-bg, #fff);
}

.review-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #d0d7de;
}

.review-user-info { flex: 1; }
.review-user-info strong { font-size: 14px; }
.review-username { font-size: 12px; color: var(--text-light, #6a737d); margin-left: 4px; }

.review-state-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.review-state-approved { background: #ecfdf5; color: #065f46; }
.review-state-changes { background: #fffbeb; color: #92400e; }
.review-state-comment { background: #eef2ff; color: #3730a3; }
.review-state-pending { background: #f3f4f6; color: #6b7280; }

.review-card-body {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-secondary, #f6f8fa);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.review-card-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-light, #6a737d);
}

.review-btn-dismiss {
  font-size: 11px;
  border: none;
  background: none;
  color: var(--text-light, #6a737d);
  cursor: pointer;
}
.review-btn-dismiss:hover { color: #e74c3c; }

.review-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light, #6a737d);
}

/* ----- Gist 代码片段 ----- */
.gist-card {
  border: 1px solid var(--border-color, #e1e4e8);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--card-bg, #fff);
  transition: box-shadow 0.15s;
}
.gist-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.gist-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.gist-lang-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}

.gist-vis-tag {
  font-size: 11px;
  margin-left: 6px;
  color: var(--text-light, #6a737d);
}

.gist-file-count {
  font-size: 12px;
  color: var(--text-light, #6a737d);
}

.gist-action-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}
.gist-action-btn:hover { background: var(--bg-secondary, #f0f0f0); }

.gist-title {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.4;
}

.gist-files-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gist-file-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-secondary, #f6f8fa);
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
}

.gist-card-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-light, #6a737d);
}

.gist-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light, #6a737d);
}

.gists-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.gists-tab-bar { display: flex; gap: 4px; }

.gists-tab {
  padding: 6px 16px;
  border: 1px solid var(--border-color, #e1e4e8);
  border-radius: 6px;
  background: var(--card-bg, #fff);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.gists-tab:hover { background: var(--bg-secondary, #f6f8fa); }
.gists-tab.active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

.btn-create-gist {
  padding: 6px 16px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.btn-create-gist:hover { background: #059669; }

/* Gist 详情模态框 */
.gist-detail-modal { }

.gist-detail-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color, #e1e4e8);
}
.gist-detail-header h2 { margin: 0 0 6px; font-size: 18px; }
.gist-detail-meta { font-size: 12px; color: var(--text-light, #6a737d); margin: 0; }

.gist-file-block {
  margin-bottom: 16px;
  border: 1px solid var(--border-color, #e1e4e8);
  border-radius: 6px;
  overflow: hidden;
}

.gist-file-header {
  padding: 8px 12px;
  background: var(--bg-secondary, #f6f8fa);
  border-bottom: 1px solid var(--border-color, #e1e4e8);
  font-size: 13px;
  font-family: monospace;
}

.gist-file-content {
  margin: 0;
  padding: 12px;
  background: #1e1e2e;
  color: #cdd6f4;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

/* ----- 数据分析仪表板 ----- */
.dashboard-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.dashboard-metric-card {
  padding: 16px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e1e4e8);
  border-radius: 8px;
  text-align: center;
  transition: box-shadow 0.15s;
}
.dashboard-metric-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.dashboard-metric-icon { font-size: 28px; margin-bottom: 6px; }
.dashboard-metric-value { font-size: 26px; font-weight: 700; }
.dashboard-metric-label { font-size: 11px; color: var(--text-light, #6a737d); margin-top: 2px; }

.analytics-section {
  margin-bottom: 28px;
}

.section-title {
  margin: 0 0 14px;
  font-size: 16px;
  display: flex;
  align-items: center;
}

/* 热力图 */
.heatmap-container {
  overflow-x: auto;
  padding: 4px 0;
}

.heatmap-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.heatmap-block {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  background: #ebedf0;
  cursor: pointer;
  transition: transform 0.15s;
}
.heatmap-block:hover { transform: scale(1.3); }
.heatmap-1 { background: #9be9a8; }
.heatmap-2 { background: #40c463; }
.heatmap-3 { background: #30a14e; }
.heatmap-4 { background: #216e39; }

.heatmap-tip {
  position: fixed;
  background: #24292f;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  z-index: 1000;
}

/* 横向柱状图 */
.chart-bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}

.chart-bar-label {
  width: 80px;
  font-size: 12px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.chart-bar-track {
  flex: 1;
  height: 20px;
  background: var(--bg-secondary, #f6f8fa);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.chart-bar-value {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: #374151;
}

/* 两列布局 */
.analytics-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 768px) {
  .analytics-two-col { grid-template-columns: 1fr; }
}

.trend-table-wrapper {
  overflow-x: auto;
}

.trend-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.trend-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-secondary, #f6f8fa);
  border-bottom: 2px solid var(--border-color, #e1e4e8);
  font-weight: 600;
}
.trend-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-color, #e1e4e8);
}

/* 导出按钮 */
.export-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.export-btn {
  padding: 8px 14px;
  border: 1px solid var(--border-color, #e1e4e8);
  border-radius: 6px;
  background: var(--card-bg, #fff);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.export-btn:hover {
  background: var(--bg-secondary, #f6f8fa);
  border-color: #6366f1;
  color: #6366f1;
}

.export-repo-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ----- 留言板 ----- */
.msg-wall-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
}

.msg-wall-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color, #e1e4e8);
}

.msg-wall-header h2 { margin: 0 0 4px; }

.msg-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.msg-input-box {
  flex: 1;
  min-height: 60px;
  padding: 12px;
  border: 1px solid var(--border-color, #e1e4e8);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.15s;
}
.msg-input-box:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.msg-submit-btn {
  padding: 10px 24px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  align-self: flex-end;
  transition: background 0.15s;
}
.msg-submit-btn:hover { background: #4f46e5; }

.msg-card {
  border: 1px solid var(--border-color, #e1e4e8);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--card-bg, #fff);
  transition: box-shadow 0.15s;
}
.msg-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.msg-card.msg-mine { border-left: 3px solid #6366f1; }

.msg-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}
.msg-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #d0d7de;
  font-size: 20px;
}

.msg-user-info { flex: 1; }
.msg-user-info strong { font-size: 14px; }
.msg-username { font-size: 11px; color: var(--text-light, #6a737d); margin-left: 4px; }

.msg-time { font-size: 11px; color: var(--text-light, #6a737d); }

.msg-delete-btn {
  font-size: 14px;
  border: none;
  background: none;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.msg-delete-btn:hover { opacity: 1; }

.msg-card-body {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 10px;
  word-break: break-word;
}

.msg-card-actions {
  display: flex;
  gap: 12px;
}

.msg-action-btn {
  border: none;
  background: none;
  color: var(--text-light, #6a737d);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  transition: color 0.15s;
}
.msg-action-btn:hover { color: #6366f1; }

.msg-replies {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary, #f6f8fa);
  border-radius: 6px;
}

.msg-reply-item {
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color, #e1e4e8);
}
.msg-reply-item:last-child { border-bottom: none; }
.msg-reply-time { font-size: 11px; color: var(--text-light, #6a737d); margin-left: 6px; }

.msg-reply-box {
  margin-top: 12px;
}

.msg-reply-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color, #e1e4e8);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
.msg-reply-textarea:focus {
  outline: none;
  border-color: #6366f1;
}

.msg-reply-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
}
.btn-outline {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border-color, #e1e4e8);
  background: var(--card-bg, #fff);
}

.msg-wall-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light, #6a737d);
}

@media (max-width: 600px) {
  .msg-wall-container { padding: 12px; }
  .msg-input-row { flex-direction: column; }
  .msg-input-box { min-height: 80px; }
  .msg-submit-btn { align-self: stretch; }
}

/* ----- 分析页面整体容器 ----- */
.analytics-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
}

.analytics-error {
  text-align: center;
  padding: 40px;
}
