* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
  color: #1f2937;
}
.header {
  background: #1e40af;
  color: #fff;
  padding: 12px 24px 0;
}
.header-row { display: flex; justify-content: space-between; align-items: flex-start; }
.header h1 { margin: 0 0 4px; font-size: 20px; }
.sub { margin: 0; opacity: 0.85; font-size: 13px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.mode-tabs { display: flex; gap: 8px; margin-top: 12px; }
.mode-tab {
  padding: 8px 16px;
  border: none;
  border-radius: 8px 8px 0 0;
  background: rgba(255,255,255,.15);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}
.mode-tab.active { background: #f0f2f5; color: #1e40af; font-weight: 600; }
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  padding: 16px;
  min-height: calc(100vh - 100px);
}
.layout.nav-mode { grid-template-columns: 1fr; }
.panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.sidebar { padding: 16px; overflow: auto; }
.label { display: block; font-size: 12px; color: #6b7280; margin: 12px 0 6px; }
.label:first-child { margin-top: 0; }
.select, input[type="text"], input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f9fafb;
  cursor: pointer;
  font-size: 13px;
}
.tab.active { background: #dbeafe; border-color: #3b82f6; color: #1d4ed8; }
.paper-list { max-height: 45vh; overflow: auto; }
.paper-item {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  border: 1px solid transparent;
}
.paper-item:hover { background: #f3f4f6; }
.paper-item.active { background: #eff6ff; border-color: #93c5fd; }
.sidebar-toolbar { display: flex; justify-content: space-between; align-items: center; }
.muted { color: #9ca3af; font-size: 12px; }
.main { padding: 0; overflow: hidden; }
.empty { padding: 48px; text-align: center; color: #9ca3af; }
.hidden { display: none !important; }
.editor { display: flex; flex-direction: column; height: calc(100vh - 120px); }
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
  gap: 8px;
}
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.editor-body { display: grid; grid-template-columns: 160px 1fr; flex: 1; min-height: 0; }
.mock-body { grid-template-columns: 180px 1fr; }
.mock-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  align-items: flex-end;
}
.field.inline { flex: 1; min-width: 120px; margin: 0; }
.field.inline label { margin-bottom: 4px; }
.check { font-size: 13px; display: flex; align-items: center; gap: 6px; padding-bottom: 8px; }
.q-nav {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow: auto;
  border-right: 1px solid #e5e7eb;
}
.q-nav li {
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
  word-break: break-all;
}
.q-nav li.active { background: #dbeafe; }
.q-form { padding: 16px; overflow: auto; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.field textarea, .field select {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.upload-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.preview {
  margin-top: 8px;
  padding: 8px;
  border: 1px dashed #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  max-height: 200px;
  overflow: auto;
}
.preview img { max-width: 100%; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
/* ---------- 导航 nav.json 编辑 ---------- */
.nav-list { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.nav-subject {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  background: #fbfcfe;
}
.nav-subject-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.nav-subject-head strong { font-size: 15px; }
.nav-fields { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.nav-fields .field.inline { flex: 1; min-width: 110px; }
.nav-type { border-top: 1px dashed #e5e7eb; padding-top: 8px; margin-top: 8px; }
.nav-type-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #374151;
  margin-bottom: 6px;
}
.nav-papers { display: flex; flex-direction: column; gap: 6px; }
.nav-paper { display: flex; gap: 6px; align-items: center; }
.nav-paper input { flex: 1; min-width: 0; padding: 5px 8px; font-size: 13px; }
.nav-paper input.st { flex: 1.4; }
.nav-paper .btn.sm { padding: 4px 8px; }
.btn {
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn:hover { background: #f9fafb; }
.btn.primary { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.btn.primary:hover { background: #2563eb; }
.btn.success { background: #059669; color: #fff; border-color: #059669; }
.btn.success:hover { background: #047857; }
.btn.danger { color: #dc2626; border-color: #fca5a5; }
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 999;
}
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
}
.login-card {
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  width: 360px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.login-card h1 { margin: 0 0 8px; font-size: 22px; }
.login-card .sub { color: #6b7280; margin-bottom: 24px; }
.login-card input {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}
.err { color: #dc2626; font-size: 13px; margin-top: 12px; }
