/* 次级功能页面：人物纠正、设置、上传、专辑与批量操作。 */
/* 照片管理页：人物 chips 与纠正弹窗 */
.manage-people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.person-chip { cursor: pointer; padding: 2px 10px; min-height: 26px; font-size: 12px; }
.person-chip:hover { border-color: var(--accent); color: var(--accent-deep); }
.correct-modal {
  position: fixed; inset: 0; z-index: 110; background: rgba(24, 30, 40, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  overflow-y: auto;
  animation: lbFade .18s ease;
}
.correct-box {
  background: var(--paper-card); border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 20px; max-width: 900px; width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); overflow-y: auto;
}
.correct-box h3 { margin: 0 0 6px; }
.correct-targets { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.correct-targets .chip { cursor: pointer; }
.correct-targets .chip .remind-state { margin-left: 4px; font-size: 11px; color: var(--ink-soft); }
.correct-targets .chip:hover { border-color: var(--accent); color: var(--accent-deep); }
.correct-targets .chip.selected {
  border-color: var(--accent-deep); color: var(--accent-deep); background: var(--accent-soft);
}
.correct-preview { margin-top: 12px; }
.correct-image-scroll {
  display: flex; justify-content: center; max-width: 100%; overflow: auto;
  border-radius: 6px; background: var(--frame); padding: 8px;
}
.correct-image-stage { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.correct-image-stage > img {
  display: block; width: auto; height: auto; max-width: 100%; max-height: 55vh;
  object-fit: contain; border-radius: 3px;
}
.correct-face-boxes { position: absolute; inset: 0; pointer-events: none; }
.correct-face-box {
  position: absolute; pointer-events: auto; appearance: none; padding: 0;
  border: 2px solid rgba(176, 141, 94, .65); border-radius: 10px;
  background: rgba(255, 253, 248, .08); box-shadow: 0 0 0 1px rgba(24, 30, 40, .2);
  cursor: pointer;
}
.correct-face-box:disabled { cursor: default; opacity: 1; }
.correct-face-box.selected {
  border: 3px solid var(--face-select); background: rgba(215, 75, 50, .08);
  box-shadow: 0 0 0 2px #fffdf8, 0 0 0 4px rgba(215, 75, 50, .45);
}
.correct-face-box.unnamed { border-style: dashed; border-color: rgba(91, 84, 76, .55); }
.correct-face-box > span {
  position: absolute; left: -2px; top: -2px; max-width: 140px; overflow: hidden;
  padding: 3px 6px; border-radius: 5px; background: rgba(24, 30, 40, .78);
  color: #fffdf8; font-size: 12px; line-height: 1.2; white-space: nowrap;
}
.correct-face-box.selected > span { background: var(--face-select); }
.correct-preview-status { margin: 7px 0; font-size: 12px; }
.correct-face-choices {
  display: flex; gap: 8px; overflow-x: auto; padding: 3px 2px 7px;
}
.correct-face-choice {
  flex: 0 0 82px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 5px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper-card); color: var(--ink); cursor: pointer; font: inherit;
}
.correct-face-choice img, .correct-face-choice .correct-face-placeholder {
  width: 64px; height: 64px; border-radius: 7px; object-fit: cover;
}
.correct-face-choice .correct-face-placeholder, .correction-face-placeholder {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--ink-soft);
}
.correct-face-choice > span:last-child {
  width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px;
}
.correct-face-choice.selected {
  border: 2px solid var(--face-select); padding: 4px; box-shadow: 0 0 0 2px rgba(215, 75, 50, .14);
}
.correct-face-choice:disabled { cursor: default; opacity: .55; }
.correct-face-choice.selected:disabled { opacity: 1; }
.correct-summary {
  margin: 12px 0; padding: 9px 11px; border-left: 3px solid var(--face-select);
  background: var(--accent-soft); font-weight: 700;
}
.correct-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* 详情页与用户设置：人工人脸补画、重画与审批预览 */
.manual-face-stage { cursor: crosshair; touch-action: none; user-select: none; }
.manual-face-stage > img { pointer-events: none; }
.manual-face-draft {
  position: absolute; z-index: 4; pointer-events: none;
  border: 3px solid var(--accent-deep); border-radius: 10px;
  background: rgba(193, 104, 63, .12); box-shadow: 0 0 0 2px #fff;
}
.manual-face-existing.manual { border-color: var(--accent-deep); border-style: solid; }
.manual-face-existing.ai { border-color: rgba(92, 122, 140, .78); border-style: dashed; }
.manual-face-existing.review-target {
  border-width: 3px; box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(193, 104, 63, .42);
}
.manual-face-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 10px;
}
.manual-face-person {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  color: var(--ink-soft); font-size: 13px;
}
.manual-face-person select { min-width: 180px; max-width: 100%; }
.manual-face-box .btn:disabled, .manual-face-person select:disabled {
  cursor: not-allowed; opacity: .55;
}
.manual-face-review-actions { margin: 12px 0; }
.manual-face-request-action { font-weight: 700; color: var(--accent-deep); }

/* 用户设置页：待确认纠正列表 */
.correction-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.correction-item {
  display: flex; align-items: center; gap: 10px; background: var(--paper-card);
  border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow);
  border: 1px solid var(--line); flex-wrap: wrap;
}
.correction-item .manage-info { min-width: 200px; }
.correction-face-thumb, .correction-face-placeholder {
  width: 54px; height: 54px; flex: 0 0 54px; border-radius: 8px; object-fit: cover;
}
.warning-text { color: var(--danger-ink); font-size: 12px; margin-top: 3px; }

@media (max-width: 600px) {
  .correct-modal { align-items: flex-start; padding: 8px; }
  .net-canvas { height: 56vh; }
  .people-grid { grid-template-columns: minmax(0, 1fr); }
  .person-group-card .face-sample { width: 56px; height: 56px; }
  .correct-box { width: calc(100vw - 16px); max-height: calc(100vh - 16px); padding: 14px; }
  .correct-image-stage > img { max-height: 42vh; }
  .correct-face-choice { flex-basis: 74px; }
  .correct-face-choice img, .correct-face-choice .correct-face-placeholder {
    width: 56px; height: 56px;
  }
}

/* 详情页：下载原片 */
.detail-download { margin-top: 8px; text-align: center; }

/* 上传页：待传文件列表 */
.file-list { margin: 12px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.file-item {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 6px 12px;
}
.upload-actions { display: flex; gap: 8px; margin-bottom: 12px; }

/* 首页拖拽排序（管理员以上） */
.card.dragging { opacity: .45; }
.waterfall[data-can-reorder="1"] .card { touch-action: pan-y; }
.waterfall[data-can-reorder="1"] .card img { -webkit-touch-callout: none; }
.waterfall.reorder-mode .card { touch-action: none; }
.reorder-done {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 90; box-shadow: var(--pill-shadow);
}

/* 专辑 */
.album-create-form { margin-top: 10px; }
.album-modal-actions { display: flex; gap: 8px; }
.album-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px;
}
.album-card {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.album-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.album-cover {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  background: var(--accent-soft);
}
.album-cover.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
}
.album-card-body { padding: 10px 12px 12px; }
.album-name { font-size: 16px; font-weight: 700; }
.album-desc { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-desc-full { margin: 4px 0; }
.album-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 14px; }
.album-edit { max-width: 480px; margin-bottom: 14px; }
.album-targets {
  display: flex; flex-direction: column; gap: 8px; margin: 14px 0;
  max-height: 50vh; overflow-y: auto; align-items: flex-start;
}
.album-target { cursor: pointer; gap: 6px; }
.album-target input { accent-color: var(--accent); width: 16px; height: 16px; }
.card-remove-form { margin: 0; }
label.manage-item { cursor: pointer; }

/* 账号活动审计与会话 */
.nav-inline-form { display: inline; margin: 0; }
.nav-link-button {
  appearance: none; border: 0; background: transparent; color: var(--ink-soft);
  cursor: pointer; font: inherit; min-height: 44px; padding: 6px 10px; border-radius: 999px;
}
.nav-link-button:hover { background: var(--accent-soft); }

/* 照片页移动顶栏：导航完整滑出，刘海安全区与时间线吸顶偏移保留。 */
:root {
  --safe-top: env(safe-area-inset-top);
  --topbar-visible-h: var(--topbar-h, 65px);
}
@media (max-width: 480px) {
  html.photo-topbar-auto-hide .topbar {
    transition: transform .16s ease-out;
  }
  html.photo-topbar-hidden { --topbar-visible-h: var(--safe-top); }
  html.photo-topbar-hidden::before {
    content: ""; position: fixed; inset: 0 0 auto; z-index: 49;
    height: var(--safe-top); pointer-events: none;
    background: var(--topbar-bg); backdrop-filter: blur(6px);
  }
  html.photo-topbar-hidden .topbar {
    transform: translateY(-100%); will-change: transform;
  }
  html.photo-topbar-auto-hide .timeline-group-title {
    top: var(--topbar-visible-h); transition: top .16s ease-out;
  }
}
@media (max-width: 480px) and (prefers-reduced-motion: reduce) {
  html.photo-topbar-auto-hide .topbar,
  html.photo-topbar-auto-hide .timeline-group-title { transition: none; }
}
.activity-notice { margin-top: 14px; font-size: 12px; line-height: 1.55; }
.section-heading {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.audit-section { margin-top: 22px; }
.audit-filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; align-items: end; margin: 14px 0 22px; padding: 14px;
  background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius);
}
.audit-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.audit-filters input, .audit-filters select {
  width: 100%; height: 40px; padding: 8px 10px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 6px; background: var(--input-bg); color: var(--ink);
}
@media (max-width: 240px) {
  .audit-filters { grid-template-columns: minmax(0, 1fr); padding: 10px; }
  .audit-filters label, .audit-filters input, .audit-filters select { min-width: 0; }
  .section-heading .btn { max-width: 100%; white-space: normal; }
}
.audit-table-wrap { overflow-x: auto; margin-bottom: 22px; }
/* 审计表格：行卡片化，与【用户管理】白卡行同一语言；子选择器保护明细嵌套表 */
.audit-table {
  width: 100%; min-width: 760px; font-size: 13px;
  border-collapse: separate; border-spacing: 0 8px;
}
.audit-table > thead > tr > th {
  padding: 0 12px 2px; text-align: left; color: var(--ink-soft);
  font-size: 12px; font-weight: 400; white-space: nowrap;
}
.audit-table > tbody > tr { filter: drop-shadow(var(--row-shadow)); }
.audit-table > tbody > tr > td {
  padding: 10px 12px; text-align: left; vertical-align: top;
  background: var(--paper-card); border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.audit-table > tbody > tr > td:first-child {
  border-left: 1px solid var(--line);
  border-top-left-radius: var(--radius); border-bottom-left-radius: var(--radius);
}
.audit-table > tbody > tr > td:last-child {
  border-right: 1px solid var(--line);
  border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius);
}
.audit-table code { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .audit-table-wrap { overflow-x: visible; }
  .audit-table { min-width: 0; }
  .audit-table > thead {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .audit-table, .audit-table > tbody, .audit-table > tbody > tr,
  .audit-table > tbody > tr > td { display: block; }
  .audit-table > tbody > tr {
    background: var(--paper-card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    filter: none; margin-bottom: 8px; padding: 6px 0;
  }
  .audit-table > tbody > tr > td,
  .audit-table > tbody > tr > td:first-child,
  .audit-table > tbody > tr > td:last-child {
    border: 0; border-radius: 0; background: none; box-shadow: none;
    padding: 4px 12px;
  }
  .audit-table > tbody > tr > td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    color: var(--ink-soft); font-size: 11px; font-weight: 700;
  }
}
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 8px; margin: 16px 0; flex-wrap: wrap;
}
.stats-detail summary { cursor: pointer; color: var(--accent-deep); font-size: 13px; }
.stats-detail-table { margin-top: 8px; width: 100%; border-collapse: collapse; font-size: 12px; }
.stats-detail-table th, .stats-detail-table td {
  border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left;
}

/* 纠正弹窗：批量纠正模式 */
.correct-mode-toggle { display: flex; gap: 8px; margin: 2px 0 4px; }
.correct-mode-toggle .btn[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
.correct-batch { margin-top: 10px; }
.correct-batch-list { display: flex; flex-direction: column; gap: 8px; }
.correct-batch-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper-card);
}
.correct-batch-row.changed { border-color: var(--accent-deep); background: var(--accent-soft); }
.correct-batch-row img, .correct-batch-row .correct-face-placeholder {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 7px; object-fit: cover;
}
.correct-batch-row .correct-face-placeholder {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--ink-soft);
}
.correct-batch-name {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 13px;
}
.correct-batch-row select {
  height: 36px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--input-bg); color: var(--ink); font: inherit; font-size: 13px; max-width: 46%;
}
.correct-batch-result { flex: 0 0 auto; font-size: 12px; color: var(--ink-soft); }
.correct-batch-result.ok { color: var(--ok-ink); }
.correct-batch-result.error { color: var(--danger-ink); }
.correct-batch-status { margin: 8px 0 12px; font-size: 12px; }

@media (max-width: 600px) {
  .correct-batch-row { flex-wrap: wrap; }
  .correct-batch-row img, .correct-batch-row .correct-face-placeholder {
    width: 44px; height: 44px; flex-basis: 44px;
  }
  .correct-batch-row select { flex: 1 1 150px; max-width: 100%; }
}

/* 共现网成员编辑：批量命名确认栏与行结果 */
.name-batch-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 90; display: flex; align-items: center; gap: 10px;
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; box-shadow: var(--shadow-lift); font-size: 13px;
}
.name-batch-result { display: block; margin-top: 6px; font-size: 12px; }
.name-batch-result.ok { color: var(--ok-ink); }
.name-batch-result.error { color: var(--danger-ink); }
.person-card.name-done { opacity: .62; }

/* 用户头像裁剪弹窗 */
.avatar-modal {
  position: fixed; inset: 0; z-index: 110; background: rgba(24, 30, 40, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  overflow-y: auto;
  animation: lbFade .18s ease;
}
.avatar-box {
  background: var(--paper-card); border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 20px; width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); overflow-y: auto;
}
.avatar-box h3 { margin: 0 0 6px; }
.avatar-stage {
  display: block; width: min(280px, 100%); aspect-ratio: 1; height: auto;
  margin: 12px auto; border-radius: 8px; background: #20242c; cursor: grab;
  touch-action: none;
}
.avatar-box .avatar-actions { justify-content: flex-end; margin-top: 12px; }
