* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0b0e13;
  --panel: #141922;
  --panel2: #1b2230;
  --line: #232c3b;
  --txt: #e6ecf5;
  --dim: #7d8899;
  --acc: #2d6cdf;
  --acc2: #4c8dff;
  --ok: #21c07a;
  --warn: #f0a93b;
  --bad: #e5534b;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
  user-select: none;
}

.hidden { display: none !important; }

/* ==================== 登录 ==================== */
.login {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% 0%, #16213a 0%, #0b0e13 60%);
  z-index: 100;
  padding: 24px;
}
.login-box {
  width: 100%; max-width: 340px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 26px 26px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.logo { margin-bottom: 14px; }
.login-box h1 { font-size: 20px; font-weight: 600; letter-spacing: .5px; }
.login-box .sub { color: var(--dim); font-size: 12.5px; margin: 8px 0 22px; }
.login-box input {
  width: 100%; height: 46px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--txt);
  font-size: 17px;
  text-align: center;
  letter-spacing: 4px;
  outline: none;
  transition: border-color .15s;
}
.login-box input:focus { border-color: var(--acc); }
.login-box button {
  width: 100%; height: 46px; margin-top: 14px;
  background: var(--acc); color: #fff;
  border: none; border-radius: 11px;
  font-size: 15px; font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.login-box button:hover { background: var(--acc2); }
.login-box button:disabled { opacity: .5; cursor: default; }
.msg { margin-top: 14px; font-size: 12.5px; color: var(--bad); min-height: 17px; }

/* ==================== 布局 ==================== */
.app {
  display: flex;
  height: 100%;
  width: 100%;
}

/* ---------- 左侧工具栏 ---------- */
.toolbar {
  width: 64px;
  flex: 0 0 64px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 2px;
  overflow-y: auto;
  scrollbar-width: none;
}
.toolbar::-webkit-scrollbar { display: none; }

.tb {
  width: 52px;
  height: 52px;
  border: none;
  background: transparent;
  border-radius: 12px;
  color: var(--dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: background .12s, color .12s;
  flex: 0 0 auto;
}
.tb svg {
  width: 21px; height: 21px;
  fill: none; stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tb span { font-size: 9.5px; letter-spacing: .3px; }
.tb:hover { background: var(--panel2); color: var(--txt); }
.tb:active { transform: scale(.94); }
.tb.on { background: rgba(45,108,223,.18); color: var(--acc2); }

.tb-sep {
  width: 28px; height: 1px;
  background: var(--line);
  margin: 7px 0;
  flex: 0 0 auto;
}

/* ---------- 舞台 ---------- */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  background:
    radial-gradient(800px 400px at 50% 40%, #12182a 0%, #0b0e13 70%);
}

.screen-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

#screen {
  max-width: 100%;
  max-height: 100%;
  display: block;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}

#overlay {
  position: absolute;
  pointer-events: none;
}

.hint {
  position: absolute;
  color: var(--dim);
  font-size: 13px;
  letter-spacing: .5px;
}

/* ---------- 状态栏 ---------- */
.statusbar {
  height: 38px;
  flex: 0 0 38px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  font-size: 11.5px;
  color: var(--dim);
}
.statusbar .grow { flex: 1; }
.statusbar .sep { opacity: .3; }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bad);
  display: inline-block;
}
.dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(33,192,122,.7); }
.dot.wait { background: var(--warn); }

.mini {
  height: 25px;
  padding: 0 11px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--txt);
  font-size: 11.5px;
  cursor: pointer;
}
.mini:hover { background: #232c3b; }

/* ---------- 输入条 ---------- */
.inputbar {
  position: absolute;
  left: 0; right: 0; bottom: 38px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 9px 10px;
  display: flex;
  gap: 7px;
  align-items: center;
  z-index: 20;
}
.inputbar input {
  flex: 1;
  height: 36px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 12px;
  color: var(--txt);
  font-size: 13.5px;
  outline: none;
  min-width: 0;
}
.inputbar input:focus { border-color: var(--acc); }
.inputbar button {
  height: 36px;
  padding: 0 13px;
  background: var(--acc);
  border: none;
  border-radius: 9px;
  color: #fff;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.inputbar button#closeInput { background: var(--panel2); color: var(--dim); }
.inputbar button#sendEnter,
.inputbar button#sendDel { background: var(--panel2); color: var(--txt); }

/* ---------- 剪切板面板 ---------- */
.clip-panel {
  width: 264px;
  flex: 0 0 264px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.cp-head {
  height: 42px;
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.cp-head button {
  background: none; border: none; color: var(--dim);
  font-size: 19px; cursor: pointer; line-height: 1;
}
.cp-body { padding: 14px; overflow-y: auto; flex: 1; }
.cp-label {
  font-size: 11px;
  color: var(--dim);
  margin: 4px 0 7px;
  letter-spacing: .4px;
}
.cp-body textarea {
  width: 100%;
  height: 84px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  color: var(--txt);
  font-size: 12.5px;
  resize: none;
  outline: none;
  margin-bottom: 8px;
  font-family: inherit;
}
.cp-body textarea:focus { border-color: var(--acc); }
.cp-body button {
  width: 100%;
  height: 33px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--txt);
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 14px;
}
.cp-body button:hover { background: #232c3b; }

/* ==================== 手机适配 ==================== */
@media (max-width: 720px) {
  .app { flex-direction: column-reverse; }

  .toolbar {
    width: 100%;
    flex: 0 0 auto;
    height: 58px;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    border-right: none;
    border-top: 1px solid var(--line);
    padding: 0 4px;
    gap: 0;
    overflow: visible;
  }
  .tb { width: 42px; height: 46px; border-radius: 10px; }
  .tb svg { width: 19px; height: 19px; }
  .tb span { font-size: 8.5px; }
  .tb-sep { width: 1px; height: 22px; margin: 0 2px; }

  .statusbar { height: 32px; flex: 0 0 32px; font-size: 10.5px; }
  .inputbar { bottom: 32px; }

  .clip-panel {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    flex: none;
    height: 54%;
    border-left: none;
    border-top: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    z-index: 60;
    box-shadow: 0 -14px 40px rgba(0,0,0,.55);
  }
}

/* 黑屏提示条 */
.blacktip{
  position:absolute;left:50%;bottom:20px;transform:translateX(-50%);
  display:flex;align-items:center;gap:12px;
  background:rgba(18,22,30,.94);border:1px solid #33415a;color:#e8eefb;
  padding:10px 14px;border-radius:12px;font-size:13px;z-index:30;
  box-shadow:0 10px 28px rgba(0,0,0,.45);white-space:nowrap;
}
.blacktip button{
  background:#2d6cdf;color:#fff;border:0;padding:7px 14px;border-radius:9px;
  font-size:13px;cursor:pointer;font-family:inherit;
}
.blacktip button:active{background:#2459bb}
