/*
  Theme for the Decap editor at /admin.

  Direction: the editorial office of the publisher whose site this is. A navy
  bar across the top, the site's cool greys and hairlines, near-square
  corners, Inter. Scholars show as 4:5 photo cards like the Editorial Board
  page; the editor puts the form on the left and a live profile preview
  (preview.js / preview.css) on the right. Status colours: green published,
  amber draft, blue awaiting publish. Fields are soft grey fills that turn
  white while you type; lists are white rounded panels whose rows (year,
  title, authors and journal) are built by rows.js.

  How it hooks in: Decap styles itself with Emotion, whose class names look
  like `css-<hash>-<ComponentName>`. The hash changes between Decap versions
  but the component names don't, so rules match `-<ComponentName>`. Emotion
  injects its styles after this file, hence the !important. After upgrading
  Decap, open /admin and check that these still apply.
*/

/* Inter is already served for the public site. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
  --canvas: #f4f5f7;
  --paper: #ffffff;
  --hover: #eef3f8;
  --ink: #1b1f24;
  --text: #2a2f36;
  --muted: #5b6470;
  --faint: #8a929c;
  --rule: #e1e4e8;
  --rule-strong: #cdd2d8;

  --navy: #0e2a47;
  --navy-600: #1d4a78;
  --navy-line: #2b4868;
  --navy-text: #c4d2e1;
  --navy-50: #eef3f8;
  --focus-ring: 0 0 0 3px #dbe6f1;

  --red: #a8322d;
  --red-bg: #fbeceb;
  --green: #2e7d4f;
  --green-bg: #e9f4ee;
  --amber: #8a5a00;
  --amber-bg: #fff4dc;

  --r-sm: 3px;
  --r: 4px;
  --r-field: 8px;
  --r-panel: 10px;
  --fill: #f4f5f7;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- Base ---------- */

html,
body {
  background: var(--canvas) !important;
  color: var(--text);
  font-family: var(--font) !important;
  -webkit-font-smoothing: antialiased;
}
#nc-root,
#nc-root button,
#nc-root input,
#nc-root textarea,
#nc-root select {
  font-family: var(--font) !important;
}
#nc-root ::selection {
  background: #dbe6f1;
}
#nc-root a,
#nc-root button,
#nc-root [role="button"] {
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
#nc-root :focus-visible {
  outline: 2px solid var(--navy-600) !important;
  outline-offset: 2px;
}

/* ---------- Sign-in: navy panel on the left, the button on the right ---------- */

[class*="-StyledAuthenticationPage"] {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(90deg, var(--navy) 0 44%, var(--paper) 44%) !important;
  justify-content: center !important;
  align-items: flex-start !important;
  gap: 0 !important;
  padding: 0 0 40px calc(44% + 96px) !important;
  box-sizing: border-box;
}
[class*="-StyledAuthenticationPage"]::before {
  content: "学者名录后台";
  white-space: pre-wrap;
  position: absolute;
  top: 0;
  left: 0;
  width: 44%;
  box-sizing: border-box;
  padding: 120px 64px 0;
  color: #fff;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.3;
}
[class*="-StyledAuthenticationPage"]::after {
  content: "■  新增或修改学者资料、照片和论文\A■  编辑时右侧实时预览网站上的个人页\A■  改动先存草稿，点“发布”后约 1–2 分钟上线";
  white-space: pre-wrap;
  position: absolute;
  top: 200px;
  left: 0;
  width: 44%;
  box-sizing: border-box;
  padding: 0 64px;
  color: var(--navy-text);
  font-size: 15px;
  line-height: 2.2;
}
[class*="-CustomIconWrapper"] {
  order: 0;
  width: 56px !important;
  height: 56px !important;
  margin: 0 0 22px !important;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
}
[class*="-CustomIconWrapper"] img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
[class*="-LoginButton-"] {
  order: 1;
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center !important;
  gap: 10px;
  width: 320px;
  height: 42px !important;
  margin: 0 !important;
  padding: 0 20px !important;
  font-size: 14.5px !important;
  font-weight: 500 !important;
}
[class*="-LoginButtonIcon"] {
  position: static !important;
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  color: #fff;
}
[class*="-LoginButtonIcon"] svg {
  width: 18px !important;
  height: 18px !important;
}
[class*="-GoBackButtonStyle"] {
  order: 2;
  margin-top: 18px !important;
  color: var(--muted) !important;
  font-size: 13px;
}
[class*="-GoBackButtonStyle"]:hover {
  color: var(--navy) !important;
}
[class*="-NetlifyCreditIcon"] {
  opacity: 0.25;
  filter: grayscale(1);
  transform: scale(0.8);
}

/* ---------- Buttons ---------- */

/* Primary: navy, flat. */
[class*="-LoginButton-"],
[class*="-CollectionTopNewButton"],
[class*="-SaveButton"],
[class*="-PublishButton"] {
  background: var(--navy) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: var(--r-sm) !important;
  box-shadow: none !important;
}
[class*="-LoginButton-"]:hover,
[class*="-CollectionTopNewButton"]:hover,
[class*="-SaveButton"]:hover,
[class*="-PublishButton"]:hover {
  background: var(--navy-600) !important;
}
[class*="-LoginButton-"] svg path {
  fill: #fff !important;
}
[class*="-PublishButton"]::after {
  color: #fff !important;
}
[class*="-CollectionTopNewButton"] {
  height: 34px !important;
  padding: 0 14px !important;
  line-height: 34px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
}

/* Secondary: outlined. On the navy bar it turns into a ghost button. */
[class*="-AppHeaderQuickNewButton"] {
  background: transparent !important;
  color: #fff !important;
  border: 1px solid var(--navy-line) !important;
  border-radius: var(--r-sm) !important;
  box-shadow: none !important;
  font-weight: 500 !important;
  height: 32px !important;
  padding: 0 30px 0 12px !important;
  line-height: 30px !important;
  font-size: 13px !important;
}
[class*="-AppHeaderQuickNewButton"]:hover {
  background: var(--navy-line) !important;
}
[class*="-AppHeaderQuickNewButton"]::after {
  top: 50% !important;
  right: 12px !important;
  transform: translateY(-50%);
  color: var(--navy-text) !important;
}

/* Destructive: quiet until hovered. */
[class*="-DeleteButton"] {
  background: transparent !important;
  color: var(--red) !important;
  border: 0 !important;
  box-shadow: none !important;
  font-weight: 500 !important;
}
[class*="-DeleteButton"]:hover {
  background: var(--red-bg) !important;
}

/* Status of the open entry. */
[class*="-PublishedToolbarButton"] {
  background: var(--green-bg) !important;
  color: var(--green) !important;
  border: 0 !important;
  border-radius: var(--r-sm) !important;
  box-shadow: none !important;
  font-weight: 500 !important;
}
[class*="-PublishedToolbarButton"]::after {
  color: var(--green) !important;
}

/* In-form "add" buttons. */
[class*="-AddButton"] {
  background: var(--paper) !important;
  color: var(--navy) !important;
  border: 1px solid var(--rule-strong) !important;
  border-radius: var(--r-sm) !important;
  font-weight: 500 !important;
}
[class*="-AddButton"]:hover {
  background: var(--hover) !important;
}
[class*="-AddButton"] svg path {
  fill: currentColor;
}

/* ---------- Top bar: navy, like the publisher's own systems ---------- */

[class*="-AppHeader-"] {
  background: var(--navy) !important;
  border-bottom: 0;
  box-shadow: none !important;
}
[class*="-AppHeaderContent"] {
  max-width: 1320px;
  min-height: 54px;
  justify-content: flex-start !important;
  align-items: center !important;
}
[class*="-AppHeaderContent"] > nav {
  display: flex;
  align-items: center;
  align-self: stretch;
}
[class*="-AppHeaderActions"] {
  margin-left: auto;
}
[class*="-AppHeaderContent"]::before {
  content: "Panorama";
  display: flex;
  align-items: center;
  padding-left: 4px;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  white-space: nowrap;
}
[class*="-AppHeaderNavList"] {
  align-items: stretch;
  align-self: stretch;
  gap: 2px;
}
[class*="-AppHeaderNavList"]::before {
  content: "编辑部后台";
  display: flex;
  align-items: center;
  margin: 0 28px 0 12px;
  padding-left: 12px;
  border-left: 1px solid var(--navy-line);
  font-size: 13px;
  color: var(--navy-text);
  white-space: nowrap;
  height: 18px;
  align-self: center;
}
[class*="-AppHeaderNavList"] > li {
  display: flex;
  align-items: flex-end;
}
/* Sections are folder tabs: the open one is cut from the page below it, so
   the bar and the page read as one sheet. */
[class*="-AppHeaderNavLink"],
[class*="-AppHeaderButton"] {
  position: relative;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: center;
  height: 40px !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 18px !important;
  border: 0 !important;
  border-radius: var(--r) var(--r) 0 0 !important;
  color: var(--navy-text) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em;
  background: transparent !important;
}
[class*="-AppHeaderNavLink"] [class*="-IconWrapper"],
[class*="-AppHeaderButton"] [class*="-IconWrapper"] {
  display: none !important;
}
[class*="-AppHeaderNavLink"]:hover,
[class*="-AppHeaderButton"]:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06) !important;
}
[class*="-AppHeaderNavLink"].header-link-active,
[class*="-AppHeaderNavLink"].header-link-active:hover {
  color: var(--navy) !important;
  font-weight: 600 !important;
  background: var(--canvas) !important;
}
/* Inverted corners where the open tab meets the bar. */
[class*="-AppHeaderNavLink"].header-link-active::before,
[class*="-AppHeaderNavLink"].header-link-active::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 8px;
  height: 8px;
  pointer-events: none;
}
[class*="-AppHeaderNavLink"].header-link-active::before {
  left: -8px;
  background: radial-gradient(circle at 0 0, transparent 7.5px, var(--canvas) 8px);
}
[class*="-AppHeaderNavLink"].header-link-active::after {
  right: -8px;
  background: radial-gradient(circle at 100% 0, transparent 7.5px, var(--canvas) 8px);
}
[class*="-AppHeaderSiteLink"] {
  font-family: var(--mono) !important;
  color: var(--navy-text) !important;
  font-size: 12px !important;
}
[class*="-AppHeaderSiteLink"]:hover {
  color: #fff !important;
}
[class*="-AvatarImage"],
[class*="-AvatarPlaceholderIcon"] {
  border: 1px solid var(--navy-line);
  border-radius: 50%;
}
[class*="-AvatarPlaceholderIcon"] path {
  fill: var(--navy-text);
}

/* ---------- Collection view ---------- */

[class*="-AppMainContainer"] {
  max-width: 1320px !important;
}
[class*="-CollectionContainer"] {
  margin-top: 28px !important;
}

/* Sidebar: a grey column of plain rows, the current one highlighted. */
[class*="-SidebarContainer"] {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
[class*="-SidebarHeading"] {
  padding: 0 10px !important;
  margin: 4px 0 10px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--faint) !important;
  letter-spacing: 0.06em;
}
[class*="-SearchContainer"] {
  margin: 0 0 10px !important;
  padding: 0 !important;
}
[class*="-SearchInput"] {
  height: 34px;
  background: var(--paper) !important;
  border: 1px solid var(--rule-strong) !important;
  border-radius: var(--r-sm) !important;
  font-size: 13.5px !important;
}
[class*="-SearchInput"]:focus {
  border-color: var(--navy-600) !important;
  box-shadow: var(--focus-ring) !important;
  outline: none;
}
/* Collections read like the board page's role list: plain rows, the open
   one tinted navy. Decap's pen icon is swapped for a 4:5 portrait frame,
   the same shape as the photo cards beside it. */
[class*="-SidebarNavLink"] {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 1px 0;
  padding: 9px 12px !important;
  border: 0 !important;
  border-radius: var(--r-sm);
  color: var(--muted) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}
[class*="-SidebarNavLink"] [class*="-IconWrapper"] {
  width: 14px !important;
  height: 18px !important;
  margin: 0 !important;
  flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 18'%3E%3Cpath fill-rule='evenodd' d='M2 0h10a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2Zm0 1.5a.5.5 0 0 0-.5.5v14c0 .28.22.5.5.5h.3c.5-2.8 2.2-4.3 4.7-4.3s4.2 1.5 4.7 4.3h.3a.5.5 0 0 0 .5-.5V2a.5.5 0 0 0-.5-.5H2ZM7 4a2.75 2.75 0 1 1 0 5.5A2.75 2.75 0 0 1 7 4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 18'%3E%3Cpath fill-rule='evenodd' d='M2 0h10a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2Zm0 1.5a.5.5 0 0 0-.5.5v14c0 .28.22.5.5.5h.3c.5-2.8 2.2-4.3 4.7-4.3s4.2 1.5 4.7 4.3h.3a.5.5 0 0 0 .5-.5V2a.5.5 0 0 0-.5-.5H2ZM7 4a2.75 2.75 0 1 1 0 5.5A2.75 2.75 0 0 1 7 4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
[class*="-SidebarNavLink"] [class*="-IconWrapper"] svg {
  display: none !important;
}
[class*="-SidebarNavLink"]:hover {
  background: #e9ecf0 !important;
  color: var(--ink) !important;
}
[class*="-SidebarNavLink"].sidebar-active,
[class*="-SidebarNavLink"].sidebar-active:hover {
  background: #e3eaf2 !important;
  color: var(--navy) !important;
  font-weight: 600 !important;
}

/* Page heading */
[class*="-CollectionTopContainer"],
[class*="-CollectionControlsContainer"] {
  width: auto !important;
  max-width: none !important;
}
[class*="-CollectionTopContainer"] {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 0 18px !important;
  margin-bottom: 4px !important;
  border-bottom: 1px solid var(--rule) !important;
  border-radius: 0 !important;
}
[class*="-CollectionTopRow"] {
  align-items: flex-end !important;
}
[class*="-CollectionTopHeading"] {
  font-size: 24px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  color: var(--ink) !important;
}
[class*="-CollectionTopDescription"] {
  max-width: 64ch;
  margin-top: 6px !important;
  color: var(--muted) !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
}
[class*="-CollectionControlsContainer"] {
  margin: 10px 0 14px !important;
}
[class*="-ViewControlsText"],
[class*="-ControlButton"] {
  color: var(--muted) !important;
  font-weight: 500 !important;
}
[class*="-ViewControlsButton"] {
  color: var(--faint) !important;
}
[class*="-ViewControlsButton"]:hover {
  color: var(--navy) !important;
}
/* Decap marks the active view only with its blue; repaint that blue. */
[class*="-ViewControlsButton"][style*="color"],
[class*="-ViewControlsButton"] svg[style*="color"] {
  color: var(--navy) !important;
}
/* Group headings (分组 → 编委会层级) read like the board page's tier rules. */
[class*="-GroupHeading"] {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 10px !important;
  color: var(--navy-600) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
[class*="-GroupHeading"]::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* Photo cards: the Editorial Board page in miniature. */
[class*="-CardsGrid"]:has(> [class*="-GridCard-"]) {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin: 0 !important;
  padding: 0 !important;
}
/* Trailing dash: the card is "-GridCard-card", its link "-GridCardLink".
   Matching the link too gave it a second border that stopped short of the
   row height, so cards with a one-line role showed a strip below them. */
[class*="-GridCard-"] {
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  background: var(--paper) !important;
  border: 1px solid var(--rule) !important;
  border-radius: var(--r) !important;
  box-shadow: none !important;
  overflow: hidden;
}
[class*="-GridCard-"]:hover {
  border-color: var(--navy-600) !important;
  box-shadow: 0 0 0 1px var(--navy-600) !important;
}
[class*="-GridCardLink"] {
  display: flex !important;
  flex-direction: column;
  height: 100% !important;
}
[class*="-GridCard"] [class*="-StyledImage"] {
  order: -1;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 4 / 5;
  background-size: cover !important;
  background-position: center !important;
  background-color: #d9dde2;
}
/* Decap mounts each card without its photo and adds it a frame later, and
   it remounts the whole grid several times while entries and images load.
   Without a placeholder every card shrank to its name and sprang back each
   time, so the grid flickered. Hold the 4:5 photo space until the photo is
   there (and for scholars with no photo). */
[class*="-GridCardLink"]:not(:has([class*="-StyledImage"]))::before {
  content: "";
  order: -1;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  background-color: #d9dde2;
}
[class*="-GridCard"] [class*="-CardBody"] {
  flex-grow: 1;
  height: auto !important;
  padding: 9px 11px 11px !important;
}
[class*="-GridCard"] [class*="-CardBody"]::after {
  display: none !important;
}
[class*="-GridCard"] [class*="-CardHeading"] {
  display: block !important;
  -webkit-line-clamp: unset !important;
  margin: 0 !important;
  white-space: pre-line;
  color: var(--muted) !important;
  font-size: 11.5px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
}
[class*="-GridCard"] [class*="-CardHeading"]::first-line {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.6;
}

/* List view (the table toggle): one bordered sheet with hairline rows. */
[class*="-CardsGrid"]:has(> [class*="-ListCard-"]) {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  overflow: hidden;
}
[class*="-ListCard-"] {
  width: auto !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--rule) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
[class*="-ListCard-"]:last-child {
  border-bottom: 0 !important;
}
[class*="-ListCard-"]:hover {
  background: var(--hover) !important;
}
[class*="-ListCardLink"] {
  padding: 11px 18px !important;
}
[class*="-ListCardTitle"] {
  white-space: pre-line;
  color: var(--muted) !important;
  font-size: 12.5px !important;
  font-weight: 400 !important;
}
[class*="-ListCardTitle"]:has(.pd-card) {
  font-size: 0 !important;
}
[class*="-ListCardTitle"] {
  flex: 1 1 auto;
  margin-right: auto !important;
  text-align: left !important;
}
.pd-card {
  order: -1;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.pd-card-name {
  color: var(--ink);
  font: 600 14px/1.45 var(--font);
}
.pd-card-role {
  color: var(--muted);
  font: 400 12.5px/1.45 var(--font);
}

/* ---------- Editor: form on the left, live profile preview on the right ---------- */

[class*="-ToolbarContainer"] {
  background: var(--paper) !important;
  border-bottom: 1px solid var(--rule);
  box-shadow: none !important;
}
[class*="-ToolbarSectionBackLink"] {
  border-right-color: var(--rule) !important;
}
[class*="-ToolbarSectionBackLink"]:hover {
  background: var(--hover) !important;
}
[class*="-BackCollection"] {
  color: var(--ink) !important;
  font-weight: 600 !important;
}
[class*="-BackArrow"] {
  color: var(--navy) !important;
}
[class*="-BackStatus"] {
  font-size: 12px !important;
  font-weight: 500 !important;
}
[class*="-ToolbarSectionMeta"] {
  border-left-color: var(--rule) !important;
}
[class*="-PreviewLink"] {
  color: var(--muted) !important;
  font-weight: 500;
}
[class*="-PreviewLink"]:hover {
  color: var(--navy) !important;
}
[class*="-PreviewLink"] * {
  color: inherit !important;
}
[class*="-EditorContainer"],
[class*="-ControlPaneContainer"],
[class*="-NoPreviewContainer"] {
  background: var(--paper) !important;
  border: 0 !important;
  box-shadow: none !important;
}
[class*="-ControlPaneContainer"] {
  padding: 4px 28px 120px !important;
}
/* Keep the preview clear of the eye / scroll-sync buttons Decap floats at
   its top right. */
[class*="-PreviewPaneContainer "] {
  padding-right: 60px !important;
}
[class*="-PreviewPaneFrame"] {
  background: var(--canvas) !important;
  border: 0 !important;
  box-shadow: none !important;
}
/* The pane-switch buttons Decap floats over the split. */
[class*="-EditorToggle"] {
  background: var(--paper) !important;
  border: 1px solid var(--rule-strong) !important;
  box-shadow: none !important;
  border-radius: var(--r-sm) !important;
}

/* Fields: label above a soft filled input, hint beneath. Inputs sit on a
   light grey fill with rounded corners and turn white with a navy outline
   while you type. */
[class*="-ControlContainer"] {
  margin-top: 22px !important;
}
[class*="-ControlTopbar"] {
  background: none !important;
  border: 0 !important;
}
[class*="-FieldLabel"] {
  background: none !important;
  border: 0 !important;
  padding: 0 0 7px !important;
  color: var(--text) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  text-transform: none !important;
}
[class*="-FieldLabel"]::before,
[class*="-FieldLabel"]::after {
  display: none !important;
}
[class*="-ControlTopbar"] + input,
[class*="-ControlTopbar"] + textarea,
.pd-doi-row input,
[aria-label="select field"] [class*="-control"] {
  border: 1px solid transparent !important;
  border-radius: var(--r-field) !important;
  background: var(--fill) !important;
  box-shadow: none !important;
  outline: none;
  transition: background-color 0.12s, border-color 0.12s;
}
[class*="-ControlTopbar"] + input,
[class*="-ControlTopbar"] + textarea,
.pd-doi-row input {
  padding: 8px 12px !important;
  min-height: 40px;
  font-size: 14px !important;
  line-height: 1.55 !important;
  color: var(--ink) !important;
}
[class*="-ControlTopbar"] + input:hover,
[class*="-ControlTopbar"] + textarea:hover,
.pd-doi-row input:hover,
[aria-label="select field"] [class*="-control"]:hover {
  border-color: var(--rule-strong) !important;
}
[class*="-ControlTopbar"] + input:focus,
[class*="-ControlTopbar"] + textarea:focus,
.pd-doi-row input:focus,
[aria-label="select field"] [class*="-control"]:focus-within {
  background: var(--paper) !important;
  border-color: var(--navy-600) !important;
  box-shadow: var(--focus-ring) !important;
}
/* Other widgets (markdown editor) keep a plain outlined box. */
[class*="-ControlTopbar"] + div:not([class*="-container"]) {
  border: 1px solid var(--rule-strong) !important;
  border-radius: var(--r-field) !important;
  background: var(--paper) !important;
  box-shadow: none !important;
}
[class*="-ControlTopbar"] + div:not([class*="-container"]):focus-within {
  border-color: var(--navy-600) !important;
  box-shadow: var(--focus-ring) !important;
}
/* ...but lists, objects, switches, photos and the DOI box are not inputs:
   no frame around them. */
[aria-label="list field"] > [class*="-ControlTopbar"] + div,
[aria-label="object field"] > [class*="-ControlTopbar"] + div,
[aria-label="boolean field"] > [class*="-ControlTopbar"] + div,
[aria-label="image field"] > [class*="-ControlTopbar"] + div,
[aria-label="doi field"] > [class*="-ControlTopbar"] + div,
[aria-label="select field"] > [class*="-ControlTopbar"] + div {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}
[class*="-ControlHint"] {
  color: var(--faint) !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
  margin-top: 6px !important;
}

/* Select: same height and fill as a text input. */
[aria-label="select field"] [class*="-control"] {
  min-height: 40px !important;
}
[aria-label="select field"] [class*="-control"] > div:first-child {
  padding: 0 12px !important;
}
[aria-label="select field"] [class*="-singleValue"] {
  margin: 0 !important;
  color: var(--ink) !important;
  font-size: 14px !important;
}
[aria-label="select field"] [class*="-indicatorContainer"] {
  padding: 0 10px !important;
}
[aria-label="select field"] [class*="-indicatorContainer"] svg {
  width: 16px;
  height: 16px;
}

/* Switch: smaller, navy when on. */
[aria-label="boolean field"] > [class*="-ControlTopbar"] + div {
  padding: 2px 0 !important;
}
[class*="-ToggleContainer"] {
  width: 36px !important;
  height: 20px !important;
}
[class*="-ToggleBackground"] {
  width: 36px !important;
  height: 20px !important;
  border-radius: 10px !important;
  background-color: var(--rule-strong) !important;
}
[class*="-ToggleContainer"][aria-checked="true"] [class*="-ToggleBackground"] {
  background-color: var(--navy) !important;
}
/* Decap slides the handle with translateX(20px); place it with left instead
   so it lines up with the smaller track. */
[class*="-ToggleHandle"] {
  width: 16px !important;
  height: 16px !important;
  top: 2px !important;
  transform: none !important;
  box-shadow: 0 1px 2px rgba(14, 42, 71, 0.25) !important;
}
[class*="-ToggleContainer"]:not([aria-checked="true"]) [class*="-ToggleHandle"] {
  left: 2px !important;
}
[class*="-ToggleContainer"][aria-checked="true"] [class*="-ToggleHandle"] {
  left: 18px !important;
}

/* ---------- Lists (论文、学术 ID、板块…) ----------
   A list is one white rounded panel. rows.js turns each item's summary into
   a row: year badge, bold title, authors and journal underneath. Click the
   row to open it; drag handle on the left, delete (×) on the right. The add button
   sits at the bottom of the panel. */

[aria-label="list field"] > [class*="-ControlTopbar"] + div {
  display: flex !important;
  flex-direction: column;
  border: 1px solid var(--rule) !important;
  border-radius: var(--r-panel) !important;
  background: var(--paper) !important;
  /* not overflow: hidden, which would clip the "添加条目" type menu */
}
[aria-label="list field"] > [class*="-ControlTopbar"] + div:focus-within {
  border-color: var(--rule) !important;
  box-shadow: none !important;
}
[aria-label="object field"] > [class*="-ControlTopbar"] + div:focus-within,
[aria-label="boolean field"] > [class*="-ControlTopbar"] + div:focus-within,
[aria-label="image field"] > [class*="-ControlTopbar"] + div:focus-within,
[aria-label="doi field"] > [class*="-ControlTopbar"] + div:focus-within,
[aria-label="select field"] > [class*="-ControlTopbar"] + div:focus-within {
  box-shadow: none !important;
}
/* The header (count + collapse-all + add) moves under the rows. */
[aria-label="list field"] [class*="-TopBarContainer"] {
  order: 2;
  display: flex !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-top: 1px solid var(--rule) !important;
  border-radius: 0 !important;
}
[aria-label="list field"]:not(:has([class*="-SortableListItem"])) [class*="-TopBarContainer"] {
  border-top: 0 !important;
}
[aria-label="list field"] [class*="-ExpandButtonContainer"] {
  display: none !important;
}
[aria-label="list field"] [class*="-TopBarContainer"] > div:last-child,
[aria-label="list field"] [class*="-TopBarContainer"] > div:last-child > div {
  display: block !important;
  flex: 1;
  width: 100% !important;
}
[aria-label="list field"] [class*="-AddButton"],
[aria-label="list field"] [class*="-StyledDropdownButton"] {
  display: flex !important;
  align-items: center;
  justify-content: flex-start !important;
  box-sizing: border-box;
  width: 100% !important;
  height: 46px !important;
  margin: 0 !important;
  padding: 0 0 0 34px !important;
  background: transparent !important;
  color: var(--navy-600) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font: 500 13.5px/46px var(--font) !important;
  text-transform: none !important;
}
[aria-label="list field"] [class*="-AddButton"],
[aria-label="list field"] [class*="-StyledDropdownButton"] {
  border-radius: 0 0 calc(var(--r-panel) - 1px) calc(var(--r-panel) - 1px) !important;
}
[aria-label="list field"]:not(:has([class*="-SortableListItem"])) [class*="-AddButton"],
[aria-label="list field"]:not(:has([class*="-SortableListItem"])) [class*="-StyledDropdownButton"] {
  border-radius: calc(var(--r-panel) - 1px) !important;
}
[aria-label="list field"] [class*="-AddButton"]:hover,
[aria-label="list field"] [class*="-StyledDropdownButton"]:hover {
  background: var(--navy-50) !important;
}
[aria-label="list field"] [class*="-AddButton"] > span,
[aria-label="list field"] [class*="-StyledDropdownButton"]::after {
  display: none !important;
}
[aria-label="list field"] [class*="-AddButton"]::before,
[aria-label="list field"] [class*="-StyledDropdownButton"]::before {
  content: "+";
  margin-right: 8px;
  font-size: 18px;
  font-weight: 400;
}

/* One item: [drag] [row] [open] [delete] */
[class*="-SortableListItem"] {
  position: relative;
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr) 28px 28px;
  align-items: start;
  column-gap: 6px;
  margin: 0 !important;
  padding: 14px 10px 14px 6px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}
/* Hairline between rows, inset to start under the text. */
[class*="-SortableListItem"] + [class*="-SortableListItem"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 34px;
  right: 0;
  border-top: 1px solid var(--rule);
}
[class*="-SortableListItem"]:has(> [class*="-NestedObjectLabel"]:hover) {
  background: #fafbfc !important;
}
[class*="-SortableListItem"]:first-child {
  border-radius: calc(var(--r-panel) - 1px) calc(var(--r-panel) - 1px) 0 0 !important;
}
/* Single values (要点、段落、登录邮箱): the text itself, not bold. */
.pd-row-title.is-value {
  font-weight: 400;
}
[class*="-SortableListItem"] > [class*="-FieldLabel"] {
  display: none !important;
}
[class*="-SortableListItem"] > [class*="-StyledListItemTopBar"] {
  display: contents !important;
}
[class*="-SortableListItem"] > [class*="-StyledListItemTopBar"] > [role="button"] {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  justify-content: center;
  cursor: grab;
}
[class*="-SortableListItem"] > [class*="-StyledListItemTopBar"] > button:first-child {
  grid-column: 3;
  grid-row: 1;
}
[class*="-SortableListItem"] > [class*="-StyledListItemTopBar"] > button:last-child {
  grid-column: 4;
  grid-row: 1;
}
[class*="-SortableListItem"] > [class*="-StyledListItemTopBar"] > * > span,
[class*="-SortableListItem"] > [class*="-StyledListItemTopBar"] > button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
}
[class*="-SortableListItem"] > [class*="-StyledListItemTopBar"] svg {
  width: 15px !important;
  height: 15px !important;
}
[class*="-SortableListItem"] > [class*="-StyledListItemTopBar"] svg path {
  fill: var(--faint) !important;
}
[class*="-SortableListItem"] > [class*="-StyledListItemTopBar"] > button:hover {
  background: var(--hover) !important;
}
[class*="-SortableListItem"] > [class*="-StyledListItemTopBar"] > button:last-child:hover {
  background: var(--red-bg) !important;
}
[class*="-SortableListItem"] > [class*="-StyledListItemTopBar"] > button:last-child:hover svg path {
  fill: var(--red) !important;
}

/* The summary: Decap's own text is hidden and rows.js's spans shown. If
   rows.js hasn't run, the plain text still shows. */
[class*="-SortableListItem"] > [class*="-NestedObjectLabel"] {
  grid-column: 2;
  grid-row: 1;
  display: block !important;
  min-width: 0;
  padding: 3px 0 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: var(--ink) !important;
  font-size: 14px !important;
  cursor: pointer;
}
[class*="-SortableListItem"] > [class*="-NestedObjectLabel"]:has(.pd-row) {
  font-size: 0 !important;
  color: transparent !important;
}
.pd-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 14px;
}
[data-row="pub"] .pd-row {
  grid-template-columns: 58px minmax(0, 1fr);
}
.pd-row-tag {
  justify-self: start;
  align-self: start;
  padding: 1px 8px;
  border-radius: 5px;
  background: #f1f2f4;
  color: var(--muted);
  font: 500 12.5px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
.pd-row-tag.is-empty {
  visibility: hidden;
}
.pd-row-tag.is-year {
  background: var(--navy-50);
  color: var(--navy);
  font-weight: 600;
}
.pd-row-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.pd-row-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--ink);
  font: 600 14px/1.45 var(--font);
}
.pd-row-meta {
  overflow: hidden;
  color: var(--muted);
  font: 400 12.5px/1.5 var(--font);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pd-row-authors::after {
  content: ". ";
}

/* The open item's fields, under the row. */
[class*="-SortableListItem"] > div:last-child:not([class*="-NestedObjectLabel"]):not([class*="-StyledListItemTopBar"]) {
  grid-column: 2 / 4;
  grid-row: 2;
  min-width: 0;
  padding: 2px 0 6px !important;
  background: transparent !important;
  border: 0 !important;
}
[class*="-SortableListItem"] > div:last-child [class*="-ControlContainer"] {
  margin-top: 16px !important;
}
/* Publication: 标签 and 题目 share a line. */
[data-row="pub"] > div:last-child > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  column-gap: 12px;
}
[data-row="pub"] > div:last-child > div > * {
  grid-column: 1 / -1;
}
[data-row="pub"] > div:last-child > div > :nth-child(2) {
  grid-column: 1;
}
[data-row="pub"] > div:last-child > div > :nth-child(3) {
  grid-column: 2;
}
[data-row="pub"] > div:last-child > div > :nth-child(2) [class*="-ControlHint"] {
  display: none;
}

/* A nested object (e.g. 链接) opens like a small section. */
[aria-label="object field"] > [class*="-ControlTopbar"] + div {
  border-top: 1px solid var(--rule) !important;
  padding-top: 6px !important;
}
[aria-label="object field"] [class*="-TopBarContainer"] {
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: var(--muted) !important;
  font-size: 13px !important;
  text-transform: none !important;
}
[aria-label="object field"] > [class*="-ControlTopbar"] + div > div:last-child {
  border: 0 !important;
  padding: 0 0 6px !important;
}
[class*="-ExpandButtonContainer"] {
  text-transform: none !important;
}

/* Narrow screens: nested fields use the full width, year sits above the title. */
@media (max-width: 799px) {
  [class*="-SortableListItem"] {
    padding: 12px 4px 12px 2px !important;
    column-gap: 4px;
  }
  [class*="-SortableListItem"] + [class*="-SortableListItem"]::before {
    left: 10px;
  }
  [class*="-SortableListItem"] > div:last-child:not([class*="-NestedObjectLabel"]):not([class*="-StyledListItemTopBar"]) {
    grid-column: 1 / -1;
    padding: 2px 6px 6px !important;
  }
  [data-row="pub"] .pd-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 4px;
  }
  [data-row="pub"] > div:last-child > div {
    grid-template-columns: 90px minmax(0, 1fr);
  }
}

/* Markdown editor: one outer frame; drop Decap's inner grey borders. */
[aria-label="markdown field"] > [class*="-ControlTopbar"] + div {
  overflow: hidden;
}
[aria-label="markdown field"] > [class*="-ControlTopbar"] + div div:not([class*="-ToolbarContainer"]) {
  border-left: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
  border-radius: 0 !important;
}
[aria-label="markdown field"] [class*="-ToolbarContainer"] {
  border-radius: 0 !important;
}

/* Markdown editor toolbar */
[class*="-StyledToolbarButton"] {
  background: transparent !important;
  border: 0 !important;
  border-radius: var(--r-sm) !important;
  color: var(--muted) !important;
}
[class*="-StyledToolbarButton"]:hover {
  background: var(--hover) !important;
  color: var(--navy) !important;
}
[class*="-ToolbarToggleLabel"] {
  color: var(--muted) !important;
  font-weight: 500;
}
[class*="-ToggleBackground"] {
  background-color: var(--rule-strong) !important;
}

/* Photo field: the portrait in the site's 4:5 frame, buttons beside it. */
[aria-label="image field"] > [class*="-ControlTopbar"] + div > span > div {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}
[aria-label="image field"] > [class*="-ControlTopbar"] + div > span > div > div:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
[class*="-ImageWrapper"] {
  width: 120px !important;
  height: 150px !important;
  margin: 0 !important;
  border-radius: var(--r-field) !important;
  border: 1px solid var(--rule);
  box-shadow: none !important;
  overflow: hidden;
}
[class*="-ImageWrapper"] img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
[class*="-FileWidgetButton"] {
  height: 32px;
  margin: 0 !important;
  padding: 0 12px !important;
  border-radius: var(--r-field) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  background: var(--paper) !important;
  color: var(--navy) !important;
  border: 1px solid var(--rule-strong) !important;
}
[class*="-FileWidgetButton"]:hover {
  background: var(--navy-50) !important;
}
[class*="-FileWidgetButtonRemove"] {
  background: transparent !important;
  color: var(--red) !important;
  border-color: transparent !important;
}
[class*="-FileWidgetButtonRemove"]:hover {
  background: var(--red-bg) !important;
}

/* ---------- Photo library ---------- */

[class*="-MediaLibraryTop"] h1,
[class*="-LibraryTitle"] {
  color: var(--ink) !important;
  font-weight: 600 !important;
}
[class*="-CardGrid"] [class*="-Card-"],
[class*="-MediaLibraryCard"] {
  border: 1px solid var(--rule) !important;
  border-radius: var(--r) !important;
  box-shadow: none !important;
}
[class*="-MediaLibraryCard"][class*="isPrivate"],
[class*="-CardImageWrapper"] {
  background-color: var(--canvas) !important;
}

/* ---------- Editorial workflow board (待发布) ---------- */

[class*="-WorkflowTop"] {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 0 18px !important;
  border-bottom: 1px solid var(--rule) !important;
  border-radius: 0 !important;
}
[class*="-WorkflowTopHeading"] {
  font-size: 24px !important;
  font-weight: 600 !important;
  color: var(--ink) !important;
}
[class*="-WorkflowTopDescription"] {
  color: var(--muted) !important;
}
[class*="-ColumnHeader"] {
  border-radius: var(--r-sm) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}
[class*="-ColumnCount"] {
  color: var(--muted) !important;
}
[class*="-WorkflowCardContainer"] {
  background: var(--paper) !important;
  border: 1px solid var(--rule) !important;
  border-radius: var(--r) !important;
  box-shadow: none !important;
}
[class*="-WorkflowCardContainer"]:hover {
  border-color: var(--navy-600) !important;
}

/* ---------- Dropdowns, modals, toasts ---------- */

[class*="-DropdownList"],
[class*="-dropdownList"] {
  background: var(--paper) !important;
  border: 1px solid var(--rule) !important;
  border-radius: var(--r) !important;
  box-shadow: 0 8px 24px rgba(14, 42, 71, 0.08) !important;
  padding: 4px !important;
  overflow: hidden;
}
[class*="-StyledMenuItem"],
[class*="-dropdownItem"] {
  border-radius: var(--r-sm) !important;
  font-size: 14px !important;
}
[class*="-StyledMenuItem"]:hover,
[class*="-dropdownItem"]:hover,
[class*="-StyledMenuItem"]:focus,
[class*="-dropdownItem"]:focus {
  background: var(--hover) !important;
  color: var(--navy) !important;
}
.ReactModal__Content {
  border-radius: var(--r) !important;
  border: 1px solid var(--rule) !important;
  box-shadow: 0 16px 48px rgba(14, 42, 71, 0.12) !important;
}
.Toastify__toast {
  border-radius: var(--r) !important;
  font-family: var(--font) !important;
  font-size: 14px;
}

/* ---------- Small screens ---------- */

@media (max-width: 800px) {
  [class*="-StyledAuthenticationPage"] {
    background: var(--paper) !important;
    align-items: center !important;
    padding: 0 16px 40px !important;
  }
  [class*="-StyledAuthenticationPage"]::before {
    position: static;
    width: auto;
    order: -1;
    padding: 0 0 24px;
    color: var(--navy);
    font-size: 22px;
    text-align: center;
  }
  [class*="-StyledAuthenticationPage"]::after {
    display: none;
  }
  [class*="-CustomIconWrapper"] {
    justify-content: center;
  }
  [class*="-LoginButton-"] {
    width: 100%;
    max-width: 320px;
  }
  [class*="-AppHeaderContent"]::before,
  [class*="-AppHeaderNavList"]::before {
    display: none;
  }
  [class*="-CollectionContainer"] {
    margin-top: 16px !important;
  }
  [class*="-CardsGrid"]:has(> [class*="-GridCard-"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  #nc-root *,
  #nc-root *::after {
    transition: none !important;
  }
}

/* ---------- "DOI 自动填写" on publication rows (doi.js) ---------- */

.pd-doi-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.pd-doi-row input {
  flex: 1 1 auto;
  min-width: 0;
}
#nc-root .pd-doi-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: var(--r-field);
  font: 500 13.5px/1 var(--font);
  cursor: pointer;
}
#nc-root .pd-doi-button:hover {
  background: var(--navy-600);
}
#nc-root .pd-doi-button:disabled {
  opacity: 0.6;
  cursor: default;
}
.pd-doi-message {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- Details ---------- */

/* Menu icons (e.g. 复制) in Decap's teal -> grey. */
[class*="-MenuItemIconContainer"] svg path {
  fill: var(--muted) !important;
}
/* Search results: a plain heading like the collection title, not a card. */
[class*="-SearchResultContainer"] {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-bottom: 1px solid var(--rule) !important;
  border-radius: 0 !important;
  padding: 0 0 18px !important;
  margin-bottom: 18px !important;
  width: 100% !important;
  max-width: none !important;
}
[class*="-SearchResultHeading"] {
  padding: 0 !important;
  border: 0 !important;
}
[class*="-SearchResultHeading"] {
  color: var(--ink) !important;
  font-size: 22px !important;
  font-weight: 600 !important;
}
/* Photo library: plain grey tiles instead of a checkerboard. */
[class*="-CardImageWrapper"],
[class*="-CardGridContainer"] [class*="-CardImage"] {
  background-image: none !important;
  background-color: var(--fill) !important;
}
[class*="-CardGridContainer"] [class*="-Card "] {
  border: 1px solid var(--rule) !important;
  border-radius: var(--r-field) !important;
  box-shadow: none !important;
  overflow: hidden;
}
[class*="-CardGridContainer"] [class*="-Card "]:hover {
  border-color: var(--rule-strong) !important;
}
/* Library buttons: navy for upload / use, quiet grey for the rest. */
[class*="-LibraryTop"] button,
[class*="-ButtonsContainer"] button {
  border-radius: var(--r-field) !important;
  font: 500 13px/1 var(--font) !important;
  box-shadow: none !important;
}
[class*="-UploadButton"],
[class*="-InsertButton"] {
  background: var(--navy) !important;
  color: #fff !important;
}
[class*="-InsertButton"][class*="disabled"] {
  background: var(--fill) !important;
  color: var(--faint) !important;
}
[class*="-ActionButton"] {
  background: var(--fill) !important;
  color: var(--text) !important;
}
[class*="-CardText"] {
  color: var(--muted) !important;
  font-size: 12.5px !important;
}
