/* Sidra 档案 APP：只使用 Sidra 全局页面、全局导航、全局输入栏与全局弹窗体系。 */
.archive-app {
  color: #202024;
  width: 100%;
  min-width: 0;
  min-height: 0;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.archive-app [hidden] { display: none; }
.archive-app button { font-family: inherit; }
.archive-app input,
.archive-app textarea { font: inherit; user-select: text; -webkit-user-select: text; }
.archive-app svg { display: block; fill: currentColor; }

.archive-navbar .sidra-app-nav-text:disabled,
.archive-navbar .sidra-app-nav-icon:disabled { opacity: .45; pointer-events: none; }
.archive-save-entry.is-busy svg { animation: sidra-spin .72s linear infinite; }

.archive-scroll {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--app-inline-inset) 30px;
}

/* 数据状态属于档案全局页内容流，不参与页面命中层。 */
.archive-data-status {
  min-height: 48px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  padding: 8px 10px;
  border: .5px solid rgba(203,203,203,.35);
  border-radius: 12px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 5px 16px rgba(0,0,0,.04);
}
.archive-data-status[hidden] { display: none; }
.archive-data-status-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--logo-color);
}
.archive-data-status-icon svg { width: 13px; height: 13px; }
.archive-data-status-copy { min-width: 0; }
.archive-data-status-copy strong { display: block; color: #4d4d52; font-size: 11px; line-height: 15px; font-weight: 500; }
.archive-data-status-copy small {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: #98989e;
  font-size: 9px;
  line-height: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-data-status button {
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  color: #77777d;
  background: rgba(238,238,239,.92);
  font-size: 9px;
  cursor: pointer;
  touch-action: manipulation;
}

.archive-view { width: 100%; min-width: 0; max-width: none; margin: 0; }

/* 父级：与设置父级相同的分组行结构。 */
.archive-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.archive-section-title small {
  overflow: hidden;
  color: #a0a0a6;
  font-size: 10px;
  line-height: 15px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-section-heading {
  min-height: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 3px 7px 13px;
}
.archive-section-heading .archive-section-title { margin: 0; }
.archive-setting-import-actions {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-right: 2px;
}
.archive-setting-import-button {
  min-width: 0;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #8e8e94;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}
.archive-setting-import-button svg {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  fill: currentColor;
}
.archive-setting-import-button:disabled { opacity: .42; pointer-events: none; }
.archive-setting-group { overflow: visible; }
.archive-setting-field {
  display: block;
  padding: 12px 14px 14px;
}
.archive-setting-field .archive-global-input-row { align-items: flex-start; }
.archive-setting-field textarea.global-input-field {
  min-height: 190px;
  padding-top: 11px;
  padding-bottom: 11px;
  line-height: 1.58;
  resize: vertical;
}
.archive-setting-file-input { display: none; }
.archive-home-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  background: var(--logo-color);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 2px 6px rgba(0,0,0,.055);
}
.archive-home-icon svg { width: 17px; height: 17px; }
.archive-home-icon[data-type="char"] svg { transform: scale(.94); }
.archive-home-icon[data-type="npc"] svg { transform: scale(1.04); }
.archive-home-copy { min-width: 0; flex: 1 1 auto; }
.archive-home-copy strong {
  display: block;
  color: #202024;
  font-size: 15px;
  line-height: 20px;
  font-weight: 400;
  letter-spacing: -.08px;
}
.archive-home-copy small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #98989e;
  font-size: 10px;
  line-height: 14px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-home-count {
  min-width: 22px;
  color: #9a9aa0;
  font-size: 12px;
  line-height: 18px;
  text-align: right;
}
.archive-home-chevron,
.archive-card-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-right: 3px;
  border-top: 1.5px solid #b6b6bb;
  border-right: 1.5px solid #b6b6bb;
  transform: rotate(45deg);
}
.archive-card-chevron svg { display: none; }
.archive-inline-note {
  margin: -8px 13px 16px;
  color: #9a9aa0;
  font-size: 10px;
  line-height: 1.55;
}

/* 类型列表：有内容时使用全局分组；空态严格复用世界书的无外壳占位结构。 */
.archive-card-list { display: block; }
.archive-card-list.is-empty {
  overflow: visible;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.archive-card { position: relative; overflow: hidden; background: transparent; }
.archive-card + .archive-card::before {
  position: absolute;
  top: 0;
  right: 14px;
  left: 78px;
  z-index: 2;
  height: .5px;
  background: rgba(203,203,203,.55);
  content: '';
}
.archive-card-main {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) 8px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.archive-card.is-active-user { background: rgba(203,203,203,.08); }
.archive-user-activate {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: -6px 14px 8px 74px;
  padding: 0;
  border: 0;
  color: var(--logo-color);
  background: transparent;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}
.archive-user-activate svg { width: 10px; height: 10px; fill: currentColor; }
.archive-user-activate:disabled { color: #9a9aa0; cursor: default; }
.archive-card-avatar {
  position: relative;
  overflow: hidden;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: .5px solid rgba(198,198,202,.42);
  border-radius: 50%;
  color: var(--logo-color);
  background: #fff center / cover no-repeat;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}
.archive-lock-preview {
  overflow: hidden;
  width: 100%;
  height: clamp(150px, 40vw, 184px);
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: .5px solid rgba(198,198,202,.42);
  border-radius: 14px;
  color: #8f8f95;
  background: #eeeeef center / cover no-repeat;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
  cursor: pointer;
  touch-action: manipulation;
}
.archive-profile-avatar {
  position: relative;
  overflow: hidden;
  width: 88px;
  height: 88px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--logo-color);
  background: #fff center / cover no-repeat;
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
}
.archive-card-avatar svg { width: 18px; height: 18px; }
.archive-card-copy { min-width: 0; display: block; }
.archive-card-copy strong {
  display: block;
  overflow: hidden;
  color: #303035;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-card-copy small {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #96969c;
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-card-copy > span {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  color: #77777d;
  font-size: 10px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
.archive-empty {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 20px;
  color: #8e8e93;
  text-align: center;
}
.archive-empty > svg {
  width: 42px;
  height: 42px;
  margin-bottom: 4px;
  color: #c7c7cc;
  fill: currentColor;
}
.archive-empty strong {
  color: #3a3a3c;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 500;
}
.archive-empty > span {
  max-width: 280px;
  color: #8e8e93;
  font-size: 13px;
  line-height: 1.45;
}

/* 编辑头像：无外壳、独立居中圆形头像，初始态与桌面头像同源。 */
.archive-avatar-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px 18px;
}
.archive-profile-avatar .archive-avatar-user,
.archive-card-avatar .archive-avatar-user {
  width: 52%;
  height: 52%;
  color: var(--logo-color);
}
.archive-avatar-star {
  position: absolute;
  z-index: 2;
  display: block;
  color: var(--logo-color);
  opacity: .9;
  pointer-events: none;
}
.archive-avatar-star.star-a { width: 8%; height: 8%; left: 8%; top: 10%; transform: rotate(-18deg); }
.archive-avatar-star.star-b { width: 5.5%; height: 5.5%; left: 24%; top: 7%; transform: rotate(19deg); }
.archive-avatar-star.star-c { width: 9.5%; height: 9.5%; right: 8%; top: 12%; transform: rotate(-11deg); }
.archive-avatar-star.star-d { width: 6.5%; height: 6.5%; right: 9%; top: 38%; transform: rotate(26deg); }
.archive-avatar-star.star-e { width: 7.5%; height: 7.5%; right: 11%; bottom: 10%; transform: rotate(-23deg); }
.archive-avatar-star.star-f { width: 5%; height: 5%; left: 23%; bottom: 8%; transform: rotate(13deg); }
.archive-avatar-star.star-g { width: 9%; height: 9%; left: 7%; bottom: 19%; transform: rotate(-8deg); }
.archive-avatar-star.star-h { width: 5.8%; height: 5.8%; left: 9%; top: 43%; transform: rotate(31deg); }
.archive-avatar-label {
  color: #74747a;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: .02em;
}

/* 锁脸图片纳入辅助信息统一容器。 */
.archive-lock-field {
  position: relative;
  display: grid;
  gap: 9px;
  padding: 12px 14px 14px;
}
.archive-lock-field::before,
.archive-select-field::before,
.archive-range-field::before {
  position: absolute;
  top: 0;
  right: 14px;
  left: 14px;
  height: .5px;
  background: rgba(203,203,203,.52);
  content: '';
}
.archive-lock-field-label {
  color: #39393e;
  font-size: 13px;
  line-height: 18px;
  font-weight: 400;
}
.archive-lock-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #96969c;
  pointer-events: none;
}
.archive-lock-placeholder svg { width: 28px; height: 28px; }
.archive-lock-placeholder small {
  color: #96969c;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 400;
}

.archive-api-note {
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.archive-api-note > div { min-width: 0; flex: 1 1 auto; }
.archive-api-note strong {
  display: block;
  overflow: hidden;
  color: #343439;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-api-note p {
  display: block;
  margin: 4px 0 0;
  color: #96969c;
  font-size: 9px;
  line-height: 1.45;
}

.archive-field {
  position: relative;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
}
.archive-field + .archive-field::before,
.archive-assistance-group > * + .archive-field::before {
  position: absolute;
  top: 0;
  right: 14px;
  left: 14px;
  height: .5px;
  background: rgba(203,203,203,.52);
  content: '';
}
.archive-field.is-textarea { min-height: 94px; align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.archive-field-label {
  min-width: 72px;
  flex: 0 0 72px;
  color: #39393e;
  font-size: 13px;
  line-height: 18px;
  font-weight: 400;
}
.archive-global-input-row {
  flex: 1 1 auto;
  width: auto;
  padding-right: 0;
}
.archive-global-input-row .global-input-field { font-size: 13px; color: #343439; }
.archive-field.is-textarea .archive-global-input-row { align-items: start; }
.archive-field.is-textarea .archive-global-input-row .global-input-icon { margin-top: 9px; }
.archive-field textarea.global-input-field {
  min-height: 70px;
  height: 70px;
  padding-top: 7px;
  padding-bottom: 7px;
  resize: vertical;
  line-height: 1.45;
}
.archive-select-field {
  position: relative;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
}
.archive-select-wrap {
  position: relative;
  min-width: 0;
  flex: 1 1 auto;
}
.archive-select-wrap select {
  width: 100%;
  height: 38px;
  padding: 0 30px 0 12px;
  border: 0;
  border-radius: 10px;
  outline: 0;
  color: #343439;
  background: #f1f1f2;
  font: inherit;
  font-size: 12px;
  appearance: none;
  -webkit-appearance: none;
}
.archive-select-chevron {
  width: 7px;
  height: 7px;
  position: absolute;
  top: 50%;
  right: 13px;
  border-right: 1.5px solid #9c9ca2;
  border-bottom: 1.5px solid #9c9ca2;
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}
.archive-range-field {
  position: relative;
  display: grid;
  gap: 9px;
  padding: 11px 14px 13px;
}
.archive-range-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #39393e;
  font-size: 13px;
  line-height: 18px;
}
.archive-range-meta output {
  color: #8c8c92;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.archive-range-field input[type="range"] {
  width: 100%;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}
.archive-range-field input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: #d7d7db;
}
.archive-range-field input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7.5px;
  border: 0;
  border-radius: 50%;
  background: var(--logo-color);
  box-shadow: 0 2px 7px rgba(0,0,0,.13);
  appearance: none;
  -webkit-appearance: none;
}
.archive-range-field input[type="range"]::-moz-range-track {
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: #d7d7db;
}
.archive-range-field input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: var(--logo-color);
  box-shadow: 0 2px 7px rgba(0,0,0,.13);
}
.archive-related-item { position: relative; }
.archive-related-item + .archive-related-item::before {
  position: absolute;
  top: 0;
  right: 14px;
  left: 48px;
  height: .5px;
  background: rgba(203,203,203,.52);
  content: '';
}
.archive-related-item .archive-choice-row + .archive-related-fields { border-top: .5px solid rgba(203,203,203,.42); }
.archive-related-fields {
  padding: 0 14px 10px 48px;
  background: rgba(248,248,249,.56);
}
.archive-related-fields[hidden] { display: none; }
.archive-related-field {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
}
.archive-related-field + .archive-related-field { border-top: .5px solid rgba(203,203,203,.42); }
.archive-related-field .archive-field-label { min-width: 64px; flex-basis: 64px; }
.archive-related-field textarea.global-input-field {
  min-height: 54px;
  height: 54px;
  padding-top: 8px;
  padding-bottom: 8px;
  line-height: 1.45;
  resize: vertical;
}
.archive-choice-group { display: block; }
.archive-choice-row {
  position: relative;
  min-height: 57px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px;
  cursor: pointer;
}
.archive-choice-group:not(.archive-related-group) .archive-choice-row + .archive-choice-row::before {
  position: absolute;
  top: 0;
  right: 14px;
  left: 48px;
  height: .5px;
  background: rgba(203,203,203,.52);
  content: '';
}
.archive-choice-row input { position: absolute; opacity: 0; pointer-events: none; }
.archive-choice-check {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #c9c9ce;
  border-radius: 7px;
  color: transparent;
  background: rgba(246,246,247,.88);
}
.archive-choice-check svg { width: 10px; height: 10px; }
.archive-choice-row input:checked + .archive-choice-check { border-color: var(--logo-color); color: #fff; background: var(--logo-color); }
.archive-choice-copy { min-width: 0; flex: 1 1 auto; }
.archive-choice-copy strong { display: block; overflow: hidden; color: #38383d; font-size: 13px; line-height: 1.3; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.archive-choice-copy small { display: block; margin-top: 3px; color: #97979d; font-size: 9px; line-height: 1.3; }
.archive-choice-empty { padding: 18px 14px; color: #96969c; font-size: 10px; line-height: 1.55; text-align: center; }
.archive-api-note > span {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--logo-color);
}
.archive-api-note > span svg { width: 17px; height: 17px; }
.archive-count-field {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 14px;
}
.archive-count-field > span:first-child strong { display: block; color: #39393e; font-size: 13px; line-height: 1.3; font-weight: 400; }
.archive-count-field > span:first-child small { display: block; margin-top: 3px; color: #97979d; font-size: 9px; line-height: 1.3; }
.archive-count-field > span:last-child { display: flex; align-items: center; gap: 5px; color: #8f8f95; font-size: 11px; }
.archive-count-field input {
  width: 58px;
  height: 31px;
  padding: 0 2px 2px;
  border: 0;
  border-bottom: 1px dashed rgba(143,143,149,.58);
  border-radius: 0;
  outline: 0;
  color: #343439;
  background: transparent;
  text-align: center;
}
.archive-count-field i { font-style: normal; }
.archive-delete-entry {
  width: 100%;
  min-height: 48px;
  margin: 0 0 16px;
  border: .5px solid rgba(215,92,86,.18);
  border-radius: 14px;
  color: #d15d59;
  background: rgba(255,255,255,.92);
  box-shadow: 0 7px 20px rgba(0,0,0,.04), 0 2px 5px rgba(0,0,0,.025);
  font-size: 13px;
  cursor: pointer;
}
.archive-generate-status {
  min-height: 18px;
  margin: -5px 13px 16px;
  color: #8f8f95;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
}

@media (max-width: 360px) {
  .archive-field,
  .archive-select-field,
  .archive-related-field { display: block; }
  .archive-field-label { width: auto; min-width: 0; margin-bottom: 8px; }
  .archive-related-fields { padding-left: 14px; }
}
