/* ===== Web 照片管理系统 · 样式 ===== */
* { box-sizing: border-box; }
:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --border: #e4e7ec;
  --text: #1f2329;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --danger: #dc2626;
  --ok: #16a34a;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
  --radius: 12px;
}
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd4dc; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b3bac5; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef2ff 0%, #f7f9fc 45%, #eefaf4 100%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px; background: var(--panel); border-radius: 16px;
  box-shadow: var(--shadow); padding: 34px 32px 28px; border: 1px solid var(--border);
}
.login-card h1 { font-size: 21px; margin: 0 0 6px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 9px; background: #fbfcfd; outline: none; transition: .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { background: #f7f8fa; border-color: #d3d8e0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { color: var(--danger); border-color: #fbd5d5; background: #fff7f7; }
.btn.danger:hover { background: #feecec; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; padding: 11px; }
.btn.link { border: none; background: none; color: var(--accent); padding: 4px 6px; }
.msg { font-size: 13px; padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; display: none; }
.msg.err { display: block; background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.msg.ok { display: block; background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.login-foot { margin-top: 18px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- 布局 ---------- */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 18px;
  position: sticky; top: 0; z-index: 50;
}
.brand { font-weight: 700; font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: linear-gradient(135deg,#2563eb,#22c55e); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 7px 14px; border-radius: 8px; color: #4b5563; font-size: 13.5px;
}
.nav a:hover { background: #f3f5f8; text-decoration: none; }
.nav a.on { background: #1f2329; color: #fff; }
.topbar .grow { flex: 1; }
.topsearch { position: relative; }
.topsearch input {
  width: 260px; padding: 8px 12px 8px 34px; border-radius: 9px;
  border: 1px solid var(--border); background: #f7f9fb; outline: none;
}
.topsearch input:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.topsearch .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #9aa3af; }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg,#2563eb,#7c3aed);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.main { flex: 1; padding: 20px 22px 60px; max-width: 1720px; width: 100%; margin: 0 auto; }
/* 安全告警条 */
#secBanner:empty { display: none; }
.secbar { margin: 14px auto 0; max-width: 1720px; width: calc(100% - 44px);
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 10px;
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; font-size: 13px; }
.secbar b { font-weight: 600; }
.secbar .btn { flex: 0 0 auto; }
.secbar.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* ---------- 卡片 / 统计 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px,1fr)); gap: 12px; margin-bottom: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.card .n { font-size: 23px; font-weight: 700; line-height: 1.25; }
.card .l { color: var(--muted); font-size: 12px; margin-top: 3px; }
.card.b .n { color: var(--accent); } .card.g .n { color: var(--ok); }
.card.o .n { color: #ea580c; } .card.p .n { color: #7c3aed; }

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden;
}
.panel-h {
  padding: 13px 18px; border-bottom: 1px solid #f0f2f5; display: flex;
  align-items: center; gap: 12px; flex-wrap: wrap;
}
.panel-h h2 { font-size: 14.5px; margin: 0; font-weight: 650; }
.panel-h .grow { flex: 1; }
.panel-b { padding: 14px 18px; }
.hint { color: var(--muted); font-size: 12.5px; }
.copytag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px;
  background: #f3f6fb; border: 1px solid #e3e8f0; color: #1f2d3d; cursor: pointer;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; user-select: all; }
.copytag:hover { background: #e8f0fe; border-color: #c7d9f7; }
.copytag b { font-family: inherit; font-weight: 600; color: #2563eb; }

.section-title {
  font-size: 15px; font-weight: 650; margin: 22px 2px 12px;
  display: flex; align-items: center; gap: 10px;
}
.section-title .more { font-size: 12.5px; font-weight: 400; }

/* ---------- 媒体网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px,1fr)); gap: 12px; }
.tile {
  position: relative; background: #fff; border: 1px solid var(--border);
  border-radius: 11px; overflow: hidden; cursor: pointer; transition: .16s;
}
.tile:hover { box-shadow: 0 6px 20px rgba(16,24,40,.13); transform: translateY(-2px); border-color: #cfd8e6; }
.tile.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tile .frame {
  position: relative; width: 100%; padding-top: 75%; background: #eef1f5; overflow: hidden;
}
.tile .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .badge {
  position: absolute; top: 7px; right: 7px; background: rgba(17,24,39,.72); color: #fff;
  font-size: 11px; padding: 2px 7px; border-radius: 20px; backdrop-filter: blur(3px);
}
.tile .dur {
  position: absolute; bottom: 7px; right: 7px; background: rgba(17,24,39,.72); color: #fff;
  font-size: 11px; padding: 2px 7px; border-radius: 6px;
}
.tile .pick {
  position: absolute; top: 7px; left: 7px; width: 19px; height: 19px; border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,.95); background: rgba(17,24,39,.35); opacity: 0;
  transition: .15s; display: flex; align-items: center; justify-content: center;
}
.tile:hover .pick, .tile.sel .pick { opacity: 1; }
.tile.sel .pick { background: var(--accent); border-color: #fff; }
.tile .pick svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3.2; fill: none; opacity: 0; }
.tile.sel .pick svg { opacity: 1; }
.tile .meta { padding: 8px 10px 9px; }
.tile .nm { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sub { font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; margin-top: 2px; }
.tile .stars { color: #f59e0b; }
/* 悬浮显示路径信息 */
.tile .pathline {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 9px 8px;
  background: linear-gradient(transparent, rgba(12,16,22,.9)); color: #e8eefc;
  font-size: 11px; line-height: 1.45; opacity: 0; transition: .18s;
  pointer-events: none; word-break: break-all;
}
.tile:hover .pathline { opacity: 1; }
.tip {
  position: fixed; z-index: 9000; max-width: 460px; background: #111827; color: #f3f4f6;
  padding: 9px 12px; border-radius: 8px; font-size: 12px; line-height: 1.55;
  box-shadow: 0 8px 28px rgba(0,0,0,.3); pointer-events: none; display: none;
  word-break: break-all;
}
.tip b { color: #93c5fd; font-weight: 600; }

/* ---------- 列表 ---------- */
.tablewrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.8px; }
table.tbl th, table.tbl td { padding: 8px 10px; border-bottom: 1px solid #f1f3f6; text-align: left; vertical-align: middle; }
table.tbl th { background: #fafbfc; position: sticky; top: 0; z-index: 2; font-weight: 600; color: #46505f; white-space: nowrap; }
table.tbl tr:hover td { background: #fafbfd; }
table.tbl td.mono, .mono { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 12px; }
.cellpath { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #4b5563; }
.cellpath:hover { color: var(--accent); text-decoration: underline; cursor: copy; }
.mini { width: 54px; height: 42px; object-fit: cover; border-radius: 6px; display: block; background: #eef1f5; cursor: pointer; }
.chk { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11px; border: 1px solid; white-space: nowrap; }
.p-A { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
.p-B { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.p-C { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.p-D { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.p-X, .p-- { color: #6b7280; border-color: #e5e7eb; background: #f9fafb; }
.p-video { color: #7c3aed; border-color: #ddd6fe; background: #f5f3ff; }
.p-image { color: #0369a1; border-color: #bae6fd; background: #f0f9ff; }
.p-other { color: #6b7280; border-color: #e5e7eb; background: #f9fafb; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: #fff; }
.seg button { border: none; background: none; padding: 7px 13px; cursor: pointer; font-size: 13px; color: #4b5563; }
.seg button.on { background: #1f2329; color: #fff; }
.pager { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.pager input { width: 54px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px; text-align: center; }
.sidebar { width: 244px; flex: 0 0 244px; }
.layout { display: flex; gap: 16px; align-items: flex-start; }
.layout .content { flex: 1; min-width: 0; }
.tree { font-size: 13px; max-height: 460px; overflow: auto; padding: 6px 0; }
.tree .node { padding: 5px 10px; border-radius: 7px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.tree .node:hover { background: #f3f5f8; }
.tree .node.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tree .node .c { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.tree .children { margin-left: 12px; border-left: 1px dashed #e5e7eb; padding-left: 4px; }
.filters { padding: 8px 12px 14px; }

/* ---------- 批量操作栏 ---------- */
.bulk {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(90px);
  background: #1f2329; color: #fff; border-radius: 14px; padding: 10px 14px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.3);
  transition: .22s; z-index: 400; opacity: 0; pointer-events: none;
}
.bulk.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.bulk .cnt { font-size: 13px; padding-right: 6px; border-right: 1px solid #3b4250; }
.bulk .btn { background: #2c323c; border-color: #3b4250; color: #e5e7eb; }
.bulk .btn:hover { background: #3a414d; }
.bulk .btn.danger { color: #fca5a5; border-color: #5b2b2b; background: #33232a; }

/* ---------- 灯箱预览 ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(9,12,17,.95); z-index: 800;
  display: none; flex-direction: column;
}
.lightbox.open { display: flex; }
.lb-top {
  height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px;
  color: #e5e7eb; border-bottom: 1px solid rgba(255,255,255,.08); flex: 0 0 auto;
}
.lb-top .nm { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-top .grow { flex: 1; }
.lb-top .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #e5e7eb; }
.lb-top .btn:hover { background: rgba(255,255,255,.16); }
.lb-body { flex: 1; display: flex; min-height: 0; }
.lb-stage {
  flex: 1; display: flex; align-items: center; justify-content: center; position: relative;
  min-width: 0; padding: 16px;
}
.lb-stage img, .lb-stage video {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px;
  box-shadow: 0 10px 50px rgba(0,0,0,.6); background: #0b0e13;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 68px;
  border-radius: 10px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14);
  color: #fff; cursor: pointer; font-size: 22px; display: flex; align-items: center; justify-content: center;
}
.lb-nav:hover { background: rgba(255,255,255,.2); }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lb-side {
  width: 350px; flex: 0 0 350px; background: #14181f; color: #d7dbe2;
  border-left: 1px solid rgba(255,255,255,.08); overflow: auto; padding: 16px 18px;
}
.lb-side h3 { font-size: 13px; margin: 18px 0 8px; color: #9aa4b2; font-weight: 600; letter-spacing: .3px; }
.lb-side h3:first-child { margin-top: 0; }
.kv { display: flex; gap: 10px; font-size: 12.5px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.kv .k { width: 74px; flex: 0 0 74px; color: #8b95a3; }
.kv .v { flex: 1; word-break: break-all; }
.kv .v.mono { font-family: ui-monospace, Consolas, monospace; font-size: 11.8px; color: #a8b6cc; }
.lb-side textarea {
  width: 100%; min-height: 88px; background: #1c222b; border: 1px solid #2c343f;
  color: #e5e7eb; border-radius: 9px; padding: 9px 11px; resize: vertical; outline: none;
}
.lb-side textarea:focus { border-color: var(--accent); }
.lb-side .row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.lb-side .btn { background: #232a34; border-color: #333c48; color: #d7dbe2; }
.lb-side .btn:hover { background: #2c3541; }
.lb-side .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.tagbox { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tagchip {
  background: #232a34; border: 1px solid #333c48; border-radius: 20px; padding: 2px 9px;
  font-size: 11.5px; display: inline-flex; align-items: center; gap: 5px;
}
.tagchip button { background: none; border: none; color: #8b95a3; cursor: pointer; padding: 0; }
.tagchip button:hover { color: #fca5a5; }
.lb-hint { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); color: #8b95a3; font-size: 11.5px; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(15,20,28,.5); z-index: 700;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal.open { display: flex; }
.modal-card {
  background: #fff; border-radius: 14px; width: 100%; max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden;
}
.modal-card.wide { max-width: 760px; }
.modal-h { padding: 15px 20px; border-bottom: 1px solid var(--border); font-weight: 650; display: flex; align-items: center; }
.modal-h .grow { flex: 1; }
.modal-b { padding: 18px 20px; max-height: 66vh; overflow: auto; }
.modal-f { padding: 13px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 9px; background: #fafbfc; }

.empty { text-align: center; color: var(--muted); padding: 56px 20px; }
.empty .big { font-size: 34px; margin-bottom: 10px; opacity: .5; }
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-70px);
  background: #1f2329; color: #fff; padding: 10px 18px; border-radius: 10px;
  z-index: 9500; transition: .22s; font-size: 13px; box-shadow: 0 8px 30px rgba(0,0,0,.25);
  opacity: 0;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.err { background: #b91c1c; }
.skeleton { background: linear-gradient(90deg,#eef1f5 25%,#f6f8fa 37%,#eef1f5 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.log-box {
  font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; background: #f8fafc;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px; white-space: pre-wrap;
  max-height: 240px; overflow: auto; color: #334155;
}
@media (max-width: 1100px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex: none; }
  .lb-side { width: 280px; flex: 0 0 280px; }
  .topsearch input { width: 170px; }
}
