/* ============================================================
   个人图库 · 设计系统
   令牌 → 基础 → 布局 → 组件 → 响应式
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
  /* 品牌色 */
  --c-brand: #4f46e5;
  --c-brand-600: #4338ca;
  --c-brand-700: #3730a3;
  --c-brand-soft: #eef2ff;
  --c-brand-ring: rgba(79, 70, 229, .18);

  --c-accent: #ec4899;
  --c-accent-soft: #fdf2f8;

  /* 语义色 */
  --c-success: #059669;
  --c-success-soft: #ecfdf5;
  --c-warning: #d97706;
  --c-warning-soft: #fffbeb;
  --c-danger: #dc2626;
  --c-danger-soft: #fef2f2;

  /* 中性色 */
  --c-ink: #0f172a;
  --c-ink-2: #334155;
  --c-muted: #64748b;
  --c-line: #e2e8f0;
  --c-line-2: #cbd5e1;
  --c-surface: #ffffff;
  --c-canvas: #f8fafc;
  --c-sunken: #f1f5f9;

  /* 暗色（侧边栏 / 顶部相册区） */
  --c-dark: #0b1120;
  --c-dark-2: #151d31;
  --c-dark-line: #263148;

  /* 尺寸 */
  --sidebar-w: 248px;
  --topbar-h: 64px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* 阴影 */
  --sh-xs: 0 1px 2px rgba(15, 23, 42, .06);
  --sh-sm: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
  --sh-md: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .04);
  --sh-lg: 0 12px 32px rgba(15, 23, 42, .12), 0 4px 8px rgba(15, 23, 42, .06);
  --sh-xl: 0 24px 64px rgba(15, 23, 42, .18);

  /* 过渡 */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: .18s;

  /* 层级 */
  --z-sidebar: 40;
  --z-topbar: 30;
  --z-scrim: 50;
  --z-drawer: 60;
  --z-toast: 90;
  --z-modal: 100;
}

/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--c-brand); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--c-brand-600); }

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 650; letter-spacing: -.015em; color: var(--c-ink); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 .75rem; }
:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; border-radius: 4px; }

.muted { color: var(--c-muted); }
.small { font-size: .8125rem; }
.tiny { font-size: .75rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.d-hide-desktop { display: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 3. 布局骨架 ---------- */
.app {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--c-dark);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  border-right: 1px solid var(--c-dark-line);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: .625rem;
  height: var(--topbar-h);
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--c-dark-line);
  flex-shrink: 0;
}

.sidebar__logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--c-brand) 0%, var(--c-accent) 100%);
  display: grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .4);
}

.sidebar__brand-text {
  font-size: .95rem;
  font-weight: 650;
  color: #f1f5f9;
  letter-spacing: -.01em;
  line-height: 1.2;
}

.sidebar__brand-sub {
  font-size: .6875rem;
  color: #64748b;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .125rem;
}

.sidebar__group-label {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #475569;
  padding: .75rem .75rem .375rem;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem .75rem;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.sidebar__link svg { flex-shrink: 0; opacity: .8; }

.sidebar__link:hover {
  background: var(--c-dark-2);
  color: #e2e8f0;
}

.sidebar__link.is-active {
  background: linear-gradient(90deg, rgba(79, 70, 229, .22), rgba(79, 70, 229, .06));
  color: #fff;
  box-shadow: inset 2px 0 0 var(--c-brand);
}

.sidebar__link.is-active svg { opacity: 1; color: #a5b4fc; }

.sidebar__badge {
  margin-left: auto;
  font-size: .6875rem;
  font-weight: 600;
  background: var(--c-brand);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: .0625rem .4375rem;
  min-width: 1.25rem;
  text-align: center;
}

.sidebar__foot {
  padding: .875rem;
  border-top: 1px solid var(--c-dark-line);
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5rem;
  border-radius: var(--radius-sm);
  transition: background var(--dur) var(--ease);
}

.sidebar__user:hover { background: var(--c-dark-2); }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: .8125rem;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  flex-shrink: 0;
  text-transform: uppercase;
}

.avatar--lg { width: 56px; height: 56px; font-size: 1.25rem; }

.sidebar__user-info { min-width: 0; flex: 1; }

.sidebar__user-name {
  font-size: .8125rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__user-role { font-size: .6875rem; color: #64748b; }

/* 主区：宽度用 calc 扣掉固定侧栏，否则 flex:1 在已占满的行里再吃 margin 会溢出 */
.main {
  width: calc(100% - var(--sidebar-w));
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.75rem;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--c-line);
  flex-shrink: 0;
}

.topbar__title { font-size: 1.0625rem; font-weight: 650; letter-spacing: -.01em; }
.topbar__sub { font-size: .75rem; color: var(--c-muted); }
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: .625rem; }

.menu-btn {
  display: none;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--c-ink-2);
}

.content {
  flex: 1;
  padding: 1.75rem;
  max-width: 1440px;
  width: 100%;
}

/* ---------- 4. 组件 ---------- */

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4375rem;
  height: 38px;
  padding: 0 1rem;
  font-size: .875rem;
  font-weight: 550;
  font-family: inherit;
  line-height: 1;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
  user-select: none;
}

.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { flex-shrink: 0; }

.btn--primary {
  background: var(--c-brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, .3);
}
.btn--primary:hover:not(:disabled) { background: var(--c-brand-600); color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, .32); }

.btn--ghost { background: var(--c-surface); border-color: var(--c-line); color: var(--c-ink-2); }
.btn--ghost:hover:not(:disabled) { background: var(--c-sunken); border-color: var(--c-line-2); color: var(--c-ink); }

.btn--soft { background: var(--c-brand-soft); color: var(--c-brand-600); }
.btn--soft:hover:not(:disabled) { background: #e0e7ff; color: var(--c-brand-700); }

.btn--danger { background: var(--c-danger-soft); color: var(--c-danger); border-color: #fecaca; }
.btn--danger:hover:not(:disabled) { background: #fee2e2; color: #b91c1c; }

.btn--danger-solid { background: var(--c-danger); color: #fff; }
.btn--danger-solid:hover:not(:disabled) { background: #b91c1c; color: #fff; }

.btn--sm { height: 32px; padding: 0 .75rem; font-size: .8125rem; }
.btn--lg { height: 46px; padding: 0 1.5rem; font-size: .9375rem; }
.btn--block { width: 100%; }
.btn--icon { width: 34px; padding: 0; }

/* 表单 */
.field { margin-bottom: 1.125rem; }

.label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--c-ink-2);
  margin-bottom: .375rem;
}

.label .req { color: var(--c-danger); margin-left: .125rem; }

.input, .select, .textarea {
  display: block;
  width: 100%;
  height: 42px;
  padding: 0 .875rem;
  font: inherit;
  font-size: .875rem;
  color: var(--c-ink);
  background: var(--c-surface);
  border: 1px solid var(--c-line-2);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.textarea { height: auto; padding: .625rem .875rem; resize: vertical; }

.input::placeholder { color: #94a3b8; }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px var(--c-brand-ring);
}

.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; }

.help {
  font-size: .75rem;
  color: var(--c-muted);
  margin-top: .3125rem;
}

/* 提示条 */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  border: 1px solid;
  margin-bottom: 1rem;
}

.alert svg { flex-shrink: 0; margin-top: .125rem; }
.alert--success { background: var(--c-success-soft); color: #065f46; border-color: #a7f3d0; }
.alert--danger  { background: var(--c-danger-soft);  color: #991b1b; border-color: #fecaca; }
.alert--warning { background: var(--c-warning-soft); color: #92400e; border-color: #fde68a; }
.alert--info    { background: var(--c-brand-soft);   color: var(--c-brand-700); border-color: #c7d2fe; }

/* 卡片 */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  box-shadow: var(--sh-sm);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--c-line);
}

.card__title { font-size: .9375rem; font-weight: 650; }
.card__body { padding: 1.25rem; }
.card__body--flush { padding: 0; }

/* 统计卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: .875rem;
  box-shadow: var(--sh-xs);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.stat:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }

.stat__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
}

.stat__icon--brand  { background: var(--c-brand-soft);   color: var(--c-brand); }
.stat__icon--green  { background: var(--c-success-soft); color: var(--c-success); }
.stat__icon--amber  { background: var(--c-warning-soft); color: var(--c-warning); }
.stat__icon--pink   { background: var(--c-accent-soft);  color: var(--c-accent); }

.stat__value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.stat__label { font-size: .75rem; color: var(--c-muted); font-weight: 500; }

/* 徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  height: 22px;
  padding: 0 .5rem;
  border-radius: var(--radius-pill);
  font-size: .6875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge--success { background: var(--c-success-soft); color: #047857; }
.badge--muted   { background: var(--c-sunken); color: var(--c-muted); }
.badge--warning { background: var(--c-warning-soft); color: #b45309; }
.badge--brand   { background: var(--c-brand-soft); color: var(--c-brand-600); }
.badge--danger  { background: var(--c-danger-soft); color: #b91c1c; }

.badge__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* 积分胶囊 */
.points-pill {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  height: 34px;
  padding: 0 .8125rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--c-brand-soft), var(--c-accent-soft));
  border: 1px solid #ddd6fe;
  font-size: .8125rem;
  font-weight: 650;
  color: var(--c-brand-700);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.points-pill svg { color: var(--c-brand); }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table { width: 100%; border-collapse: collapse; font-size: .875rem; }

.table th {
  text-align: left;
  font-size: .6875rem;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-muted);
  padding: .6875rem 1rem;
  background: var(--c-sunken);
  border-bottom: 1px solid var(--c-line);
  white-space: nowrap;
}

.table th:first-child { border-top-left-radius: 0; }
.table td {
  padding: .8125rem 1rem;
  border-bottom: 1px solid var(--c-line);
  vertical-align: middle;
}

.table tbody tr { transition: background var(--dur) var(--ease); }
.table tbody tr:hover { background: #fafbff; }
.table tbody tr:last-child td { border-bottom: 0; }

.table__actions { display: flex; gap: .375rem; justify-content: flex-end; }

.table__title { font-weight: 600; color: var(--c-ink); line-height: 1.35; }
.table__sub {
  display: inline-flex; align-items: center; gap: .3rem;
  margin-top: .2rem; font-size: .75rem; color: var(--c-muted); white-space: nowrap;
}

.editable {
  display: inline-block;
  min-width: 2.5rem;
  padding: .125rem .4375rem;
  margin: -.125rem -.4375rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  font-variant-numeric: tabular-nums;
}

.editable:hover { background: var(--c-brand-soft); box-shadow: inset 0 0 0 1px #c7d2fe; }
.editable:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 2px var(--c-brand); }

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  gap: .25rem;
  justify-content: center;
  padding: 1rem;
  flex-wrap: wrap;
}

.pager__item {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 .5rem;
  border-radius: var(--radius-sm);
  font-size: .8125rem;
  font-weight: 550;
  color: var(--c-ink-2);
  border: 1px solid transparent;
  transition: background var(--dur) var(--ease);
}

.pager__item:hover { background: var(--c-sunken); color: var(--c-ink); }
.pager__item.is-active { background: var(--c-brand); color: #fff; }
.pager__item.is-disabled { opacity: .4; pointer-events: none; }

/* 标签页 */
.tabs {
  display: flex;
  gap: .25rem;
  border-bottom: 1px solid var(--c-line);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: .6875rem .875rem;
  font: inherit;
  font-size: .875rem;
  font-weight: 550;
  color: var(--c-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.tab:hover { color: var(--c-ink); }
.tab.is-active { color: var(--c-brand); border-bottom-color: var(--c-brand); }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fadeUp .22s var(--ease); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 5. 相册瀑布流 ---------- */
/* 列数由 js/script.js 决定：它把卡片轮流塞进 .masonry__col，这里只管等宽和间距。
   不用 CSS 多列——Chromium 算列宽时会多扣一个列间距，卡片被压窄。 */
.masonry {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.masonry__col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.masonry__item {
  /* figure 默认有 1em 40px 的外边距，且不会自动撑满列宽 */
  margin: 0;
  width: 100%;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--c-sunken);
  box-shadow: var(--sh-sm);
  cursor: zoom-in;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.masonry__item:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-lg);
}

.masonry__item img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: cover;
}

.masonry__item.is-selected {
  box-shadow: 0 0 0 3px var(--c-brand), var(--sh-lg);
}

/* 悬浮遮罩：只负责压暗和展示作者信息，不拦点击，放大、勾选、操作按钮各自在顶层 */
.masonry__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(11, 17, 32, .45) 0%, transparent 35%, transparent 55%, rgba(11, 17, 32, .72) 100%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: .625rem;
}

.masonry__item:hover .masonry__overlay,
.masonry__item.is-selected .masonry__overlay { opacity: 1; }

/* 图库卡片的操作按钮和勾选框：直接挂在卡片上，避免被遮挡层压住 */
.masonry__bar-overlay {
  position: absolute;
  left: .5rem; right: .5rem; bottom: .5rem;
  display: flex;
  gap: .375rem;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.masonry__item:hover .masonry__bar-overlay,
.masonry__item:focus-within .masonry__bar-overlay,
.masonry__item.is-selected .masonry__bar-overlay { opacity: 1; }

.masonry__check-wrap {
  position: absolute;
  top: .5rem; right: .5rem;
  display: flex;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.masonry__item:hover .masonry__check-wrap,
.masonry__item:focus-within .masonry__check-wrap,
.masonry__item.is-selected .masonry__check-wrap { opacity: 1; }

/* 触屏没有 hover，操作按钮常显 */
@media (hover: none) {
  .masonry__bar-overlay,
  .masonry__check-wrap { opacity: 1; }
}

.masonry__top { display: flex; justify-content: flex-end; }

.masonry__check {
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, .9);
  background: rgba(15, 23, 42, .3);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--dur) var(--ease);
}

.masonry__check:checked {
  background: var(--c-brand);
  border-color: var(--c-brand);
}

.masonry__check:checked::after {
  content: "";
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.masonry__bar {
  display: flex;
  gap: .375rem;
  justify-content: flex-end;
}

.icon-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 0;
  background: rgba(255, 255, 255, .16);
  backdrop-filter: blur(8px);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.icon-btn:hover { background: rgba(255, 255, 255, .32); }
.icon-btn--danger:hover { background: var(--c-danger); }
.icon-btn.is-on { background: rgba(139, 92, 246, .85); }

/* 图上的广场状态角标 */
.square-tag {
  position: absolute;
  top: .5rem;
  left: .5rem;
  backdrop-filter: blur(6px);
  box-shadow: var(--sh-sm);
}

/* 头像图片形态 */
.avatar--img { object-fit: cover; background: var(--c-sunken); }

/* 个人资料页的头像区 */
.avatar-edit {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.avatar-edit__preview {
  width: 88px; height: 88px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--c-surface), 0 0 0 5px var(--c-line);
}
.avatar-edit__preview .avatar,
.avatar-edit__preview img { width: 88px !important; height: 88px !important; font-size: 2rem !important; }

/* 广场卡片作者行 */
.square-author {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  min-width: 0;
}
.square-author__name { font-size: .75rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.masonry__item .avatar { border: 1px solid rgba(255, 255, 255, .35); }

/* 审核队列卡片 */
.review-card { display: grid; grid-template-columns: 180px 1fr; gap: 1.25rem; align-items: start; }
.review-card__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--c-sunken);
  cursor: zoom-in;
}
.review-card__img:hover { filter: brightness(.93); }
.review-card__meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.review-card__title { font-weight: 650; margin-bottom: .375rem; word-break: break-word; }
.review-card__actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .875rem; }

/* 广场内容管理：缩略图即入口，点开看大图 */
.review-thumb { position: relative; display: block; padding: 0; border: 0; background: none; cursor: zoom-in; line-height: 0; border-radius: 6px; }
.review-thumb img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; display: block; transition: filter var(--dur) var(--ease); }
.review-thumb:hover img { filter: brightness(.9); }
.review-thumb::after {
  content: "看大图";
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: .125rem .375rem; border-radius: 4px;
  background: rgba(0, 0, 0, .62); color: #fff;
  font-size: .6875rem; line-height: 1.5; white-space: nowrap;
  opacity: 0; transition: opacity var(--dur) var(--ease); pointer-events: none;
}
.review-thumb:hover::after, .review-thumb:focus-visible::after { opacity: 1; }
.table__gallery { display: flex; gap: .25rem; }

/* 管理后台 · 账号与权限 */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.check { display: flex; align-items: flex-start; gap: .5rem; padding: .375rem 0; font-size: .875rem; cursor: pointer; line-height: 1.5; }
.check input { margin-top: .2rem; flex: none; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0 .75rem; }
.access-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-bottom: 1.25rem; }
.group-tags { font-size: .8125rem; }

@media (max-width: 720px) {
  .field-grid, .access-grid { grid-template-columns: 1fr; }
}

/* 广场页首的英雄条 */
.square-hero {
  background: linear-gradient(145deg, #0b1120 0%, #1e1b4b 60%, #4c1d95 100%);
  color: #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
}
.square-hero::after {
  content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%;
  background: var(--c-accent); filter: blur(70px); opacity: .45; top: -90px; right: -40px;
}
.square-hero__title { font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; color: #fff; position: relative; }
.square-hero__desc { color: #c7d2fe; margin-top: .375rem; position: relative; max-width: 34rem; }

/* 广场分区切换 */
.zone-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: -0.75rem 0 1.25rem; }
.zone-tabs__item {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .4375rem .875rem; border-radius: 999px;
  background: var(--c-surface); border: 1px solid var(--c-line);
  color: var(--c-muted); font-size: .875rem; font-weight: 600;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.zone-tabs__item:hover { border-color: var(--c-brand-soft); color: var(--c-brand-600); text-decoration: none; }
.zone-tabs__item.is-active { background: var(--c-brand); border-color: var(--c-brand); color: #fff; }
.zone-tabs__count {
  font-size: .75rem; font-weight: 650; line-height: 1;
  padding: .1875rem .375rem; border-radius: 999px;
  background: var(--c-sunken); color: var(--c-muted);
}
.zone-tabs__item.is-active .zone-tabs__count { background: rgba(255, 255, 255, .22); color: #fff; }

/* 图上分区角标（右下） */
.square-zone {
  position: absolute; right: .5rem; bottom: .5rem;
  max-width: calc(100% - 1rem);
  padding: .125rem .5rem; border-radius: 999px;
  background: rgba(15, 23, 42, .62); color: #e2e8f0;
  font-size: .6875rem; font-weight: 600; line-height: 1.6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none; z-index: 2;
}

/* 管理后台可见范围说明行 */
.zone-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }

/* 空状态 */
.empty {
  text-align: center;
  padding: 4rem 2rem;
  border: 2px dashed var(--c-line-2);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
}

.empty__icon {
  width: 72px; height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--c-brand-soft), var(--c-accent-soft));
  display: grid;
  place-items: center;
  color: var(--c-brand);
}

.empty__title { font-size: 1.0625rem; font-weight: 650; margin-bottom: .375rem; }
.empty__desc { color: var(--c-muted); font-size: .875rem; margin-bottom: 1.5rem; }

/* ---------- 6. 上传区 ---------- */
.dropzone {
  border: 2px dashed var(--c-line-2);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  background: var(--c-surface);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

.dropzone:hover { border-color: var(--c-brand); background: #fafaff; }
.dropzone.is-over {
  border-color: var(--c-brand);
  background: var(--c-brand-soft);
  transform: scale(1.005);
}

.dropzone__icon {
  width: 64px; height: 64px;
  margin: 0 auto 1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--c-brand-soft), var(--c-accent-soft));
  display: grid;
  place-items: center;
  color: var(--c-brand);
}

.dropzone__title { font-size: .9375rem; font-weight: 650; margin-bottom: .25rem; }
.dropzone__hint { font-size: .8125rem; color: var(--c-muted); }

.preview {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  align-items: center;
}

.preview__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--c-sunken);
}

.progress {
  height: 6px;
  background: var(--c-sunken);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--c-brand), var(--c-accent));
  border-radius: inherit;
  transition: width .2s var(--ease);
}

/* ---------- 7. 认证页 ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 480px;
  background: var(--c-canvas);
}

.auth__aside {
  position: relative;
  background: linear-gradient(145deg, #0b1120 0%, #1e1b4b 55%, #4c1d95 100%);
  color: #e2e8f0;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.auth__aside::before,
.auth__aside::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .5;
}

.auth__aside::before {
  width: 320px; height: 320px;
  background: var(--c-brand);
  top: -80px; right: -60px;
}

.auth__aside::after {
  width: 280px; height: 280px;
  background: var(--c-accent);
  bottom: -100px; left: -60px;
}

.auth__aside > * { position: relative; z-index: 1; }

.auth__headline {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.25;
  color: #fff;
  margin-bottom: 1rem;
}

.auth__lede { color: #c7d2fe; font-size: .9375rem; max-width: 28rem; }

.auth__features {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: flex;
  flex-direction: column;
  gap: .875rem;
}

.auth__features li {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .875rem;
  color: #e0e7ff;
}

.auth__features svg { color: #a5b4fc; flex-shrink: 0; }

.auth__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem;
  background: var(--c-surface);
}

.auth__form { width: 100%; max-width: 340px; margin: 0 auto; }

.auth__logo {
  display: flex;
  align-items: center;
  gap: .625rem;
  margin-bottom: 2rem;
}

.auth__title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.025em; margin-bottom: .375rem; }
.auth__sub { color: var(--c-muted); font-size: .875rem; margin-bottom: 1.75rem; }
.auth__foot { margin-top: 1.5rem; text-align: center; font-size: .8125rem; color: var(--c-muted); }

/* ---------- 8. 模态 / 抽屉 / Toast ---------- */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
  z-index: var(--z-scrim);
}

.scrim.is-open { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
  z-index: var(--z-modal);
}

.modal.is-open { opacity: 1; pointer-events: auto; }

.modal__dialog {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--sh-xl);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(.96) translateY(8px);
  transition: transform .22s var(--ease);
}

.modal.is-open .modal__dialog { transform: none; }

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--c-line);
  flex-shrink: 0;
}

.modal__title { font-size: .9375rem; font-weight: 650; }

.modal__body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.modal__body img { width: 100%; border-radius: var(--radius-sm); display: block; }

.close-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--c-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  flex-shrink: 0;
}

.close-btn:hover { background: var(--c-sunken); color: var(--c-ink); }

/* 移动端抽屉菜单 */
.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: 272px;
  background: var(--c-dark);
  z-index: var(--z-drawer);
  transform: translateX(-100%);
  transition: transform .26s var(--ease);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.drawer.is-open { transform: none; }

/* 移动端底部标签栏 */
.tabbar {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  height: calc(58px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--c-line);
  z-index: var(--z-topbar);
}

.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1875rem;
  font-size: .625rem;
  font-weight: 550;
  color: var(--c-muted);
  transition: color var(--dur) var(--ease);
}

.tabbar__item.is-active { color: var(--c-brand); }
.tabbar__item svg { transition: transform var(--dur) var(--ease); }
.tabbar__item.is-active svg { transform: translateY(-1px); }

/* Toast */
.toast-host {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: .625rem;
  min-width: 240px;
  max-width: 380px;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--c-ink);
  color: #f8fafc;
  font-size: .875rem;
  box-shadow: var(--sh-lg);
  pointer-events: auto;
  animation: toastIn .26s var(--ease);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}

.toast.is-out { opacity: 0; transform: translateX(12px); }
.toast--success svg { color: #4ade80; }
.toast--danger  svg { color: #f87171; }
.toast--warning svg { color: #fbbf24; }
.toast--info    svg { color: #818cf8; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: none; }
}

/* 复制地址行 */
.copy-row {
  display: flex;
  gap: .5rem;
  margin-top: 1rem;
}

.copy-row .input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8125rem; }

/* 页头 */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-head__title { font-size: 1.375rem; font-weight: 700; letter-spacing: -.025em; }
.page-head__desc { font-size: .8125rem; color: var(--c-muted); margin-top: .1875rem; }
.page-head__actions { display: flex; gap: .5rem; flex-shrink: 0; }

/* 搜索栏 */
.searchbar { position: relative; flex: 1; max-width: 340px; }
.searchbar svg {
  position: absolute;
  left: .8125rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-muted);
  pointer-events: none;
}
.searchbar .input { padding-left: 2.375rem; }

.toolbar {
  display: flex;
  align-items: center;
  gap: .625rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

/* 选择工具条 */
.selection-bar {
  position: fixed;
  bottom: 1.5rem;
  left: calc(50% + var(--sidebar-w) / 2);
  transform: translate(-50%, 140%);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .625rem .75rem .625rem 1.25rem;
  background: var(--c-ink);
  color: #f8fafc;
  border-radius: var(--radius-pill);
  box-shadow: var(--sh-xl);
  z-index: 70;
  transition: transform .26s var(--ease), opacity .2s var(--ease);
  opacity: 0;
  pointer-events: none;
}

.selection-bar.is-open { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.selection-bar__count { font-size: .8125rem; font-weight: 600; }

/* ---------- 9. 响应式 ---------- */

@media (max-width: 992px) {
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .auth__panel { min-height: 100vh; }
}

/* 平板 / 手机：侧边栏收起为抽屉 */
@media (max-width: 992px) {
  .d-hide-desktop { display: flex; }
}

@media (max-width: 860px) {
  .sidebar { display: none; }
  .main { margin-left: 0; width: 100%; }
  .d-hide-mobile { display: none !important; }

  /* 工具条在窄屏堆叠 */
  .toolbar { align-items: stretch; }
  .searchbar { max-width: none; }
  .searchbar .input { height: 40px; }
  .points-pill { height: 30px; font-size: .75rem; padding: 0 .625rem; }
  .page-head__desc { font-size: .75rem; }

  .card__head { padding: .875rem 1rem; }
  .card__body { padding: 1rem; }

  .tabs { gap: 0; }
  .tab { flex: 1; text-align: center; }

  /* 手机表格：单元格标签靠左，值靠右 */
  .table--cards td { padding: .375rem 0; }
  .table--cards td[style] { text-align: left !important; }
  .table--cards .editable { text-align: right; }

  .menu-btn { display: inline-flex; }

  .topbar { padding: 0 1rem; }
  .content { padding: 1rem; padding-bottom: 5rem; }

  .masonry { gap: .75rem; }
  .masonry__col { gap: .75rem; }
  .masonry__item { border-radius: var(--radius-sm); }

  .tabbar { display: flex; }

  .selection-bar {
    left: 50%;
    bottom: calc(58px + env(safe-area-inset-bottom) + .75rem);
    padding-left: 1rem;
  }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .stat { padding: .875rem 1rem; }
  .stat__value { font-size: 1.25rem; }
  .stat__icon { width: 34px; height: 34px; }

  .page-head { margin-bottom: 1rem; }
  .page-head__title { font-size: 1.1875rem; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1; }

  .preview { grid-template-columns: 1fr; }
  .preview__img { max-height: 220px; }

  .review-card { grid-template-columns: 1fr; gap: .875rem; }
  .review-card__img { aspect-ratio: 16 / 10; }
  .square-hero { padding: 1.75rem 1.25rem; margin-bottom: 1.25rem; }
  .square-hero__title { font-size: 1.375rem; }
  .square-hero__desc { font-size: .8125rem; }
  .avatar-edit__preview { width: 72px; height: 72px; }
  .avatar-edit__preview .avatar,
  .avatar-edit__preview img { width: 72px !important; height: 72px !important; }

  .dropzone { padding: 2.25rem 1.25rem; }

  .topbar__sub { display: none; }
  .topbar__title { font-size: .9375rem; }

  .toast-host { top: auto; bottom: calc(58px + env(safe-area-inset-bottom) + 4.5rem); left: .75rem; right: .75rem; }
  .toast { min-width: 0; max-width: none; }

  /* 表格在手机上转卡片列表 */
  .table--cards thead { display: none; }
  .table--cards tbody tr {
    display: block;
    margin-bottom: .75rem;
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: .75rem;
    background: var(--c-surface);
  }
  .table--cards td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .3125rem 0;
    border: 0;
    font-size: .8125rem;
  }
  .table--cards td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--c-muted);
    font-size: .75rem;
  }
  .table--cards td:last-child { justify-content: flex-start; padding-top: .625rem; }
  .table__actions { justify-content: flex-start; flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .masonry { gap: .5rem; }
  .masonry__col { gap: .5rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .auth__panel { padding: 1.5rem 1.25rem; }
  .points-pill { height: 30px; font-size: .75rem; padding: 0 .625rem; }
  .topbar { gap: .5rem; }
}

/* 审核面板：桌面左侧待审队列，右侧内容管理 */
@media (min-width: 1100px) {
  .review-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
  .review-layout .review-side .table th,
  .review-layout .review-side .table td { padding-left: .75rem; padding-right: .75rem; }
  .review-layout .review-side .review-thumb img { width: 44px !important; height: 34px !important; }
  .review-card { grid-template-columns: 140px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
   轮播组件 .crs            js/carousel.js + js/carousel-plugins.js
   多实例通用灯箱：翻页 / 自动播放 / 键盘 / 插件动作区 / 媒体释放
   ============================================================ */
.crs {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(9, 12, 20, .94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #e8ecf6;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.crs:focus { outline: none; }
.crs.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.crs:not(.is-open) { visibility: hidden; pointer-events: none; }
body.crs-lock { overflow: hidden; }

.crs__head { position: absolute; top: 0; left: 0; right: 0; padding: .875rem 4.5rem .875rem 1.25rem; display: flex; flex-direction: column; gap: .125rem; pointer-events: none; }
.crs__title { font-size: 1rem; font-weight: 600; letter-spacing: .01em; }
.crs__sub { font-size: .75rem; color: #9aa6bf; }

.crs__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: min(1100px, 100%);
  max-height: calc(100vh - 9rem);
  min-height: 0;
}
.crs__media { display: none; border-radius: var(--radius-md); box-shadow: 0 24px 64px rgba(0, 0, 0, .55); background: #000; }
.crs__media.is-active { display: block; }
.crs__img { max-width: 100%; max-height: calc(100vh - 9.5rem); width: auto; height: auto; object-fit: contain; }
.crs[data-type="video"] .crs__video { width: min(1100px, 100%); max-height: calc(100vh - 9.5rem); }
.crs[data-type="audio"] .crs__audio { width: min(560px, 100%); background: #14192a; border: 1px solid rgba(255, 255, 255, .08); }
.crs__hooks { width: min(760px, 100%); display: flex; flex-direction: column; gap: .5rem; }
.crs__caption { max-width: min(760px, 100%); text-align: center; margin-top: .75rem; font-size: .875rem; }
.crs__caption.is-empty { display: none; }
.crs__caption-title { font-weight: 600; color: #fff; }
.crs__caption-author { color: #9aa6bf; font-size: .8125rem; margin-top: .125rem; }

.crs__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(22, 27, 42, .78);
  color: #e8ecf6;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.crs__nav:hover { background: rgba(52, 60, 86, .92); }
.crs__nav--prev { left: 1rem; }
.crs__nav--next { right: 1rem; }
.crs__nav--prev::before,
.crs__nav--next::before { content: ""; width: 10px; height: 10px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.crs__nav--prev::before { transform: rotate(45deg) translate(2px, -2px); }
.crs__nav--next::before { transform: rotate(-135deg) translate(2px, -2px); }

.crs__close {
  position: absolute;
  top: .75rem;
  right: .875rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(22, 27, 42, .8);
  color: #e8ecf6;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.crs__close::before { content: "×"; }

.crs__bar {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .375rem .5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(17, 21, 34, .86);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .45);
}
.crs__count { font-size: .8125rem; color: #b8c2d8; font-variant-numeric: tabular-nums; padding: 0 .375rem; }
.crs__btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .07);
  color: #e8ecf6;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}
.crs__btn:hover { background: rgba(255, 255, 255, .14); }
.crs__toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--c-brand);
  color: #fff;
  cursor: pointer;
}
.crs__toggle.is-playing { background: var(--c-danger); }
/* 两个图标同时在 DOM，靠状态切换显隐：不再每次翻页重写 innerHTML */
.crs__toggle .crs-icon-pause { display: none; }
.crs__toggle.is-playing .crs-icon-play { display: none; }
.crs__toggle.is-playing .crs-icon-pause { display: block; }
.crs__rate {
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: transparent;
  color: #cbd5e8;
  font-size: .75rem;
  padding: 0 .5rem;
}
.crs__rate option { background: #161b2a; color: #e8ecf6; }
/* 深色底上原生下拉箭头是黑的，自带一个浅色箭头 */
.crs__rate {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 1.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .5rem center;
  background-color: transparent;
}

/* 插件区：审核按钮、作者、媒体信息 */
.crs__hooks:empty { display: none; }

/* 加载态：图片解码出来之前先占位转圈，避免空白等半天才出现 */
.crs__loading { display: none !important; position: absolute; inset: 0; align-items: center; justify-content: center; pointer-events: none; }
.crs.is-loading .crs__loading { display: flex !important; }
.crs.is-loading .crs__media { visibility: hidden; }
.crs.is-loading .crs__stage { min-width: min(420px, 80vw); min-height: 220px; }
.crs__spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .18);
  border-top-color: #fff;
  animation: crs-spin .8s linear infinite;
}
@keyframes crs-spin { to { transform: rotate(360deg); } }
.crs.is-error .crs__caption-title::after { content: "（图片加载失败）"; color: var(--c-danger); font-weight: 400; }
.crs-plugin { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.crs-plugin.is-empty { display: none; }
.crs-author { justify-content: center; margin-top: .625rem; color: #cbd5e8; font-size: .8125rem; gap: .375rem; }
.crs-author__meta { color: #8b97b0; }

.crs-review {
  margin-top: .75rem;
  padding: .625rem .75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(17, 21, 34, .9);
  gap: .5rem;
  width: 100%;
}
.crs-review__label { font-size: .75rem; color: #9aa6bf; }
.crs-review__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.crs-review__actions .crs-review__ok { background: var(--c-success); color: #fff; border-color: transparent; }
.crs-review__actions .btn--ghost { color: #e8ecf6; border-color: rgba(255, 255, 255, .2); }
.crs-review__reason { flex: 1 1 180px; min-width: 140px; height: 34px; }
.crs-review__zone { display: inline-flex; align-items: center; gap: .375rem; font-size: .75rem; color: #9aa6bf; }
.crs-review__zonesel {
  height: 30px; max-width: 220px; padding: 0 .5rem; font-size: .75rem;
  background: rgba(255, 255, 255, .06); color: #e8ecf6; border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-sm);
}
.crs-review__zonesel option { color: var(--c-ink); background: #fff; }
.crs-review__hint { flex-basis: 100%; font-size: .6875rem; color: #7c88a2; }
.crs-media-info { justify-content: center; color: #9aa6bf; font-size: .8125rem; margin-top: .5rem; }

@media (max-width: 720px) {
  .crs__nav { width: 38px; height: 38px; }
  .crs__nav--prev { left: .375rem; }
  .crs__nav--next { right: .375rem; }
  .crs__img { max-height: calc(100vh - 14rem); }
  .crs__bar { bottom: .5rem; gap: .25rem; padding: .25rem; }
  .crs__rate { display: none; }
  .crs-review { margin-top: .5rem; padding: .5rem; }
  .crs-review__hint { display: none; }
}
