:root {
  --brand: #4D6BFE;
  --bg: #f7f8fa; --card: #fff; --line: #e5e6eb;
  --text: #1d2129; --text2: #86909c;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 40px; width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { font-size: 22px; text-align: center; color: var(--brand); }
.login-card .sub { text-align: center; color: var(--text2); margin-top: -8px; }
.login-card input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.login-card .hint, .hint { color: var(--text2); font-size: 12px; text-align: center; }
.err { color: #f53f3f; font-size: 13px; min-height: 16px; }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.side { width: 210px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px; }
.logo { font-size: 16px; font-weight: 600; color: var(--brand); margin-bottom: 24px; line-height: 1.4; }
.logo span { font-size: 12px; color: var(--text2); font-weight: 400; }
.side nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side nav a { padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--text); }
.side nav a:hover { background: #f2f3f5; }
.side nav a.active { background: #eef2ff; color: var(--brand); font-weight: 600; }
.side-foot { display: flex; align-items: center; justify-content: space-between; color: var(--text2); }
.main { flex: 1; padding: 24px 32px; }
.tab { display: none; }
.tab.active { display: block; }
h2 { margin-bottom: 18px; font-size: 18px; }

/* 组件 */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 13px; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { opacity: .92; color: #fff; }
.btn.danger { color: #f53f3f; }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn.block { width: 100%; }
.btn.ghost { border: none; background: none; color: var(--text2); }
.toolbar { margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.card-form { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.card-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; width: 160px; }

.tbl { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.tbl th { background: #fafbfc; color: var(--text2); font-weight: 500; }
.tbl tr:last-child td { border-bottom: none; }

.pager { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text2); }
.pager:empty { display: none; }
.pager select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 13px; cursor: pointer; }
.pager .pager-page { min-width: 76px; text-align: center; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager button:disabled:hover { border-color: var(--line); color: var(--text2); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.card .num { font-size: 26px; font-weight: 700; color: var(--brand); }
.card .lbl { color: var(--text2); margin-top: 4px; }

.cfg-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; max-width: 640px; display: flex; flex-direction: column; gap: 10px; }
.cfg-card label { color: var(--text2); font-size: 13px; }
.cfg-card input, .cfg-card textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.cfg-card textarea { resize: vertical; font-family: Consolas, monospace; font-size: 12px; }
.cfg-card .chk { display: flex; gap: 8px; align-items: center; color: var(--text); }
.cfg-card .row { display: flex; gap: 10px; }
.msg { min-height: 18px; font-size: 13px; }
.msg.ok { color: #00b42a; } .msg.bad { color: #f53f3f; }

/* 通用输入弹窗 */
.ask-mask { position: fixed; inset: 0; background: rgba(29,33,41,.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.ask-dialog { width: 380px; max-width: 92vw; background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 12px 40px rgba(0,0,0,.18); animation: ask-in .18s ease; }
@keyframes ask-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.ask-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.ask-label { display: block; color: #86909c; font-size: 12px; margin-bottom: 12px; line-height: 1.5; }
.ask-input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none; }
.ask-input:focus { border-color: var(--brand); }
.ask-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 轻提示 */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { padding: 10px 18px; border-radius: 10px; font-size: 13px; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.16); animation: ask-in .18s ease; }
.toast.success { background: #0e9f6f; }
.toast.error { background: #e0402f; }

/* 客户端版本发布 */
.upd-now { margin-bottom: 14px; }
.upd-now-card .num { font-size: 22px; }
.upd-form { align-items: center; margin-bottom: 12px; }
.upd-form input { width: 250px; }
.upd-file-btn { display: inline-flex; align-items: center; cursor: pointer; user-select: none; }
.upd-bar { max-width: 520px; height: 22px; background: #f2f3f5; border-radius: 999px; overflow: hidden; position: relative; margin: 10px 0; }
.upd-bar-fill { height: 100%; width: 0; background: var(--brand); border-radius: 999px; transition: width .2s; }
.upd-bar span { position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 22px; color: #1d2129; }
.pub-badge { background: #e8f7ee; color: #00b42a; font-size: 11px; border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
.hint.left { text-align: left; margin: 10px 0 14px; }
