/* Sidra 档案 APP：只使用 Sidra 全局页面、全局导航、全局输入栏与全局弹窗体系。 */
.archive-app {
  color: #202024;
  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; }
.archive-app input,
.archive-app textarea { user-select: text; -webkit-user-select: text; }
.archive-app svg { display: block; fill: currentColor; }

.archive-navbar {
  min-width: 0;
  min-height: 58px;
  margin: 0 0 17px;
}
.archive-navbar .sidra-app-nav-leading {
  max-width: calc(100% - 92px);
  min-height: 42px;
  gap: 10px;
}
.archive-navbar .sidra-app-nav-icon {
  width: 38px;
  height: 42px;
}
.archive-navbar .sidra-app-nav-text { min-height: 42px; }
.archive-navbar .sidra-app-nav-text:disabled { opacity: .45; pointer-events: none; }

.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 18px max(30px, env(safe-area-inset-bottom));
  scrollbar-width: none;
}
.archive-scroll::-webkit-scrollbar { display: none; }

/* 数据状态属于档案全局页内容流，不参与页面命中层。 */
.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,
.archive-data-status-copy small { display: block; }
.archive-data-status-copy strong { 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-data-status button:active { opacity: .58; }

.archive-view { width: 100%; max-width: 600px; margin: 0 auto; }

/* 父级：与设置父级相同的分组行结构。 */
.archive-section-label,
.archive-section-title {
  margin: 0 13px 7px;
  color: #929298;
  font-size: 12px;
  line-height: 17px;
  font-weight: 400;
}
.archive-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 1px;
}
.archive-section-title small {
  overflow: hidden;
  color: #a0a0a6;
  font-size: 10px;
  line-height: 15px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-home-group,
.archive-group,
.archive-card-list {
  overflow: hidden;
  margin: 0 0 16px;
  border: .5px solid rgba(203,203,203,.28);
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 7px 20px rgba(0,0,0,.055), 0 2px 5px rgba(0,0,0,.035);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
}
.archive-home-row {
  position: relative;
  width: 100%;
  min-height: 65px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border: 0;
  color: #202024;
  background: transparent;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.archive-home-row + .archive-home-row::before {
  position: absolute;
  top: 0;
  right: 14px;
  left: 58px;
  height: .5px;
  background: rgba(203,203,203,.55);
  content: '';
}
.archive-home-row:active { background: rgba(203,203,203,.13); }
.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-home-note,
.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 52px 10px 14px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.archive-card-main:active { background: rgba(203,203,203,.13); }
.archive-card-avatar,
.archive-profile-avatar,
.archive-lock-preview {
  overflow: hidden;
  display: grid;
  place-items: center;
  border: .5px solid rgba(198,198,202,.42);
  color: #8f8f95;
  background: #eeeeef center / cover no-repeat;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}
.archive-card-avatar { width: 48px; height: 48px; border-radius: 12px; }
.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-card-delete {
  width: 42px;
  height: 100%;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: #a7a7ad;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}
.archive-card-delete::before {
  width: .5px;
  height: 36px;
  position: absolute;
  left: 0;
  top: 50%;
  background: rgba(203,203,203,.48);
  content: '';
  transform: translateY(-50%);
}
.archive-card-delete svg { width: 11px; height: 11px; }
.archive-card-delete:active { color: #d15d59; background: rgba(215,92,86,.06); }
.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-profile-row,
.archive-lock-row,
.archive-api-note {
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.archive-profile-avatar { width: 56px; height: 56px; flex: 0 0 auto; border-radius: 14px; padding: 0; cursor: pointer; }
.archive-profile-avatar svg { width: 20px; height: 20px; }
.archive-profile-copy,
.archive-lock-row > div:nth-child(2),
.archive-api-note > div { min-width: 0; flex: 1 1 auto; }
.archive-profile-copy strong,
.archive-lock-row strong,
.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-profile-copy span,
.archive-lock-row span,
.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-parameter-row::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-parameter-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 0;
  padding: 10px 14px 12px;
}
.archive-parameter-row label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  color: #77777d;
  font-size: 10px;
}
.archive-parameter-row label + label { border-left: .5px solid rgba(203,203,203,.5); }
.archive-parameter-row input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 2px 2px;
  border: 0;
  border-bottom: 1px dashed rgba(143,143,149,.58);
  border-radius: 0;
  outline: 0;
  color: #343439;
  background: transparent;
  font-size: 12px;
  text-align: center;
}
.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-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-lock-preview { width: 58px; height: 58px; flex: 0 0 auto; border-radius: 13px; padding: 0; cursor: pointer; }
.archive-lock-preview svg { width: 20px; height: 20px; }
.archive-card-avatar.has-custom-image > svg,
.archive-profile-avatar.has-custom-image > svg,
.archive-lock-preview.has-custom-image > svg { display: none; }
.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-delete-entry:active { background: rgba(215,92,86,.07); }
.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-scroll { padding-right: 14px; padding-left: 14px; }
  .archive-field { display: block; }
  .archive-field-label { width: auto; min-width: 0; margin-bottom: 8px; }
}