/* 云霄云后台 —— iOS 26 Liquid Glass 风格
   原则：高斯模糊 + 玻璃质感 + 层次感；不使用任何渐变色。 */

:root {
  --bg: #eef1f6;
  --bg-blob-1: rgba(120, 149, 255, 0.28);
  --bg-blob-2: rgba(120, 210, 200, 0.24);
  --bg-blob-3: rgba(200, 160, 255, 0.22);

  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-inner: rgba(255, 255, 255, 0.4);

  --text: #1c1c24;
  --text-soft: #5b5f6b;
  --text-faint: #8b8f9a;

  --accent: #2f6bff;
  --accent-soft: rgba(47, 107, 255, 0.12);
  --ok: #1fae5a;
  --warn: #e08a1e;
  --danger: #e5484d;

  --line: rgba(120, 125, 140, 0.18);
  --shadow: 0 8px 30px rgba(30, 40, 70, 0.12);
  --shadow-lg: 0 20px 60px rgba(30, 40, 70, 0.18);
  --radius: 22px;
  --radius-sm: 14px;
  --blur: 22px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d12;
    --bg-blob-1: rgba(90, 120, 255, 0.30);
    --bg-blob-2: rgba(40, 170, 160, 0.26);
    --bg-blob-3: rgba(150, 110, 240, 0.24);

    --glass: rgba(30, 32, 40, 0.55);
    --glass-strong: rgba(36, 39, 49, 0.75);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-inner: rgba(255, 255, 255, 0.05);

    --text: #f2f3f7;
    --text-soft: #b6bac6;
    --text-faint: #7f8494;

    --accent: #5b8bff;
    --accent-soft: rgba(91, 139, 255, 0.18);
    --line: rgba(255, 255, 255, 0.09);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 背景装饰：纯色高斯模糊光斑，制造层次而非渐变 */
.bg-decor { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-decor span {
  position: absolute; display: block; border-radius: 50%;
  filter: blur(80px); opacity: 0.9;
}
.bg-decor span:nth-child(1) { width: 460px; height: 460px; background: var(--bg-blob-1); top: -120px; left: -80px; }
.bg-decor span:nth-child(2) { width: 520px; height: 520px; background: var(--bg-blob-2); bottom: -160px; right: -120px; }
.bg-decor span:nth-child(3) { width: 380px; height: 380px; background: var(--bg-blob-3); top: 40%; left: 55%; }

/* 玻璃卡片 */
.glass {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* 布局 */
.wrap { max-width: 1120px; margin: 0 auto; padding: 22px 18px 60px; }
.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 14px; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 18px; margin-bottom: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: .3px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who { color: var(--text-soft); font-size: 13px; }

/* 标签页 */
.tabs { display: flex; gap: 6px; padding: 6px; margin-bottom: 20px; overflow-x: auto; }
.tab {
  border: none; background: transparent; color: var(--text-soft);
  padding: 9px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: .18s;
}
.tab.active { background: var(--glass-strong); color: var(--text); box-shadow: var(--shadow); }
.tab:hover { color: var(--text); }

/* 卡片网格 */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.card { padding: 18px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title { font-size: 16px; font-weight: 700; line-height: 1.35; word-break: break-word; }
.card-sub { color: var(--text-faint); font-size: 12px; margin-top: 3px; }

/* 状态徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--glass-inner); color: var(--text-soft);
  border: 1px solid var(--line);
}
.badge .d { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.badge.running { color: var(--ok); } .badge.running .d { background: var(--ok); }
.badge.offline { color: var(--text-faint); } .badge.offline .d { background: var(--text-faint); }
.badge.suspended { color: var(--danger); } .badge.suspended .d { background: var(--danger); }
.badge.warn { color: var(--warn); } .badge.warn .d { background: var(--warn); }

/* 占用率仪表 */
.meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.meter { text-align: center; }
.ring { --v: 0; --c: var(--accent); position: relative; width: 74px; height: 74px; margin: 0 auto 6px; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .track { stroke: var(--line); }
.ring .fill { stroke: var(--c); transition: stroke-dashoffset .6s ease, stroke .3s; stroke-linecap: round; }
.ring .val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; }
.meter .lbl { font-size: 12px; color: var(--text-soft); }

.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.kv:first-of-type { border-top: none; }
.kv .k { color: var(--text-faint); }
.kv .v { color: var(--text); font-weight: 600; text-align: right; word-break: break-all; }

.countdown { font-weight: 700; }
.countdown.soon { color: var(--warn); }
.countdown.expired { color: var(--danger); }

/* 服务器 IP 展示块 */
.ipbox {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--glass-inner); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; margin: 12px 0;
}
.ipbox .addr { font-weight: 700; font-size: 15px; word-break: break-all; }
.ipbox .hint { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--glass-border); background: var(--glass-strong);
  color: var(--text); padding: 9px 15px; border-radius: 12px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: .16s;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.ok { color: var(--ok); }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 6px; font-weight: 600; }
.input, textarea.input, select.input {
  width: 100%; padding: 12px 14px; font-size: 15px; color: var(--text);
  background: var(--glass-inner); border: 1px solid var(--line);
  border-radius: var(--radius-sm); outline: none; transition: .16s;
  font-family: inherit;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row .input { flex: 1; }
.captcha-img { height: 48px; border-radius: 10px; cursor: pointer; border: 1px solid var(--line); }

/* 认证卡片 */
.auth-card { width: 100%; max-width: 400px; padding: 30px 26px; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head h1 { font-size: 22px; margin: 8px 0 4px; }
.auth-head p { color: var(--text-soft); font-size: 13px; margin: 0; }
.logo-badge {
  width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); font-size: 26px;
}

/* 提示条 */
.hint-line { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
.form-msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.form-msg.error { color: var(--danger); }
.form-msg.ok { color: var(--ok); }

/* 空状态 */
.empty { text-align: center; padding: 50px 20px; color: var(--text-soft); }
.empty .em { font-size: 40px; display: block; margin-bottom: 10px; }

/* 表格（管理端用户/邀请） */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--text-faint); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.mono { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 12px; }

/* 弹层 */
.modal-mask {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 18px;
  background: rgba(20, 24, 36, 0.35); backdrop-filter: blur(6px);
}
.modal-mask.show { display: flex; }
.modal { width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto; padding: 24px; }
.modal h3 { margin: 0 0 16px; font-size: 18px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* Toast */
#toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast {
  padding: 12px 16px; border-radius: 14px; font-size: 14px; font-weight: 500;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  animation: toast-in .25s ease;
}
.toast.error { color: var(--danger); }
.toast.ok { color: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* 骨架/加载 */
.skeleton { color: var(--text-faint); }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

.section-title { font-size: 15px; font-weight: 700; margin: 4px 2px 12px; color: var(--text-soft); }

@media (max-width: 560px) {
  .wrap { padding: 14px 12px 50px; }
  .topbar { top: 8px; padding: 10px 14px; }
  .brand { font-size: 15px; }
  .meters { gap: 8px; }
  .ring { width: 64px; height: 64px; }
  .tbl { font-size: 12px; }
}
