/* 后台编辑器:与前台同一套笔记样式,只多出工具栏 */

/* ---------- 登录 ---------- */

.login {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #fff;
}

.login[hidden] { display: none; }

.login-box {
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.login-box h1 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

.login-tip {
  margin: 0 0 22px;
  color: #888;
  font-size: 14px;
  line-height: 1.5;
}

#pw {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  font-size: 16px;
  color: #000;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: 0;
}

#pw:focus { border-color: #07c160; }

.btn-primary {
  width: 100%;
  height: 46px;
  margin-top: 14px;
  border: 0;
  border-radius: 8px;
  background: #07c160;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.btn-primary:active { opacity: 0.85; }

.err {
  min-height: 18px;
  margin: 8px 0 0;
  color: #e64340;
  font-size: 13px;
  line-height: 1.4;
}

/* ---------- 编辑态 ---------- */

body.is-admin .note {
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}

body.is-admin .body {
  min-height: 220px;
  caret-color: #07c160;
}

body.is-admin .body:empty::before {
  content: '点这里开始写…';
  color: #c8c8c8;
}

.done-btn {
  height: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: #07c160;
  font-size: 17px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.done-btn:active { opacity: 0.6; }

/* ---------- 底部工具栏 ---------- */

.toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  background: #fff;
  border-top: 1px solid #ececec;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
}

.toolbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: #333;
  font-size: 11px;
  line-height: 1.4;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.toolbar button:active { opacity: 0.45; }

.toolbar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  z-index: 200;
  max-width: 80%;
  padding: 9px 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
}

.toast[hidden] { display: none; }

@media (min-width: 720px) {
  .toolbar {
    left: 50%;
    max-width: 560px;
    transform: translateX(-50%);
  }
}
