/* Proxy Panel — design.md 2026-09-30 · 深色工程控制台 */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  --bg: #0B0E14;
  --surface: #121722;
  --surface-2: #1A2130;
  --border: #232B3B;
  --text: #E6EBF4;
  --text-2: #8B95A7;
  --accent: #4F8CFF;
  --success: #3FB68B;
  --warning: #E5B454;
  --danger: #E5644E;
  --focus-ring: rgba(79, 140, 255, .45);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
}

h1, h2, h3 { margin: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

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

/* ---------- 头部 ---------- */
.pp-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.pp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.pp-brand { display: flex; align-items: baseline; gap: 12px; }

.pp-brand h1 { font-size: 20px; font-weight: 600; }

.pp-domain { color: var(--text-2); font-size: 12px; }

.pp-header-meta { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 12px; }

/* ---------- 横幅 ---------- */
.banner {
  padding: 10px 24px;
  font-size: 13px;
}

.banner-danger {
  background: color-mix(in srgb, var(--danger) 14%, var(--bg));
  color: var(--danger);
  border-bottom: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
}

/* ---------- 统计区 ---------- */
main { display: flex; flex-direction: column; gap: 24px; padding-top: 24px; padding-bottom: 48px; }

.pp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}

.stat-label { color: var(--text-2); font-size: 12px; }

.stat-value {
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

.stat-sub { color: var(--text-2); font-size: 12px; margin-top: 2px; }

/* ---------- 生成区 ---------- */
.pp-gen-card { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }

.pp-gen-title { font-size: 14px; font-weight: 600; }

.pp-gen-desc { color: var(--text-2); font-size: 12px; margin: 4px 0 0; }

.pp-gen-form { display: flex; align-items: flex-end; gap: 12px; flex-shrink: 0; }

.pp-field { display: flex; flex-direction: column; gap: 4px; }

.pp-field-label { color: var(--text-2); font-size: 12px; }

/* ---------- 工具栏与表格 ---------- */
.pp-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

.pp-search { width: 260px; }

.pp-toolbar-actions { display: flex; gap: 8px; }

.pp-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table th, .data-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  top: 0;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 400;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover { background: var(--surface-2); }

.data-table td.num, .data-table th.num { text-align: right; }

/* ---------- 组件 ---------- */
.btn {
  appearance: none;
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, opacity .15s;
}

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

.btn-primary { background: var(--accent); color: #fff; }

.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 85%, #fff); }

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

.btn-ghost:hover:not(:disabled) { border-color: var(--text-2); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
}

.btn-danger:hover:not(:disabled) { border-color: var(--danger); }

.btn-sm { padding: 5px 10px; font-size: 12px; }

.input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 12px;
  width: 100%;
}

.input:focus { outline: 2px solid var(--focus-ring); outline-offset: 0; border-color: var(--accent); }

.badge {
  display: inline-block;
  border-radius: 999px;
  font-size: 12px;
  padding: 1px 10px;
}

.badge-success { color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 45%, transparent); }

.badge-muted { color: var(--text-2); border: 1px solid var(--border); }

.pw-mask { color: var(--text-2); letter-spacing: 1px; }

.pp-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- 骨架 / 空态 ---------- */
.skeleton-row { height: 44px; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 14px; gap: 24px; }

.skeleton-row:last-child { border-bottom: none; }

.skeleton {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: pp-shimmer 1.4s infinite linear;
}

@keyframes pp-shimmer { to { background-position: -200% 0; } }

.pp-empty { padding: 40px 20px; text-align: center; color: var(--text-2); }

.pp-empty-title { color: var(--text); font-size: 14px; font-weight: 600; margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  .btn { transition: none; }
}

/* ---------- 对话框 ---------- */
.dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  width: min(400px, calc(100vw - 32px));
}

.dialog::backdrop { background: rgba(4, 6, 10, .6); }

.dialog-form { display: flex; flex-direction: column; gap: 12px; }

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

/* ---------- 浮层提示 ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 9px 16px;
  z-index: 10;
}

/* ---------- 页脚 ---------- */
.pp-footer {
  color: var(--text-2);
  font-size: 12px;
  padding-top: 16px;
  padding-bottom: 32px;
  border-top: 1px solid var(--border);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .pp-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .container { padding: 0 16px; }
  .pp-gen-card { flex-direction: column; align-items: stretch; }
  .pp-gen-form { width: 100%; }
  .pp-toolbar { flex-direction: column; align-items: stretch; }
  .pp-search { width: 100%; }
  .pp-toolbar-actions { justify-content: flex-end; }
}

@media (max-width: 560px) {
  .pp-stats { grid-template-columns: 1fr; }
  .pp-domain { display: none; }
}
