/* ===== SSH Web 终端样式 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #12151c;
  color: #e6e9f0;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 顶部状态栏 */
#topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: #1a1f2b;
  border-bottom: 1px solid #2a3142;
  flex: none;
}
.brand { font-weight: 700; color: #7aa2f7; letter-spacing: 1px; }
.target { color: #aab; font-family: Consolas, monospace; font-size: 13px; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.status { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.gray { background: #555d70; }
.dot.green { background: #3fb950; box-shadow: 0 0 6px #3fb950; }
.dot.red { background: #f85149; box-shadow: 0 0 6px #f85149; }

/* 主体 */
#main { flex: 1; display: flex; min-height: 0; }
.term-wrap { flex: 1; padding: 8px 10px; min-width: 0; }
#terminal { width: 100%; height: 100%; }

/* 右侧快捷指令栏 */
#sidebar {
  width: 260px;
  background: #171c26;
  border-left: 1px solid #2a3142;
  display: flex;
  flex-direction: column;
  transition: width .15s;
  flex: none;
}
#sidebar.collapsed { width: 34px; }
#sidebar.collapsed .side-body { display: none; }
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-bottom: 1px solid #2a3142;
  font-weight: 600; color: #9fb4e8;
}
#side-toggle { background: none; border: none; color: #8a93a6; cursor: pointer; font-size: 14px; }
.side-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; }
.cmd-group { margin-bottom: 12px; }
.cmd-group h4 {
  font-size: 12px; color: #67748c;
  margin-bottom: 6px; letter-spacing: 1px;
  border-left: 3px solid #7aa2f7; padding-left: 6px;
}
.cmd-btn {
  display: block; width: 100%; text-align: left;
  background: #222a38; border: 1px solid #2e3a4f; color: #d7dde8;
  padding: 7px 10px; margin-bottom: 6px; border-radius: 6px;
  font-size: 13px; cursor: pointer; transition: background .1s;
}
.cmd-btn:hover { background: #2b3648; border-color: #4d6bb3; }
.cmd-btn .cmd-name { display: block; }
.cmd-btn .cmd-tip { display: block; color: #6f7a92; font-family: Consolas, monospace; font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot { border-top: 1px solid #2a3142; padding: 8px 2px; font-size: 12px; color: #8a93a6; }
.chk { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.empty-tip { color: #67748c; font-size: 13px; padding: 8px 2px; }

/* 连接弹窗 */
.overlay {
  position: fixed; inset: 0; background: rgba(8,10,16,.75);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.hidden { display: none !important; }
.card {
  background: #1a1f2b; border: 1px solid #2e3a4f; border-radius: 10px;
  padding: 26px 30px; width: 360px; box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.card h2 { margin-bottom: 6px; color: #eef; }
.card .sub { font-size: 12px; color: #8a93a6; margin-bottom: 16px; line-height: 1.6; }
.card .sub code { background: #252c3b; padding: 1px 5px; border-radius: 4px; }
.card label { display: block; font-size: 12px; color: #9fb4e8; margin: 10px 0 4px; }
.card input {
  width: 100%; background: #12151c; border: 1px solid #2e3a4f; color: #eef;
  padding: 8px 10px; border-radius: 6px; font-size: 14px;
}
.card input:focus { outline: none; border-color: #7aa2f7; }
.card button {
  width: 100%; margin-top: 18px; background: #3d5bb3; color: #fff; border: none;
  padding: 10px; border-radius: 6px; font-size: 14px; cursor: pointer;
}
.card button:hover { background: #4a6ccb; }
.err { color: #f85149; font-size: 13px; margin-top: 10px; min-height: 18px; }

/* 手机端悬浮按钮 */
.mobile-fab {
  position: fixed; right: 12px; bottom: 18px; z-index: 40;
  background: #3d5bb3; color: #fff; border: none; border-radius: 22px;
  padding: 10px 16px; font-size: 13px; box-shadow: 0 6px 18px rgba(0,0,0,.45);
}

/* 手机端：指令栏默认隐藏，点按钮从右侧滑出覆盖层 */
@media (max-width: 640px) {
  #sidebar.mobile {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 240px; z-index: 45;
    transform: translateX(100%);
    transition: transform .15s;
    border-left: 1px solid #2a3142;
  }
  #sidebar.mobile.mobile-open { transform: translateX(0); }
  #sidebar.mobile .side-body { display: flex; }
  .term-wrap { padding: 6px; }
}
