.entry-body {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 22px;
}
.entry-panel {
  width: min(100%, 440px);
}
.entry-project {
  color: var(--muted);
  margin: 20px 0 8px;
}
.entry-panel h1 {
  font-family: var(--reader-font);
  font-size: clamp(27px, 5vw, 34px);
  font-weight: 600;
  margin: 0 0 12px;
}
.entry-panel form {
  margin-top: 30px;
}
.entry-panel form button {
  width: 100%;
  margin-top: 8px;
  min-height: 48px;
}
.entry-note {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 40px;
  font-size: 12px;
  color: var(--muted);
}
.comments-section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
}
.comments-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.comments-heading h2 {
  font-family: var(--reader-font);
  margin: 0;
  font-size: 25px;
}
#commentCount {
  font: 400 14px sans-serif;
  color: var(--muted);
}
.comments-heading label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
}
.comments-heading select {
  width: auto;
}
#commentForm {
  margin: 24px 0 32px;
}
#commentNickname {
  max-width: 320px;
}
.reply-context {
  margin: 18px 0;
  border-left: 3px solid var(--line);
  padding: 8px 12px;
  overflow-wrap: anywhere;
}
.reply-context span {
  display: block;
}
.comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.comment-actions button {
  flex-shrink: 0;
}
.comment-item {
  border-top: 1px solid var(--line);
  padding: 22px 0;
  overflow-wrap: anywhere;
}
.comment-item header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.comment-item time {
  color: var(--muted);
  font-size: 12px;
}
.comment-text {
  white-space: pre-wrap;
  line-height: 1.85;
  margin: 14px 0;
}
.comment-item blockquote {
  margin: 16px 0 0;
  padding: 8px 14px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.comment-item blockquote p {
  margin: 4px 0;
  white-space: pre-wrap;
}
.comments-empty {
  color: var(--muted);
  padding: 20px 0;
}
.comment-pagination {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
}
.move-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding: 16px 0 24px;
}
.move-tools label {
  margin: 0;
}
.move-tools .select-all {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  white-space: nowrap;
}
.select-all input[type="checkbox"],
.document-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.document-check {
  margin: 0;
  padding: 10px 6px;
  flex-shrink: 0;
}
.document-info {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
#moveCount {
  align-self: center;
  color: var(--muted);
}
.focus-mode .comments-section {
  display: none;
}
@media (max-width: 600px) {
  .comments-heading {
    align-items: flex-start;
  }
  .comments-heading h2 {
    font-size: 23px;
  }
  .comment-actions {
    flex-wrap: wrap;
  }
  .comment-actions button {
    margin-left: auto;
  }
  .move-tools > label {
    max-width: 100%;
  }
  .move-tools select {
    max-width: 100%;
  }
  #documentRows .admin-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  #documentRows .button-row {
    flex-basis: 100%;
    padding-left: 36px;
  }
  .site-header {
    flex-wrap: wrap;
    gap: 14px;
  }
  .admin-tabs button {
    flex: 1;
    padding: 8px;
    white-space: nowrap;
  }
}
.shelf-pagination,
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0;
}
#shelfJump {
  display: flex;
  align-items: center;
  gap: 8px;
}
#shelfJump label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
#shelfPageInput {
  width: 78px;
  margin: 0;
}
#sectionTabs {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
}
.share-code {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  font-family: system-ui, sans-serif;
  font-size: 12px;
}
.share-code label {
  margin: 0;
}
.share-code input {
  width: 285px;
  max-width: 100%;
  padding: 8px;
  min-height: 36px;
  text-align: center;
  font-size: 12px;
}
.share-code button {
  font-size: 12px;
}
/* 通用 input 规则（权重 0,3,1）会把分享码输入框拉成整行，这里用 id 提权回到 285px */
.share-code input#shareCode {
  width: 285px;
  max-width: 100%;
}
.range-tools {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 20px;
}
.range-tools label {
  margin: 0;
}
.range-tools input {
  width: 100px;
}
.range-tools > span {
  align-self: center;
  font-size: 13px;
}
.document-number {
  color: var(--muted);
  min-width: 2.8em;
  font-variant-numeric: tabular-nums;
}
.result-section {
  color: var(--muted);
}
.section-manager {
  max-width: 700px;
}
.managed-section {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.managed-sections span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
#sectionForm {
  margin-top: 24px;
}
.admin-tabs {
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  #sectionTabs {
    gap: 4px;
  }
  #sectionTabs .section-tab {
    padding: 14px 0;
  }
  #sectionTabs .tab-title,
  #sectionTabs .tab-description {
    min-height: 0;
  }
  .share-code input {
    flex-basis: 100%;
  }
  .admin-tabs button {
    flex: initial;
  }
  .admin-pagination span {
    font-size: 12px;
  }
}
@media (max-width: 480px) {
  .shelf {
    grid-template-columns: 1fr;
  }
  .book {
    min-height: 180px;
  }
}

.managed-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.managed-section > div:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.section-order-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.section-order-actions button {
  padding: 8px 12px;
}
@media (max-width: 480px) {
  .managed-section {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

/* 访问验证：二次验证提示、讨论区「验证后可见」遮罩 */
.gate-notice {
  margin: 0 0 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.7;
  color: #8a5a12;
  background: #fdf5e3;
  border: 1px solid #f0dcb4;
  border-radius: 6px;
}
.gate-question {
  margin-top: 4px;
}
.gate-question-text {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.7;
}
.gate-question .gate-answer {
  margin-top: 6px;
}
.entry-panel .gate-question-text {
  font-size: 15px;
}
.comments-gate {
  padding: 22px 18px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--tint);
}
.comments-gate > p:first-child {
  margin: 0 0 6px;
  font: 600 15px/1.6 "Songti SC", "SimSun", serif;
  letter-spacing: 1px;
  color: var(--ink);
}
.comments-gate .hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
}

/* 后台「访问验证」页 */
.gate-admin {
  max-width: 760px;
}
.gate-admin h2 {
  margin: 0 0 6px;
  font: 600 20px/1.5 "Songti SC", "SimSun", serif;
  letter-spacing: 1px;
}
.gate-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
  font-size: 14px;
  cursor: pointer;
}
.gate-switch input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  flex: 0 0 auto;
  padding: 0;
}
.gate-block {
  display: block;
  margin: 16px 0;
  font-size: 13px;
  color: var(--muted);
}
.gate-block textarea {
  width: 100%;
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.gate-questions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 6px;
}
.gate-questions-head h3 {
  margin: 0;
  font: 600 16px/1.5 "Songti SC", "SimSun", serif;
  color: var(--ink);
}
.gate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  gap: 10px;
  align-items: end;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.gate-row label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.gate-row textarea,
.gate-row input {
  width: 100%;
  margin-top: 4px;
  font-size: 13px;
}
.gate-row button {
  align-self: end;
  height: 38px;
}
.gate-admin .button-row {
  margin-top: 18px;
}
.gate-status {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: #8a5a12;
}
@media (max-width: 640px) {
  .gate-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }
  .gate-row button {
    height: auto;
  }
}
