/* /opt/webssh/css/ssh.css */
:root{
  --bg0:#0b1220;
  --bg1:#0a1630;
  --glass: rgba(255,255,255,.06);
  --glass2: rgba(255,255,255,.10);
  --line: rgba(255,255,255,.10);
  --text:#e8eefc;
  --muted: rgba(232,238,252,.65);
  --good:#22c55e;
  --warn:#f59e0b;
  --bad:#ef4444;
  --shadow: 0 20px 50px rgba(0,0,0,.45);
  --radius: 18px;
  --radius2: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  min-height: 100vh;
  margin:0;
  font-family: var(--sans);
  color:var(--text);
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(56,189,248,.16), transparent 60%),
    radial-gradient(1100px 650px at 85% 35%, rgba(124,58,237,.18), transparent 60%),
    radial-gradient(900px 600px at 40% 90%, rgba(34,197,94,.10), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow:hidden;
}

.wrap{
  height:100%;
  padding:12px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.panel{
  width:min(1500px, calc(100vw - 24px));
  height:min(900px, calc(100vh - 24px));
  border-radius: 22px;
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.04));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position:relative;
  overflow:hidden;
}

.topbar{
  height:58px;
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
}

.leftTop{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 300px;
}

.dot{
  width:10px;height:10px;border-radius:50%;
  background: var(--bad);
  box-shadow: 0 0 0 4px rgba(239,68,68,.15);
  flex:0 0 auto;
}

.state{ font-size:13px; color:var(--muted); }
.title{ font-weight:600; letter-spacing:.2px; }

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  color: var(--muted);
  font-size:12px;
  margin-left:8px;
  user-select:none;
}

.actions{ display:flex; align-items:center; gap:10px; }

.btn{
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  color: var(--text);
  border-radius: 12px;
  padding:9px 12px;
  font-size:13px;
  cursor:pointer;
  user-select:none;
  transition: .15s ease;
}
.btn:hover{ transform: translateY(-1px); background: rgba(0,0,0,.26); }
.btn:active{ transform: translateY(0); }
.btn.primary{
  border-color: rgba(34,197,94,.35);
  background: rgba(34,197,94,.12);
}
.btn.primary:hover{ background: rgba(34,197,94,.18); }

.grid{
  height: calc(100% - 58px);
  display:grid;
  grid-template-columns: 260px 1fr 320px;
  gap:14px;
  padding:14px;
  transition: grid-template-columns .18s ease;
  min-height: 0;
}

.card{
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0,0,0,.18);
  box-shadow: 0 14px 30px rgba(0,0,0,.25);
  overflow:hidden;
  min-height: 0;
}

.cardHead{
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.cardTitle{
  font-weight:600;
  font-size:14px;
  color: rgba(232,238,252,.92);
  display:flex; align-items:center; gap:8px;
}

.sub{ font-size:12px; color:var(--muted); }

.cardBody{
  padding:12px 14px;
  height: calc(100% - 49px);
  overflow:auto;
  min-height: 0;
}

.cardBodyTerm{
  padding:12px 14px;
  height: calc(100% - 49px);
  overflow:hidden;
  min-height: 0;
}

/* 左侧系统状态 */
.stat{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.statItem{
  padding:12px;
  border-radius: var(--radius2);
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.05);
}
.statRow{ display:flex; justify-content:space-between; align-items:center; }
.k{ font-size:12px; color:var(--muted); }
.v{ font-size:14px; font-weight:600; }

.bar{
  margin-top:10px;
  height:8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow:hidden;
}
.bar > i{
  display:block;
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(56,189,248,.8), rgba(124,58,237,.85));
  border-radius: 999px;
  transition: width .25s ease;
}

/* ✅ 删除你圈住的“提示块”（直接隐藏） */
.hint{ display:none !important; }

/* 中间终端布局 */
.termWrap{
  height:100%;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:0;
}

.termBox{
  flex:1;
  min-height:0;
  border-radius: var(--radius);
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.35);
  overflow:hidden;
  display:flex;
  height: 100%;
}

.xtermHost{
  flex:1;
  min-height:0;
  padding:12px;
  height: 100%;
  position: relative;
}

/* xterm 背景透明 */
.xterm,
.xterm .xterm-viewport,
.xterm .xterm-screen{
  background: transparent !important;
}
.xterm .xterm-viewport{ overflow-y:auto; }

/* ✅ 强制 xterm 高度为 100% */
.xterm{ height: 100% !important; }

.inputRow{
  display:flex;
  gap:10px;
  align-items:center;
  position: relative;
  z-index: 3;
}

.cmd{
  flex:1;
  height:42px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.20);
  color: var(--text);
  padding:0 12px;
  font-family: var(--mono);
  outline:none;
}
.cmd::placeholder{ color: rgba(232,238,252,.45); }

/* 右侧指令助手 */
.list{ display:flex; flex-direction:column; gap:10px; }
.item{
  padding:12px;
  border-radius: var(--radius2);
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
}
.itemTop{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
.itemName{ font-weight:600; font-size:13px; }
.itemDesc{ margin-top:6px; font-size:12px; color:var(--muted); line-height:1.5; }

.code{
  margin-top:10px;
  font-family: var(--mono);
  font-size:12px;
  background: rgba(0,0,0,.22);
  border:1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  padding:10px;
  color: rgba(232,238,252,.90);
  white-space: pre-wrap;
  word-break: break-word;
}

.miniBtns{ display:flex; gap:8px; }
.mini{
  padding:6px 10px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.16);
  font-size:12px;
  color: var(--text);
  cursor:pointer;
  user-select:none;
}
.mini:hover{ background: rgba(0,0,0,.24); }

/* Toast */
.toast{
  position:absolute;
  left:50%;
  bottom:14px;
  transform: translateX(-50%);
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.30);
  color: rgba(232,238,252,.92);
  font-size:12px;
  box-shadow: 0 12px 24px rgba(0,0,0,.35);
  opacity:0;
  pointer-events:none;
  transition: opacity .2s ease, transform .2s ease;
  max-width: calc(100% - 40px);
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  z-index: 100000;
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(-4px); }

/* 右侧区域固定高度 */
.statBody{
  display:flex;
  flex-direction:column;
  height: calc(100% - 49px);
  overflow:hidden;
  min-height: 0;
}

/* 指令助手折叠 */
.item.collapsed .itemDesc,
.item.collapsed .code{ display:none; }

.foldBtn{
  margin-left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.16);
  color: var(--text);
  cursor:pointer;
  line-height: 26px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  user-select:none;
}
.foldBtn:hover{ background: rgba(0,0,0,.24); transform: translateY(-1px); }
.foldBtn:active{ transform: translateY(0); }

#grid.helper-collapsed{ grid-template-columns: 260px 1fr 44px; }
#grid.helper-collapsed #helperCard .cardBody{ display:none; }
#grid.helper-collapsed #helperSub{ display:none !important; }
#grid.helper-collapsed #helperTitleText{ display:none !important; }
#grid.helper-collapsed #helperCard{ padding:0; overflow:hidden; }
#grid.helper-collapsed #helperCard .cardHead{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border-bottom:none;
}
#grid.helper-collapsed #helperCard .cardTitle{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0;
}
#grid.helper-collapsed #btnFoldHelper{
  width:34px;
  height:80px;
  border-radius:999px;
}

/* ✅ iframe 内全屏模式：铺满 iframe */
html.in-iframe body{ overflow:hidden; }
html.in-iframe .wrap{ padding:0 !important; }
html.in-iframe .panel{
  width:100vw !important;
  height:100vh !important;
  border-radius:0 !important;
}

/* ✅ 小屏自动上下布局 */
@media (max-width: 980px){
  .grid{
    grid-template-columns: 1fr;
    grid-template-rows: 260px 1fr 320px;
  }
}