/* ==========================================================================
   GALLERY PRO — 页面与视图布局
   ========================================================================== */

.app-root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 46px 32px 96px;
}

.shell-pad { padding-inline: 32px; }

/* ==========================================================================
   顶栏
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--bar-h);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
}
.topbar__inner {
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand__mark {
  width: 11px; height: 11px;
  border: 1px solid var(--gold);
  display: block;
  position: relative;
  transform: rotate(45deg);
}
.brand__mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--gold);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name {
  font-family: var(--serif);
  font-size: 13.5px;
  letter-spacing: 0.28em;
  font-weight: 600;
  color: var(--text);
}
.brand__sub {
  font-size: 8px;
  letter-spacing: 0.32em;
  color: var(--text-3);
  margin-top: 2px;
  text-transform: uppercase;
}

.topnav { display: flex; align-items: center; gap: 26px; margin-left: 14px; }
.topnav__link {
  position: relative;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: 6px 0;
  transition: color 0.2s;
  white-space: nowrap;
}
.topnav__link:hover { color: var(--text); }
.topnav__link.is-active { color: var(--text); }
.topnav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--gold);
}

.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.topbar__menu { display: none; }

.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: var(--gold-soft);
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.user-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px 4px 4px;
  border-radius: 30px;
  transition: background-color 0.2s;
}
.user-btn:hover { background: var(--surface-2); }
.user-btn__name { font-size: 12px; color: var(--text-2); letter-spacing: 0.04em; }

/* 弹层菜单 */
.menu {
  position: fixed;
  z-index: 80;
  min-width: 216px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
  animation: menu-in 0.18s var(--ease-out) both;
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  font-size: 12.5px;
  color: var(--text-2);
  text-align: left;
  border-radius: 1px;
  transition: background-color 0.15s, color 0.15s;
}
.menu__item:hover { background: var(--gold-soft); color: var(--text); }
.menu__item .icon { color: var(--text-3); }
.menu__item:hover .icon { color: var(--gold); }
.menu__item--danger { color: var(--danger); }
.menu__item--danger:hover { background: rgba(196, 104, 95, 0.1); color: var(--danger); }
.menu__sep { height: 1px; background: var(--line-soft); margin: 6px 4px; }
.menu__label { padding: 8px 11px 6px; font-size: 9.5px; letter-spacing: 0.2em; color: var(--text-3); text-transform: uppercase; }

/* 移动端抽屉 */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
}
.drawer.is-open { display: block; }
.drawer__scrim {
  position: absolute; inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  animation: fade-in 0.2s both;
}
.drawer__panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: min(300px, 84vw);
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: drawer-in 0.3s var(--ease-out) both;
}
@keyframes drawer-in { from { transform: translateX(-100%); } to { transform: none; } }
.drawer__link {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 10px;
  font-size: 13.5px;
  color: var(--text-2);
  border-bottom: 1px solid var(--line-soft);
}
.drawer__link:hover { color: var(--text); }
.drawer__link .icon { color: var(--text-3); }

/* ==========================================================================
   登录页
   ========================================================================== */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
}

.login__visual {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  background: var(--surface);
}
.login__visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  filter: brightness(1.14) saturate(1.02);
  animation: slow-zoom 26s ease-out both;
}
@keyframes slow-zoom { from { transform: scale(1.09); } to { transform: scale(1.02); } }
.login__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(6, 6, 6, 0.9) 0%, rgba(6, 6, 6, 0.2) 46%, rgba(6, 6, 6, 0.38) 100%),
    linear-gradient(to right, rgba(6, 6, 6, 0.34), transparent 44%);
}
.login__visual-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 100vh;
  padding: 44px 48px 46px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #F4F2ED;
}
.login__brand { display: flex; align-items: center; gap: 16px; }
.login__brand .brand__name { color: #F4F2ED; }
.login__brand .brand__sub { color: rgba(244, 242, 237, 0.5); }
.login__issue {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: rgba(244, 242, 237, 0.55);
}
.login__hero { max-width: 560px; }
.login__hero .eyebrow { color: rgba(201, 169, 110, 0.9); margin-bottom: 22px; }
.login__hero h1 {
  text-wrap: balance;
  font-family: var(--serif);
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 1.18;
  letter-spacing: 0.01em;
  font-weight: 400;
  margin-bottom: 22px;
}
.login__hero p {
  font-size: 13.5px;
  line-height: 1.9;
  color: rgba(244, 242, 237, 0.62);
  max-width: 420px;
}
.login__foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: rgba(244, 242, 237, 0.42);
  text-transform: uppercase;
}

.login__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--bg);
  position: relative;
}
.login__panel::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 1px;
  background: var(--line);
}
.login__form { width: 100%; max-width: 360px; animation: rise 0.7s var(--ease-out) 0.1s both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.login__form .eyebrow { margin-bottom: 14px; }
.login__form h2 {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.2;
  margin-bottom: 8px;
}
.login__form > p { color: var(--text-2); font-size: 12.5px; margin-bottom: 34px; }
.login__hint {
  margin-top: 26px;
  padding: 13px 15px;
  border: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.7;
}
.login__hint b { color: var(--text-2); font-weight: 500; }
.login__row { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 26px; }
.login__meta {
  margin-top: 30px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.password-toggle {
  position: absolute;
  right: 0;
  color: var(--text-3);
  display: flex;
  padding: 6px;
}
.password-toggle:hover { color: var(--text); }

/* ==========================================================================
   页面标题区
   ========================================================================== */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}
.page-head__eyebrow { margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.page-head__eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--gold);
}
.page-head h1 {
  text-wrap: balance;
  font-family: var(--serif);
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: 0.005em;
}
.page-head__lead {
  text-wrap: pretty;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-2);
  max-width: 520px;
  line-height: 1.8;
}
.page-head__actions { display: flex; align-items: center; gap: 10px; flex: none; }

/* 统计条 */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  margin-bottom: 44px;
}
.stat {
  padding: 20px 24px;
  border-right: 1px solid var(--line);
  position: relative;
}
.stat:last-child { border-right: 0; }
.stat__num {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.stat__num small { font-family: var(--sans); font-size: 10px; letter-spacing: 0.12em; color: var(--text-3); }
.stat__label { font-size: 10px; letter-spacing: 0.18em; color: var(--text-3); text-transform: uppercase; margin-top: 7px; }

/* ==========================================================================
   项目卡片
   ========================================================================== */
.section-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.section-bar h2 { font-family: var(--serif); font-size: 19px; }
.section-bar__count { font-size: 10.5px; letter-spacing: 0.14em; color: var(--text-3); text-transform: uppercase; }

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

.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.35s var(--ease), transform 0.45s var(--ease-out), background-color 0.35s;
}
.pcard:hover { border-color: var(--gold-line); transform: translateY(-4px); }
.pcard__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--img-placeholder);
}
.pcard__blank {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(201, 169, 110, 0.08), transparent 55%),
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(255, 255, 255, 0.025) 14px 15px);
  color: var(--text-3);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.pcard__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease-out), filter 0.6s;
  filter: saturate(0.92);
}
.pcard:hover .pcard__media img { transform: scale(1.045); filter: saturate(1); }
.pcard__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent 46%);
  opacity: 0.85;
}
.pcard__index {
  position: absolute;
  top: 14px; left: 16px;
  z-index: 2;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5);
}
.pcard__status {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 23px;
  padding: 0 9px;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(10, 10, 10, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(6px);
}
.pcard__status--active { color: #E8CD9A; border-color: rgba(201, 169, 110, 0.5); }
.pcard__tools {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: flex;
  gap: 6px;
}
.pcard__tool {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(10, 10, 10, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.pcard__tool:hover { color: #fff; background: rgba(10, 10, 10, 0.72); border-color: rgba(255, 255, 255, 0.5); }
.pcard__tool--danger:hover {
  color: #F0A79E;
  border-color: rgba(196, 104, 95, 0.75);
  background: rgba(70, 22, 20, 0.72);
}
.pcard__body { padding: 20px 22px 18px; display: flex; flex-direction: column; flex: 1; }
.pcard__client { font-size: 9.5px; letter-spacing: 0.22em; color: var(--text-3); text-transform: uppercase; }
.pcard__title {
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.25;
  margin: 9px 0 8px;
}
.pcard__desc {
  text-wrap: pretty;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}
.pcard__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.pcard__meta span { display: inline-flex; align-items: center; gap: 5px; }
.pcard__meta .icon { width: 13px; height: 13px; }
.pcard__progress { margin-top: 16px; }
.pcard__progress-head {
  display: flex; justify-content: space-between;
  font-size: 10px; letter-spacing: 0.1em; color: var(--text-3);
  margin-bottom: 7px; text-transform: uppercase;
}
.pcard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line-soft);
}
.pcard__foot-right { display: flex; align-items: center; gap: 10px; }
.pcard__enter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.pcard__enter .icon { transition: transform 0.3s var(--ease); }
.pcard:hover .pcard__enter .icon { transform: translateX(4px); }
.pcard__more {
  color: var(--text-3);
  padding: 3px;
  display: flex;
  border-radius: 50%;
  transition: color 0.2s, background-color 0.2s;
}
.pcard__more:hover { color: var(--text); background: var(--surface-2); }

/* 空状态卡片 */
.add-card {
  border: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 300px;
  color: var(--text-3);
  transition: border-color 0.3s, color 0.3s, background-color 0.3s;
}
.add-card:hover { border-color: var(--gold-line); color: var(--gold); background: var(--gold-soft); }
.add-card__plus {
  width: 42px; height: 42px;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.add-card__label { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }
.add-card__sub { font-size: 11px; color: var(--text-3); }

/* ==========================================================================
   选片厅
   ========================================================================== */
.gallery {
  --tile: 190px;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: calc(100vh - var(--bar-h));
  max-width: 1840px;
  margin: 0 auto;
  transition: grid-template-columns 0.28s var(--ease);
}
.gallery.no-rail { grid-template-columns: minmax(0, 1fr); }
.gallery.no-rail .rail { display: none; }

/* 文件夹导航 */
.rail {
  border-right: 1px solid var(--line);
  padding: 26px 0 40px;
  position: sticky;
  top: var(--bar-h);
  height: calc(100vh - var(--bar-h));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.rail__head { padding: 0 22px 18px; position: relative; }
.rail__title { font-family: var(--serif); font-size: 17px; margin-top: 8px; }
.rail__close { display: none; position: absolute; top: -4px; right: 12px; }
.rail__collapse { display: none; position: absolute; top: -4px; right: 12px; }
@media (min-width: 961px) {
  .rail__collapse { display: inline-flex; }
}
.rail__list { padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }
.rail__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  text-align: left;
  border-left: 2px solid transparent;
  transition: background-color 0.2s, border-color 0.2s;
}
.rail__item:hover { background: var(--surface-2); }
.rail__item.is-active { border-left-color: var(--gold); background: var(--gold-soft); }
.rail__thumb {
  width: 34px; height: 44px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex: none;
  filter: saturate(0.9);
}
.rail__thumb--empty {
  display: block;
  background: var(--surface-2);
  border-style: dashed;
}
.rail__meta { min-width: 0; flex: 1; }
.rail__name { font-size: 11.5px; letter-spacing: 0.06em; color: var(--text-2); }
.rail__item.is-active .rail__name { color: var(--gold); }
.rail__sub { font-size: 10px; color: var(--text-3); margin-top: 1px; }
.rail__count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.rail__item.is-done .rail__count { color: var(--success); }
.rail__foot { margin-top: auto; padding: 18px 22px 0; border-top: 1px solid var(--line-soft); }
.rail__foot-label { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }

/* 工具条 */
.gmain { min-width: 0; padding: 0 30px 100px; }

.gbar {
  position: sticky;
  top: var(--bar-h);
  z-index: 30;
  margin: 0 -30px;
  padding: 0 30px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.gbar__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  flex-wrap: wrap;
}
.gbar__row + .gbar__row { border-top: 1px solid var(--line-soft); padding-top: 11px; padding-bottom: 11px; }
.gbar__title { min-width: 0; }
.gbar__title h1 {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.2;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.gbar__title .en { font-size: 10px; letter-spacing: 0.2em; color: var(--text-3); text-transform: uppercase; font-family: var(--sans); }
.gbar__meta { display: flex; align-items: center; gap: 12px; margin-top: 4px; font-size: 10.5px; color: var(--text-3); letter-spacing: 0.05em; }
.gbar__spacer { flex: 1; }
.gbar__actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gbar__actions .btn--icon { --btn-h: 32px; width: 32px; }

.search {
  position: relative;
  display: flex;
  align-items: center;
  width: 190px;
}
.search .icon { position: absolute; left: 9px; color: var(--text-3); width: 14px; height: 14px; pointer-events: none; }
.search input {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 29px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 11.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, width 0.3s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: var(--gold-line); }

.range {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-3);
}
.range input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 68px;
  height: 2px;
  background: var(--line-strong);
  outline: none;
  cursor: pointer;
}
.range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 1px;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}
.filter-pill:hover { color: var(--text); }
.filter-pill.is-active { color: var(--gold); background: var(--gold-soft); border-color: var(--gold-line); }
.filter-pill__n { font-family: var(--mono); font-size: 9.5px; opacity: 0.7; }

/* 文件夹分区 */
.folder-section { margin-bottom: 56px; scroll-margin-top: 150px; }
.folder-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.folder-head__idx {
  font-family: var(--serif);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.1em;
  padding-top: 3px;
}
.folder-head__name {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0.01em;
}
.folder-head__note { font-size: 10.5px; color: var(--text-3); letter-spacing: 0.06em; }
.folder-head__chips { display: flex; align-items: center; gap: 7px; }
.folder-head__actions { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.folder-delete:hover {
  color: var(--danger);
  background: rgba(196, 104, 95, 0.12);
  border-color: rgba(196, 104, 95, 0.4);
}
.empty__actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* 图片网格 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr));
  gap: 14px;
}
.gallery.tile-sm { --tile: 158px; }
.gallery.tile-lg { --tile: 300px; }

.photo {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  transition: border-color 0.3s var(--ease), transform 0.4s var(--ease-out);
}
.photo:hover { border-color: var(--line-strong); }
.photo.is-selected { border-color: var(--gold); }
.photo.is-selected::after {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border: 1px solid var(--gold);
}
.photo__media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--img-placeholder);
  cursor: zoom-in;
}
.photo__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out), opacity 0.5s;
  opacity: 0;
  filter: saturate(0.96);
}
.photo__media img.is-loaded { opacity: 1; }
.photo:hover .photo__media img { transform: scale(1.035); }
.photo__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.06) 38%, transparent 60%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.photo:hover .photo__veil, .photo.is-selected .photo__veil { opacity: 1; }

.photo__slot {
  position: absolute;
  top: 9px; left: 9px;
  z-index: 3;
  min-width: 26px; height: 26px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: var(--gold);
  color: var(--gold-ink);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.photo__slot .icon { width: 11px; height: 11px; stroke-width: 2; }

.photo__fav {
  position: absolute;
  top: 9px; right: 9px;
  z-index: 3;
  width: 27px; height: 27px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(10, 10, 10, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s, color 0.2s, background-color 0.2s;
}
.photo__fav .icon { width: 14px; height: 14px; }
.photo:hover .photo__fav, .photo.is-fav .photo__fav { opacity: 1; }
.photo__fav:hover { color: #fff; background: rgba(10, 10, 10, 0.6); }
.photo.is-fav .photo__fav { color: #E7C989; }
.photo.is-fav .photo__fav .icon { fill: currentColor; }

.photo__slots {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}
.photo:hover .photo__slots, .photo:focus-within .photo__slots { opacity: 1; transform: none; }
.photo__slot-btn {
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(12, 12, 12, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.photo__slot-btn:hover { background: rgba(201, 169, 110, 0.9); color: #0A0A0A; border-color: transparent; transform: translateY(-2px); }
.photo__slot-btn.is-current { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.photo__slot-clear {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(12, 12, 12, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  margin-left: 3px;
}
.photo__slot-clear .icon { width: 12px; height: 12px; }
.photo__slot-clear:hover { color: #fff; border-color: #fff; }

.photo__cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}
.photo__file {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo.is-selected .photo__file { color: var(--gold); }
.photo__dims { font-family: var(--mono); font-size: 9px; color: var(--text-3); flex: none; opacity: 0.7; }

.photo__check {
  position: absolute;
  top: 9px; left: 9px;
  z-index: 4;
  width: 25px; height: 25px;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  background: rgba(10, 10, 10, 0.5);
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  backdrop-filter: blur(4px);
  transition: background-color 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
}
.photo__check .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.photo:hover .photo__check { border-color: var(--gold); }
.photo.is-checked .photo__check {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--gold-ink);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}
.photo.is-checked { border-color: var(--gold); }
.photo.is-checked .photo__media img { opacity: 0.66; }
.photo.is-checked .photo__cap { background: var(--gold-soft); }

/* 列表视图 */
.photo-table { border: 1px solid var(--line); background: var(--surface); }
.photo-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 2.2fr) 100px 120px 84px;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 0.2s;
}
.photo-row:last-child { border-bottom: 0; }
.photo-row:hover { background: var(--surface-2); }
.photo-row.is-selected { background: var(--gold-soft); }
.photo-row__thumb { width: 40px; height: 52px; object-fit: cover; border: 1px solid var(--line); cursor: zoom-in; }
.photo-row__name { font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.photo-row.is-selected .photo-row__name { color: var(--gold); }
.photo-row__meta { font-size: 10px; color: var(--text-3); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.photo-row__dim { font-family: var(--mono); font-size: 10px; color: var(--text-3); }
.photo-row__slot { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.photo-row__slot.is-set { color: var(--gold); }
.photo-row__acts { display: flex; justify-content: flex-end; gap: 2px; }
.photo-row .select { height: 28px; font-size: 11px; padding: 0 22px 0 8px; background-position: calc(100% - 11px) 12px, calc(100% - 7px) 12px; }
.photo-row--head {
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding-top: 9px;
  padding-bottom: 9px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.photo-row--head:hover { background: transparent; }
.photo-row--head span:last-child { text-align: right; }

/* ==========================================================================
   已选托盘
   ========================================================================== */
.tray {
  border-left: 1px solid var(--line);
  background: var(--bg-soft);
  position: sticky;
  top: var(--bar-h);
  height: calc(100vh - var(--bar-h));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tray__head {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.tray__head h2 { font-family: var(--serif); font-size: 19px; margin-top: 7px; }
.tray__count { font-family: var(--mono); font-size: 11px; color: var(--gold); letter-spacing: 0.04em; padding-top: 4px; }
.tray__close { display: none; margin: -4px -6px 0 0; }
.tray__folder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.tray__folder strong { color: var(--text-2); font-weight: 500; letter-spacing: 0.08em; }
.tray__slots { flex: 1; overflow-y: auto; padding: 10px 12px 14px; }
.tray-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px;
  border: 1px solid transparent;
  transition: background-color 0.2s, border-color 0.2s;
}
.tray-slot:hover { background: var(--surface); border-color: var(--line-soft); }
.tray-slot__no {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--text-3);
  width: 18px;
  flex: none;
  text-align: center;
}
.tray-slot.is-filled .tray-slot__no { color: var(--gold); }
.tray-slot__thumb {
  width: 42px;
  height: 54px;
  flex: none;
  border: 1px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}
.tray-slot__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tray-slot__meta { min-width: 0; flex: 1; overflow: hidden; }
.tray-slot__name {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tray-slot__sub {
  display: block;
  font-size: 9.5px;
  color: var(--text-3);
  margin-top: 3px;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tray-slot__x { color: var(--text-3); padding: 5px; opacity: 0; transition: opacity 0.2s, color 0.2s; }
.tray-slot:hover .tray-slot__x { opacity: 1; }
.tray-slot__x:hover { color: var(--danger); }
.tray-slot__empty {
  width: 42px; height: 54px; flex: none;
  border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  font-family: var(--serif);
  font-size: 15px;
  opacity: 0.6;
}
.tray__foot { border-top: 1px solid var(--line); padding: 16px 20px 18px; }
.tray__progress { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.tray__hint { font-size: 10px; color: var(--text-3); line-height: 1.6; margin-top: 10px; }

/* 移动端已选浮条 */
.mobile-tray-btn {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 45;
  display: none;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 16px 0 14px;
  background: var(--surface-2);
  border: 1px solid var(--gold-line);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--text);
}
.mobile-tray-btn__badge {
  min-width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold);
  color: var(--gold-ink);
  font-family: var(--mono);
  font-size: 11px;
}
.tray-scrim {
  position: fixed;
  inset: 0;
  z-index: 74;
  background: var(--overlay);
  backdrop-filter: blur(4px);
}
.tray-scrim[hidden] { display: none; }

/* ==========================================================================
   灯箱
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #050505;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  animation: fade-in 0.25s both;
  color: #F4F2ED;
  isolation: isolate;
}
.lightbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 74px 76px;
  min-width: 0;
}
.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 148px);
  object-fit: contain;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  animation: lb-in 0.4s var(--ease-out) both;
}
@keyframes lb-in { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
.lightbox__close {
  position: absolute;
  top: 18px; right: 20px;
  z-index: 4;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.8);
  transition: background-color 0.2s, color 0.2s;
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  z-index: 3;
}
.lightbox__nav:hover { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
.lightbox__counter {
  position: absolute;
  left: 24px; top: 24px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.5);
}
.lightbox__counter b { color: #F4F2ED; font-weight: 500; }
.lightbox__caption {
  position: absolute;
  left: 24px; bottom: 22px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.42);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.lightbox__side {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: #0C0C0C;
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
}
.lightbox__side .eyebrow { color: rgba(255, 255, 255, 0.36); }
.lightbox__file { font-family: var(--mono); font-size: 14px; letter-spacing: 0.04em; margin-top: 8px; word-break: break-all; }
.lightbox__folder { font-size: 11px; color: rgba(255, 255, 255, 0.42); margin-top: 6px; }
.lightbox__section-title {
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.36);
  margin-bottom: 10px;
}
.lb-slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.lb-slot {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  transition: all 0.18s;
}
.lb-slot:hover { border-color: rgba(201, 169, 110, 0.8); color: #E7C989; }
.lb-slot.is-current { background: var(--gold); border-color: var(--gold); color: #0A0A0A; }
.lb-slot.is-taken { color: rgba(255, 255, 255, 0.3); border-style: dashed; }
.lb-actions { display: flex; flex-direction: column; gap: 8px; }
.lb-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.75);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.lb-action:hover { border-color: rgba(255, 255, 255, 0.34); color: #fff; background: rgba(255, 255, 255, 0.04); }
.lb-action.is-on { border-color: var(--gold-line); color: #E7C989; background: rgba(201, 169, 110, 0.1); }
.lb-action.is-on .icon { fill: currentColor; }
.lb-action--danger { color: rgba(226, 138, 128, 0.9); border-color: rgba(196, 104, 95, 0.34); }
.lb-action--danger:hover { color: #F0A79E; border-color: rgba(196, 104, 95, 0.7); background: rgba(196, 104, 95, 0.12); }
.lb-meta { display: flex; flex-direction: column; gap: 9px; font-size: 11px; color: rgba(255, 255, 255, 0.4); }
.lb-meta__row { display: flex; justify-content: space-between; gap: 12px; }
.lb-meta__row span:last-child { color: rgba(255, 255, 255, 0.72); }
.lb-dropdown { margin-top: auto; font-size: 10px; color: rgba(255, 255, 255, 0.28); line-height: 1.7; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 14px; }

/* ==========================================================================
   手机预览 / 统计 / 分享
   ========================================================================== */
.preview-wrap { display: flex; gap: 34px; align-items: center; justify-content: center; padding: 10px 0 6px; }
.phone {
  width: 286px;
  flex: none;
  aspect-ratio: 9 / 18.5;
  border: 9px solid #1B1B1B;
  border-radius: 34px;
  background: #0C0C0C;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.phone::before {
  content: "";
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 74px; height: 17px;
  background: #1B1B1B;
  border-radius: 12px;
  z-index: 3;
}
.phone__screen { position: absolute; inset: 0; padding: 38px 12px 14px; display: flex; flex-direction: column; }
.phone__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; padding: 0 3px; }
.phone__title { font-family: var(--serif); font-size: 13px; color: #EDE9E1; }
.phone__sub { font-size: 7.5px; letter-spacing: 0.14em; color: rgba(237, 233, 225, 0.4); text-transform: uppercase; }
.phone__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; flex: 1; align-content: start; }
.phone__cell { position: relative; aspect-ratio: 3/4; overflow: hidden; background: #161616; }
.phone__cell img { width: 100%; height: 100%; object-fit: cover; }
.phone__cell span {
  position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(201, 169, 110, 0.92);
  color: #0A0A0A;
  font-family: var(--mono);
  font-size: 7.5px;
}
.phone__foot { margin-top: 8px; display: flex; justify-content: space-between; font-size: 7px; letter-spacing: 0.16em; color: rgba(237, 233, 225, 0.3); text-transform: uppercase; }

.preview-note { max-width: 300px; }
.preview-note h4 { font-family: var(--serif); font-size: 19px; margin-bottom: 10px; }
.preview-note p { font-size: 12px; color: var(--text-2); line-height: 1.8; }
.preview-note .field { margin-top: 20px; margin-bottom: 0; }

.stat-bars { display: flex; flex-direction: column; gap: 16px; }
.stat-bar__head { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); margin-bottom: 6px; }
.stat-bar__head b { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); font-weight: 400; }
.stat-bar .progress { height: 3px; }

.share-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
      margin-bottom: 18px;
}
.share-box code {
  flex: 1;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 分享只读页 */
.share-page { max-width: 1180px; margin: 0 auto; padding: 56px 32px 96px; }
.share-head { border-bottom: 1px solid var(--line); padding-bottom: 28px; margin-bottom: 36px; }
.share-head h1 { font-family: var(--serif); font-size: clamp(30px, 4vw, 46px); margin: 14px 0 10px; }
.share-head__meta { display: flex; gap: 20px; flex-wrap: wrap; font-size: 11px; color: var(--text-3); letter-spacing: 0.06em; }
.share-folder { margin-bottom: 44px; }
.share-folder__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.share-folder__head h2 { font-family: var(--serif); font-size: 22px; }
.share-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.share-item { position: relative; border: 1px solid var(--line); background: var(--surface); }
.share-item img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.share-item--empty {
  border-style: dashed;
  border-color: var(--line);
  background: transparent;
  aspect-ratio: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}
.share-item__ghost {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--text-3);
  opacity: 0.5;
}
.share-item__no {
  position: absolute; top: 8px; left: 8px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold);
  color: var(--gold-ink);
  font-family: var(--serif);
  font-size: 12px;
}
.share-item__cap { padding: 7px 9px; font-family: var(--mono); font-size: 9.5px; color: var(--text-3); border-top: 1px solid var(--line-soft); }
.share-item--local { display: flex; flex-direction: column; }
.share-item__local {
  flex: 1;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-align: center;
  line-height: 1.5;
}
.share-item__local .icon { color: var(--text-3); opacity: 0.6; margin-bottom: 3px; }
.share-foot { border-top: 1px solid var(--line); padding-top: 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ==========================================================================
   添加图片弹窗
   ========================================================================== */
.import-tabs { margin-bottom: 18px; }
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 34px 20px;
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--gold); background: var(--gold-soft); }
.dropzone__icon { color: var(--text-3); }
.dropzone:hover .dropzone__icon, .dropzone.is-drag .dropzone__icon { color: var(--gold); }
.dropzone__title { font-family: var(--serif); font-size: 16px; }
.dropzone__sub { font-size: 10.5px; color: var(--text-3); letter-spacing: 0.04em; }
.file-list {
  margin-top: 12px;
  max-height: 164px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.file-item__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-2);
}
.file-item__size { font-size: 10px; color: var(--text-3); }
.file-item__x { color: var(--text-3); display: flex; padding: 2px; }
.file-item__x:hover { color: var(--danger); }
.textarea {
  width: 100%;
  min-height: 108px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.textarea::placeholder { color: var(--text-3); }
.textarea:focus { border-color: var(--gold); }
.import-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.import-grid:has([data-newfolder][hidden]) { grid-template-columns: 1fr; }
.import-status { margin-top: 12px; min-height: 16px; }
.source-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.source-progress { margin-top: 10px; color: var(--gold); line-height: 1.7; font-size: 11px; }
.switch.is-disabled { opacity: 0.45; pointer-events: none; }
.dir-actions { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--line-soft); }

/* 文件夹导入的分组摘要 */
.dir-summary {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  max-height: 180px;
  overflow-y: auto;
}
.dir-summary__total {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
  color: var(--text-2);
  position: sticky;
  top: 0;
  background: var(--surface-2);
}
.dir-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.dir-group__name {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dir-group__n { font-size: 10px; color: var(--text-3); flex: none; }
.dir-more, .dir-empty { padding: 9px 12px; font-size: 10.5px; color: var(--text-3); }

/* 批量操作条 */
.batch-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 65;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px 10px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: fade-in 0.25s both;
  max-width: calc(100vw - 32px);
}
.batch-bar__count { font-size: 11.5px; color: var(--text-2); white-space: nowrap; letter-spacing: 0.04em; }
.batch-bar__count b { font-family: var(--mono); font-size: 14px; color: var(--gold); margin: 0 2px; }
.batch-bar__actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.gallery.is-batch .mobile-tray-btn { display: none; }
body.has-batch .toasts { bottom: 92px; }

/* 图片加载失败的占位 */
.photo__media img.is-broken, .pcard__media img.is-broken { opacity: 0; }
.photo__media:has(img.is-broken)::before {
  content: "图片无法加载";
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 10px;
  letter-spacing: 0.12em;
}
.photo-row__thumb.is-broken { opacity: 0.25; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1500px) {
  .range { display: none; }
}

@media (max-width: 1320px) {
  .gallery { grid-template-columns: 212px minmax(0, 1fr); }
  .gmain { padding: 0 24px 100px; }
  .gbar { margin: 0 -24px; padding: 0 24px; }
}

@media (max-width: 1120px) {
  .gallery { grid-template-columns: 206px minmax(0, 1fr); }
  .gallery.no-rail { grid-template-columns: minmax(0, 1fr); }
  .rail__foot { display: none; }
  .topnav { display: none; }
  .topbar__menu { display: inline-flex; }
}

@media (max-width: 960px) {
  .page { padding: 34px 22px 80px; }
  .topbar__inner { padding: 0 22px; gap: 14px; }
  .shell-pad { padding-inline: 22px; }
  .login { grid-template-columns: 1fr; }
  .login__visual { min-height: 300px; height: 300px; }
  .login__visual-inner { padding: 26px 26px 28px; min-height: 300px; }
  .login__hero h1 { font-size: 26px; margin-bottom: 10px; }
  .login__hero p { display: none; }
  .login__hero .eyebrow { margin-bottom: 12px; }
  .login__foot { display: none; }
  .login__panel { padding: 40px 26px 56px; }
  .login__panel::before { display: none; }
  .login__form h2 { font-size: 26px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .page-head { flex-direction: column; align-items: flex-start; gap: 18px; }
  .gallery, .gallery.no-rail { grid-template-columns: minmax(0, 1fr); }
  .gallery.no-rail .rail { display: flex; }
  .rail {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(280px, 84vw);
    height: 100vh;
    z-index: 75;
    background: var(--surface);
    transform: translateX(-100%);
    transition: transform 0.32s var(--ease-out);
    box-shadow: 30px 0 60px rgba(0, 0, 0, 0.4);
    padding-top: 22px;
  }
  .rail.is-open { transform: none; }
  .rail__close { display: inline-flex; }
  .gmain { padding: 0 22px 100px; }
  .gbar { margin: 0 -22px; padding: 0 22px; }
  .gbar__row { padding: 12px 0; gap: 10px; }
  .gbar__actions .btn__label { display: none; }
  .search { width: 150px; }
  .lightbox { grid-template-columns: 1fr; }
  .lightbox__side {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    max-height: 56vh;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 18px 20px 22px;
    gap: 16px;
  }
  .lightbox__stage { padding: 60px 22px 50vh; }
  .lightbox__img { max-height: 42vh; }
  .lightbox__nav { top: 30%; }
  .preview-wrap { flex-direction: column; }
  .phone { width: 244px; }
}

@media (max-width: 680px) {
  .page { padding: 28px 16px 76px; }
  .topbar__inner { padding: 0 14px; gap: 9px; }
  .brand { gap: 9px; min-width: 0; }
  .brand__text { min-width: 0; overflow: hidden; }
  .brand__name { font-size: 12px; letter-spacing: 0.2em; white-space: nowrap; }
  .brand__sub { display: none; }
  .topbar__actions { gap: 2px; }
  .topbar__actions .chip--plain { display: none; }
  .user-btn { gap: 5px; padding: 4px; }
  .user-btn__name, .user-btn .icon { display: none; }
  .project-grid { grid-template-columns: 1fr; gap: 18px; }
  .page-head h1 { font-size: 30px; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1; }
  .stats { margin-bottom: 30px; }
  .stat { padding: 15px 16px; }
  .stat__num { font-size: 24px; }
  .gmain { padding: 0 16px 100px; }
  .gbar { margin: 0 -16px; padding: 0 16px; }
  .gbar__title h1 { font-size: 19px; }
  .gbar__meta { flex-wrap: wrap; row-gap: 3px; column-gap: 9px; }
  .gbar__meta .mono { display: none; }
  .gbar__actions { gap: 2px; }
  .range { display: none; }
  .folder-head__name { font-size: 20px; }
  .folder-head__actions { width: 100%; margin-left: 0; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .photo__slots { opacity: 1; transform: none; padding: 6px 4px; gap: 3px; }
  .photo__slot-btn { width: 21px; height: 21px; font-size: 9.5px; }
  .photo__slot-clear { width: 21px; height: 21px; }
  .photo__fav { opacity: 1; }
  .photo__dims { display: none; }
  .gallery.tile-sm .photo-grid, .gallery.tile-lg .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-row { grid-template-columns: 44px minmax(0, 1fr) 92px 40px; gap: 10px; padding: 9px 10px; }
  .photo-row__dim, .photo-row__meta { display: none; }
  .np-grid { grid-template-columns: 1fr !important; }
  .import-grid { grid-template-columns: 1fr; gap: 14px; }
  .file-list { max-height: 120px; }
  .import-tabs { flex-wrap: wrap; }
  .batch-bar {
    left: 10px;
    right: 10px;
    bottom: 10px;
    transform: none;
    max-width: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .batch-bar__actions { justify-content: space-between; }
  .batch-bar__actions .btn { flex: 1; padding: 0 6px; }
  .dir-summary { max-height: 140px; }
  body.has-batch .toasts { bottom: 168px; }
  .modal-backdrop { padding: 12px; align-items: flex-end; }
  .modal { max-height: calc(100vh - 24px); }
  .modal__head { padding: 20px 20px 14px; }
  .modal__body { padding: 0 20px 20px; }
  .modal__foot { padding: 14px 20px 18px; }
  .modal__title { font-size: 21px; }
  .lightbox__close { top: 12px; right: 12px; }
  .lightbox__stage { padding: 56px 12px 56vh; }
  .lightbox__nav { width: 36px; height: 36px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__caption { display: none; }
  .login__visual { height: 240px; min-height: 240px; }
  .login__visual-inner { min-height: 240px; padding: 22px; }
  .login__form h2 { font-size: 24px; }
  .login__form > p { margin-bottom: 26px; }
  .toasts { left: 12px; right: 12px; bottom: 74px; transform: none; align-items: stretch; }
  .toast { min-width: 0; max-width: none; }
  .mobile-tray-btn { bottom: 12px; }
  .share-page { padding: 32px 16px 70px; }
  .share-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .page-head__lead { max-width: none; }
}

@media (max-width: 1100px) and (min-width: 681px) {
  .share-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.transition-fade { animation: view-in 0.45s var(--ease-out) both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

