/* ============================================================
   无面单快递留档 · 样式
   设计原则：白底 + 细描边，信息密度克制，移动端优先
   ============================================================ */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --line: #e7e9ef;
  --line-strong: #d7dbe4;
  --ink: #15181e;
  --ink-2: #3b414d;
  --muted: #7a828f;
  --muted-2: #9aa1ad;
  --accent: #2a5cdb;
  --accent-deep: #1f47ad;
  --accent-soft: #edf2fe;

  --ok: #127a4b;
  --ok-soft: #e8f6ef;
  --warn: #8a5a00;
  --warn-soft: #fbf3e2;
  --danger: #b3261e;
  --danger-soft: #fbecea;
  --info: #1f5fa8;
  --info-soft: #eaf2fb;
  --slate: #555b66;
  --slate-soft: #eff1f4;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px -22px rgba(16, 24, 40, 0.28);
  --shadow-lift: 0 2px 4px rgba(16, 24, 40, 0.05), 0 16px 32px -20px rgba(16, 24, 40, 0.24);
  --ring: 0 0 0 3px rgba(42, 92, 219, 0.14);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  flex: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------ 顶栏 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  flex: none;
}

.brand-mark-lg {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
}

.brand-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ghost-link {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.ghost-link:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

/* ------------------------------------------------------------ 布局 */

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px 96px;
}

.page-narrow {
  max-width: 720px;
}

.page-head {
  margin-bottom: 16px;
}

.page-title {
  margin: 0;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.3px;
}

.page-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}

.card-title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--ink-2);
}

.section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

/* ------------------------------------------------------------ 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    box-shadow 0.15s ease, transform 0.12s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(42, 92, 219, 0.28);
}

.btn-primary:hover {
  background: var(--accent-deep);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-quiet {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-2);
}

.btn-quiet:hover {
  border-color: var(--muted-2);
  color: var(--ink);
}

.btn-danger {
  background: var(--danger-soft);
  border-color: #f0cdca;
  color: var(--danger);
}

.btn-danger:hover {
  background: #f7ddd9;
}

.btn-sm {
  height: 32px;
  padding: 0 11px;
  font-size: 13px;
  border-radius: var(--radius-xs);
}

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(20, 24, 30, 0.55);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.icon-btn:hover {
  background: rgba(179, 38, 30, 0.9);
}

/* ------------------------------------------------------------ 提示条 */

.flash-stack {
  position: fixed;
  bottom: calc(84px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 460px;
  pointer-events: none;
}

.flash {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  animation: flash-in 0.22s ease both;
}

.flash-success {
  border-color: #bfe3cf;
  background: var(--ok-soft);
  color: var(--ok);
}

.flash-error {
  border-color: #f1cbc7;
  background: var(--danger-soft);
  color: var(--danger);
}

.flash-info {
  border-color: #cadcf0;
  background: var(--info-soft);
  color: var(--info);
}

@keyframes flash-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------------------------------------------ 底部导航 */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 0 10px;
  font-size: 11.5px;
  color: var(--muted);
  transition: color 0.15s ease;
}

.tab.is-active {
  color: var(--accent);
  font-weight: 600;
}

.tab svg {
  opacity: 0.8;
}

.tab.is-active svg {
  opacity: 1;
}

/* ------------------------------------------------------------ 统计 */

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px 12px;
  box-shadow: var(--shadow);
}

.stat-num {
  display: block;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.8px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

/* ------------------------------------------------------------ 搜索 */

.search-card {
  padding: 14px;
}

.search-line {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 4px 4px 12px;
}

.search-line:focus-within {
  border-color: var(--accent);
  box-shadow: var(--ring);
  background: var(--surface);
}

.search-icon {
  color: var(--muted-2);
}

.input-search {
  border: 0;
  background: transparent;
  padding: 8px 0;
  font-size: 14.5px;
}

.input-search:focus {
  outline: none;
  box-shadow: none;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.filter-grid .field:last-child {
  grid-column: 1 / -1;
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.pill {
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  transition: all 0.15s ease;
}

.pill:hover {
  border-color: var(--line-strong);
  color: var(--ink-2);
}

.pill.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 550;
}

.pill-clear {
  color: var(--muted-2);
}

/* ------------------------------------------------------------ 表单 */

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-2);
  letter-spacing: 0.1px;
}

.field-help {
  font-size: 12px;
  color: var(--muted-2);
}

.req {
  font-style: normal;
  font-size: 11px;
  color: var(--accent);
  margin-left: 2px;
}

.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}

.input::placeholder {
  color: var(--muted-2);
  font-size: 14px;
}

.input:hover {
  border-color: var(--muted-2);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.6;
}

.input-sm {
  min-height: 32px;
  height: 32px;
  padding: 4px 9px;
  font-size: 13px;
  width: 120px;
  border-radius: var(--radius-xs);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-note {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ------------------------------------------------------------ 列表 */

.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 22px 2px 12px;
}

.list-count {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 11px;
}

.record-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.record-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}

.record-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f0f1f4;
  overflow: hidden;
}

.record-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.record-card:hover .record-thumb img {
  transform: scale(1.03);
}

.thumb-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.chip-pending {
  background: var(--warn-soft);
  color: var(--warn);
}

.chip-contacted {
  background: var(--info-soft);
  color: var(--info);
}

.chip-claimed {
  background: var(--ok-soft);
  color: var(--ok);
}

.chip-returned {
  background: var(--danger-soft);
  color: var(--danger);
}

.chip-unclaimed {
  background: var(--slate-soft);
  color: var(--slate);
}

.record-thumb .chip {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}

.photo-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(20, 24, 30, 0.55);
  color: #fff;
  backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
}

.record-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 11px 12px;
  min-width: 0;
}

.record-no {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
}

.record-desc {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.record-meta {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.pager-info {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pager-placeholder {
  width: 1px;
}

/* ------------------------------------------------------------ 空状态 */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 56px 20px 64px;
  color: var(--muted-2);
  text-align: center;
}

.empty-title {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}

.empty-text {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
}

/* ------------------------------------------------------------ 照片选择 */

.photo-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.picker-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 26px 16px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.picker-drop:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.picker-drop:focus-within {
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.picker-icon {
  color: var(--accent);
  margin-bottom: 2px;
}

.picker-title {
  font-size: 14.5px;
  font-weight: 550;
  color: var(--ink-2);
}

.picker-hint {
  font-size: 12px;
  color: var(--muted);
}

.picker-drop:hover .picker-title {
  color: var(--accent-deep);
}

.compact .picker-drop {
  padding: 16px;
  flex-direction: row;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}

.preview-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f0f1f4;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(20, 24, 30, 0.6);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
}

.preview-remove:hover {
  background: var(--danger);
}

.picker-status {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.picker-status.is-warn {
  color: var(--danger);
}

/* ------------------------------------------------------------ 详情页 */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0 12px;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--ink);
}

.record-hero {
  padding: 18px 18px 16px;
}

.record-hero-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.record-no-lg {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.record-hero-meta {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.record-hero-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  padding: 2px 0 12px;
  margin: 0;
}

.photo-item {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: 780px;
  justify-self: center;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f2f3f6;
  box-shadow: var(--shadow);
}

.photo-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  line-height: 0;
}

.photo-open img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
}

.photo-del {
  position: absolute;
  top: 8px;
  right: 8px;
}

.info-rows {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.info-row {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.info-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.info-key {
  flex: none;
  width: 72px;
  color: var(--muted);
  font-size: 12.5px;
}

.info-val {
  margin: 0;
  color: var(--ink);
  word-break: break-word;
  white-space: pre-line;
}

.edit-panel {
  margin-top: 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.edit-panel summary {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
  width: fit-content;
}

.edit-panel summary::-webkit-details-marker {
  display: none;
}

.edit-panel summary:hover {
  color: var(--ink);
}

.edit-panel[open] summary {
  color: var(--accent);
  margin-bottom: 8px;
}

.status-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.status-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.status-btn.is-current {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  cursor: default;
  font-weight: 550;
}

.status-btn:disabled {
  opacity: 1;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  position: relative;
}

.timeline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
  flex: none;
  margin-top: 9px;
}

.timeline-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.timeline-text {
  font-size: 13.5px;
  color: var(--ink-2);
  word-break: break-word;
}

.timeline-time {
  font-size: 11.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.danger-zone {
  margin: 26px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.danger-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ------------------------------------------------------------ 灯箱 */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 12, 16, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.18s ease both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.lightbox-close {
  top: 16px;
  right: 16px;
}

.lightbox-prev {
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-caption {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.is-locked {
  overflow: hidden;
}

/* ------------------------------------------------------------ 登录 */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 64px;
  background:
    radial-gradient(120% 80% at 50% -10%, #eff3fd 0%, rgba(246, 247, 249, 0) 62%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.04), 0 32px 64px -40px rgba(16, 24, 40, 0.34);
  padding: 32px 28px 26px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.login-title {
  margin: 14px 0 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.3px;
}

.login-sub {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.login-foot {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--muted-2);
  text-align: center;
  line-height: 1.6;
}

/* ------------------------------------------------------------ 账号 */

.notice {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.notice-warn {
  border-color: #efdfb9;
  background: var(--warn-soft);
  color: var(--warn);
}

.user-list {
  display: flex;
  flex-direction: column;
  margin: 0 -4px;
}

.user-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 4px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.user-row:first-child {
  border-top: 0;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  flex: none;
}

.user-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.user-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 550;
}

.role-chip {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--slate-soft);
  color: var(--slate);
  font-weight: 500;
}

.role-admin {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.state-chip {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
}

.user-sub {
  font-size: 11.5px;
  color: var(--muted-2);
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-details summary {
  list-style: none;
  cursor: pointer;
}

.mini-details summary::-webkit-details-marker {
  display: none;
}

.mini-details[open] {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.action-item:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.action-hint {
  font-size: 12px;
  color: var(--muted);
}

.steps {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.85;
}

.help-foot {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted-2);
}

/* ------------------------------------------------------------ 错误页 */

.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
}

.error-card {
  text-align: center;
  max-width: 420px;
}

.error-code {
  font-size: 44px;
  font-weight: 650;
  letter-spacing: -2px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.error-title {
  margin: 4px 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.error-text {
  margin: 0 0 20px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.7;
}

.error-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ------------------------------------------------------------ 响应式 */

@media (min-width: 600px) {
  .page {
    padding: 26px 24px 40px;
  }

  .filter-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .filter-grid .field:last-child {
    grid-column: auto;
  }

  .field-row {
    flex-direction: row;
  }

  .field-row > .field {
    flex: 1;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
    gap: 14px;
  }

  .stats-row {
    gap: 14px;
  }

  .stat-card {
    padding: 16px 18px 14px;
  }

  .stat-num {
    font-size: 28px;
  }

  .card {
    padding: 22px;
  }

  .search-card {
    padding: 16px;
  }
}

@media (min-width: 900px) {
  .topbar-inner {
    padding: 0 24px;
  }

  .tabbar {
    display: none;
  }

  .flash-stack {
    bottom: 24px;
  }

  .page {
    padding-bottom: 48px;
  }

  .photo-open img {
    max-height: 560px;
  }

  .login-card {
    padding: 36px 32px 30px;
  }
}

@media (max-width: 380px) {
  .stat-num {
    font-size: 22px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
