/* 基于离线版样式 + 小增改 */
:root{
  --bg:#0b1020;
  --card:#121a33;
  --muted:#9aa7c7;
  --text:#e7ecff;
  --line:rgba(255,255,255,.10);
  --primary:#5b7cfa;
  --danger:#ff5c7a;
  --shadow: 0 18px 60px rgba(0,0,0,.35);
  --radius:16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "PingFang SC","Noto Sans CJK SC","Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(91,124,250,.20), transparent 60%),
              radial-gradient(1000px 700px at 80% 0%, rgba(255,92,122,.12), transparent 55%),
              var(--bg);
  color:var(--text);
}

.topbar{
  position: sticky;
  top:0;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 18px;
  border-bottom:1px solid var(--line);
  backdrop-filter: blur(10px);
  background: rgba(11,16,32,.55);
}

.brand{ display:flex; gap:12px; align-items:center; }
.logo{
  width:42px; height:42px;
  border-radius: 14px;
  display:grid; place-items:center;
  background: rgba(255,255,255,.08);
  border:1px solid var(--line);
}
.title{ font-weight:700; letter-spacing:.4px; }
.subtitle{ font-size:12px; color:var(--muted); margin-top:2px; }

.actions{ display:flex; gap:10px; align-items:center; flex-wrap: wrap; justify-content:flex-end; }
.who{
  font-size: 12px;
  color: rgba(231,236,255,.85);
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.05);
}

.container{ max-width: 980px; margin: 18px auto; padding: 0 14px; }
.panel{
  background: rgba(18,26,51,.70);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

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

.input, .select, .textarea{
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}
.input::placeholder, .textarea::placeholder{ color: rgba(231,236,255,.55); }
.input:focus, .select:focus, .textarea:focus{
  border-color: rgba(91,124,250,.55);
  box-shadow: 0 0 0 3px rgba(91,124,250,.12);
}

.select{ padding: 10px 10px; }
.textarea{ width:100%; resize: vertical; }

.btn{
  cursor:pointer;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{ background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.18); }
.btn:active{ transform: translateY(1px); }

.btn.primary{
  background: rgba(91,124,250,.22);
  border-color: rgba(91,124,250,.38);
}
.btn.primary:hover{ background: rgba(91,124,250,.30); }

.btn.danger{
  background: rgba(255,92,122,.18);
  border-color: rgba(255,92,122,.35);
}
.btn.danger:hover{ background: rgba(255,92,122,.26); }

.btn.file{ position:relative; overflow:hidden; }
.btn.file input{
  position:absolute; inset:0;
  opacity:0; cursor:pointer;
}

.stats{
  margin: 12px 2px 8px;
  font-size: 13px;
  color: var(--muted);
}

.list{ display:flex; flex-direction:column; gap:10px; padding: 6px 0 2px; }

.card{
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.05);
  padding: 12px 12px;
  display:flex;
  gap: 12px;
  align-items:flex-start;
}
.card:hover{ background: rgba(255,255,255,.07); }

.left{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding-top: 2px;
}
.chk{ width: 18px; height: 18px; cursor:pointer; }

.content{ flex:1; min-width: 0; }
.cardTitle{
  display:flex; gap:8px; align-items:center;
  font-weight: 650;
  overflow:hidden;
}
.cardTitle .t{
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
.badge{
  font-size:12px;
  padding: 2px 8px;
  border-radius: 999px;
  border:1px solid var(--line);
  color: var(--muted);
}
.badge.pin{ color: rgba(231,236,255,.9); background: rgba(91,124,250,.14); border-color: rgba(91,124,250,.28); }

.cardBody{
  margin-top: 6px;
  color: rgba(231,236,255,.86);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 8.8em;
  overflow:hidden;
}


/* 仅在内容被截断时启用底部渐隐，避免短内容出现“变色” */
.cardBody.fade{
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

.meta{
  margin-top: 8px;
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items:center;
  color: var(--muted);
  font-size: 12px;
}
.tags{ display:flex; gap:6px; flex-wrap: wrap; }
.tag{
  border:1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
}

.right{ display:flex; flex-direction:column; gap:8px; }
.iconBtn{
  cursor:pointer;
  width: 36px; height: 36px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
}
.iconBtn:hover{ background: rgba(255,255,255,.10); }
.iconBtn:active{ transform: translateY(1px); }

.empty{
  padding: 30px 12px 26px;
  text-align:center;
  color: var(--muted);
}
.emptyTitle{ font-size: 16px; color: rgba(231,236,255,.88); font-weight: 650; }
.emptyHint{ margin-top: 8px; font-size: 13px; }

.hidden{ display:none !important; }

/* modal */
.mask{
  position:fixed; inset:0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 20;
}
.modal{
  position:fixed;
  z-index: 21;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: min(860px, calc(100vw - 24px));
  background: rgba(18,26,51,.92);
  border:1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.modalHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 12px;
  border-bottom:1px solid var(--line);
}
.modalTitle{ font-weight: 700; }
.modalBody{ padding: 12px; display:flex; flex-direction:column; gap:12px; }
.field .label{ font-size: 12px; color: var(--muted); margin: 0 0 6px 2px; }
.row{ display:flex; gap:10px; align-items:center; flex-wrap: wrap; }
.check{ display:flex; gap:8px; align-items:center; color: rgba(231,236,255,.85); }
.modalFooter{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 12px;
  border-top:1px solid var(--line);
}
.spacer{ flex: 1; }

.divider{
  height:1px;
  width:100%;
  background: var(--line);
  margin: 4px 0;
}

.smallmuted{ color: var(--muted); font-size: 12px; line-height: 1.4; }

/* nicer inline status output (login/admin/guest tools) */
.statusMsg{ margin-top: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.88); font-size: 12px; line-height: 1.4; word-break: break-word; }
.statusMsg:empty{ display: none; }
.statusMsg.ok{ background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.25); }
.statusMsg.warn{ background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.25); }
.statusMsg.error{ background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.25); }
.hint{
  border:1px dashed rgba(255,255,255,.16);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.03);
}
.hintTitle{ font-weight: 650; }
.hintText{ margin-top:6px; color: var(--muted); font-size: 12px; }

.users{ display:flex; flex-direction:column; gap:10px; }
.userRow{
  display:flex; gap:10px; align-items:center; flex-wrap: wrap;
  border:1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255,255,255,.04);
}
.userRow .u{ font-weight: 650; }
.userRow .pill{
  font-size:12px;
  padding: 2px 8px;
  border-radius: 999px;
  border:1px solid var(--line);
  color: var(--muted);
}
/* Admin tabs */
.tabbar{
  display:flex;
  gap:10px;
  align-items:center;
  margin: 6px 0 12px;
}

.tabbtn{
  appearance:none;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.82);
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}

.tabbtn:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.22);
}

.tabbtn:active{
  transform: translateY(1px);
}

.tabbtn.active{
  background: rgba(59,130,246,.22);
  border-color: rgba(59,130,246,.55);
  color: rgba(255,255,255,.95);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* Admin notes: creator filter + full view */
.adminNoteMain{ flex: 1; min-width: 260px; display:flex; flex-direction:column; gap:6px; }
.adminNoteTitle{ font-weight: 650; }
.adminNoteSnippet{ color: rgba(255,255,255,.82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.btn.small{
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1;
}
.pre{
  white-space: pre-wrap;
  word-break: break-word;
  margin: 10px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.90);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
}

/* --- Share Modal --- */
.iconBtn{
  appearance:none;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.06);
  color:rgba(255,255,255,.9);
  border-radius:12px;
  width:34px;
  height:34px;
  line-height:30px;
  font-size:18px;
  cursor:pointer;
}
.iconBtn:hover{ background:rgba(255,255,255,.10); }

.shareModal{ max-width:560px; }
.shareRow{ margin-top:12px; }
.shareActions{ display:flex; gap:10px; align-items:center; }
.shareLabel{ display:flex; gap:10px; align-items:center; color:rgba(255,255,255,.88); }
.shareHint{ color:rgba(255,255,255,.7); font-size:12px; }

/* 让管理员弹窗内部可滚动 */
#adminModal{
  max-height: 90vh;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;     /* 关键：外层不滚，交给内部滚动 */
}

/* 两个 tab 面板负责滚动（你代码里就是这俩） */
#adminPanelUsers,
#adminPanelNotes{
  flex: 1 1 auto;
  min-height: 0;        /* 关键：让 flex 子元素允许变小，从而出现滚动条 */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ========== Admin 备忘录「查看全文」弹窗优化 ========== */
#adminNoteViewModal{
  width: min(980px, calc(100vw - 24px));
  max-height: 86vh;
  height: 86vh;
  display: flex;
  flex-direction: column;
}

#adminNoteViewModal .modalBody{
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#adminNoteViewMeta{
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

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

.adminNoteViewBodyWrap{
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  overflow: hidden;
}

.adminNoteViewBody{
  margin: 0;
  padding: 14px 14px;
  height: 100%;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  color: rgba(231,236,255,.92);
  font-size: 14px;
}

@media (max-width: 520px){
  #adminNoteViewModal{
    height: 92vh;
    max-height: 92vh;
  }
  .adminNoteViewBody{ padding: 12px; }
}
/* ========== Admin 弹窗：内部列表可滚动（用户/备忘录） ========== */
#adminModal{
  max-height: 90vh;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#adminModal .modalBody{
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
#adminPanelUsers,
#adminPanelNotes{
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#usersList,
#adminNotesList{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 6px;
}


/* --- System dialog + toast (replace native alert/confirm) --- */
.modal.modal-sm{
  width: min(520px, calc(100vw - 24px));
}
.dialogMessage{
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--text);
  font-size: 14px;
}

.toastHost{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(520px, calc(100vw - 24px));
  pointer-events: none;
}
.toast{
  pointer-events: auto;
  display:flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(18,26,51,.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: toastIn .18s ease-out;
}
.toastIcon{
  width: 22px; height: 22px;
  display:grid; place-items:center;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.toastBody{ flex:1; min-width: 0; }
.toastTitle{ font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.toastText{ color: var(--muted); font-size: 13px; line-height: 1.45; word-break: break-word; }

.toast.error .toastIcon{ background: rgba(255,92,122,.12); border-color: rgba(255,92,122,.25); }
.toast.success .toastIcon{ background: rgba(91,124,250,.12); border-color: rgba(91,124,250,.25); }

@keyframes toastIn{
  from{ opacity: 0; transform: translateY(8px); }
  to{ opacity: 1; transform: translateY(0); }
}


/* 分页 */
.pager{
  margin-top: 12px;
  display:flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.btn.small{
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13px;
}
.btn:disabled{
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}
.pager .pgInfo{
  color: var(--muted);
  font-size: 13px;
  margin: 0 6px;
  white-space: nowrap;
}
.pager .jump{
  width: 84px;
}


#loading{
  margin-top: 8px;
}
