/* ==== base.css：变量 / 重置 / 通用组件（按钮、表格、表单、徽章、toast、导入块） ==== */
:root {
  --primary: #2563eb;
  --danger: #dc2626;
  --success: #16a34a;
  --warn: #ea580c;
  --bg: #f5f5f5;
  --card: #fff;
  --border: #ddd;
  --text: #333;
  --muted: #6b7280;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
[x-cloak] { display: none !important; }

.btn { display: inline-block; min-height: 36px; padding: 8px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; border: none; background: #ddd; }
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-warn { background: var(--warn); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); opacity: 1; }
.btn-sm { min-height: 30px; padding: 5px 10px; font-size: 12px; }

.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.table th, .table td { padding: 10px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid #eee; vertical-align: middle; }
.table th { background: #fafafa; font-weight: 600; color: #555; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.running { background: var(--success); }
.status-dot.stopped { background: #9ca3af; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.tag-ok { background: #dcfce7; color: var(--success); }
.tag-err { background: #fef2f2; color: var(--danger); }

.empty { text-align: center; padding: 48px; color: #999; }
.empty-td { text-align: center; color: #999; }

.form-card { background: var(--card); border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.06); padding: 24px; max-width: 700px; margin: 0 auto; }
.form-card.wide { max-width: 860px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 4px; }
.form-group input, .form-group select { width: 100%; padding: 9px 12px; min-height: 40px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.form-group textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: monospace; min-height: 60px; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 120px; }
.form-actions { display: flex; gap: 8px; margin-top: 20px; }
.header-row { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.header-row .form-group { flex: 1; margin-bottom: 0; }
.header-row button { flex-shrink: 0; margin-bottom: 2px; }

.logs { background: #1e1e1e; color: #d4d4d4; border-radius: 8px; padding: 16px; font-family: monospace; font-size: 12px; max-height: 500px; overflow-y: auto; white-space: pre-wrap; }
.log-entry { padding: 2px 0; border-bottom: 1px solid #333; }
.log-entry .ts { color: #6a9955; }
.log-entry .ok { color: #4ec9b0; }
.log-entry .err { color: #f44747; }

.toast { position: fixed; top: 16px; right: 16px; background: #333; color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 13px; z-index: 100; opacity: 0; transition: opacity .3s; }
.toast.show { opacity: 1; }

.import-block { background: #eef2ff; border: 1px dashed #a5b4fc; border-radius: 8px; padding: 16px; margin-bottom: 20px; }
.import-block h3 { font-size: 14px; margin-bottom: 6px; color: #4338ca; }
.import-block p { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.import-block textarea { width: 100%; min-height: 90px; padding: 8px 12px; border: 1px solid #c7d2fe; border-radius: 6px; font-family: monospace; font-size: 12px; }
.import-block .row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.import-err { color: var(--danger); font-size: 12px; margin-top: 6px; white-space: pre-wrap; }

.method-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; background: #eef2ff; color: #4338ca; }
.method-badge.post { background: #fef2f2; color: var(--danger); }
.op-badge-confirm { display: inline-block; background: #ffedd5; color: var(--warn); font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: 600; }

/* 小工具类 */
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.inline { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.w-90 { width: 90px; }
.mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; }
