html { background: #121826; }
/* 字体已改回浏览器默认（2026-08-14 鹤玖决定） */
/* ===== 微言斋 · 样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #121826; color: #b8c6e0;
  min-height: 100vh;
}

/* ── 顶栏 ── */
.top-bar {
  max-width: 720px; margin: 0 auto; padding: 1.2rem 1.5rem;
  display: flex; align-items: center; gap: 12px;
}
.top-bar h1 {
  font-size: 1.3rem; font-weight: 300; letter-spacing: 0.2rem;
  background: linear-gradient(135deg, #e0e0e0, #4a9eff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  flex: 1;
}
.back-btn {
  color: #556688; font-size: 0.85rem; text-decoration: none;
  transition: color 0.2s;
}
.back-btn:hover { color: #6aaeff; }
.words-userbar {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-family: system-ui;
}
.words-username { color: #b0d0ff; font-weight: 500; }
.words-userrole {
  padding: 1px 6px; border-radius: 4px;
  font-size: 10px; background: rgba(100,200,255,0.12); color: #64c8ff;
}
.words-userrole.role-admin { background: rgba(255,200,100,0.12); color: #ffc864; }
.words-logout {
  color: #445577; text-decoration: none; font-size: 10px;
  padding: 1px 6px; border-radius: 4px;
  border: 1px solid #2a2f45; transition: all 0.2s;
}
.words-logout:hover { border-color: #e17055; color: #e17055; }

.desc {
  text-align: center; color: #445577; font-size: 0.8rem;
  letter-spacing: 0.15rem; margin-bottom: 0.5rem;
}

/* ── 容器 ── */
.container { max-width: 720px; margin: 0 auto; padding: 0 1.2rem 3rem; }

.toolbar { display: flex; justify-content: flex-end; margin-bottom: 1rem; }

.btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 16px; border-radius: 8px; font-size: 0.9rem;
  cursor: pointer; border: 1px solid rgba(80,120,180,0.2);
  transition: all 0.2s; font-family: inherit;
}
.btn-new {
  background: rgba(74,158,255,0.12); color: #6aaeff;
  border-color: rgba(74,158,255,0.25);
}
.btn-new:hover { background: rgba(74,158,255,0.22); }
.btn-submit {
  background: rgba(74,158,255,0.2); color: #8abdf0;
  border-color: rgba(74,158,255,0.3); font-size: 0.95rem; padding: 8px 24px;
}
.btn-submit:hover { background: rgba(74,158,255,0.3); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── 条目列表 ── */
.entries { display: flex; flex-direction: column; gap: 0.8rem; }

.entry {
  background: rgba(15,20,35,0.45); backdrop-filter: blur(8px);
  border: 1px solid rgba(80,120,180,0.08);
  border-radius: 12px; padding: 1rem 1.3rem;
  transition: all 0.25s; cursor: pointer;
  animation: fadeUp 0.4s ease forwards;
}
.entry:hover {
  border-color: rgba(74,158,255,0.18);
  background: rgba(18,24,42,0.55);
}
.entry .meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.entry .meta .time {
  font-size: 0.75rem; color: #445577; font-family: system-ui;
}
.entry .meta .author {
  font-size: 0.75rem; color: #556688;
}
.entry .meta .cmt-count {
  font-size: 0.7rem; color: #3a5a8a; margin-left: auto;
}
.entry .body {
  font-size: 1rem; line-height: 1.7; color: #c8d8f0;
  word-break: break-word;
}
.entry .body p { margin: 0.3rem 0; }
.entry .body strong { color: #8ac4ff; }
.entry .body code {
  background: rgba(74,158,255,0.08); color: #7ab4ee;
  padding: 1px 5px; border-radius: 4px; font-size: 0.85rem;
}
.entry .body ul, .entry .body ol { margin: 0.3rem 0; padding-left: 1.2rem; }

.entry-idx {
  animation-delay: calc(var(--idx) * 0.06s);
}

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

/* ── 空状态 ── */
.empty-state { text-align: center; padding: 4rem 0; color: #445577; }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.95rem; }
.empty-hint { font-size: 0.8rem; margin-top: 0.3rem; color: #334466; }

/* ── 编辑器弹窗 ── */
.editor-overlay, .detail-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(5,8,15,0.6); backdrop-filter: blur(3px);
}
.editor-overlay.show, .detail-overlay.show { display: block; }

.editor-panel, .detail-panel {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 1001; width: 90%; max-width: 520px;
  background: #0f1420; border: 1px solid rgba(80,120,180,0.12);
  border-radius: 16px; padding: 1.5rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  display: none;
}
.editor-panel.show, .detail-panel.show { display: block; }

.editor-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.editor-header h2 { font-size: 1.1rem; font-weight: 400; color: #b8c6e0; letter-spacing: 0.1rem; }
.editor-close, .detail-close {
  background: none; border: none; color: #556688; font-size: 1.3rem;
  cursor: pointer; transition: color 0.2s; line-height: 1;
}
.editor-close:hover { color: #ff7788; }

.editor-panel textarea {
  width: 100%; padding: 0.8rem;
  background: rgba(15,20,35,0.6); border: 1px solid rgba(80,120,180,0.12);
  border-radius: 10px; color: #c8d6e5; font-size: 1rem;
  outline: none; resize: vertical; min-height: 120px;
  transition: border-color 0.2s; font-family: inherit; line-height: 1.6;
}
.editor-panel textarea:focus { border-color: rgba(74,158,255,0.3); }
.editor-panel textarea::placeholder { color: #334466; }

.editor-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 0.8rem;
}
.editor-hint { font-size: 0.75rem; color: #445577; }

/* ── 详情弹窗 ── */
.detail-panel { max-width: 600px; padding: 2rem; }
.detail-close { position: absolute; top: 1rem; right: 1.2rem; font-size: 1.4rem; }
.detail-content { }
.detail-content .body {
  font-size: 1.1rem; line-height: 1.9; color: #c8d8f0;
  background: rgba(74,158,255,0.05);
  border: 1px solid rgba(80,120,180,0.1);
  border-left: 3px solid rgba(74,158,255,0.3);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1rem 0;
  word-break: break-word;
}
.detail-content .body p:first-child { margin-top: 0; }
.detail-content .body p:last-child { margin-bottom: 0; }
.detail-time, .detail-author { font-size: 0.8rem; color: #445577; }
.detail-author { color: #556688; }
.detail-content .body strong { color: #8ac4ff; }
.detail-content .body code {
  background: rgba(74,158,255,0.08); color: #7ab4ee;
  padding: 1px 5px; border-radius: 4px;
}
.detail-content .body p { margin: 0.6rem 0; }
.detail-content .body ul, .detail-content .body ol { margin: 0.6rem 0; padding-left: 1.4rem; }
.detail-content .detail-meta {
  margin-bottom: 1rem; font-size: 0.8rem; color: #445577;
  font-family: system-ui;
}

/* ── 确认弹窗 ── */
.confirm-overlay {
  display: none; position: fixed; inset: 0; z-index: 1002;
  background: rgba(5,8,15,0.6); backdrop-filter: blur(3px);
}
.confirm-overlay.show { display: block; }

.confirm-panel {
  display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 1003; width: 300px;
  background: #0f1420; border: 1px solid rgba(80,120,180,0.12);
  border-radius: 14px; padding: 1.5rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  text-align: center;
}
.confirm-text {
  font-size: 1rem; color: #c8d6e5; margin-bottom: 1.2rem;
  line-height: 1.5;
}
.confirm-btns {
  display: flex; gap: 10px; justify-content: center;
}
.confirm-btn {
  padding: 0.5rem 1.5rem; border-radius: 8px;
  font-size: 0.9rem; cursor: pointer; border: none; font-family: inherit;
  transition: all 0.2s;
}
.confirm-cancel {
  background: rgba(255,255,255,0.06); color: #8899bb;
  border: 1px solid rgba(80,120,180,0.15);
}
.confirm-cancel:hover { background: rgba(255,255,255,0.1); }
.confirm-ok {
  background: rgba(200,60,60,0.2); color: #ff7788;
  border: 1px solid rgba(200,60,60,0.25);
}
.confirm-ok:hover { background: rgba(200,60,60,0.3); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  background: rgba(0,184,148,0.9); color: #fff;
  padding: 8px 20px; border-radius: 10px; font-size: 0.9rem;
  z-index: 9999; display: none;
  animation: fadeUp 0.3s ease;
}

/* ── 详情中的操作按钮 ── */
.detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.del-entry-btn {
  color: #ff6677;
  background: none; border: none; cursor: pointer;
  font-size: 0.85rem; padding: 2px 4px; margin-left: auto;
  transition: color 0.2s;
}
.del-entry-btn:hover { color: #ff4466; }
.meta-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.meta-actions .del-entry-btn { margin-left: 0; }
.edit-entry-btn { color: #6aaeff; }
.edit-entry-btn:hover { color: #8ac4ff !important; }
.edited-tag { font-size: 0.65rem; color: #3a5a8a; }
.edit-area {
  width: 100%; min-height: 220px; padding: 0.7rem; box-sizing: border-box;
  background: rgba(15,20,35,0.6); border: 1px solid rgba(80,120,180,0.12);
  border-radius: 8px; color: #c8d6e5; font-size: 1rem; outline: none;
  font-family: inherit; line-height: 1.6; resize: vertical;
}
.edit-area:focus { border-color: rgba(74,158,255,0.3); }
.edit-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 0.5rem; }
.edit-save, .edit-cancel {
  background: none; border: 1px solid rgba(80,120,180,0.15); color: #8899bb;
  border-radius: 6px; padding: 4px 14px; font-size: 0.8rem; cursor: pointer; transition: all 0.2s;
}
.edit-save { border-color: rgba(74,158,255,0.3); color: #6aaeff; }
.edit-save:hover { background: rgba(74,158,255,0.1); }
.cmt-edit-input {
  flex: 1; min-width: 0; padding: 0.4rem 0.6rem; box-sizing: border-box;
  background: rgba(15,20,35,0.6); border: 1px solid rgba(80,120,180,0.12);
  border-radius: 6px; color: #c8d6e5; font-size: 0.9rem; outline: none;
}
.cmt-edit-input:focus { border-color: rgba(74,158,255,0.3); }
.cmt-save, .cmt-cancel {
  background: none; border: 1px solid rgba(80,120,180,0.15); color: #8899bb;
  border-radius: 6px; padding: 2px 10px; font-size: 0.75rem; cursor: pointer; transition: all 0.2s;
}
.cmt-save { border-color: rgba(74,158,255,0.3); color: #6aaeff; }
.cmt-save:hover { background: rgba(74,158,255,0.1); }

/* ── 留言区域 ── */
.cmt-section { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid rgba(80,120,180,0.1); }
.cmt-title { font-size: 0.9rem; color: #8899bb; margin-bottom: 0.8rem; }
.cmt-list { margin-bottom: 0.8rem; }
.cmt-empty { color: #445577; font-size: 0.8rem; text-align: center; padding: 1rem 0; }

.comment {
  background: rgba(10,15,28,0.3); border-radius: 8px;
  padding: 0.6rem 0.8rem; margin-bottom: 0.4rem;
}
.cmt-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 0.2rem; }
.cmt-author { font-size: 0.75rem; color: #6aaeff; }
.cmt-time { font-size: 0.65rem; color: #445577; }
.cmt-text { font-size: 0.9rem; line-height: 1.6; color: #c8d8f0; word-break: break-word; }

.del-cmt-btn {
  margin-left: auto; background: none; border: none; color: #445577;
  font-size: 0.7rem; cursor: pointer; opacity: 0; transition: opacity 0.2s;
  padding: 1px 4px;
}
.comment:hover .del-cmt-btn { opacity: 0.5; }
.del-cmt-btn:hover { opacity: 0.8 !important; color: #ff6677; }

.cmt-actions {
  display: flex; justify-content: flex-end; align-items: center;
  padding: 0.3rem 0; border-top: 1px solid rgba(80,120,180,0.06);
  margin-bottom: 0.5rem;
}
.cmt-input-row {
  display: flex; gap: 6px;
}
.cmt-input-row input {
  flex: 1; padding: 0.5rem 0.8rem;
  background: rgba(15,20,35,0.6); border: 1px solid rgba(80,120,180,0.12);
  border-radius: 8px; color: #c8d6e5; font-size: 0.9rem;
  outline: none; transition: border-color 0.2s;
}
.cmt-input-row input:focus { border-color: rgba(74,158,255,0.3); }
.cmt-input-row input::placeholder { color: #445577; }
.cmt-send {
  padding: 0.5rem 1rem; border-radius: 8px;
  background: rgba(74,158,255,0.2); color: #8abdf0;
  border: 1px solid rgba(74,158,255,0.25); cursor: pointer;
  font-size: 0.85rem; transition: all 0.2s; white-space: nowrap;
}
.cmt-send:hover { background: rgba(74,158,255,0.3); }

/* ── 移动端 ── */
@media (max-width: 720px) {
  .top-bar { padding: 0.8rem 1rem; }
  .top-bar h1 { font-size: 1.1rem; }
  .container { padding: 0 0.8rem 2rem; }
  .entry { padding: 0.8rem 1rem; }
  .entry .body { font-size: 0.95rem; }
  .editor-panel, .detail-panel { width: 95%; padding: 1.2rem; }
  .detail-panel { max-height: 80vh; overflow-y: auto; }
  .toolbar { justify-content: center; }
}

.footer {
  text-align: center; color: #223344; font-size: 0.7rem;
  padding: 1.5rem 0; letter-spacing: 0.1rem;
}

/* ════ 淡蓝粉浅色主题（2026-08-14） ════ */
html { background: #eef3fb !important; }
body {
  background: linear-gradient(165deg, #eaf1fb 0%, #f2ecf5 52%, #fdeef2 100%) !important;
  background-attachment: fixed;
  color: #46536b !important;
}
.top-bar h1 {
  background: linear-gradient(135deg, #5b7db8, #e58fa8) !important;
  -webkit-background-clip: text !important; -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
.back-btn { color: #7a8aa5 !important; }
.back-btn:hover { color: #5b8fd0 !important; }
.words-username { color: #5b8fd0 !important; }
.words-userrole { background: rgba(90,150,230,0.15) !important; color: #4a8fd0 !important; }
.words-userrole.role-admin { background: rgba(240,160,180,0.2) !important; color: #d8709a !important; }
.words-logout { color: #8a96ad !important; border-color: #d8dff0 !important; }
.words-logout:hover { border-color: #e17055 !important; color: #e17055 !important; }
.desc { color: #93a1bc !important; }

.btn { border-color: rgba(120,150,200,0.35) !important; }
.btn-new { background: rgba(110,170,255,0.15) !important; color: #4a8fd0 !important; border-color: rgba(110,170,255,0.4) !important; }
.btn-new:hover { background: rgba(110,170,255,0.28) !important; }
.btn-submit { background: linear-gradient(135deg, #6aa6f0, #e89ab4) !important; color: #fff !important; border-color: transparent !important; }
.btn-submit:hover { background: linear-gradient(135deg, #5a96e0, #dd8aa4) !important; }

.entry {
  background: rgba(255,255,255,0.72) !important;
  border: 1px solid rgba(150,170,210,0.25) !important;
  box-shadow: 0 2px 12px rgba(140,160,200,0.08);
}
.entry:hover {
  border-color: rgba(140,170,230,0.5) !important;
  background: rgba(255,255,255,0.92) !important;
}
.entry .meta .time { color: #9aa8c2 !important; }
.entry .meta .author { color: #7a8aa5 !important; }
.entry .meta .cmt-count { color: #8aa5cf !important; }
.entry .body { color: #46536b !important; }
.entry .body strong { color: #5b8fd0 !important; }
.entry .body code { background: rgba(110,170,255,0.12) !important; color: #4a8fd0 !important; }

.empty-state { color: #93a1bc !important; }
.empty-hint { color: #a8b4cc !important; }

.editor-overlay, .detail-overlay { background: rgba(90,105,135,0.35) !important; }
.editor-panel, .detail-panel {
  background: #ffffff !important;
  border: 1px solid rgba(150,170,210,0.3) !important;
  box-shadow: 0 10px 40px rgba(120,140,180,0.25) !important;
}
.editor-header h2 { color: #5b6a85 !important; }
.editor-close, .detail-close { color: #9aa8c2 !important; }
.editor-close:hover { color: #e07090 !important; }
.editor-panel textarea {
  background: #f6f9fe !important;
  border-color: rgba(150,170,210,0.35) !important;
  color: #46536b !important;
}
.editor-panel textarea::placeholder { color: #a8b4cc !important; }
.editor-hint { color: #93a1bc !important; }

.detail-content .body {
  background: linear-gradient(135deg, rgba(110,170,255,0.09), rgba(235,150,180,0.12)) !important;
  border-color: rgba(150,170,210,0.3) !important;
  border-left-color: rgba(110,170,255,0.55) !important;
  color: #46536b !important;
}
.detail-content .body strong { color: #5b8fd0 !important; }
.detail-content .body code { background: rgba(110,170,255,0.12) !important; color: #4a8fd0 !important; }
.detail-time, .detail-author { color: #8a96ad !important; }
.detail-author { color: #7a8aa5 !important; }
.detail-meta { color: #8a96ad !important; }

.cmt-section { border-top-color: rgba(150,170,210,0.25) !important; }
.cmt-title { color: #8a96ad !important; }
.cmt-empty { color: #9aa8c2 !important; }
.comment { background: rgba(240,244,252,0.7) !important; }
.cmt-author { color: #5b8fd0 !important; }
.cmt-time { color: #9aa8c2 !important; }
.cmt-text { color: #46536b !important; }
.cmt-input-row input {
  background: #f6f9fe !important;
  border-color: rgba(150,170,210,0.35) !important;
  color: #46536b !important;
}
.cmt-input-row input::placeholder { color: #a8b4cc !important; }

.confirm-panel { background: #fff !important; border-color: rgba(150,170,210,0.3) !important; }
.confirm-panel p { color: #5b6a85 !important; }
.confirm-cancel { background: rgba(150,160,190,0.12) !important; color: #7a8aa5 !important; }
.confirm-ok { background: rgba(230,120,150,0.15) !important; color: #e06088 !important; }

.del-entry-btn, .del-cmt-btn { color: #e080a0 !important; }
.edit-entry-btn, .edit-cmt-btn { color: #5b8fd0 !important; }
.edited-tag { color: #b0a8c8 !important; }
.edit-area, .cmt-edit-input {
  background: #f6f9fe !important;
  border-color: rgba(150,170,210,0.35) !important;
  color: #46536b !important;
}
.edit-save, .cmt-save { color: #4a8fd0 !important; border-color: rgba(110,170,255,0.4) !important; }
.edit-cancel, .cmt-cancel { color: #8a96ad !important; border-color: rgba(150,160,190,0.3) !important; }

.footer { color: #a8b4cc !important; }

/* ── 搜索 + 排序控件（浅色） ── */
.toolbar {
  justify-content: space-between !important;
  align-items: center; gap: 10px; flex-wrap: wrap;
}
.words-tools { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 150px; }
.search-box input {
  width: 100%; padding: 7px 34px 7px 32px; border-radius: 8px;
  background: rgba(255,255,255,0.85); border: 1px solid rgba(150,170,210,0.35);
  color: #46536b; font-size: 0.88rem; outline: none; font-family: inherit;
  transition: border-color 0.2s;
}
.search-box input:focus { border-color: rgba(110,170,255,0.6); }
.search-box input::placeholder { color: #a8b4cc; }
.search-box .search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 0.85rem; color: #9aa8c2; pointer-events: none;
}
.search-box .search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #a8b4cc; font-size: 0.85rem;
  cursor: pointer; padding: 2px 5px;
}
.search-box .search-clear:hover { color: #e06088; }
.sort-group {
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.7); border: 1px solid rgba(150,170,210,0.3);
  border-radius: 8px; padding: 3px;
}
.sort-btn {
  background: none; border: none; padding: 4px 12px; border-radius: 6px;
  font-size: 0.8rem; color: #8a96ad; cursor: pointer; font-family: inherit;
  transition: all 0.2s;
}
.sort-btn:hover { color: #5b8fd0; }
.sort-btn.active { background: linear-gradient(135deg, #6aa6f0, #e89ab4); color: #fff; }

/* ════ 写留言编辑器对齐帆海楼编辑台（2026-08-19） ════ */
.editor-panel, .detail-panel {
  background: #ffffff !important;
  border: 1px solid rgba(150,170,210,0.25) !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 12px rgba(140,160,200,0.08) !important;
}
.editor-panel textarea {
  background: #fff !important;
  border: 1px solid #d8dff0 !important;
  border-radius: 8px !important;
  color: #46536b !important;
  padding: 0.55rem 0.8rem !important;
  font-size: 0.92rem !important;
  line-height: 1.7 !important;
  font-family: Consolas, "Courier New", monospace;
}
.editor-panel textarea:focus {
  border-color: rgba(110,170,255,0.6) !important;
  outline: none;
}
.btn-submit {
  background: #5b8fd0 !important;
  border-color: #5b8fd0 !important;
  color: #fff !important;
  border-radius: 8px !important;
}
.btn-submit:hover { background: #4a7fc0 !important; }
.btn-new {
  background: #fff !important;
  color: #5b8fd0 !important;
  border: 1px solid #c8d4ea !important;
  border-radius: 8px !important;
}
.btn-new:hover { background: #f0f6ff !important; border-color: #5b8fd0 !important; }
