:root {
  --bg: #f4efe6;
  --card: #fffcf7;
  --line: #e4d9c8;
  --text: #3b332c;
  --muted: #8a7d70;
  --accent: #c4784a;
  --accent2: #d9a066;
  --danger: #c45c4a;
  --shadow: 0 8px 24px rgba(90, 70, 50, .08);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  color: var(--text);
  overflow-x: hidden;
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Nunito", sans-serif;
}
body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 88% 8%, #f3e4c8 0 90px, transparent 140px),
    linear-gradient(180deg, #f8f4ee 0%, #f3eee4 100%);
}
h1, h2 {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Nunito", sans-serif;
  font-weight: 700;
}
.sticky-chrome {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 244, 238, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
}
.top-title {
  min-width: 0;
  flex: 1 1 auto;
}
h1 {
  margin: 0;
  font-size: 20px;
  color: #3b332c;
  overflow-wrap: anywhere;
}
.sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.account-phone {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.account-phone[hidden] { display: none; }
.land-nav .account-phone {
  margin: 0;
  padding: 0 4px;
}
.quota-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 7px 0 2px;
  max-width: min(280px, 100%);
}
.quota-row[hidden] { display: none; }
.quota-bar {
  flex: 1 1 auto;
  min-width: 72px;
  height: 6px;
  background: #d8ccbb;
  border-radius: 99px;
  overflow: hidden;
}
.quota-bar span {
  display: block;
  height: 100%;
  width: 0;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width .35s ease, background .2s ease, min-width .2s ease;
}
.quota-bar.warn span { background: #c9a24a; }
.quota-bar.full span { background: var(--danger); }
.quota-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}
.top-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
}
.more-wrap { position: relative; }
.more-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(40, 32, 24, .28);
}
.more-backdrop[hidden] { display: none; }
.more-menu {
  position: fixed;
  top: auto;
  right: auto;
  left: 12px;
  min-width: 168px;
  max-width: calc(100vw - 24px);
  background: #fffcf7;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.more-menu[hidden] { display: none; }
.more-menu a,
.more-menu button {
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.more-menu a:hover,
.more-menu button:hover { background: #f4efe6; }
.more-menu [hidden] { display: none !important; }
@media (max-width: 1023px) {
  .top {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }
  .top-title { flex: 1 1 100%; }
  .top-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
  }
  .ghost-btn, .upload-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  .desk-only { display: none !important; }
  .top-actions.spread {
    display: flex;
    width: 100%;
  }
  .top-actions.spread > .ghost-btn {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 10px 4px;
    white-space: nowrap;
  }
}
@media (max-width: 639px), (hover: none) and (pointer: coarse) {
  .drop { display: none !important; }
}
a.ghost-btn {
  text-decoration: none;
  text-align: center;
}
.upload-btn {
  flex: 0 0 auto;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 8px 16px rgba(196, 120, 74, .25);
}
.ghost-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fffcf7;
  color: var(--text);
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 700;
}
.qr-mask {
  position: fixed;
  inset: 0;
  background: rgba(40, 32, 24, .45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.qr-mask[hidden] { display: none; }
.site-dialog-mask { z-index: 1000; }
.qr-card {
  background: #fffcf7;
  color: var(--text);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  width: min(400px, 100%);
  max-height: min(90dvh, 720px);
  overflow: auto;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.qr-card h2 { margin: 0 0 4px; font-size: 18px; }
.site-dialog-card { text-align: left; }
.site-dialog-card p { line-height: 1.7; white-space: pre-line; }
.site-dialog-actions { display: flex; gap: 8px; margin-top: 4px; }
.site-dialog-actions button { flex: 1 1 0; min-width: 0; }
.site-dialog-input { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); font: inherit; }
.site-dialog-check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
#nameTitle[data-error]::after { display: block; margin-top: 6px; color: var(--danger); content: attr(data-error); font-size: 12px; font-weight: 400; }
.qr-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  background: transparent;
  padding: 0;
}
.qr-card p { margin: 0 0 6px; color: var(--muted); font-size: 13px; word-break: break-all; }
.qr-card #qrUrl, .qr-card #shareUrl {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  user-select: all;
}
.qr-card #shareMeta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.qr-card input[type="text"] {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 16px;
}
.share-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  margin: 2px 0 6px;
}
.share-opts label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}
.share-opts .share-exp-edit {
  display: flex;
  align-items: center;
  gap: 6px;
}
.share-opts input[type="number"],
.share-opts input[type="date"] {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 16px;
}
.share-opts input[type="number"] { width: 72px; }
.share-opts input[type="date"] { width: 148px; max-width: 100%; }
@media (max-width: 400px) {
  .share-opts label { flex-wrap: wrap; }
  .share-opts input[type="date"] { width: 100%; }
}
.share-opts input:disabled { opacity: 0.45; }
.share-opts .share-dl { justify-content: flex-start; }
.share-opts .share-dl input { margin: 0 8px 0 0; }
.qr-card button {
  appearance: none;
  display: block;
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  width: 100%;
  margin: 0;
  cursor: pointer;
  font-weight: 800;
}
.qr-card button[hidden] { display: none !important; }
.qr-card button.danger { background: var(--danger); }
.qr-card button.plain {
  background: #fffcf7;
  color: var(--text);
  border: 1px solid var(--line);
}
.reel-btn {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.reel-opt {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.reel-opt > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.reel-seg {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.qr-card .reel-seg button {
  flex: 1 1 0;
  width: auto;
  min-width: 52px;
  margin: 0;
  padding: 8px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.qr-card .reel-seg button + button { border-left: 1px solid var(--line); }
.qr-card .reel-seg button.is-on {
  background: var(--accent);
  color: #fff;
}
.reel-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 128px;
  padding: 6px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 80% 0%, #f3e4c8 0 36px, transparent 70px),
    #f3eee4;
}
.reel-music {
  min-width: 0;
  margin: 2px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
}
.reel-music legend { padding: 0 6px; font-weight: 700; }
.reel-music-select-label { display: block; margin: 3px 0 5px; color: var(--muted); font-size: 12px; }
#reelMusicSelect { width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--text); font: inherit; }
.reel-local-music-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.qr-card .reel-local-music-pick, .qr-card .reel-local-music-remove { width: auto; min-height: 34px; padding: 6px 10px; font-size: 12px; }
.reel-local-music-row p { flex: 1 1 100%; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.reel-music-audio { width: 100%; height: 38px; }
.reel-music-audio[hidden], .reel-clip-preview[hidden] { display: none !important; }
.reel-clip-preview { min-height: 36px; padding: 7px 10px !important; font-size: 12px; }
.reel-music-audio:focus-visible, #reelMusicSelect:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.reel-music-range { display: grid; gap: 4px; margin-top: 8px; }
.reel-music-range[hidden] { display: none; }
.reel-music-range label { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.reel-music-range output { color: var(--text); font-variant-numeric: tabular-nums; }
.reel-music-range input { width: 100%; accent-color: var(--accent); }
.reel-task-notice { position: sticky; top: 70px; z-index: 19; display: flex; align-items: center; gap: 8px; max-width: 1208px; margin: 8px auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fffcf7; box-shadow: var(--shadow); }
.reel-task-notice[hidden] { display: none; }
.reel-task-notice span { flex: 1; min-width: 0; font-size: 12px; line-height: 1.5; }
.reel-task-notice progress { width: 96px; height: 8px; accent-color: var(--accent); }
.reel-task-notice progress[hidden] { display: none; }
.reel-task-notice .ghost-btn { min-height: 34px; padding: 6px 9px; font-size: 12px; }
.reel-save-album-label { display: block; margin: 10px auto 4px; color: var(--muted); font-size: 12px; text-align: left; }
#reelSaveAlbum { width: 100%; min-height: 40px; margin: 0 0 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fffcf7; color: var(--text); font: inherit; }
#reelSaveStatus { margin: 6px 0; color: var(--muted); font-size: 12px; }
.reel-mini {
  position: relative;
  background: #f4efe6;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(90, 70, 50, .16);
  --reel-zoom: 1.08;
  --reel-hold: 2s;
}
.reel-mini.story { height: 228px; aspect-ratio: 9 / 16; }
.reel-mini.square { height: 168px; aspect-ratio: 1; }
.reel-mini.wide { width: min(320px, 100%); aspect-ratio: 16 / 9; }
#reelSetup .qr-card { width: min(440px, 100%); max-height: min(94dvh, 980px); gap: 6px; }
#reelSetup .reel-preview { min-height: 118px; }
#reelSetup .reel-mini.story { height: 104px; }
#reelSetup .reel-mini.square { height: 118px; }
#reelSetup .reel-music { padding: 8px; }
#reelSetup .reel-music-audio { height: 34px; }
#reelSetup .reel-music-range { margin-top: 4px; }
@media (max-width: 639px) {
  #reelSetup { padding: 10px; }
  #reelSetup .qr-card { max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 14px; }
  #reelSetup .reel-preview { min-height: 94px; }
  #reelSetup .reel-mini.story { height: 82px; }
  #reelSetup .reel-mini.square { height: 94px; }
  #reelSetup .reel-opt { gap: 4px; }
  #reelSetup .qr-card .reel-seg button { padding: 7px 4px; font-size: 12px; }
}
.reel-mini[data-motion="soft"] { --reel-zoom: 1.04; }
.reel-mini-page {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .35s linear;
}
.reel-mini-page.is-on { opacity: 1; }
#reelSetup .reel-transition-opt .reel-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; border: 0; background: transparent; overflow: visible; }
#reelSetup .reel-transition-opt .reel-seg button { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 6px; }
#reelTransitionHint { margin: 0 0 8px; font-size: 12px; color: var(--muted); line-height: 1.65; text-align: left; }
.reel-mini-page { transition-duration: var(--reel-transition-duration, .4s); }
.reel-mini-page.is-leaving { opacity: 1; z-index: 1; }
.reel-mini-page.is-on { z-index: 2; animation: reel-enter-dissolve var(--reel-transition-duration, .4s) ease-in-out both; }
.reel-mini[data-transition=slide] .reel-mini-page.is-on { animation-name: reel-enter-slide; }
.reel-mini[data-transition=slide] .reel-mini-page.is-leaving { animation: reel-leave-slide var(--reel-transition-duration) ease-in-out both; }
.reel-mini[data-transition=wipe] .reel-mini-page.is-on { animation-name: reel-enter-wipe; }
.reel-mini[data-transition=page] .reel-mini-page.is-on { animation: none; z-index: 1; }
.reel-mini[data-transition=page] .reel-mini-page.is-leaving { z-index: 3; transform-origin: left center; animation: reel-leave-page var(--reel-transition-duration) ease-in-out both; }
.reel-mini[data-transition=cut] .reel-mini-page { animation: none; transition: none; }
.reel-mini[data-transition=cut] .reel-mini-page.is-leaving { opacity: 0; }
@keyframes reel-enter-dissolve { from { opacity: 0; } to { opacity: 1; } }
@keyframes reel-enter-slide { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes reel-leave-slide { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes reel-enter-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes reel-leave-page { from { transform: scaleX(1); filter: brightness(1); } to { transform: scaleX(0); filter: brightness(.72); } }
@media (prefers-reduced-motion: reduce) { .reel-mini .reel-mini-page { animation: none !important; transition: none; } .reel-mini .reel-mini-page.is-leaving { opacity: 0; } }
.reel-mini-cell {
  position: absolute;
  overflow: hidden;
  background: #e7dfd2;
}
.reel-mini-cell.is-round { border-radius: 7px; }
.reel-mini-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center center;
}
.reel-mini[data-motion="soft"] .reel-mini-cell img,
.reel-mini[data-motion="live"] .reel-mini-cell img {
  animation-duration: var(--reel-hold);
  animation-timing-function: ease-in-out;
  animation-fill-mode: both;
}
.reel-mini-cell[data-move="zoom_in"] img { animation-name: reel-zoom-in; }
.reel-mini-cell[data-move="zoom_out"] img { animation-name: reel-zoom-out; }
.reel-mini-cell[data-move="pan_left"] img { animation-name: reel-pan-left; }
.reel-mini-cell[data-move="pan_right"] img { animation-name: reel-pan-right; }
.reel-mini-cell[data-move="pan_up"] img { animation-name: reel-pan-up; }
.reel-mini-cell[data-move="pan_down"] img { animation-name: reel-pan-down; }
.reel-mini[data-motion="still"] .reel-mini-cell img { animation: none; }
@keyframes reel-zoom-in {
  from { transform: scale(1); }
  to { transform: scale(var(--reel-zoom)); }
}
@keyframes reel-zoom-out {
  from { transform: scale(var(--reel-zoom)); }
  to { transform: scale(1); }
}
@keyframes reel-pan-left {
  from { transform: scale(var(--reel-zoom)) translateX(6%); }
  to { transform: scale(var(--reel-zoom)) translateX(-6%); }
}
@keyframes reel-pan-right {
  from { transform: scale(var(--reel-zoom)) translateX(-6%); }
  to { transform: scale(var(--reel-zoom)) translateX(6%); }
}
@keyframes reel-pan-up {
  from { transform: scale(var(--reel-zoom)) translateY(6%); }
  to { transform: scale(var(--reel-zoom)) translateY(-6%); }
}
@keyframes reel-pan-down {
  from { transform: scale(var(--reel-zoom)) translateY(-6%); }
  to { transform: scale(var(--reel-zoom)) translateY(6%); }
}
@media (prefers-reduced-motion: reduce) {
  .reel-mini-cell img { animation: none !important; }
  .reel-mini-page { transition: none; }
}
#reelVideo {
  width: min(280px, 72vw);
  aspect-ratio: 9 / 16;
  height: auto;
  margin: 0 auto;
  display: block;
  background: #2a2622;
  border-radius: 18px;
  object-fit: contain;
}
#reelMask .qr-card { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; overflow-x: hidden; }
#reelMask #reelVideo { max-width: 100%; max-height: 42dvh; }
#reelMask #reelSaveAlbum { max-width: 100%; min-width: 0; }
#reelMask #reelSaveToAlbum:disabled { cursor: default; }
#reelMask #reelSaveAlbum:disabled { cursor: default; }
#reelSavedLink { display: flex; justify-content: center; margin: 10px 0; text-decoration: none; font-size: 14px; }
#reelSavedLink[hidden], #reelTaskEntry[hidden] { display: none; }
.cell.busy { cursor: default; }
.reel-stage {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 48px;
}
.reel-phone {
  width: min(390px, 100%);
}
.reel-phone h1 {
  margin: 0 0 6px;
  font-size: 22px;
}
.reel-phone .sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.reel-phone video {
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #2a2622;
  border-radius: 22px;
  display: block;
  box-shadow: var(--shadow);
}
.confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 2px 0 6px;
  text-align: left;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.confirm-check[hidden] { display: none; }
.confirm-check input {
  margin: 3px 0 0;
  flex-shrink: 0;
  accent-color: var(--danger);
}
.qr-card #qrClose {
  background: #fffcf7;
  color: var(--text);
  border: 1px solid var(--line);
}
.upload-btn input { display: none; }
.progress-wrap { padding: 8px 16px 10px; }
.progress-wrap[hidden] { display: none; }
.progress-bar {
  height: 8px;
  background: #e8dccb;
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}
.progress-text { color: var(--muted); font-size: 12px; margin-top: 6px; }
.drop {
  margin: 12px 16px;
  border: 1px dashed #d8cbb8;
  border-radius: 18px;
  padding: 18px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: rgba(255, 252, 247, .7);
}
.drop.over {
  border-color: var(--accent);
  color: var(--text);
  background: #fffcf7;
}
.wx-tip {
  margin: 0 16px 10px;
  background: #fffcf7;
  color: var(--text);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}
.wx-steps {
  background: #f4efe6;
  border-radius: 14px;
  padding: 12px;
  line-height: 1.7;
  font-size: 15px;
  color: var(--text);
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px 12px 48px;
  max-width: 1080px;
  margin: 0 auto;
}
@media (min-width: 640px) {
  .album-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px 16px 48px;
  }
}
@media (min-width: 1024px) {
  .album-grid { grid-template-columns: repeat(4, 1fr); }
}
.album-card {
  display: block;
  text-decoration: none;
  color: inherit;
}
.album-cover {
  aspect-ratio: 1;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, #efe4d4 0%, #e4d4c2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  box-shadow:
    8px 8px 0 -6px #f3e6d6,
    8px 8px 0 -5px var(--line),
    16px 16px 0 -12px #efe0ce,
    var(--shadow);
}
.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.album-cover span { color: #b49a82; font-size: 14px; }
.album-meta { padding: 10px 8px 8px; }
.album-meta h2 {
  margin: 0 0 4px;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.album-meta p { margin: 0; color: var(--muted); font-size: 12px; }
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 10px 12px 48px;
  align-items: start;
}
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 12px 16px 48px; }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
}
body.density-dense .grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px 10px 48px;
}
body.density-dense .card { gap: 0; }
body.density-dense .card-meta { display: none; }
body.density-dense .cell { border-radius: 10px; }
body.density-dense .pick-dot {
  top: 5px;
  left: 5px;
  width: 22px;
  height: 22px;
  font-size: 13px;
}
@media (min-width: 640px) {
  body.density-dense .grid { grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 12px 16px 48px; }
}
@media (min-width: 1024px) {
  body.density-dense .grid { grid-template-columns: repeat(7, 1fr); }
}
@media (min-width: 1280px) {
  body.density-dense .grid { grid-template-columns: repeat(8, 1fr); }
}
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.cell {
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 100%;
  flex: none;
  min-width: 0;
  min-height: 0;
  background: var(--card);
  overflow: hidden;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #f7f3ec;
  display: block;
}
.dl-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  background: #fffcf7;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 8px;
  font-size: 14px;
  font-weight: 800;
}
.dl-btn.off {
  opacity: .4;
  pointer-events: none;
}
.cell.busy {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  background: #f7f3ec;
}
.cell-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
}
.cell-status strong {
  color: var(--text);
  font-size: 13px;
}
.cell-status span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.cell.is-wait { background: #f3eadc; }
.cell.is-error { background: #f8ece8; }
.cell.is-error .cell-status strong { color: var(--danger); }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  display: none;
  font-size: 15px;
}
.empty.show { display: block; }
.lightbox {
  position: fixed;
  inset: 0;
  background: #171513;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.lightbox[hidden] { display: none; }
.lb-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}
.lb-stage img, .lb-stage video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  border-radius: 12px;
  transform-origin: center center;
  will-change: transform;
  cursor: grab;
}
.lb-stage img:active { cursor: grabbing; }
.lb-stage video { width: 100%; background: #1c1a18; cursor: default; }
.lightbox .lb-close, .lightbox .lb-nav {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  appearance: none;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(25, 25, 28, .64);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .16);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: background .16s ease, border-color .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.lightbox .lb-close svg, .lightbox .lb-nav svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.lightbox .lb-close {
  width: 44px;
  height: 44px;
  top: calc(16px + env(safe-area-inset-top));
  right: calc(16px + env(safe-area-inset-right));
}
.lightbox .lb-close svg { width: 22px; height: 22px; }
@media (hover: hover) {
  .lightbox .lb-close:hover, .lightbox .lb-nav:hover {
    background: rgba(65, 65, 70, .9);
    border-color: rgba(255, 255, 255, .42);
  }
}
.lightbox .lb-close:active, .lightbox .lb-nav:active { background: rgba(85, 85, 90, .95); }
.lightbox .lb-close:focus-visible, .lightbox .lb-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .lightbox .lb-close, .lightbox .lb-nav { transition: none; }
}
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-nav.prev { left: calc(20px + env(safe-area-inset-left)); }
.lb-nav.next { right: calc(20px + env(safe-area-inset-right)); }
.lb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  background: rgba(29, 26, 23, .96);
}
.lb-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.lb-tools button, .lb-dl {
  appearance: none;
  border: 0;
  min-width: 76px;
  height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  background: #4a423b;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lb-tools button[hidden], .lb-dl[hidden] { display: none !important; }
.lb-tools button:hover, .lb-dl:hover { background: #62564b; }
.lb-tools .danger { background: #a43d32; }
.lb-meta {
  min-width: 0;
  flex: 1 1 auto;
  padding: 0;
  color: #f5eee6;
  font-size: 13px;
}
.lb-meta #lbName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.lb-meta .hint { color: #b8aa98; font-size: 11px; margin-top: 4px; }
@media (max-width: 639px) {
  .lb-footer { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 12px; }
  .lb-meta #lbName { padding-right: 48px; }
  .lb-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; }
  .lb-tools button, .lb-dl { min-width: 0; width: 100%; height: 40px; padding: 0 6px; font-size: 13px; }
  .lightbox .lb-nav { width: 44px; height: 44px; }
  .lightbox .lb-close { top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); }
  .lb-nav.prev { left: calc(10px + env(safe-area-inset-left)); }
  .lb-nav.next { right: calc(10px + env(safe-area-inset-right)); }
}
.login-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100dvh;
  padding: calc(20px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.login-body::before,
.login-body::after {
  display: none;
  content: none;
  flex: none;
}
@media (min-width: 880px) {
  .login-body {
    justify-content: center;
    padding-top: 48px;
    padding-bottom: 48px;
  }
}
.login-card {
  width: min(360px, 100%);
  background: #fffcf7;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.login-card.is-long {
  width: min(400px, 100%);
  padding: 28px 26px 24px;
}
.login-card h1 { margin-bottom: 8px; }
.login-card p { color: var(--muted); font-size: 13px; }
.login-card input {
  width: 100%;
  margin: 16px 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 16px;
}
.login-card .code-row {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.login-card .code-row[hidden],
.login-card .login-links[hidden],
.login-card .pass-row[hidden],
.login-card .login-agree[hidden],
.login-card input[hidden],
.login-card p[hidden] {
  display: none;
}
.login-card.is-long #phone,
.login-card.is-long .code-row,
.login-card.is-long .pass-row {
  margin-top: 10px;
  margin-bottom: 0;
}
.login-card.is-long #phone { margin-top: 14px; }
.login-card .login-agree {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.login-card .login-agree input {
  width: auto;
  margin: 3px 0 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.login-card .login-agree a {
  color: var(--accent);
  text-decoration: none;
}
.login-card .pass-row {
  position: relative;
  margin: 16px 0;
}
.login-card .pass-row input {
  margin: 0;
  padding-right: 44px;
}
.login-card .pass-row input::-ms-reveal,
.login-card .pass-row input::-ms-clear {
  display: none;
}
.login-card .pass-row input::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  right: 0;
}
.login-card .pass-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  color: #b8aa98;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card .pass-toggle:hover { color: var(--text); }
.login-card .pass-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.login-card .pass-toggle .eye-off { display: none; }
.login-card .pass-toggle[aria-pressed="true"] .eye-on { display: none; }
.login-card .pass-toggle[aria-pressed="true"] .eye-off { display: block; }
.login-card .code-row input { margin: 0; }
.login-card .code-row button {
  width: auto;
  flex-shrink: 0;
  padding: 12px 14px;
  font-size: 13px;
}
.login-card .login-note { margin: 10px 0 0; font-size: 12px; }
.login-card .login-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 12px 0 0;
}
.login-card .login-hint {
  color: var(--muted);
  font-size: 13px;
}
.login-card .login-hint .login-text {
  display: inline;
  margin-left: 2px;
}
.login-card .login-back[hidden] { display: none; }
.login-card .login-links a.login-text { text-decoration: none; }
.login-card .login-text {
  width: auto;
  background: none;
  color: var(--accent);
  padding: 0;
  font-weight: 600;
  font-size: 13px;
}
.login-card .login-back {
  display: inline-block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
.land-body { padding-bottom: 64px; }
.land-nav {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top)) 24px 8px;
}
.land-brand {
  color: var(--text);
  font-weight: 700;
  font-size: 22px;
  text-decoration: none;
  letter-spacing: .04em;
}
.land-nav-links { display: flex; align-items: center; gap: 8px; }
.land-hero {
  max-width: 1120px;
  margin: 20px auto 0;
  padding: 0 24px 8px;
  display: grid;
  gap: 36px;
  align-items: center;
}
@media (min-width: 880px) {
  .land-hero { grid-template-columns: 1fr 1.15fr; min-height: 52vh; }
}
@media (max-width: 879px) {
  .land-nav { padding-left: 20px; padding-right: 20px; }
  .land-hero { margin-top: 8px; gap: 24px; padding: 0 20px 8px; }
  .land-kicker { margin-bottom: 8px; }
  .land-hero h1 { font-size: 28px; margin-bottom: 10px; }
  .land-lead { font-size: 15px; line-height: 1.65; }
  .land-kinds { margin-top: 14px; }
  .land-devices { margin-top: 8px; }
  .land-kinds,
  .land-devices { gap: 6px; }
  .land-kinds li,
  .land-devices li { padding: 6px 12px; font-size: 12px; }
  .land-hero-actions { margin-top: 20px; }
  .land-split,
  .land-feats,
  .land-flow,
  .land-plans { margin-top: 40px; padding-left: 20px; padding-right: 20px; }
  .land-body > .plan-grid,
  .plans-hero { padding-left: 20px; padding-right: 20px; }
}
.land-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
}
.land-hero h1, .land-split h2 {
  font-size: clamp(30px, 4.6vw, 44px);
  line-height: 1.22;
  margin: 0 0 16px;
  letter-spacing: -.02em;
}
.land-lead, .land-split p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
  max-width: 34em;
}
.land-kinds,
.land-devices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}
.land-kinds { margin-top: 20px; }
.land-kinds li,
.land-devices li {
  border: 1px solid var(--line);
  background: #fff8ef;
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
}
.land-kinds li {
  background: #fff;
  color: var(--accent);
}
.land-hero-actions { margin-top: 28px; }
.www-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.land-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 13px 24px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(196, 120, 74, .22);
}
.land-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  max-width: 28em;
}
.land-hero-visual {
  margin: 0;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 50px rgba(90, 70, 50, .14);
  background: #e8ddd0;
}
.land-hero-visual img, .land-split figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.land-split {
  max-width: 1120px;
  margin: 72px auto 0;
  padding: 0 24px;
  display: grid;
  gap: 36px;
  align-items: center;
}
@media (min-width: 880px) {
  .land-split { grid-template-columns: 1.1fr 0.9fr; }
  .land-split-rev { grid-template-columns: 0.9fr 1.1fr; }
  .land-split-rev figure { order: 2; }
}
.land-split figure {
  margin: 0;
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow);
  background: #e8ddd0;
}
.land-feats {
  max-width: 1120px;
  margin: 72px auto 0;
  padding: 0 24px;
  display: grid;
  gap: 16px;
}
@media (min-width: 768px) {
  .land-feats { grid-template-columns: repeat(3, 1fr); }
}
.land-feats article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 20px 24px;
  min-height: 168px;
}
.land-feats span {
  display: block;
  margin-bottom: 28px;
  color: var(--accent2);
  font-size: 13px;
  letter-spacing: .08em;
}
.land-feats h2 { font-size: 20px; margin: 0 0 10px; }
.land-feats p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.land-flow {
  max-width: 1120px;
  margin: 72px auto 0;
  padding: 0 24px;
}
.land-flow h2 { font-size: 22px; margin: 0 0 20px; }
.land-flow ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
@media (min-width: 768px) {
  .land-flow ol { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .land-flow ol { grid-template-columns: repeat(4, 1fr); }
}
.land-flow li {
  background: #fff8ef;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 18px;
}
.land-flow strong { display: block; font-size: 18px; margin-bottom: 8px; }
.land-flow span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.land-plans {
  max-width: 1120px;
  margin: 72px auto 0;
  padding: 0 24px;
}
.land-plans h2 { font-size: clamp(24px, 3.6vw, 34px); margin: 0 0 24px; }
.plans-hero {
  max-width: 1120px;
  margin: 28px auto 0;
  padding: 0 24px;
}
.plans-hero h1 { font-size: clamp(30px, 4.6vw, 44px); line-height: 1.22; margin: 0 0 16px; }
.plan-grid {
  max-width: 1120px;
  width: 100%;
  margin: 28px auto 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
.land-body > .plan-grid { padding: 0 24px; }
@media (min-width: 900px) {
  .plan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.plan-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px 20px 22px;
  min-height: 0;
}
@media (min-width: 768px) {
  .plan-card { min-height: 220px; }
}
.plan-card.hot { border-color: var(--accent); box-shadow: 0 12px 28px rgba(196, 120, 74, .12); }
.plan-card em {
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
}
.plan-card h2, .plan-card h3 { margin: 0 0 8px; font-size: 20px; }
.plan-quota { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.plan-price {
  margin: 6px 0 12px;
  color: var(--accent);
  font-size: 26px;
  font-weight: 700;
}
.plan-price span { color: var(--muted); font-size: 14px; font-weight: 500; }
.plan-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.plan-pay {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.plan-card button {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
}
.plan-card button.pay-ali {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.plan-card button:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.plans-note {
  max-width: 1120px;
  margin: 18px auto 0;
  padding: 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.land-plans .land-cta { margin-top: 22px; }
.pay-card #payQr {
  display: block;
  width: 220px;
  height: 220px;
  margin: 12px auto;
  background: #fff8ef;
}
.pay-card #payQr[hidden] { display: none !important; }
.pay-card a#payGo {
  display: inline-block;
  margin: 10px 0 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}
.pay-card a#payGo[hidden] { display: none !important; }
.pay-status { color: var(--muted); font-size: 13px; }
.admin-h2 { font-size: 18px; margin: 28px 0 12px; }
.land-foot {
  max-width: 1120px;
  margin: 72px auto 0;
  padding: 0 24px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.land-foot .land-cta { margin-bottom: 22px; }
.land-foot p { margin: 0 0 4px; }
.land-foot .beian {
  color: inherit;
  text-decoration: none;
}
.land-foot .beian:hover { text-decoration: underline; }
.legal-page {
  max-width: 720px;
  margin: 12px auto 64px;
  padding: 0 24px;
}
.legal-page h1 {
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.25;
  margin: 0 0 16px;
}
.legal-page h2 {
  font-size: 18px;
  margin: 28px 0 8px;
}
.legal-page p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}
.login-card button, .upload-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
}
.login-card button {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 12px;
  font-weight: 800;
}
.login-card button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.error { color: var(--danger); min-height: 20px; margin-top: 10px; font-size: 13px; }
.cell .del {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 252, 247, .92);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(90, 70, 50, .16);
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}
@media (hover: hover) {
  .cell:hover .del,
  .cell:focus-within .del {
    opacity: 1;
    pointer-events: auto;
  }
}
body.select-mode .cell .del { display: none; }
.album-title { cursor: pointer; }
.album-title:hover { color: var(--accent); }
.album-card-wrap { min-width: 0; }
.album-ops {
  display: flex;
  gap: 6px;
  padding: 0 4px 2px;
}
.album-ops button {
  flex: 1;
  appearance: none;
  border: 1px solid var(--line);
  background: #fffcf7;
  color: var(--text);
  border-radius: 999px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.album-ops button.danger { color: var(--danger); }
@media (max-width: 639px) {
  .album-cover {
    border-radius: 16px;
    box-shadow:
      4px 4px 0 -3px #f3e6d6,
      4px 4px 0 -2px var(--line),
      var(--shadow);
  }
  .album-meta { padding: 8px 4px 6px; }
  .album-meta h2 { font-size: 14px; }
  .album-ops { gap: 6px; padding: 0 2px 2px; }
  .album-ops button { padding: 8px 6px; font-size: 13px; min-height: 40px; }
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px 14px;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}
@media (max-width: 1023px) {
  .search-bar { padding: 10px 12px 12px; }
  .sort-wrap,
  .density-wrap { flex: 1 1 auto; }
}
.search-input {
  display: block;
  flex: 1 1 200px;
  min-width: 0;
  width: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 16px;
  background: #fffcf7;
  color: var(--text);
  font-size: 16px;
  touch-action: manipulation;
}
.sort-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}
.sort-wrap select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 28px 10px 12px;
  background: #fffcf7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a7d70' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
}
.density-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}
.density-seg {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fffcf7;
}
.density-seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.density-seg button + button { border-left: 1px solid var(--line); }
.density-seg button.is-on {
  background: var(--accent);
  color: #fff;
}
.card-meta {
  padding: 0 2px 2px;
  min-width: 0;
}
.card-meta strong,
.card-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-meta strong { font-size: 13px; }
.card-meta span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.select-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  width: min(1208px, calc(100% - 32px));
  margin: 0 auto 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffcf7;
  box-shadow: 0 3px 12px rgba(90, 70, 50, .06);
}
body.select-mode .select-bar { display: flex; }
body.select-mode .drop { display: none; }
#selectHint { color: var(--text); font-size: 13px; font-weight: 700; margin-right: auto; }
.select-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.select-actions .ghost-btn { min-height: 40px; }
@media (max-width: 639px) {
  .select-bar { width: calc(100% - 24px); align-items: flex-start; }
  #selectHint { flex: 1 1 100%; margin-right: 0; }
  .select-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .select-actions .ghost-btn { width: 100%; text-align: center; }
}
.danger-btn { color: var(--danger); }
.card.selected .cell {
  outline: 4px solid var(--accent);
  outline-offset: -4px;
}
.pick-dot {
  appearance: none;
  display: flex;
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fffcf7;
  border: 2px solid #c9b8a4;
  color: transparent;
  font-size: 16px;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(90, 70, 50, .22);
  z-index: 2;
  padding: 0;
  cursor: pointer;
}
.pick-dot.is-on {
  background: var(--accent);
  border-color: #fff;
  color: #fff;
  box-shadow: 0 1px 4px rgba(196, 120, 74, .35);
}
body.select-mode .pick-dot { display: flex; }
.pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
  text-align: left;
  max-height: 50vh;
  overflow: auto;
}
.pick-list button {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.pick-list button:disabled { opacity: .45; cursor: default; }
.search-card { text-decoration: none; color: inherit; }
.search-meta, .item-ops + .search-meta {
  min-width: 0;
}
.search-meta strong, .search-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-meta strong { font-size: 13px; }
.search-meta span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.item-ops { display: flex; gap: 6px; }
.item-ops .ghost-btn { flex: 1; padding: 8px 6px; font-size: 12px; }
#confirmCancel, #shareClose, #moveCancel, #nameCancel {
  background: #fffcf7;
  color: var(--text);
  border: 1px solid var(--line);
}
.admin-body { padding-bottom: 40px; }
.admin-sum {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 0 16px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.admin-sum article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}
.admin-sum strong { display: block; font-size: 22px; }
.admin-sum span { color: var(--muted); font-size: 12px; }
.admin-wrap { max-width: 1100px; margin: 16px auto 0; padding: 0 16px; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table th { color: var(--muted); font-weight: 500; background: #fff8ef; }
.admin-table input { width: 118px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); }
.admin-table em { color: var(--accent); font-style: normal; font-size: 12px; }
.admin-gate[hidden], .admin-work[hidden] { display: none !important; }
.ops-wrap { max-width: 980px; margin: 0 auto; padding: 8px 24px 48px; }
.ops-wrap h1 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 40px); }
.ops-total { margin: 0 0 8px; color: var(--muted); }
.ops-total b { display: block; margin-top: 4px; color: var(--text); font-size: 36px; }
.ops-grid { display: grid; gap: 14px; margin-top: 18px; }
@media (min-width: 800px) {
  .ops-grid { grid-template-columns: repeat(3, 1fr); }
}
.ops-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}
.ops-card h2 { margin: 0 0 12px; font-size: 20px; }
.ops-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 0 0 8px; }
.ops-metrics dt { color: var(--muted); font-size: 12px; }
.ops-metrics dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; }
.ops-note { min-height: 1.2em; margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.ops-card .land-cta { margin-top: 4px; }
