/* LightPic UI — design tokens + components. Tailwind CDN handles utility layout. */

:root {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #fbfbfe;
  --surface-3: #f0f1f7;
  --border: #e5e7f0;
  --border-strong: #d5d9e6;
  --fg: #0d1220;
  --muted: #626b80;
  --muted-2: #949cb0;
  --accent: #5a54e8;
  --accent-2: #9257f5;
  --accent-soft: rgba(90, 84, 232, 0.09);
  --accent-ring: rgba(90, 84, 232, 0.28);
  --danger: #dc3d43;
  --danger-soft: rgba(220, 61, 67, 0.09);
  --ok: #0f9d8a;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 2px 4px rgba(16, 24, 40, 0.04), 0 18px 40px -24px rgba(16, 24, 40, 0.3);
  --shadow-lg: 0 40px 90px -40px rgba(12, 18, 45, 0.45);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.dark {
  --bg: #090b11;
  --surface: #10131c;
  --surface-2: #141824;
  --surface-3: #1a1f2d;
  --border: #232939;
  --border-strong: #2f3648;
  --fg: #e9edf7;
  --muted: #9aa4ba;
  --muted-2: #6f7a92;
  --accent: #8b85ff;
  --accent-2: #b07dff;
  --accent-soft: rgba(139, 133, 255, 0.12);
  --accent-ring: rgba(139, 133, 255, 0.3);
  --danger: #ff6369;
  --danger-soft: rgba(255, 99, 105, 0.12);
  --ok: #2fd4bd;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 50px -30px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 50px 100px -40px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); background-clip: content-box; }

.lp-icon { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lp-icon-sm { width: 15px; height: 15px; }
.lp-icon-lg { width: 22px; height: 22px; }

/* ---------- shell ---------- */

.lp-shell { display: flex; min-height: 100vh; }

.lp-sidebar {
  width: 238px;
  flex: 0 0 238px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 14px 18px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 60;
}

.lp-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 2px 6px; }

.lp-logo {
  width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 12px 24px -12px rgba(90, 84, 232, 0.9);
  position: relative; overflow: hidden;
}
.lp-logo::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.45), transparent 55%);
}
.lp-logo .lp-icon { width: 21px; height: 21px; position: relative; z-index: 1; }

.lp-brand-name { font-size: 16px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.2; }
.lp-brand-sub { font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.08em; margin-top: 2px; }

.lp-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 0; overflow-y: auto; padding-right: 2px; }
.lp-nav-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted-2); padding: 8px 12px 4px; }
.lp-nav-head { display: flex; align-items: center; justify-content: space-between; padding-right: 5px; }
.lp-nav-head .lp-nav-label { padding-bottom: 4px; }
.lp-nav-add { width: 22px; height: 22px; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--muted-2); display: grid; place-items: center; margin-top: 4px; }
.lp-nav-add:hover { background: var(--surface-3); color: var(--accent); border-color: var(--border); }
.lp-albums { display: flex; flex-direction: column; gap: 1px; }
.lp-album { position: relative; display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 9px; font-size: 12px; color: var(--muted); cursor: pointer; border: 1px solid transparent; }
.lp-album:hover { background: var(--surface-3); color: var(--fg); }
.lp-album.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.lp-album .lp-icon { width: 14px; height: 14px; opacity: .75; }
.lp-album-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-album-count { font-size: 10px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.lp-album.active .lp-album-count { color: var(--accent); }
.lp-album-tools { display: none; align-items: center; gap: 1px; }
.lp-album:hover .lp-album-tools { display: flex; }
.lp-album-tools button { width: 20px; height: 20px; border: 0; background: none; color: var(--muted-2); border-radius: 5px; display: grid; place-items: center; padding: 0; }
.lp-album-tools button:hover { background: var(--surface); color: var(--accent); }
.lp-album-tools button.danger:hover { color: var(--danger); }
.lp-album-tools .lp-icon { width: 11px; height: 11px; }
.lp-album-empty { font-size: 11px; color: var(--muted-2); padding: 4px 12px 6px; }

.lp-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 11px; border: 1px solid transparent;
  background: none; color: var(--muted); font-size: 13px; font-weight: 550;
  width: 100%; text-align: left; transition: background .15s, color .15s;
}
.lp-nav-item:hover { background: var(--surface-3); color: var(--fg); }
.lp-nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.lp-nav-item .lp-nav-count { margin-left: auto; font-size: 10.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.lp-nav-item.active .lp-nav-count { color: var(--accent); }

.lp-storage {
  margin-top: auto;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 14px;
  padding: 12px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.65;
}
.lp-storage-title { display: flex; align-items: center; gap: 7px; color: var(--fg); font-size: 11.5px; font-weight: 650; margin-bottom: 3px; }
.lp-storage-title .lp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(15,157,138,.16); }
.lp-storage-path { word-break: break-all; font-family: var(--mono); font-size: 10px; color: var(--muted-2); }

.lp-user { display: flex; align-items: center; gap: 9px; padding: 8px 8px 4px; border-top: 1px solid var(--border); }
.lp-avatar {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 750; text-transform: uppercase;
}
.lp-user-name { font-size: 12px; font-weight: 650; }
.lp-user-sub { font-size: 10px; color: var(--muted-2); }
.lp-user .lp-logout { margin-left: auto; border: 0; background: none; color: var(--muted-2); padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.lp-user .lp-logout:hover { background: var(--danger-soft); color: var(--danger); }

.lp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- topbar ---------- */

.lp-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 26px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.lp-heading { min-width: 0; }
.lp-title { font-size: 18px; font-weight: 750; letter-spacing: -0.025em; margin: 0; line-height: 1.25; }
.lp-sub { font-size: 11px; color: var(--muted-2); margin: 2px 0 0; font-variant-numeric: tabular-nums; }

.lp-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 10px 0 12px;
  width: min(300px, 32vw);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px;
  color: var(--muted-2);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.lp-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); background: var(--surface); }
.lp-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--fg); font-size: 12.5px; }
.lp-search input::placeholder { color: var(--muted-2); }
.lp-search kbd {
  font-family: var(--mono); font-size: 10px; color: var(--muted-2);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; background: var(--surface);
}

.lp-viewtoggle { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 2px; }
.lp-viewtoggle button { border: 0; background: none; color: var(--muted-2); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.lp-viewtoggle button:hover { color: var(--fg); }
.lp-viewtoggle button.active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }

.lp-menu-btn { display: none !important; }

/* ---------- buttons ---------- */

.lp-btn {
  height: 38px; padding: 0 14px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--fg);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.lp-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.lp-btn:active { transform: translateY(1px); }
.lp-btn:disabled { opacity: .5; cursor: not-allowed; }
.lp-btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 20px -14px rgba(90, 84, 232, 0.95), inset 0 1px 0 rgba(255,255,255,.18);
}
.lp-btn-primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.lp-btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 28%, transparent); background: var(--danger-soft); }
.lp-btn-danger:hover { background: color-mix(in srgb, var(--danger) 16%, transparent); border-color: var(--danger); }
.lp-btn-ghost { border-color: transparent; background: none; color: var(--muted); }
.lp-btn-ghost:hover { background: var(--surface-3); color: var(--fg); }
.lp-btn-icon { width: 38px; padding: 0; }
.lp-btn-sm { height: 32px; padding: 0 10px; font-size: 12px; border-radius: 9px; }

/* ---------- content ---------- */

.lp-content { width: 100%; max-width: 1680px; margin: 0 auto; padding: 22px 26px 70px; }

.lp-drop {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
}
.lp-drop:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); }
.lp-drop.dragging { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-ring); transform: scale(.998); }
.lp-drop-icon {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.lp-drop-icon .lp-icon { width: 22px; height: 22px; }
.lp-drop-title { font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; }
.lp-drop-title .lp-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.lp-drop-hint { font-size: 11.5px; color: var(--muted-2); margin-top: 3px; }
.lp-drop .lp-switch { margin-left: auto; }

.lp-store-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.lp-store-pick .lp-select { height: 30px; font-size: 11px; padding: 0 24px 0 8px; }

.lp-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; flex: none; }
.lp-switch input { position: absolute; opacity: 0; pointer-events: none; }
.lp-switch-track {
  width: 36px; height: 21px; border-radius: 999px; background: var(--border-strong);
  position: relative; transition: background .18s;
}
.lp-switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s;
}
.lp-switch input:checked + .lp-switch-track { background: var(--accent); }
.lp-switch input:checked + .lp-switch-track .lp-switch-thumb { transform: translateX(15px); }
.lp-switch input:focus-visible + .lp-switch-track { box-shadow: 0 0 0 3px var(--accent-ring); }
.lp-switch-label { font-size: 11.5px; color: var(--muted); font-weight: 550; white-space: nowrap; }

.lp-toolbar { display: flex; align-items: center; gap: 10px; margin: 20px 0 14px; flex-wrap: wrap; }
.lp-chips { display: none; gap: 3px; background: var(--surface-2); border: 1px solid var(--border); padding: 3px; border-radius: 11px; }
.lp-chip { border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 8px; }
.lp-chip.active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.lp-count { font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.lp-toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

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

.lp-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.lp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.lp-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }

.lp-thumb {
  position: relative; aspect-ratio: 4 / 3; background: var(--surface-3);
  display: grid; place-items: center; overflow: hidden;
}
.lp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.lp-card:hover .lp-thumb img { transform: scale(1.035); }
.lp-thumb::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,10,18,.22) 0%, transparent 32%, transparent 70%, rgba(8,10,18,.10) 100%);
  opacity: 0; transition: opacity .18s;
}
.lp-card:hover .lp-thumb::after { opacity: 1; }

.lp-file-icon { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted-2); }
.lp-file-icon .lp-icon { width: 30px; height: 30px; stroke-width: 1.4; }
.lp-file-icon span { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

.lp-card-body { padding: 10px 12px 12px; }
.lp-card-name { font-size: 12.5px; font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-card-path {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  min-width: 0;
  font-size: 10px;
  color: var(--muted-2);
}
.lp-card-path .lp-icon { flex: none; width: 11px; height: 11px; }
.lp-card-path > span:not(.lp-storage-tag) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lp-storage-tag {
  flex: none;
  margin-left: auto;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.4;
  color: var(--muted);
  background: var(--surface-2);
}
.lp-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 10.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.lp-card-meta .lp-dotsep { width: 2px; height: 2px; border-radius: 50%; background: var(--muted-2); }

.lp-card-actions {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  display: flex; gap: 4px; opacity: 0; transform: translateY(-4px);
  transition: opacity .16s, transform .16s;
}
.lp-card:hover .lp-card-actions, .lp-card:focus-within .lp-card-actions { opacity: 1; transform: none; }
.lp-mini {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(8px); color: var(--fg);
  transition: background .14s, color .14s, border-color .14s;
}
.lp-mini .lp-icon { width: 14px; height: 14px; }
.lp-mini:hover { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.lp-mini.danger:hover { border-color: var(--danger); color: var(--danger); }

.lp-badge {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  height: 21px; padding: 0 7px; border-radius: 7px;
  background: rgba(9, 12, 22, .62); color: #fff; backdrop-filter: blur(8px);
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
}
.lp-badge.private { background: rgba(74, 48, 160, .8); }
.lp-badge .lp-icon { width: 11px; height: 11px; stroke-width: 2; }

.lp-check { position: absolute; left: 8px; top: 8px; z-index: 4; width: 20px; height: 20px; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.lp-card:hover .lp-check, .lp-check:has(input:checked) { opacity: 1; }
.lp-check input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.lp-check-box {
  width: 18px; height: 18px; border-radius: 6px; border: 1px solid rgba(255,255,255,.7);
  background: rgba(255,255,255,.86);
  box-shadow: 0 1px 4px rgba(9,12,22,.28);
  display: grid; place-items: center; color: transparent; transition: all .14s;
}
.lp-check-box .lp-icon { width: 11px; height: 11px; stroke-width: 3; }
.lp-check input:checked + .lp-check-box { background: var(--accent); border-color: var(--accent); color: #fff; }

.lp-empty { padding: 64px 20px; text-align: center; }
.lp-empty .lp-empty-icon { width: 60px; height: 60px; border-radius: 20px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted-2); }
.lp-empty h3 { margin: 0 0 5px; font-size: 14px; font-weight: 650; }
.lp-empty p { margin: 0; font-size: 12px; color: var(--muted-2); }

.lp-loadmore { display: flex; justify-content: center; padding: 26px 0 0; }

.lp-skel { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); }
.lp-skel-thumb { aspect-ratio: 4/3; background: linear-gradient(100deg, var(--surface-3) 20%, var(--surface-2) 40%, var(--surface-3) 60%); background-size: 220% 100%; animation: shimmer 1.3s infinite linear; }
.lp-skel-line { height: 9px; border-radius: 5px; margin: 11px 12px 0; background: var(--surface-3); }
.lp-skel-line.short { width: 45%; margin-bottom: 12px; }
@keyframes shimmer { to { background-position: -120% 0; } }

/* ---------- list view ---------- */

.lp-grid.lp-list { grid-template-columns: 1fr; gap: 8px; }
.lp-grid.lp-list .lp-card { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 12px; }
.lp-grid.lp-list .lp-card:hover { transform: none; }
.lp-grid.lp-list .lp-thumb { width: 48px; height: 48px; flex: none; aspect-ratio: auto; border-radius: 9px; order: 1; position: relative; }
.lp-grid.lp-list .lp-thumb::after { display: none; }
.lp-grid.lp-list .lp-thumb .lp-file-icon .lp-icon { width: 18px; height: 18px; }
.lp-grid.lp-list .lp-thumb .lp-file-icon span { display: none; }
.lp-grid.lp-list .lp-card-body { padding: 0; flex: 1; min-width: 0; order: 2; }
.lp-grid.lp-list .lp-card-name { font-size: 12.5px; }
.lp-grid.lp-list .lp-card-path { margin-top: 1px; font-size: 9.5px; }
.lp-grid.lp-list .lp-card-meta { margin-top: 2px; }
.lp-grid.lp-list .lp-card-actions { position: static; opacity: 1; transform: none; order: 3; margin-left: auto; padding-left: 10px; }
.lp-grid.lp-list .lp-badge { position: absolute; left: 2px; top: 2px; bottom: auto; width: 16px; height: 16px; padding: 0; border-radius: 5px; font-size: 0; justify-content: center; margin: 0; }
.lp-grid.lp-list .lp-badge.private { background: rgba(74, 48, 160, .82); }
.lp-grid.lp-list .lp-badge .lp-icon { width: 9px; height: 9px; }
.lp-grid.lp-list .lp-check { position: static; opacity: 1; order: 0; }
.lp-grid.lp-list .lp-check-box { background: var(--surface); border-color: var(--border-strong); box-shadow: none; }
.lp-grid.lp-list .lp-check input:checked + .lp-check-box { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- modal ---------- */

.lp-modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 22px; }
.lp-modal.open { display: flex; }
.lp-backdrop { position: absolute; inset: 0; background: rgba(6, 8, 16, .58); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); animation: fade .16s ease; }

.lp-dialog {
  position: relative; z-index: 1;
  width: min(1080px, 100%); max-height: min(90vh, 820px);
  display: grid; grid-template-columns: minmax(0, 1fr) 384px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: pop .2s cubic-bezier(.2, .8, .3, 1);
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes fade { from { opacity: 0; } }

.lp-modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(12, 15, 24, .5); color: #fff; border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(8px);
}
.lp-modal-close:hover { background: rgba(12, 15, 24, .75); }

.lp-preview {
  background:
    radial-gradient(circle at 25% 20%, rgba(90,84,232,.18), transparent 55%),
    #0a0c13;
  display: flex; align-items: center; justify-content: center;
  min-height: 460px; padding: 18px; overflow: hidden; position: relative;
}
.lp-preview img, .lp-preview video { max-width: 100%; max-height: 76vh; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px -20px rgba(0,0,0,.7); }
.lp-preview iframe { width: 100%; height: 74vh; border: 0; background: #fff; border-radius: 8px; }
.lp-audio { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; padding: 0 18px; }
.lp-audio-icon { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; background: rgba(255,255,255,.07); color: #cfd6ff; border: 1px solid rgba(255,255,255,.09); }
.lp-audio-icon .lp-icon { width: 36px; height: 36px; }
.lp-audio audio { width: min(420px, 100%); }
.lp-text {
  margin: 0; width: 100%; height: 100%; max-height: 72vh; overflow: auto;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 10px;
  padding: 16px; color: #d6dcf0; font-family: var(--mono); font-size: 12px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.lp-file-big { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #c9d0e6; }
.lp-file-big .lp-icon { width: 54px; height: 54px; stroke-width: 1.2; }
.lp-file-big span { font-size: 11px; letter-spacing: .14em; color: #8f99b5; }
.lp-file-big a { font-size: 12px; color: #a9a4ff; text-decoration: underline; text-underline-offset: 3px; }

.lp-panel { padding: 20px 20px 18px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 15px; overflow-y: auto; }
.lp-panel-name { font-size: 15px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.35; word-break: break-word; }
.lp-panel-meta { font-size: 11px; color: var(--muted-2); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 5px 8px; font-variant-numeric: tabular-nums; }
.lp-panel-label { font-size: 10px; font-weight: 700; letter-spacing: .12em; color: var(--muted-2); text-transform: uppercase; }

.lp-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lp-fact { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.lp-fact span { font-size: 9.5px; color: var(--muted-2); letter-spacing: .04em; }
.lp-fact b { font-size: 11px; font-weight: 650; color: var(--fg); font-variant-numeric: tabular-nums; }

.lp-notice { display: flex; gap: 8px; padding: 10px 11px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; line-height: 1.55; }
.lp-notice .lp-icon { margin-top: 1px; }

.lp-ttl { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.lp-ttl select {
  height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2);
  padding: 0 8px; font-size: 11.5px; outline: none;
}
.lp-ttl select:focus { border-color: var(--accent); }

.lp-links { display: flex; flex-direction: column; gap: 7px; }
.lp-linkrow { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px 4px 4px 10px; }
.lp-linkrow .lp-linklabel { font-size: 10px; font-weight: 700; color: var(--muted-2); width: 54px; flex: none; letter-spacing: .02em; }
.lp-linkrow code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.lp-copy {
  flex: none; width: 28px; height: 28px; border-radius: 8px; border: 1px solid transparent;
  background: none; color: var(--muted); display: grid; place-items: center;
}
.lp-copy:hover { background: var(--surface); border-color: var(--border); color: var(--accent); }
.lp-copy .lp-icon { width: 14px; height: 14px; }
.lp-copy.copied { color: var(--ok); }

.lp-keybox { margin-top: 10px; display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); border: 1px dashed var(--border); }
.lp-keybox span { font-size: 10px; color: var(--muted-2); flex: none; }
.lp-keybox code { font-family: var(--mono); font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lp-panel-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 7px; padding-top: 4px; }
.lp-panel-actions .lp-btn { flex: 1 1 auto; }
.lp-panel-actions .lp-btn-danger { flex: 0 0 auto; }

/* confirm dialog */

.lp-confirm {
  position: relative; z-index: 1; width: min(380px, 100%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 24px; box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2,.8,.3,1);
}
.lp-confirm-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); margin-bottom: 12px; }
.lp-confirm h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.lp-confirm p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.6; word-break: break-word; }
.lp-confirm-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ---------- batch bar ---------- */

.lp-batch {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px);
  z-index: 100; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 8px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
}
.lp-batch.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.lp-batch-count { font-size: 12px; font-weight: 650; color: var(--muted); margin-right: 4px; white-space: nowrap; }
.lp-batch .lp-btn { height: 32px; }

/* ---------- upload tray ---------- */

.lp-tray {
  position: fixed; right: 20px; bottom: 20px; z-index: 95;
  width: 342px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pop .2s ease;
}
.lp-tray[hidden] { display: none; }
.lp-tray-head { display: flex; align-items: center; gap: 8px; padding: 12px 13px; border-bottom: 1px solid var(--border); }
.lp-tray-title { font-size: 12px; font-weight: 700; }
.lp-tray-summary { margin-left: auto; font-size: 10.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.lp-tray-close { border: 0; background: none; color: var(--muted-2); padding: 4px; border-radius: 6px; display: grid; place-items: center; }
.lp-tray-close:hover { background: var(--surface-3); color: var(--fg); }
.lp-tray-list { max-height: 260px; overflow-y: auto; padding: 6px; }
.lp-tray-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 9px; }
.lp-tray-item:hover { background: var(--surface-2); }
.lp-tray-fileicon { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-3); color: var(--muted-2); display: grid; place-items: center; flex: none; }
.lp-tray-fileicon .lp-icon { width: 15px; height: 15px; }
.lp-tray-info { flex: 1; min-width: 0; }
.lp-tray-name { font-size: 11px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-tray-progress { height: 3px; border-radius: 999px; background: var(--surface-3); margin-top: 5px; overflow: hidden; }
.lp-tray-progress i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }
.lp-tray-status { font-size: 10px; color: var(--muted-2); flex: none; font-variant-numeric: tabular-nums; }
.lp-tray-status.ok { color: var(--ok); }
.lp-tray-status.err { color: var(--danger); }

/* ---------- toasts ---------- */

.lp-toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 130; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.lp-toast {
  display: flex; align-items: center; gap: 9px; min-width: 200px; max-width: 340px;
  padding: 10px 13px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-size: 12px; color: var(--fg); animation: toastin .2s ease; pointer-events: auto;
}
.lp-toast .lp-icon { width: 15px; height: 15px; }
.lp-toast.ok .lp-icon { color: var(--ok); }
.lp-toast.err .lp-icon { color: var(--danger); }
.lp-toast.fade { opacity: 0; transform: translateY(-4px); transition: all .25s; }
@keyframes toastin { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- drag overlay ---------- */

.lp-dragover {
  position: fixed; inset: 0; z-index: 140; display: none;
  align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(8px);
}
.lp-dragover.show { display: flex; }
.lp-dragover-box {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 46px 64px; border-radius: 24px;
  border: 2px dashed var(--accent); background: var(--surface);
  box-shadow: var(--shadow-lg); color: var(--accent); font-size: 15px; font-weight: 650;
  animation: pop .18s ease;
}
.lp-dragover-box .lp-icon { width: 40px; height: 40px; }

/* ---------- login ---------- */

.lp-login { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 24px; overflow: hidden; }
.lp-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; pointer-events: none; }
.lp-glow-a { width: 560px; height: 560px; left: -160px; top: -180px; background: radial-gradient(circle, rgba(124, 92, 245, .55), transparent 62%); }
.lp-glow-b { width: 520px; height: 520px; right: -120px; bottom: -200px; background: radial-gradient(circle, rgba(60, 170, 255, .38), transparent 62%); }
.dark .lp-glow { opacity: .35; }

.lp-login-card {
  position: relative; z-index: 1; width: min(404px, 100%);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--border); border-radius: 24px;
  padding: 32px 30px 26px;
  box-shadow: 0 40px 90px -50px rgba(20, 24, 60, .55);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.lp-login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.lp-login-title { font-size: 20px; font-weight: 750; letter-spacing: -0.03em; margin: 0 0 6px; }
.lp-login-sub { font-size: 12px; color: var(--muted-2); margin: 0 0 22px; }

.lp-field { margin-bottom: 13px; }
.lp-field label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.lp-inputwrap {
  display: flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.lp-inputwrap:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-ring); }
.lp-inputwrap .lp-icon { color: var(--muted-2); }
.lp-inputwrap input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 13px; color: var(--fg); }
.lp-inputwrap input::placeholder { color: var(--muted-2); }
.lp-eye { border: 0; background: none; color: var(--muted-2); padding: 4px; display: grid; place-items: center; border-radius: 6px; }
.lp-eye:hover { color: var(--fg); }

.lp-login-btn { width: 100%; height: 44px; border-radius: 12px; font-size: 13px; margin-top: 6px; }
.lp-login-error {
  display: none; align-items: flex-start; gap: 8px; margin: 0 0 14px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--danger-soft); color: var(--danger);
  font-size: 11.5px; line-height: 1.5;
}
.lp-login-error.show { display: flex; }
.lp-login-foot { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; color: var(--muted-2); }

.lp-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- new console: dashboard / api ---------- */

.lp-search.is-hidden, .lp-viewtoggle.is-hidden { display: none !important; }

.lp-select {
  height: 32px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted);
  padding: 0 8px; font-size: 11.5px; outline: none; cursor: pointer;
}
.lp-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.lp-select-block { width: 100%; height: 34px; background: var(--surface); color: var(--fg); }
.lp-panel-field { display: flex; flex-direction: column; gap: 5px; }

.lp-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.lp-stat-card {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  min-width: 0;
}
.lp-stat-icon {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.lp-stat-icon .lp-icon { width: 19px; height: 19px; }
.lp-stat-icon.private { background: rgba(139, 92, 246, .12); color: #8b5cf6; }
.lp-stat-icon.album { background: rgba(16, 185, 129, .12); color: #0f9d8a; }
.lp-stat-icon.today { background: rgba(245, 158, 11, .14); color: #d97706; }
.dark .lp-stat-icon.private { color: #b39bff; }
.dark .lp-stat-icon.album { color: #2fd4bd; }
.dark .lp-stat-icon.today { color: #fbbf24; }
.lp-stat-body { display: flex; flex-direction: column; min-width: 0; }
.lp-stat-body span { font-size: 10.5px; color: var(--muted-2); }
.lp-stat-body b { font-size: 23px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.lp-stat-body small { font-size: 10px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lp-dash-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; }
.lp-card-panel {
  margin-top: 14px; padding: 17px 18px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  min-width: 0;
}
.lp-dash-grid .lp-card-panel { margin-top: 14px; }
.lp-card-panel header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.lp-card-panel h3 { margin: 0; font-size: 12.5px; font-weight: 700; letter-spacing: -0.01em; }
.lp-panel-hint { font-size: 10.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.lp-linkbtn { border: 0; background: none; color: var(--accent); font-size: 11px; font-weight: 650; padding: 0; }

.lp-bars { display: flex; align-items: flex-end; gap: 8px; height: 154px; padding-top: 10px; }
.lp-bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.lp-bar-count { font-size: 9.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; height: 12px; }
.lp-bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.lp-bar-fill {
  width: 100%; min-height: 3px; border-radius: 7px 7px 4px 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: .9; transition: opacity .15s;
}
.lp-bar-col:hover .lp-bar-fill { opacity: 1; }
.lp-bar-label { font-size: 9.5px; color: var(--muted-2); white-space: nowrap; }

.lp-typebar { display: flex; height: 10px; gap: 2px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.lp-typebar i { display: block; height: 100%; border-radius: 999px; }
.lp-type-wrap { display: flex; align-items: center; gap: 22px; padding: 2px 2px 4px; }
.lp-donut { width: 138px; height: 138px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--surface-3); }
.lp-donut-hole { width: 92px; height: 92px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px var(--border); }
.lp-donut-hole b { font-size: 22px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.lp-donut-hole span { font-size: 9.5px; color: var(--muted-2); margin-top: 2px; }
.lp-legend-col { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; margin-top: 0; }
.lp-legend-col .lp-legend-item { width: 100%; justify-content: space-between; gap: 14px; }
.lp-legend-col .lp-legend-item span { flex: 1; }
.lp-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 14px; }
.lp-legend.lp-legend-col { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 9px; margin-top: 0; }
.lp-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.lp-legend-dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.lp-legend-item b { font-weight: 650; color: var(--fg); font-variant-numeric: tabular-nums; }

.lp-recent { display: flex; flex-direction: column; gap: 1px; }
.lp-recent-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.lp-recent-row:hover { background: var(--surface-2); }
.lp-recent-thumb { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; background: var(--surface-3); flex: none; }
.lp-recent-icon { width: 34px; height: 34px; border-radius: 8px; background: var(--surface-3); color: var(--muted-2); display: grid; place-items: center; flex: none; }
.lp-recent-icon .lp-icon { width: 15px; height: 15px; }
.lp-recent-body { flex: 1; min-width: 0; }
.lp-recent-name { font-size: 12px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-recent-meta { font-size: 10px; color: var(--muted-2); margin-top: 2px; }
.lp-recent-right { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.lp-empty-mini { padding: 22px 0 8px; text-align: center; font-size: 11.5px; color: var(--muted-2); }

.lp-api-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.lp-api-grid .lp-card-panel { margin-top: 0; }
.lp-kv { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); margin-bottom: 8px; }
.lp-kv span { font-size: 9.5px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; flex: none; width: 64px; }
.lp-kv code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-code {
  margin: 10px 0 0; padding: 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 10.5px; line-height: 1.75; color: var(--muted);
  overflow-x: auto; white-space: pre;
}
.lp-token-list { display: flex; flex-direction: column; gap: 6px; }
.lp-token-row { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 11px; }
.lp-token-body { flex: 1; min-width: 0; }
.lp-token-name { font-size: 12px; font-weight: 600; }
.lp-token-meta { font-size: 10px; color: var(--muted-2); font-family: var(--mono); margin-top: 2px; }
.lp-token-del { width: 28px; height: 28px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted-2); display: grid; place-items: center; }
.lp-token-del:hover { background: var(--danger-soft); color: var(--danger); border-color: rgba(220,61,67,.2); }
.lp-token-del .lp-icon { width: 14px; height: 14px; }

.lp-storage-db { display: flex; align-items: center; gap: 5px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); color: var(--muted-2); font-size: 9.5px; }
.lp-sync { margin-top: 8px; width: 100%; height: 26px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 600; }
.lp-sync:hover { color: var(--accent); border-color: var(--accent); }
.lp-sync:disabled { opacity: .55; }

.lp-small-modal { width: min(430px, 100%); }
.lp-small-modal h3 { margin: 0 0 6px; font-size: 16px; }
.lp-small-modal p { margin: 0 0 4px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.lp-small-modal .lp-field { margin-top: 14px; }
.lp-small-modal .lp-field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.lp-small-modal input {
  width: 100%; height: 39px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); padding: 0 11px; font-size: 12.5px; outline: none; color: var(--fg);
}
.lp-small-modal input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); background: var(--surface); }
.lp-form-error { display: none; margin-top: 9px; font-size: 11px; color: var(--danger); }
.lp-form-error.show { display: block; }
.lp-small-modal .lp-confirm-actions { margin-top: 18px; }

/* ---------- responsive ---------- */

.lp-sidebar-backdrop { position: fixed; inset: 0; background: rgba(6, 8, 16, .45); z-index: 55; display: none; backdrop-filter: blur(3px); }

@media (max-width: 900px) {
  .lp-sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; width: 264px; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .lp-sidebar.open { transform: none; }
  .lp-sidebar-backdrop.show { display: block; }
  .lp-menu-btn { display: inline-flex !important; }
  .lp-topbar { padding: 10px 14px; gap: 8px; flex-wrap: wrap; }
  .lp-title { font-size: 16px; }
  .lp-heading { order: 1; }
  .lp-search { order: 3; width: 100%; margin-left: 0; }
  .lp-viewtoggle { order: 2; margin-left: auto; }
  #themeBtn { order: 2; }
  #uploadBtn { order: 2; height: 34px; padding: 0 11px; }
  #uploadBtn span { display: none; }
  .lp-content { padding: 14px 14px 90px; }
  .lp-drop { padding: 14px; gap: 12px; }
  .lp-drop-icon { width: 38px; height: 38px; border-radius: 11px; }
  .lp-drop-title { font-size: 12.5px; }
  .lp-drop-hint { font-size: 10.5px; }
  .lp-chips { display: flex; order: -1; width: 100%; overflow-x: auto; }
  .lp-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
  .lp-card-body { padding: 8px 9px 10px; }
  .lp-card-name { font-size: 11.5px; }
  .lp-card-meta { font-size: 10px; }
  .lp-card-actions { opacity: 1; transform: none; }
  .lp-check { opacity: 1; }
  .lp-thumb { aspect-ratio: 1 / 1; }
  .lp-dialog { grid-template-columns: 1fr; max-height: 92vh; overflow-y: auto; }
  .lp-preview { min-height: 250px; }
  .lp-preview img, .lp-preview video { max-height: 46vh; }
  .lp-panel { border-left: 0; border-top: 1px solid var(--border); overflow: visible; }
  .lp-modal { padding: 10px; }
  .lp-toasts { top: auto; bottom: 88px; right: 14px; left: 14px; transform: none; align-items: center; }
  .lp-toast { width: 100%; }
  .lp-tray { right: 12px; left: 12px; bottom: 12px; width: auto; }
  .lp-batch { bottom: 14px; width: calc(100vw - 28px); justify-content: center; flex-wrap: wrap; }
}

@media (max-width: 1180px) {
  .lp-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-dash-grid, .lp-api-grid { grid-template-columns: 1fr; }
  .lp-api-grid .lp-card-panel + .lp-card-panel { margin-top: 4px; }
  .lp-album-tools { display: flex; }
}

@media (max-width: 900px) {
  .lp-stat-grid { gap: 8px; }
  .lp-stat-card { padding: 12px; gap: 9px; }
  .lp-stat-icon { width: 34px; height: 34px; border-radius: 10px; }
  .lp-stat-icon .lp-icon { width: 16px; height: 16px; }
  .lp-stat-body b { font-size: 19px; }
  .lp-stat-body small { font-size: 9px; }
  .lp-bars { height: 140px; gap: 5px; }
  .lp-donut { width: 112px; height: 112px; }
  .lp-donut-hole { width: 74px; height: 74px; }
  .lp-donut-hole b { font-size: 18px; }
  .lp-type-wrap { gap: 16px; }
  .lp-card-panel { padding: 14px; border-radius: 15px; }
  .lp-toolbar-right { gap: 4px; }
  #sortSelect { max-width: 92px; }
  .lp-split-hide { display: none; }
}

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

/* ---------- 文件夹 / 管理员 ---------- */

.lp-storage .lp-sync + .lp-sync { margin-top: 6px; }

.lp-admin-kv { display: grid; gap: 2px; }
.lp-admin-kv-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.lp-admin-kv-row:last-child { border-bottom: 0; }
.lp-admin-kv-row span { color: var(--muted); flex: none; }
.lp-admin-kv-row b {
  font-weight: 600;
  color: var(--fg);
  text-align: right;
  overflow-wrap: anywhere;
}

.lp-audit-list { display: grid; }
.lp-audit-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 140px;
  gap: 14px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
}
.lp-audit-row:last-child { border-bottom: 0; }
.lp-audit-action { font-weight: 650; color: var(--fg); }
.lp-audit-detail { color: var(--muted); overflow-wrap: anywhere; }
.lp-audit-meta { color: var(--muted-2); text-align: right; font-family: var(--mono); font-size: 10px; }
.lp-audit-empty { padding: 24px 0; text-align: center; color: var(--muted-2); font-size: 12px; }

@media (max-width: 760px) {
  .lp-audit-row { grid-template-columns: 1fr; gap: 3px; }
  .lp-audit-meta { text-align: left; }
}
