:root {
  --bg: #1e2433;
  --bg-card: #252a3a;
  --bg-hover: #2d3344;
  --fg: #ffffff;
  --fg-secondary: #8b95a5;
  --fg-muted: #6b7280;
  --border: #3d4555;
  --border-hover: #4d5565;
  --accent: #3b82f6;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

/* 现代细滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #3d4555;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4d5565;
}

/* Firefox 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: #3d4555 transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #1e2433;
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

.font-mono {
  font-family: ui-monospace, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* 输入框 - 深色 */
.geist-input {
  width: 100%;
  height: 36px;
  font-size: 13px;
  border-radius: 6px;
  padding: 0 12px;
  outline: none;
  background: #252a3a;
  border: 1px solid #3d4555;
  color: #fff;
  transition: border-color 0.15s;
}

.geist-input:focus {
  border-color: #3b82f6;
}

.geist-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.geist-input::placeholder {
  color: #6b7280;
}

textarea.geist-input {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}

select.geist-input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b95a5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select.geist-input:focus {
  border-color: #3b82f6;
}

select.geist-input option {
  background: #252a3a;
  color: #fff;
  padding: 10px 12px;
}

select.geist-input option:hover,
select.geist-input option:checked {
  background: #3b82f6;
  color: #fff;
}

/* 主按钮 - 蓝色 */
.geist-button {
  height: 36px;
  font-size: 13px;
  font-weight: 500;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.geist-button:hover {
  opacity: 0.85;
}

.geist-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 边框按钮 */
.geist-button-outline {
  height: 36px;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: #8b95a5;
  border: 1px solid #3d4555;
  border-radius: 6px;
  padding: 0 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s;
}

.geist-button-outline:hover {
  border-color: #4d5565;
  color: #fff;
}

.geist-button-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 危险按钮 */
.geist-button-danger {
  height: 36px;
  font-size: 13px;
  font-weight: 500;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.geist-button-danger:hover {
  opacity: 0.85;
}

.geist-button-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 卡片 */
.stat-card {
  background: #252a3a;
  border: 1px solid #3d4555;
  border-radius: 6px;
  padding: 16px;
  transition: border-color 0.15s;
}

.stat-card:hover {
  border-color: #4d5565;
}

.stat-value {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
}

.stat-label {
  font-size: 12px;
  color: #8b95a5;
  margin-top: 4px;
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.hidden {
  display: none;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
  background: #252a3a;
  border: 1px solid #3d4555;
  border-radius: 8px;
  padding: 20px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #8b95a5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: none;
  border: none;
}

.modal-close:hover {
  color: #fff;
  background: #2d3344;
}

.modal-label {
  font-size: 13px;
  font-weight: 500;
  color: #8b95a5;
  margin-bottom: 6px;
}

/* 标签 */
.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  background: #2d3344;
  color: #8b95a5;
  border: 1px solid #3d4555;
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
}

.badge-error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  background: #252a3a;
}

th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: #8b95a5;
  padding: 12px 16px;
  border-bottom: 1px solid #3d4555;
  background: #252a3a;
}

td {
  font-size: 13px;
  color: #8b95a5;
  padding: 12px 16px;
  border-bottom: 1px solid #3d4555;
  background: #252a3a;
}

tr:hover td {
  background: #2d3344;
}

/* 复选框 */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
  cursor: pointer;
}

/* 密码输入框（隐藏文字） */
.secret-input {
  -webkit-text-security: disc;
}

/* 页面头部 - 桌面端适配 */
.page-header {
  padding: 0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.page-desc {
  font-size: 13px;
  color: #8b95a5;
  margin: 4px 0 0 0;
}

.page-header .page-actions {
  margin-top: 0;
}

@media (max-width: 768px) {
  .modal-content {
    max-height: calc(100dvh - 32px);
    padding: 16px;
  }
}
