* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1115; --panel: #191c22; --panel-2: #21252d; --line: #2c313b;
  --ink: #e8eaed; --sub: #9aa1ac; --accent: #f2c94c; --accent-ink: #1a1c20;
  --green: #34c98a; --blue: #4c9bf0; --warn: #f0a94c; --danger: #ef6b6b;
}
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 22px 20px 60px; }
h1 { font-size: 21px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 600; }
.sub { color: var(--sub); font-size: 12.5px; }
a { color: var(--blue); }

/* 顶栏 */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; }

/* 按钮 */
.btn { border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); padding: 7px 13px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn:hover { border-color: #3a4150; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.green { background: var(--green); border-color: var(--green); color: #06231a; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }

/* 卡片 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: var(--panel-2); border: 1px solid var(--line); color: var(--sub); }
.tag.green { color: var(--green); border-color: #1f5a44; background: #10261e; }
.tag.blue { color: var(--blue); border-color: #244a6e; background: #10202e; }
.tag.warn { color: var(--warn); border-color: #6b4e22; background: #2a2110; }
.tag.danger { color: var(--danger); border-color: #6b2c2c; background: #2a1414; }

/* 空间卡 */
.space-card .sc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.space-card .sc-name { font-size: 15.5px; font-weight: 650; }
.meter { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin: 6px 0; }
.meter > span { display: block; height: 100%; background: var(--green); }
.meter.warn > span { background: var(--warn); }
.meter.danger > span { background: var(--danger); }
.kv { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--sub); }
.sc-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* 表单 */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--sub); margin-bottom: 5px; }
.input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); padding: 9px 11px; font-size: 14px; }
.input:focus { outline: none; border-color: var(--accent); }
.form-row { display: flex; gap: 10px; }
.form-row .field { flex: 1; }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; width: 100%; max-width: 460px; max-height: 88vh; overflow: auto; padding: 20px; }
.modal h2 { margin-bottom: 4px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }

/* 登录 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-card .logo { width: 46px; height: 46px; font-size: 20px; margin: 0 auto 14px; border-radius: 12px; }

.empty { color: var(--sub); text-align: center; padding: 30px; }

/* toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(30px); background: #000; color: #fff; padding: 10px 18px; border-radius: 9px; opacity: 0; transition: .25s; z-index: 99; font-size: 13px; max-width: 80vw; }
.toast.on { opacity: .95; transform: translateX(-50%) translateY(0); }
