/* ========== Gitee Widgets 样式 ========== */

/* --- Watch/Star/Follow 按钮 --- */
.gw-btn-watch, .gw-btn-star, .gw-btn-follow,
.btn-watch, .btn-star {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border: 1px solid var(--border, #d1d5db);
  border-radius: 6px; background: var(--bg-card, #fff);
  color: var(--text, #333); font-size: 12px; cursor: pointer;
  transition: all .2s; white-space: nowrap;
  text-decoration: none; /* 避免 a 标签下划线 */
}
.gw-btn-watch:hover, .gw-btn-star:hover, .gw-btn-follow:hover,
.btn-watch:hover, .btn-star:hover {
  background: var(--accent-bg, #f0f5ff); border-color: var(--accent, #0071E3);
}
.gw-btn-watch.gw-active, .gw-btn-watch.active,
.gw-btn-star.gw-active, .gw-btn-star.active,
.gw-btn-follow.gw-active, .gw-btn-follow.active {
  background: var(--accent, #0071E3); color: #fff; border-color: var(--accent, #0071E3);
}
.gw-btn-watch:disabled, .gw-btn-star:disabled, .gw-btn-follow:disabled,
.btn-watch:disabled, .btn-star:disabled {
  opacity: .5; cursor: not-allowed;
}
.gw-widget-row {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px;
}

/* --- 通知面板 Gitee 标签 --- */
.gw-notif-tabs {
  display: flex; border-bottom: 1px solid var(--border, #e5e7eb);
  padding: 0 12px; gap: 0;
}
.gw-notif-tab {
  flex: 0 0 auto; padding: 8px 16px; border: none; border-bottom: 2px solid transparent;
  background: none; cursor: pointer; font-size: 12px; color: var(--text-muted, #666);
  transition: all .2s; display: flex; align-items: center; gap: 4px;
}
.gw-notif-tab:hover { color: var(--text, #333); }
.gw-notif-tab.active { color: var(--accent, #0071E3); border-bottom-color: var(--accent, #0071E3); font-weight: 600; }
.gw-notif-gitee-badge {
  position: absolute; top: -2px; right: -8px;
  background: #28a745; color: #fff; font-size: 10px; line-height: 1;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* --- 活动流 Gitee 事件 --- */
.gw-event-source {
  font-size: 10px; background: #28a74515; color: #28a745;
  padding: 1px 5px; border-radius: 4px; font-weight: 600;
  margin-left: 4px;
}

/* --- Issue/PR 详情模态框 --- */
.gip-modal-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); z-index: 99998;
  display: flex; align-items: center; justify-content: center;
}
.gip-modal {
  background: var(--bg-card, #fff); border-radius: 12px; width: 90%; max-width: 800px;
  max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.2); overflow: hidden;
}
.gip-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border, #e5e7eb);
}
.gip-modal-title { font-size: 18px; font-weight: 600; flex: 1; }
.gip-modal-close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--text-muted, #999); padding: 0 8px;
}
.gip-modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.gip-modal-body h1,.gip-modal-body h2,.gip-modal-body h3{
  font-size: 16px; margin: 12px 0 6px;
}
.gip-modal-body pre { background: var(--code-bg, #f5f5f5); padding: 12px; border-radius: 6px; overflow-x: auto; }
.gip-modal-body code { font-family: monospace; font-size: 13px; }
.gip-modal-body img { max-width: 100%; border-radius: 6px; }
.gip-meta-row {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  font-size: 13px; color: var(--text-muted, #888); margin-bottom: 16px;
}
.gip-meta-row .gip-state { padding: 2px 10px; border-radius: 12px; font-weight: 600; font-size: 11px; }
.gip-state-open { background: #28a74520; color: #28a745; }
.gip-state-closed { background: #dc354520; color: #dc3545; }
.gip-state-merged { background: #8250df20; color: #8250df; }
.gip-label { padding: 2px 8px; border-radius: 12px; font-size: 11px; }
.gip-comment-list { margin-top: 20px; }
.gip-comment {
  border: 1px solid var(--border, #e5e7eb); border-radius: 8px;
  padding: 12px 16px; margin-bottom: 12px;
}
.gip-comment-header { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 8px; }
.gip-comment-avatar { width: 28px; height: 28px; border-radius: 50%; }
.gip-comment-user { font-weight: 600; }
.gip-comment-time { color: var(--text-muted, #999); font-size: 11px; }
.gip-comment-body { font-size: 14px; line-height: 1.6; }

/* --- 搜索结果 Gitee 卡片 --- */
.gw-search-section { margin-top: 16px; }
.gw-search-section h4 {
  font-size: 14px; font-weight: 600; margin-bottom: 8px;
  color: #28a745; display: flex; align-items: center; gap: 6px;
}
.gw-search-cards { display: flex; flex-direction: column; gap: 8px; }
.gw-search-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px; cursor: pointer; transition: all .2s;
}
.gw-search-card:hover { background: var(--accent-bg, #f0f5ff); border-color: var(--accent, #0071E3); }
.gw-search-card-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.gw-search-card-avatar-placeholder {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-bg, #e8f0fe); color: var(--accent, #0071E3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.gw-search-card-info { flex: 1; min-width: 0; }
.gw-search-card-name { font-weight: 600; font-size: 14px; }
.gw-search-card-desc { font-size: 12px; color: var(--text-muted, #777); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gw-search-card-stats { font-size: 11px; color: var(--text-muted, #999); margin-top: 2px; display: flex; gap: 10px; }
.gw-search-card-actions { flex-shrink: 0; }

/* --- Webhooks 管理 --- */
.gw-webhook-empty {
  text-align: center; padding: 40px 20px; color: var(--text-muted, #999);
}
.gw-webhook-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px; font-size: 13px; color: var(--text-muted, #777);
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.gw-webhook-list { padding: 0; }
.gw-webhook-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px 20px; border-bottom: 1px solid var(--border, #e5e7eb);
  transition: background .15s;
}
.gw-webhook-item:hover { background: var(--accent-bg, #f8faff); }
.gw-webhook-item.gw-disabled { opacity: .5; }
.gw-webhook-info { flex: 1; min-width: 0; }
.gw-webhook-url {
  font-size: 13px; font-weight: 600; word-break: break-all;
  color: var(--accent, #0071E3); margin-bottom: 4px;
}
.gw-webhook-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted, #999); flex-wrap: wrap; }
.gw-webhook-events { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.gw-webhook-actions { display: flex; gap: 4px; flex-shrink: 0; }
.gw-webhook-actions button {
  background: none; border: 1px solid var(--border, #ddd); border-radius: 4px;
  padding: 4px 8px; cursor: pointer; font-size: 14px; transition: all .15s;
}
.gw-webhook-actions button:hover { background: var(--accent-bg, #f0f5ff); border-color: var(--accent, #0071E3); }

.gw-badge-active { color: #28a745; font-weight: 600; }
.gw-badge-inactive { color: var(--text-muted, #999); }
.gw-tag {
  display: inline-block; padding: 1px 6px; font-size: 10px; border-radius: 4px;
  background: var(--accent-bg, #e8f0fe); color: var(--accent, #0071E3);
}

/* --- 表单 --- */
.gw-form-container { padding: 20px; max-width: 520px; }
.gw-form-container h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.gw-form-group { margin-bottom: 14px; }
.gw-form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text, #333); }
.gw-form-group input[type="text"],
.gw-form-group input[type="url"],
.gw-form-group input[type="date"],
.gw-form-group textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border, #d1d5db);
  border-radius: 6px; font-size: 14px; background: var(--bg, #fff);
  color: var(--text, #333); box-sizing: border-box;
}
.gw-form-group textarea { resize: vertical; }
.gw-form-group input:focus, .gw-form-group textarea:focus {
  outline: none; border-color: var(--accent, #0071E3); box-shadow: 0 0 0 3px rgba(0,113,227,.1);
}
.gw-check-group { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.gw-check-group label { 
  display: inline-flex; align-items: center; gap: 4px; font-weight: 400; font-size: 13px;
  cursor: pointer; 
}
.gw-form-actions { display: flex; gap: 8px; margin-top: 20px; }
.gw-btn-primary {
  padding: 8px 20px; border: none; border-radius: 6px; background: var(--accent, #0071E3);
  color: #fff; cursor: pointer; font-size: 14px; font-weight: 600; transition: all .2s;
}
.gw-btn-primary:hover { filter: brightness(1.1); }
.gw-btn-cancel {
  padding: 8px 20px; border: 1px solid var(--border, #d1d5db); border-radius: 6px;
  background: var(--bg, #fff); color: var(--text, #333); cursor: pointer; font-size: 14px;
  transition: all .2s;
}
.gw-btn-cancel:hover { background: var(--accent-bg, #f0f5ff); }

.gw-btn-edit, .gw-btn-del {
  background: none; border: 1px solid var(--border, #ddd); border-radius: 4px;
  padding: 2px 6px; cursor: pointer; font-size: 13px;
}
.gw-btn-edit:hover { background: var(--accent-bg, #f0f5ff); border-color: var(--accent, #0071E3); }
.gw-btn-del:hover { background: #fee; border-color: #dc3545; }

/* --- 标签管理 --- */
.gw-label-list { padding: 0; }
.gw-label-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.gw-label-item:hover { background: var(--accent-bg, #f8faff); }
.gw-label-chip {
  display: inline-block; padding: 3px 12px; border-radius: 16px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.gw-label-desc { font-size: 12px; color: var(--text-muted, #888); flex: 1; }
.gw-label-actions { display: flex; gap: 4px; }

/* --- 里程碑管理 --- */
.gw-milestone-list { padding: 0; }
.gw-milestone-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px 20px; border-bottom: 1px solid var(--border, #e5e7eb);
  transition: background .15s;
}
.gw-milestone-item:hover { background: var(--accent-bg, #f8faff); }
.gw-milestone-item.gw-closed { opacity: .5; }
.gw-milestone-info { flex: 1; min-width: 0; }
.gw-milestone-title { font-size: 15px; font-weight: 600; }
.gw-milestone-desc { font-size: 13px; color: var(--text-muted, #777); margin: 4px 0; }
.gw-milestone-meta { display: flex; gap: 10px; align-items: center; font-size: 11px; color: var(--text-muted, #999); flex-wrap: wrap; margin-top: 6px; }
.gw-milestone-actions { display: flex; gap: 4px; flex-shrink: 0; }
.gw-milestone-actions button {
  background: none; border: 1px solid var(--border, #ddd); border-radius: 4px;
  padding: 4px 8px; cursor: pointer; font-size: 13px; transition: all .15s;
}
.gw-milestone-actions button:hover { background: var(--accent-bg, #f0f5ff); border-color: var(--accent, #0071E3); }

.gw-progress-bar {
  width: 120px; height: 6px; background: var(--border, #e5e7eb);
  border-radius: 3px; overflow: hidden;
}
.gw-progress-fill { height: 100%; background: var(--accent, #28a745); border-radius: 3px; transition: width .3s; }

/* --- Gitee 用户社交卡片 --- */
.gw-user-list { display: flex; flex-direction: column; gap: 8px; padding: 12px 20px; }
.gw-user-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px; transition: all .2s;
}
.gw-user-card:hover { background: var(--accent-bg, #f0f5ff); border-color: var(--accent, #0071E3); }
.gw-user-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.gw-user-avatar-placeholder {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-bg, #e8f0fe); color: var(--accent, #0071E3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
}
.gw-user-card-info { flex: 1; min-width: 0; }
.gw-user-card-name { font-weight: 600; font-size: 14px; }
.gw-user-card-login { font-size: 12px; color: var(--text-muted, #999); }
.gw-user-card-bio { font-size: 12px; color: var(--text-muted, #777); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gw-user-card-actions { flex-shrink: 0; }
.gw-follow-btn {
  padding: 4px 14px; border: 1px solid var(--border, #d1d5db);
  border-radius: 6px; background: var(--bg, #fff); color: var(--text, #333);
  font-size: 12px; cursor: pointer; transition: all .2s;
}
.gw-follow-btn:hover { background: var(--accent-bg, #f0f5ff); border-color: var(--accent, #0071E3); }

/* --- Issue 列表 hover 提示 --- */
.repo-issue[data-issue-number] { cursor: pointer; }

/* --- 搜索结果公共 --- */
.loading-block { text-align: center; padding: 40px 20px; color: var(--text-muted, #999); }
.loading-block .spinner {
  width: 32px; height: 32px; border: 3px solid var(--border, #e5e7eb);
  border-top-color: var(--accent, #0071E3); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 0 auto 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-block { text-align: center; padding: 40px 20px; color: var(--text-muted, #999); font-size: 14px; }
