
:root {
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --bg-hover: #f5f5f5;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --text: #1a1a1a;
  --text-secondary: #525252;
  --text-muted: #8a8a8a;
  --accent: #111111;
  --accent-hover: #000000;
  --blue: #2563eb;
  --green: #16a34a;
  --orange: #ea580c;
  --red: #dc2626;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--mono);
}

.brand-logo {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-logo-sm {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text small {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.nav a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  transition: background 0.15s, color 0.15s;
}

.nav a:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav a.active {
  color: var(--text);
  font-weight: 600;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: #bdbdbd;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 500;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12.5px;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: transparent;
}

.btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  font-weight: 500;
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.input,
.select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.input::placeholder {
  color: #b0b0b0;
}

.select {
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #6b6b6b 50%),
    linear-gradient(135deg, #6b6b6b 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.captcha-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.captcha-row .input {
  flex: 1;
  min-width: 0;
}

.captcha-box {
  flex-shrink: 0;
  min-width: 116px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.captcha-box:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.captcha-box:disabled {
  cursor: default;
  opacity: 0.7;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.card-body {
  padding: 18px;
}

.card-body-flush {
  padding: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  white-space: nowrap;
}

.badge-solid {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.badge-ai {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  font-weight: 500;
}

.badge-gh {
  background: #f6f8fa;
  border-color: #d0d7de;
  color: #24292f;
}

.badge-gitee {
  background: #fef2f2;
  border-color: #fecaca;
  color: #c41e1e;
}

.badge-other {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #6d28d9;
}

.badge-web {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #0e7490;
}

.badge-hot {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.badge-new {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.badge-muted {
  color: var(--text-muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 11.5px;
  white-space: nowrap;
}

.tag:hover {
  background: var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  background: var(--bg-subtle);
}

.table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.table tbody tr:hover {
  background: var(--bg-subtle);
}

.table-wrap {
  overflow-x: auto;
}

.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.alert-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.alert-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.alert-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.alert-danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.alert-warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 0 8px;
  flex-wrap: wrap;
}

.pagination button {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.pagination button:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text);
}

.pagination button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .ellipsis {
  color: var(--text-muted);
  padding: 0 4px;
  user-select: none;
}

.empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
}

.empty-title {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.empty-desc {
  font-size: 13px;
}

.skeleton {
  background: linear-gradient(90deg, #f3f3f3 25%, #eaeaea 37%, #f3f3f3 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 20px 0;
}

.overlay-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 15, 0.4);
  z-index: 9000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.overlay-mask.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  width: min(580px, 100vw);
  max-width: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  z-index: 9001;
  transform: translateX(102%);
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  background: var(--bg);
}

.drawer-body {
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}

.drawer-close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.drawer-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(0.97);
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  z-index: 9002;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: var(--bg-subtle);
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .container,
  .container-wide,
  .site-header .inner {
    padding: 0 16px;
  }

  .site-header .inner {
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
  }

  .brand-text small {
    display: none;
  }
}

@media (max-width: 640px) {

  .drawer {
    width: 100vw;
    border-left: 0;
  }

  .captcha-box {
    min-width: 100px;
    font-size: 14px;
  }

  .drawer-head,
  .drawer-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .modal-body,
  .modal-head,
  .modal-foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal-foot {
    flex-direction: column-reverse;
  }

  .modal-foot .btn {
    width: 100%;
  }
}
