/* 蓝云直链 —— 浅色主题。语义化类都集中在这里，页面只写结构。 */
:root {
  color-scheme: light;
  --line: #e6e9ef;
  --line-soft: #eef1f5;
  --ink: #0f172a;
  --muted: #64748b;
  --brand: #3b82f6;
}

html, body { height: 100%; }
body { background: #f7f8fa; }

/* ---------------- 卡片 ---------------- */
.card, .glass {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.card-flat, .glass-soft {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}
.card-hd {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 12px;          /* 手机端标题/按钮自动换行，不再互相挤压 */
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
}
.card-hd > h2, .card-hd > :first-child { min-width: 0; }
.card-bd { padding: 18px; }
.card-hover { transition: border-color .15s, box-shadow .15s; }
.card-hover:hover { border-color: #bfdbfe; box-shadow: 0 6px 20px rgba(16, 24, 40, .07); }

/* ---------------- 表单 ---------------- */
.input {
  width: 100%; padding: 10px 12px; font-size: 14px; color: var(--ink);
  background: #fff; border: 1px solid #d7dce4; border-radius: 10px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #a3adbb; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59, 130, 246, .12); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; font-size: 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost { background: #fff; border-color: #d7dce4; color: #475569; }
.btn-ghost:hover { border-color: #b9c2ce; color: var(--ink); }
.btn-xs { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-danger { background: #e11d48; color: #fff; border-color: #e11d48; }
.btn-danger:hover { background: #be123c; }

.seg { padding: 5px 12px; font-size: 13px; border-radius: 8px; cursor: pointer;
       color: var(--muted); background: transparent; border: 1px solid transparent; }
.seg-on { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }

.muted { color: var(--muted); }
.link-plain { color: #2563eb; text-decoration: none; }
.link-plain:hover { text-decoration: underline; }
a { color: inherit; }

.grad-text {
  background: linear-gradient(92deg, #0f172a 0%, #2563eb 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------------- 状态点 / 徽章 ---------------- */
.dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; }
.dot-ok { background: #10b981; }
.dot-err { background: #ef4444; }
.dot-pending { background: #f59e0b; animation: blink 1.1s infinite; }
.dot-off { background: #94a3b8; }
@keyframes blink { 0%, 100% { opacity: 1 } 50% { opacity: .25 } }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px;
  border-radius: 999px; font-size: 11px; line-height: 18px; border: 1px solid transparent; white-space: nowrap;
}
.badge-ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge-err { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge-wait { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge-off { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

/* ---------------- 表格 ---------------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 500; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fbfcfd;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr:hover { background: #f9fbfd; }

/* ---------------- 柱状图 ---------------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 60px; }
.bars > div { flex: 1; min-height: 2px; border-radius: 3px 3px 1px 1px;
              background: linear-gradient(180deg, #93c5fd, #3b82f6); }
.bars > div.zero { background: #eef1f5; }

/* ---------------- 代码块 ---------------- */
pre.code, code.inline {
  background: #f8fafc; border: 1px solid var(--line-soft); border-radius: 10px;
  color: #334155; font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
pre.code { padding: 13px; overflow: auto; font-size: 12.5px; line-height: 1.65; }
code.inline { padding: 1px 5px; font-size: 12px; }

/* ---------------- 提示条 ---------------- */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 200px; max-width: 360px; padding: 11px 13px; border-radius: 10px; font-size: 13px;
  background: #fff; color: #334155; border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .10); animation: toast-in .16s ease-out;
}
.toast-ok { border-color: #a7f3d0; }
.toast-err { border-color: #fecaca; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }

/* ---------------- 其它 ---------------- */
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.skeleton { background: linear-gradient(90deg, #f1f5f9 25%, #e8edf3 37%, #f1f5f9 63%);
            background-size: 400% 100%; animation: sk 1.4s ease infinite; }
@keyframes sk { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d7dce4; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b9c2ce; background-clip: content-box; }

/* 3D 地球容器：浅浅的底色，让点阵地球看得清 */
.globe-panel { background: linear-gradient(180deg, #fbfdff 0%, #eef3f9 100%); }
#globe-canvas { display: block; touch-action: none; }

.divide-line > * + * { border-top: 1px solid var(--line-soft); }

/* ---------------- 文件库 ---------------- */
.lib-ck { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; flex: none; }
.lib-ck:disabled { opacity: .4; }
.lib-row { transition: background .12s; }
.lib-row .lib-menu { min-width: 9rem; }
