* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  padding: 2rem;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
}

nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

nav a {
  color: #58a6ff;
  text-decoration: none;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
}

nav a:hover,
nav a.active {
  background: #1c2128;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: #58a6ff;
}

.subtitle {
  color: #8b949e;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.meta {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: #8b949e;
  flex-wrap: wrap;
}

.meta span {
  background: #161b22;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #161b22;
  border-radius: 8px;
  overflow: hidden;
}

th {
  background: #21262d;
  padding: 0.8rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #8b949e;
}

td {
  padding: 0.6rem 1rem;
  border-top: 1px solid #21262d;
  font-size: 0.9rem;
  vertical-align: middle;
}

tr:hover {
  background: #1c2128;
}

code {
  background: #0d1117;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.82rem;
  color: #79c0ff;
}

.key-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.key-masked {
  font-family: 'Consolas', 'Courier New', monospace;
  letter-spacing: 0.8px;
  color: #484f58;
  user-select: none;
}

.btn {
  border: 1px solid #30363d;
  background: #21262d;
  color: #c9d1d9;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn:hover {
  background: #30363d;
  border-color: #8b949e;
}

.btn-copy:active {
  background: #238636;
  border-color: #3fb950;
}

.btn-primary {
  background: #238636;
  border-color: #238636;
}

.btn-primary:hover {
  background: #2ea043;
  border-color: #3fb950;
}

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

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

.badge-ok {
  background: #1a3a2a;
  color: #3fb950;
  padding: 0.3rem 0.7rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-warn {
  background: #3d2e00;
  color: #d29922;
  padding: 0.3rem 0.7rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-err {
  background: #3d1a1a;
  color: #f85149;
  padding: 0.3rem 0.7rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-pending {
  background: #1c2128;
  color: #8b949e;
  padding: 0.3rem 0.7rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.key-name {
  font-weight: 600;
  color: #e6edf3;
  white-space: nowrap;
}

.region {
  text-transform: uppercase;
  font-weight: 600;
}

.http-code {
  color: #8b949e;
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #238636;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 999;
}

.toast.show {
  opacity: 1;
}

.usage {
  margin-top: 1.5rem;
  background: #161b22;
  padding: 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.usage h3 {
  color: #58a6ff;
  margin-bottom: 0.5rem;
}

.usage code {
  color: #79c0ff;
}

pre {
  background: #0d1117;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.5rem 0;
}

pre code {
  background: none;
  padding: 0;
}

.note {
  background: #1c2128;
  border-left: 3px solid #58a6ff;
  padding: 0.8rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
  color: #8b949e;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.3rem;
  color: #8b949e;
  font-size: 0.85rem;
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  width: 100%;
  max-width: 500px;
  padding: 0.6rem 0.8rem;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #c9d1d9;
  font-size: 0.9rem;
  font-family: 'Consolas', 'Courier New', monospace;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #58a6ff;
}

.form-group .hint {
  font-size: 0.75rem;
  color: #484f58;
  margin-top: 0.25rem;
}

.card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 550px;
}

.card h2 {
  color: #58a6ff;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.result-box {
  background: #0d1117;
  border: 1px solid #238636;
  border-radius: 8px;
  padding: 1.2rem;
  margin-top: 1.5rem;
  max-width: 550px;
}

.result-box h3 {
  color: #3fb950;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.result-box .url-display {
  color: #79c0ff;
  word-break: break-all;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.result-box .token-display {
  color: #d29922;
  font-family: 'Consolas', monospace;
  font-size: 0.8rem;
}

.status-display {
  margin-top: 1rem;
}

.error-msg {
  background: #3d1a1a;
  border: 1px solid #f85149;
  color: #f85149;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.loading {
  color: #8b949e;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.footer {
  margin-top: 2rem;
  text-align: center;
  color: #484f58;
  font-size: 0.8rem;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: #484f58;
}

.empty-state p {
  font-size: 1rem;
}

/* Admin */
.admin-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.source-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  text-transform: uppercase;
  font-weight: 600;
}

.source-builtin {
  background: #1c2128;
  color: #8b949e;
}

.source-submitted {
  background: #1a2a3a;
  color: #58a6ff;
}

.gate-card {
  max-width: 450px;
  margin: 4rem auto;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
}

.gate-card h2 {
  color: #f85149;
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
}

.gate-card p {
  color: #8b949e;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.gate-card input {
  text-align: center;
  max-width: 250px;
}

.toggle-filter {
  background: #161b22;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #8b949e;
  cursor: pointer;
  user-select: none;
}

.toggle-filter input {
  accent-color: #58a6ff;
}

.tab-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab-btn {
  border: 1px solid #30363d;
  background: #161b22;
  color: #8b949e;
  padding: 0.4rem 1.2rem;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  border-bottom: none;
}

.tab-btn:hover {
  background: #1c2128;
  color: #c9d1d9;
}

.tab-btn.active {
  background: #21262d;
  color: #58a6ff;
  border-color: #30363d;
}
