/* ==================== 公共样式 - Modal、Dropdown、排序控制 ==================== */

/* ==================== Bind Key Modal ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #24292f;
}

.modal-desc {
  font-size: 14px;
  color: #57606a;
  margin-bottom: 16px;
}

.modal-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  margin-bottom: 16px;
}

.modal-input:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.12);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.modal-error {
  color: #cf222e;
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}

.modal-error.show {
  display: block;
}

/* ==================== Dropdown Styles ==================== */
.sort-dropdown {
  position: relative;
}

.sort-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: #24292f;
  background-color: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s cubic-bezier(0.3, 0, 0.5, 1);
  appearance: none;
  user-select: none;
}

.sort-trigger:hover {
  background-color: #f3f4f6;
  border-color: #c5cad0;
}

.sort-trigger:active {
  background-color: #ebecf0;
  border-color: #c5cad0;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 100;
  width: 300px;
  margin-top: 4px;
  background-color: #ffffff;
  background-clip: padding-box;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(140, 149, 159, 0.2);
  display: none;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-header {
  padding: 8px 16px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #57606a;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 8px 16px 8px 16px;
  font-size: 14px;
  color: #24292f;
  text-decoration: none;
  background-color: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.dropdown-item:hover {
  background-color: #0969da;
  color: #ffffff;
  text-decoration: none;
}

.dropdown-item .check-icon {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  visibility: hidden;
  flex-shrink: 0;
}

.dropdown-item.selected .check-icon {
  visibility: visible;
}

.dropdown-divider {
  height: 1px;
  margin: 8px 0;
  background-color: #d0d7de;
  border: 0;
}

/* Close overlay for clicking outside */
.dropdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  display: none;
  background: transparent;
}

.dropdown-overlay.show {
  display: block;
}

/* ==================== Sort Bar ==================== */
.sort-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}

.sort-bar .sort-info {
  font-size: 14px;
  color: #57606a;
}

.sort-bar .sort-info strong {
  color: #24292f;
}

/* ==================== Me 页面特有样式 ==================== */
.key-section {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  margin-bottom: 16px;
  overflow: hidden;
}

.key-section:hover {
  border-color: #0969da;
}

.key-card {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eaeef2;
}

.key-stats {
  padding: 16px;
  background: #f6f8fa;
}

.key-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.key-value {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 14px;
  color: #24292f;
}

.key-meta {
  font-size: 12px;
  color: #57606a;
}

.key-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.toggle-public {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  border: 1px solid #d0d7de;
  background: #f6f8fa;
  transition: all 0.15s ease;
}

.toggle-public:hover {
  background: #f3f4f6;
}

.toggle-public.public {
  background: #dafbe1;
  border-color: #4ac26b;
  color: #1a7f37;
}

.unbind-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #cf222e;
  border: 1px solid #d0d7de;
  background: #ffffff;
  cursor: pointer;
}

.unbind-btn:hover {
  background: #ffebe9;
  border-color: #cf222e;
}

.no-keys-message {
  text-align: center;
  padding: 48px 24px;
  background: #f6f8fa;
  border-radius: 6px;
  border: 1px dashed #d0d7de;
}

.no-keys-message h3 {
  margin-bottom: 12px;
  color: #24292f;
}

.no-keys-message p {
  color: #57606a;
  margin-bottom: 16px;
}


