/* ServerMgr 样式 */
:root {
  --bg:#0b1020; --bg2:#0e1425; --panel:#131b30; --panel2:#18213a; --border:#223052;
  --text:#e7ecf7; --muted:#8fa0c0; --accent:#4f8cff; --accent2:#2ecc71; --danger:#ff5d5d; --warn:#ffb020;
  --radius:10px;
  --mono:"JetBrains Mono","SFMono-Regular",Consolas,"Liberation Mono",monospace;
}
* { box-sizing:border-box; }
html, body { margin:0; padding:0; height:100%; }
body { background:var(--bg); color:var(--text); font:14px/1.55 -apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; }
.hidden { display:none !important; }
a { color:var(--accent); text-decoration:none; }
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-thumb { background:#2a3a5f; border-radius:6px; }
::-webkit-scrollbar-track { background:transparent; }
.muted { color:var(--muted); }
.mono { font-family:var(--mono); }
.num { text-align:right; }
.spacer { flex:1; }

/* 登录 */
.login-wrap { position:fixed; inset:0; display:flex; align-items:center; justify-content:center;
  background:radial-gradient(1000px 600px at 50% 18%, #16223f 0%, #0b1020 62%); }
.login-box { width:340px; background:var(--panel); border:1px solid var(--border); border-radius:14px;
  padding:28px; display:flex; flex-direction:column; gap:12px; text-align:center; box-shadow:0 20px 60px rgba(0,0,0,.5); }
.login-box .logo { font-size:26px; font-weight:700; letter-spacing:.5px; }
.login-box .logo span { color:var(--accent); }
.login-box p { margin:0; }
.login-box .error { color:var(--danger); min-height:20px; font-size:13px; }

/* 应用框架 */
.app { display:grid; grid-template-columns:216px 1fr; height:100vh; }
.sidebar { background:var(--bg2); border-right:1px solid var(--border); display:flex; flex-direction:column; padding:14px 10px; }
.brand { font-size:18px; font-weight:700; padding:6px 10px 16px; display:flex; align-items:center; gap:8px; }
.brand .dot { width:10px; height:10px; border-radius:50%; background:linear-gradient(135deg,#4f8cff,#2ecc71); }
nav { display:flex; flex-direction:column; gap:2px; overflow-y:auto; flex:1; }
nav a { color:var(--muted); padding:9px 12px; border-radius:8px; font-size:14px; border:1px solid transparent; }
nav a:hover { background:var(--panel); color:var(--text); }
nav a.active { background:var(--panel2); color:#fff; border-color:var(--border); }
.side-foot { border-top:1px solid var(--border); padding-top:10px; display:flex; flex-direction:column; gap:8px; }
.side-foot .host { color:var(--muted); font-size:12px; padding:0 4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.main { display:flex; flex-direction:column; min-width:0; height:100vh; }
.topbar { display:flex; align-items:center; gap:12px; padding:14px 22px; border-bottom:1px solid var(--border); background:var(--bg2); }
.topbar h1 { font-size:17px; margin:0; font-weight:600; }
.top-actions { margin-left:auto; display:flex; gap:8px; }
.page { padding:18px 22px 40px; overflow-y:auto; flex:1; }

/* 卡片与网格 */
.card { background:var(--panel); border:1px solid var(--border); border-radius:var(--radius); padding:16px; margin-bottom:16px; }
.card.flat { padding:10px; }
.card h3 { margin:0 0 12px; font-size:14px; color:#c9d4ea; font-weight:600; }
.grid { display:grid; gap:14px; margin-bottom:16px; }
.stats-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.two-col { grid-template-columns:repeat(2,minmax(0,1fr)); }
.three-col { grid-template-columns:repeat(3,minmax(0,1fr)); }
@media (max-width:1100px) { .stats-grid,.two-col,.three-col { grid-template-columns:1fr 1fr; } }
@media (max-width:760px) { .app { grid-template-columns:1fr; } .sidebar { display:none; } .stats-grid,.two-col,.three-col { grid-template-columns:1fr; } }

.stat { margin-bottom:0; }
.stat-label { color:var(--muted); font-size:12px; margin-bottom:6px; }
.stat-value { font-size:24px; font-weight:700; letter-spacing:.3px; }
.stat-value.small-value { font-size:17px; }
.stat-sub { color:var(--muted); font-size:12px; margin-top:6px; }
.spark { width:100%; height:44px; display:block; margin-top:8px; }

.bar { height:8px; border-radius:5px; background:#0d1526; overflow:hidden; margin-top:8px; }
.bar-fill { height:100%; width:0; background:linear-gradient(90deg,#2ecc71,#4f8cff); border-radius:5px; transition:width .4s ease; }
.bar-fill.warn { background:linear-gradient(90deg,#ffb020,#ff7a45); }
.bar-fill.danger { background:linear-gradient(90deg,#ff5d5d,#ff2d55); }

.cores { margin-top:10px; display:flex; flex-direction:column; gap:5px; }
.corebar { display:flex; align-items:center; gap:8px; font-size:11px; color:var(--muted); }
.corebar em { font-style:normal; width:30px; }
.corebar .track { flex:1; height:6px; background:#0d1526; border-radius:3px; overflow:hidden; }
.corebar .track i { display:block; height:100%; width:0; background:linear-gradient(90deg,#4f8cff,#7aa8ff); border-radius:3px; transition:width .4s; }
.corebar b { width:50px; text-align:right; font-weight:400; }

/* 表格 */
.table-wrap { overflow-x:auto; }
table.table { width:100%; border-collapse:collapse; font-size:13px; }
table.table th { text-align:left; color:var(--muted); font-weight:500; padding:8px 10px; border-bottom:1px solid var(--border); white-space:nowrap; }
table.table td { padding:8px 10px; border-bottom:1px solid #1b2540; vertical-align:middle; }
table.table tbody tr:hover { background:#16203a; }
table.table td.ops, table.table th.ops { text-align:right; white-space:nowrap; }
.ellipsis { max-width:420px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; vertical-align:middle; }
.td-cmd { max-width:460px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* 按钮与输入 */
.btn { appearance:none; border:1px solid var(--border); background:var(--panel2); color:var(--text);
  border-radius:8px; padding:8px 14px; font-size:13px; cursor:pointer; transition:.15s; }
.btn:hover { border-color:#33508c; background:#1d2947; }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.btn.primary:hover { background:#3d7bf0; }
.btn.danger { background:#b64040; border-color:#b64040; color:#fff; }
.btn.danger:hover { background:#a33535; }
.btn.ghost { background:transparent; }
.btn.small { padding:5px 10px; font-size:12px; border-radius:7px; }
.btn.tiny { padding:3px 8px; font-size:12px; border-radius:6px; }
.btn.block { width:100%; }

.input, .select { background:#0e1526; border:1px solid var(--border); color:var(--text); border-radius:8px; padding:8px 10px; font-size:13px; outline:none; }
.input:focus, .select:focus { border-color:var(--accent); }
textarea.editor { width:100%; min-height:52vh; resize:vertical; font-family:var(--mono); font-size:12.5px; line-height:1.5; white-space:pre; }
.toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.path-input { flex:1; min-width:200px; }
.cwd-input { max-width:260px; }
label.muted { font-size:13px; display:inline-flex; align-items:center; gap:6px; color:var(--muted); }

/* 徽标与图标 */
.badge { display:inline-block; padding:2px 8px; border-radius:20px; font-size:12px; border:1px solid transparent; }
.badge.ok { background:rgba(46,204,113,.16); color:#5ee08f; border-color:rgba(46,204,113,.35); }
.badge.err { background:rgba(255,93,93,.15); color:#ff8a8a; border-color:rgba(255,93,93,.4); }
.badge.warn { background:rgba(255,176,32,.14); color:#ffc45e; border-color:rgba(255,176,32,.4); }
.badge.gray { background:rgba(143,160,192,.14); color:#a9b7d4; border-color:rgba(143,160,192,.3); }
.badge.info { background:rgba(79,140,255,.15); color:#7aa8ff; border-color:rgba(79,140,255,.4); }

.ficon { display:inline-block; width:16px; height:12px; border-radius:3px; margin-right:8px; vertical-align:-1px; background:#5a6b8c; }
.ficon.dir { background:linear-gradient(160deg,#4f8cff,#3568cc); height:13px; }
.ficon.file { background:linear-gradient(160deg,#586a8f,#3a4866); }
.ficon.link { background:linear-gradient(160deg,#b884ff,#7c4dff); }
.fname-wrap { cursor:pointer; }
.fname-wrap:hover .fname { color:var(--accent); }
.fname { color:var(--text); }

/* 弹窗 */
.modal-root { position:fixed; inset:0; background:rgba(5,8,17,.72); display:flex; align-items:center; justify-content:center; z-index:60; padding:20px; }
.modal-box { width:520px; max-width:100%; max-height:92vh; display:flex; flex-direction:column; background:var(--panel);
  border:1px solid var(--border); border-radius:12px; box-shadow:0 24px 80px rgba(0,0,0,.6); }
.modal-box.wide { width:880px; }
.modal-head { display:flex; align-items:center; padding:14px 16px; border-bottom:1px solid var(--border); }
.modal-head h3 { margin:0; font-size:15px; flex:1; }
.modal-body { padding:16px; overflow-y:auto; }
.modal-body p { margin:0 0 10px; }
.modal-foot { display:flex; justify-content:flex-end; gap:10px; padding:12px 16px; border-top:1px solid var(--border); }
.confirm-text { line-height:1.7; }

/* 键值对 */
.kv { display:grid; grid-template-columns:110px 1fr; gap:7px 14px; font-size:13px; }
.kv .k { color:var(--muted); }
.kv .v { word-break:break-all; }

/* 提示消息 */
#toast-root { position:fixed; right:18px; top:18px; z-index:100; display:flex; flex-direction:column; gap:8px; }
.toast { background:#1b2742; border:1px solid var(--border); border-left:3px solid var(--accent); padding:10px 14px;
  border-radius:8px; font-size:13px; box-shadow:0 10px 30px rgba(0,0,0,.4); max-width:380px; }
.toast.ok { border-left-color:var(--accent2); }
.toast.err { border-left-color:var(--danger); }
.toast.out { opacity:0; transform:translateX(10px); transition:.3s; }

/* 终端 */
.term-out { background:#070b14; border:1px solid var(--border); border-radius:10px; padding:12px;
  font-family:var(--mono); font-size:12.5px; line-height:1.5; height:calc(100vh - 320px); min-height:260px;
  overflow-y:auto; white-space:pre-wrap; word-break:break-all; margin:0 0 12px; }
.term-out .cmd { color:#7aa8ff; }
.term-out .err { color:#ff8a8a; }
.term-out .meta { color:#8fa0c0; }
.term-input { display:flex; gap:10px; align-items:center; }
.term-input .prompt { color:var(--accent2); font-family:var(--mono); font-weight:700; }
.term-input .input { flex:1; }

/* 日志 */
.logs-grid { grid-template-columns:320px 1fr; align-items:start; }
@media (max-width:1000px) { .logs-grid { grid-template-columns:1fr; } }
.log-list { max-height:calc(100vh - 220px); overflow-y:auto; margin-bottom:0; }
.log-item { padding:8px 10px; border-radius:8px; cursor:pointer; border:1px solid transparent; }
.log-item:hover { background:#16203a; }
.log-item.active { background:var(--panel2); border-color:var(--border); }
.log-item .n { font-size:13px; word-break:break-all; }
.log-item .m { font-size:11px; color:var(--muted); margin-top:2px; }
.log-out { background:#070b14; border:1px solid var(--border); border-radius:10px; padding:12px;
  font-family:var(--mono); font-size:12px; line-height:1.55; max-height:calc(100vh - 330px); min-height:300px;
  overflow:auto; white-space:pre-wrap; word-break:break-all; margin:10px 0 0; }
.out-pre { background:#070b14; border:1px solid var(--border); border-radius:10px; padding:12px;
  font-family:var(--mono); font-size:12px; max-height:50vh; overflow:auto; white-space:pre-wrap; word-break:break-all; margin:0; }

/* 其他 */
.loading { color:var(--muted); padding:18px; text-align:center; }
.error-box { color:#ff8a8a; background:rgba(255,93,93,.08); border:1px solid rgba(255,93,93,.25); padding:12px; border-radius:8px; margin:10px 0; }
.empty { color:var(--muted); padding:14px; }
.small-note { font-size:12px; color:var(--muted); margin-top:8px; }
.form { display:flex; flex-direction:column; gap:10px; max-width:360px; }
details.syscron { border:1px solid var(--border); border-radius:8px; padding:8px 12px; margin-bottom:8px; }
details.syscron summary { cursor:pointer; font-family:var(--mono); font-size:13px; }
details.syscron pre { margin:10px 0 4px; font-size:12px; overflow:auto; color:#c9d4ea; }

/* 面板更新 */
.update-banner { display:flex; align-items:center; gap:10px; padding:10px 18px; font-size:13px;
  background:linear-gradient(90deg, rgba(79,140,255,.18), rgba(46,204,113,.12)); border-bottom:1px solid var(--border); }
.update-banner strong { color:#7aa8ff; }
.update-banner .spacer { flex:1; }
.update-steps { margin:6px 0 8px 18px; padding:0; }
.update-steps li { margin:3px 0; }
.update-wait { font-size:14px; padding:6px 0; color:#c9d4ea; }
