:root {
  --bg: #0d0f13;
  --panel: #15181f;
  --panel2: #1b1f28;
  --line: #232833;
  --text: #e7eaf0;
  --muted: #8b93a7;
  --blue: #4c8dff;
  --green: #35d07f;
  --red: #ff5964;
  --amber: #ffb020;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- 登录 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(6, 8, 11, .82); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.mask.show { display: flex; }
.login-box {
  width: 100%; max-width: 340px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 26px 24px;
}
.login-box h2 { margin: 0 0 4px; font-size: 18px; }
.login-box p { color: var(--muted); font-size: 12.5px; margin: 0 0 18px; }

/* ---------- 布局 ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px 60px; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 18px 0 14px;
  border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
.logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(150deg, #4c8dff, #1f5fd0);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; }
.brand { font-weight: 600; font-size: 15px; }
.brand small { color: var(--muted); font-weight: 400; margin-left: 8px; font-size: 12px; }
.spacer { flex: 1; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; }
.tab {
  padding: 9px 15px; border-radius: 10px; color: var(--muted); cursor: pointer;
  border: 1px solid transparent; background: transparent; font-size: 13.5px;
}
.tab:hover { color: var(--text); background: var(--panel); }
.tab.active { color: #fff; background: var(--panel2); border-color: var(--line); }
.section { display: none; }
.section.active { display: block; }

/* ---------- 卡片 ---------- */
.grid { display: grid; gap: 14px; }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.card h3 { margin: 0 0 14px; font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card h3 .spacer { flex: 1; }
.stat { font-size: 26px; font-weight: 650; letter-spacing: -.5px; }
.stat-label { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.row { display: flex; gap: 10px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 6px; }

/* ---------- 表单 ---------- */
label.f { display: block; margin-bottom: 12px; }
label.f span { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); font-size: 13.5px; outline: none; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
button {
  padding: 9.5px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); font-size: 13.5px; cursor: pointer; font-family: inherit;
}
button:hover { border-color: #33405a; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
button.primary:hover { background: #3d7ef0; }
button.ghost { background: transparent; }
button.danger { color: var(--red); border-color: #3a2530; background: #21161b; }
button.mini { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 文件选择 ---------- */
.drop {
  border: 1.5px dashed #2a3241; border-radius: 12px; padding: 22px; text-align: center;
  color: var(--muted); cursor: pointer; transition: .15s; background: #12151b;
}
.drop:hover, .drop.over { border-color: var(--blue); color: var(--text); }
.drop.picked { border-color: var(--green); color: var(--text); }
.drop b { color: var(--text); }

/* ---------- 列表 ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 8px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 8px; border-bottom: 1px solid #1c212b; vertical-align: middle; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px;
  background: #202634; color: #9aa4bb; }
.badge.ok { background: #12281d; color: var(--green); }
.badge.err { background: #2a161a; color: var(--red); }
.badge.warn { background: #2a2113; color: var(--amber); }
.badge.info { background: #14243d; color: #7fb0ff; }

.empty { color: var(--muted); text-align: center; padding: 26px 0; font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.85; }
.hint b { color: #b6bece; }
.mono.small { font-size: 12px; color: var(--muted); }
.icon-sm { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; background: #222833; }
.warnbox { background: #201a10; border: 1px solid #3a2f16; color: #e8c37a; border-radius: 12px;
  padding: 12px 14px; font-size: 13px; line-height: 1.9; margin-bottom: 14px; }
.warnbox b { color: #ffd08a; }
.okbox { background: #0f2018; border: 1px solid #1c3a2a; color: #9fe0bb; border-radius: 12px;
  padding: 12px 14px; font-size: 13px; line-height: 1.9; margin-bottom: 14px; }

/* ---------- 日志 / 弹层 ---------- */
pre.log {
  margin: 0; max-height: 320px; overflow: auto; background: #0b0d11; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; font-size: 12px; line-height: 1.7; color: #b3bccd;
  white-space: pre-wrap; word-break: break-all;
}
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: #1e2430; border: 1px solid #333c4c; color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 90; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #2a161b; border-color: #5a2b33; }

.modal {
  position: fixed; inset: 0; background: rgba(5, 7, 10, .75); display: none; align-items: center;
  justify-content: center; z-index: 60; padding: 24px;
}
.modal.show { display: flex; }
.modal-box { width: 100%; max-width: 640px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; }
.modal-box h3 { margin: 0 0 12px; font-size: 15px; }
.linky {
  display: flex; gap: 8px; align-items: center; background: #0b0d11; border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px;
}
.linky input { flex: 1; border: 0; background: transparent; color: #b3bccd; font-size: 12.5px;
  padding: 0; font-family: ui-monospace, Menlo, monospace; }
.linky input:focus { border: 0; }
