/* ============================================================
   云充站 · 设计系统
   ============================================================ */
:root {
  --bg: #06070d;
  --bg-2: #0a0c15;
  --surface: #11131f;
  --surface-2: #171a29;
  --surface-3: #1e2233;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #eef0f7;
  --text-2: #a5abc2;
  --text-3: #6d7288;
  --brand: #6d5efc;
  --brand-2: #22d3ee;
  --brand-soft: rgba(109, 94, 252, 0.14);
  --gold: #f5c451;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #f43f5e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(109, 94, 252, 0.22), transparent 62%),
    radial-gradient(760px 460px at 92% 4%, rgba(34, 211, 238, 0.13), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; outline: none; }
img { display: block; max-width: 100%; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #2a2f45; border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: #39405c; }
::-webkit-scrollbar-track { background: transparent; }

.container { width: 100%; max-width: 1220px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.hide { display: none !important; }
.muted { color: var(--text-3); }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: blur(18px);
  background: rgba(6, 7, 13, 0.82);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { height: 66px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 17px; letter-spacing: 0.2px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-size: 17px; box-shadow: 0 6px 20px rgba(109, 94, 252, 0.45);
}
.brand small { display: block; font-size: 11px; font-weight: 400; color: var(--text-3); letter-spacing: 0.4px; }
.nav { display: flex; gap: 4px; margin-left: 6px; }
.nav a {
  padding: 8px 14px; border-radius: 9px; color: var(--text-2); font-size: 14px; transition: 0.18s;
}
.nav a:hover, .nav a.on { color: #fff; background: var(--surface-2); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); cursor: pointer;
  font-size: 14px; font-weight: 500; transition: 0.18s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: rgba(255, 255, 255, 0.22); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #8b7cff);
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 8px 24px rgba(109, 94, 252, 0.34);
}
.btn-primary:hover { background: linear-gradient(135deg, #7a6cff, #9b8dff); }
.btn-gold { background: linear-gradient(135deg, #f5c451, #e0a92e); border-color: transparent; color: #2a1f00; font-weight: 700; }
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(244, 63, 94, 0.14); border-color: rgba(244, 63, 94, 0.35); color: #ff8598; }
.btn-danger:hover { background: rgba(244, 63, 94, 0.22); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-xs { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 14px 26px; font-size: 15.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ---------------- 通用卡片 ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.card-tight { padding: 16px; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 8px; font-weight: 500; }
.field > label .req { color: var(--danger); margin-left: 3px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px; background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font-size: 14px; transition: 0.18s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface); }
.input::placeholder, .textarea::placeholder { color: #565b70; }
.textarea { resize: vertical; min-height: 70px; line-height: 1.6; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.hint { font-size: 12.5px; color: var(--text-3); margin-top: 7px; line-height: 1.6; }
.hint-warn { color: var(--warn); }
.err { font-size: 12.5px; color: #ff8598; margin-top: 7px; }

/* ---------------- 徽标 / 标签 ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; background: var(--surface-3);
  color: var(--text-2); border: 1px solid var(--line);
  white-space: nowrap; line-height: 1.5;
}
.chip-brand { background: var(--brand-soft); color: #b3a9ff; border-color: rgba(109, 94, 252, 0.3); }
.chip-ok { background: rgba(34, 197, 94, 0.13); color: #6ee7a0; border-color: rgba(34, 197, 94, 0.28); }
.chip-warn { background: rgba(245, 158, 11, 0.13); color: #fbc65e; border-color: rgba(245, 158, 11, 0.28); }
.chip-danger { background: rgba(244, 63, 94, 0.13); color: #ff8598; border-color: rgba(244, 63, 94, 0.28); }
.chip-gold { background: rgba(245, 196, 81, 0.14); color: var(--gold); border-color: rgba(245, 196, 81, 0.3); }
.chip-info { background: rgba(34, 211, 238, 0.12); color: #7ee7f7; border-color: rgba(34, 211, 238, 0.28); }

.tag { font-size: 11.5px; color: var(--text-3); border: 1px solid var(--line-2); padding: 2px 7px; border-radius: 6px; }

/* ---------------- Toast ---------------- */
#toast-wrap { position: fixed; top: 82px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  padding: 11px 20px; border-radius: 11px; background: rgba(23, 26, 41, 0.97);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px;
  animation: toastIn 0.26s ease; max-width: 460px; backdrop-filter: blur(10px);
}
.toast.ok { border-color: rgba(34, 197, 94, 0.4); }
.toast.err { border-color: rgba(244, 63, 94, 0.45); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------------- Modal ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(3, 4, 9, 0.75); backdrop-filter: blur(6px);
  z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px;
  width: 100%; max-width: 1000px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow); animation: popIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(12px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-close { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; border: none; background: var(--surface-2); color: var(--text-2); cursor: pointer; font-size: 18px; line-height: 1; }
.modal-close:hover { background: var(--surface-3); color: #fff; }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 14px; background: var(--bg-2); }

/* ---------------- 表格 ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 12px 14px; color: var(--text-3); font-weight: 500;
  font-size: 12.5px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.022); }
.table-wrap { overflow-x: auto; }

/* ---------------- 状态点 ---------------- */
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot-ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot-warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.dot-err { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.dot-idle { background: var(--text-3); }

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; padding: 56px 20px; color: var(--text-3); }
.empty .big { font-size: 38px; margin-bottom: 12px; opacity: 0.5; }

/* ---------------- 段落标题 ---------------- */
.sec { padding: 62px 0 10px; }
.sec-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.sec-head h2 { font-size: 25px; font-weight: 700; letter-spacing: -0.3px; }
.sec-head .sub { color: var(--text-3); font-size: 13.5px; padding-bottom: 3px; }
.sec-head .right { margin-left: auto; }

/* ---------------- 骨架 ---------------- */
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 10px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------------- 页脚 ---------------- */
.footer { margin-top: 70px; border-top: 1px solid var(--line); padding: 40px 0 46px; color: var(--text-3); font-size: 13px; }
.footer-grid { display: flex; gap: 60px; flex-wrap: wrap; }
.footer h4 { font-size: 13px; color: var(--text-2); margin-bottom: 12px; font-weight: 600; }
.footer li { list-style: none; margin-bottom: 8px; }
.footer a:hover { color: var(--brand-2); }
