body {
  font-family: SimSun, "????", serif;
  margin: 0;
  background: #f5f5f5;
  color: #333;
}
.lb-edit-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  font-size: 14px;
}
.lb-edit-top a { color: #008080; text-decoration: none; }
.lb-edit-top a:hover { color: #ff7700; }
.list {
  display: flex;
  flex-direction: row;
  gap: 0;
  justify-content: space-between;
  background: #fff;
}
.serverlist {
  background: #000;
  height: calc(100vh - 42px);
  width: 400px;
  padding: 5px 5px 5px 0;
  flex-shrink: 0;
}
#serverGroups {
  height: calc(100vh - 42px);
  overflow-y: auto;
  cursor: default;
}
.upload-container {
  background: #fff;
  width: calc(100% - 416px);
  padding: 5px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 42px);
}
.upload-container .txttitle {
  font-size: 16px;
  border: 1px solid #ddd;
  width: 200px;
  border-radius: 3px;
  line-height: 35px;
  padding-left: 8px;
  margin-right: 15px;
}
.content {
  height: calc(100% - 60px);
  border: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
}
#content {
  flex: 1;
  height: calc(100% - 5px);
  width: 100%;
  border: none;
  font-family: Consolas, monospace;
  font-size: 13px;
  resize: none;
  padding: 8px;
  box-sizing: border-box;
}
textarea:focus-visible, input:focus-visible { outline: none; }
.button-group {
  display: flex;
  margin-top: 11px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.button-group .operation {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.button-group .savebutton { display: flex; align-items: center; gap: 8px; }
button {
  background: #008080;
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 15px;
}
button:hover { background: #ff7700; }
.group {
  overflow: hidden;
  font-size: 12px;
  color: #ff7700;
  max-width: 400px;
  background: #000;
}
.group-header { display: flex; align-items: center; cursor: pointer; }
.group-name:hover, .server-title:hover {
  background: #0078d7;
  color: #fff !important;
}
.server-items { margin-left: 21px; overflow: hidden; background: #000; }
.server-item { display: flex; align-items: center; }
.color-preview, .group-preview {
  width: 9px;
  height: 14px;
  margin: 0 3px 0 0;
  flex-shrink: 0;
}
.group-preview { width: 13px; }
.server-title { white-space: pre-wrap; max-height: 14px; line-height: 14px; }
.empty-message { text-align: center; padding: 20px; color: #7f8c8d; }
.modal-content {
  display: none;
  min-width: 300px;
  max-width: 324px;
  padding: 5px;
  border-left: 1px solid #ddd;
  overflow-y: auto;
}
.modal-content.is-open { display: block; }
.template-modal-content, .replace-modal-content, .color-modal-content { display: none; }
.template-modal-content.is-open, .replace-modal-content.is-open, .color-modal-content.is-open { display: block; }
.template-modal-header, .color-modal-header, .replace-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  border-bottom: 1px solid #ddd;
}
.color-modal-title { font-size: 18px; font-weight: bold; }
.close-modal { font-size: 24px; cursor: pointer; color: #aaa; border: none; background: none; padding: 0 4px; }
.close-modal:hover { color: #f00; }
.color-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  background: #e8e8e8;
  padding: 4px;
  margin-bottom: 5px;
}
.color-item {
  text-align: center;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 2px;
}
.color-item:hover { border-color: #008080; }
.color-preview-box {
  height: 28px;
  width: 100%;
  margin: 0;
  border-bottom: 1px solid rgba(0, 0, 0, .12);
  box-sizing: border-box;
}
.color-code {
  font-size: 11px;
  font-family: Consolas, monospace;
  color: #222;
  background: #fff;
  line-height: 18px;
  padding: 1px 0 2px;
}
.color-hex { font-size: 9px; color: #aaa; }
.template-modal-content .buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.template-modal-content button { padding: 4px 6px; font-size: 13px; }
.replace-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.replace-row label { font-weight: bold; font-size: 13px; }
.replace-row input { padding: 8px; border: 1px solid #ddd; border-radius: 4px; }
.buttons-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.confirm-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,.7);
  align-items: center;
  justify-content: center;
}
.confirm-modal.is-open { display: flex; }
.confirm-modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
}
.confirm-modal-buttons { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.confirm-btn-danger { background: #dc3545; }
.confirm-btn-danger:hover { background: #c82333; }
.lb-toast {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 6px;
  color: #fff;
  z-index: 3000;
  opacity: 0;
  transition: opacity .3s;
}
.lb-toast.show { opacity: 1; }
.lb-toast.ok { background: #28a745; }
.lb-toast.err { background: #dc3545; }
.lb-toast.warn { background: #ff7700; }
